diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2009-08-01 16:53:47 -0400 |
---|---|---|
committer | Alex Deucher <alexdeucher@gmail.com> | 2009-08-01 16:53:47 -0400 |
commit | f564460e94c9d0f1cf3ff4b8535481b2b8b4e9c1 (patch) | |
tree | 106301653aabaf6f249e5c762fac8474e431b48c | |
parent | c71b2f050e8996787eae463eddbfdb5864ffa65a (diff) |
radeon: use XAA in some cases
Use XAA in low memory situations or when the DRI is disabled.
Using shadowfb might also be a viable option, maybe even a better option...
fixes bug 21683
-rw-r--r-- | src/radeon_driver.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/radeon_driver.c b/src/radeon_driver.c index 3f79917b..29c0b11a 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -2083,6 +2083,7 @@ static Bool RADEONPreInitAccel(ScrnInfoPtr pScrn) #if defined(USE_EXA) && defined(USE_XAA) char *optstr; #endif + int maxy = info->FbMapSize / (pScrn->displayWidth * info->CurrentLayout.pixel_bytes); if (!(info->accel_state = xcalloc(1, sizeof(struct radeon_accel_state)))) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unable to allocate accel_state rec!\n"); @@ -2109,7 +2110,16 @@ static Bool RADEONPreInitAccel(ScrnInfoPtr pScrn) return TRUE; } - info->useEXA = TRUE; +#ifdef XF86DRI + if ((!info->directRenderingEnabled) || + (maxy <= pScrn->virtualY * 3) || + (pScrn->videoRam <= 32768)) + info->useEXA = FALSE; + else + info->useEXA = TRUE; +#else + info->useEXA = FALSE; +#endif if (!xf86ReturnOptValBool(info->Options, OPTION_NOACCEL, FALSE)) { int errmaj = 0, errmin = 0; @@ -2119,9 +2129,10 @@ static Bool RADEONPreInitAccel(ScrnInfoPtr pScrn) #if defined(USE_XAA) optstr = (char *)xf86GetOptValString(info->Options, OPTION_ACCELMETHOD); if (optstr != NULL) { - if (xf86NameCmp(optstr, "EXA") == 0) + if (xf86NameCmp(optstr, "EXA") == 0) { from = X_CONFIG; - else if (xf86NameCmp(optstr, "XAA") == 0) { + info->useEXA = TRUE; + } else if (xf86NameCmp(optstr, "XAA") == 0) { from = X_CONFIG; if (info->ChipFamily < CHIP_FAMILY_R600) info->useEXA = FALSE; |