diff options
author | Eric Anholt <anholt@freebsd.org> | 2004-06-20 07:26:08 +0000 |
---|---|---|
committer | Eric Anholt <anholt@freebsd.org> | 2004-06-20 07:26:08 +0000 |
commit | 8c1b37420ea890f76edb97aed61ee427a871cd3f (patch) | |
tree | 91ee9ae38e7fa59acc14d595e4a474ed8393e005 /src/radeon_accelfuncs.c | |
parent | 6ecf374d500afe6da494dfdd6566396ec65b6d6a (diff) |
Bug #748:
- Add Render acceleration for Radeon 100 and 200-series cards, enabled by
default. Notable performance gains include 27fps in cairogears instead
of 6fps (compared to 50 with glitz), and my disks are now the
bottleneck in an ls -lR in gnome-terminal. Only supported in DRI mode
because the MMIO submission hangs the card so far, but the code is left
in because it may be supportable soon.
- Add xorg.conf options to disable Render acceleration and to force the
subpixel order in the server (Hui Yu).
Many thanks to Hui Yu at ATI for the code this was based off of, Michel
Daenzer for bugfixes and suggestions, and LinuxFund for sponsoring the
work.
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 |