diff options
Diffstat (limited to 'src/radeon_accelfuncs.c')
-rw-r--r-- | src/radeon_accelfuncs.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/radeon_accelfuncs.c b/src/radeon_accelfuncs.c index 442c0fd8..16dcec15 100644 --- a/src/radeon_accelfuncs.c +++ b/src/radeon_accelfuncs.c @@ -1347,6 +1347,57 @@ FUNC_NAME(RADEONAccelInit)(ScreenPtr pScreen, XAAInfoRecPtr a) | HARDWARE_PATTERN_SCREEN_ORIGIN | BIT_ORDER_IN_BYTE_LSBFIRST); #endif + +#ifdef RENDER + if (info->RenderAccel && info->directRenderingEnabled && + ((pScrn->bitsPerPixel == 32) || (pScrn->bitsPerPixel == 16))) { + /* XXX: The non-CP vertex dispatch doesn't seem to work. */ + /* XXX: We are actually violating Render semantics with this, but it + * can't be helped with current XAA. With Render you can make the + * Picture have whatever r/g/b/a masks you want, pretty much. + * We're forced to assume window pictures as destinations are of the + * common types of PICT_r5g6b5 for 16bpp and PICT_a8r8g8b8 for 32bpp, + * due to the lack of a dst format arg to the Setup functions. + * PICT_x8r8g8b8 is certainly almost as likely for 32bpp though, because + * XRenderFindStandardFormat(dpy, PictStandardRGB24) returns it. + */ + + a->CPUToScreenAlphaTextureFlags = XAA_RENDER_POWER_OF_2_TILE_ONLY; + a->CPUToScreenAlphaTextureFormats = RADEONTextureFormats; + a->CPUToScreenTextureFlags = XAA_RENDER_POWER_OF_2_TILE_ONLY; + a->CPUToScreenTextureFormats = RADEONTextureFormats; + + if (info->ChipFamily >= CHIP_FAMILY_R300) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Render acceleration " + "unsupported on Radeon 9500/9700 and newer.\n"); + return; + } else if ((info->ChipFamily == CHIP_FAMILY_RV250) || + (info->ChipFamily == CHIP_FAMILY_RV280) || + (info->ChipFamily == CHIP_FAMILY_RS300) || + (info->ChipFamily == CHIP_FAMILY_R200)) { + a->SetupForCPUToScreenAlphaTexture = + FUNC_NAME(R200SetupForCPUToScreenAlphaTexture); + a->SubsequentCPUToScreenAlphaTexture = + FUNC_NAME(R200SubsequentCPUToScreenTexture); + + a->SetupForCPUToScreenTexture = + FUNC_NAME(R200SetupForCPUToScreenTexture); + a->SubsequentCPUToScreenTexture = + FUNC_NAME(R200SubsequentCPUToScreenTexture); + } else { + a->SetupForCPUToScreenAlphaTexture = + FUNC_NAME(R100SetupForCPUToScreenAlphaTexture); + a->SubsequentCPUToScreenAlphaTexture = + FUNC_NAME(R100SubsequentCPUToScreenTexture); + + a->SetupForCPUToScreenTexture = + FUNC_NAME(R100SetupForCPUToScreenTexture); + a->SubsequentCPUToScreenTexture = + FUNC_NAME(R100SubsequentCPUToScreenTexture); + } + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Render acceleration enabled\n"); + } +#endif } #undef FUNC_NAME |