diff options
author | Michel Daenzer <michel@daenzer.net> | 2006-03-03 16:41:41 +0000 |
---|---|---|
committer | Michel Daenzer <michel@daenzer.net> | 2006-03-03 16:41:41 +0000 |
commit | e19ccfa18fee046c54d7a9401e4e0098b2300598 (patch) | |
tree | 0b211073b83ba8ed9a5e021b2b464d9ffeda4e3d | |
parent | ca00035eccb6e3495b27f8e64f2d016d8d2a9ce2 (diff) |
Add Option "FBTexPercent" to override the amount of video RAM reserved for
OpenGL textures with EXA.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | man/radeon.man | 10 | ||||
-rw-r--r-- | src/radeon_driver.c | 32 | ||||
-rw-r--r-- | src/radeon_exa.c | 8 |
4 files changed, 50 insertions, 8 deletions
@@ -1,3 +1,11 @@ +2006-03-03 Michel Dänzer <michel@daenzer.net> + + * man/radeon.man: + * src/radeon_driver.c: (RADEONScreenInit): + * src/radeon_exa.c: (RADEONSetupMemEXA): + Add Option "FBTexPercent" to override the amount of video RAM reserved + for OpenGL textures with EXA. + 2006-03-02 Benjamin Herrenschmidt <benh@kernel.crashing.org> * src/radeon_driver.c: (RADEONPreInitConfig): diff --git a/man/radeon.man b/man/radeon.man index 4b7538a8..582cf9e8 100644 --- a/man/radeon.man +++ b/man/radeon.man @@ -512,6 +512,16 @@ the Render and Composite extensions, but the rendering code for it is newer and possibly unstable. The default is .B XAA. .TP +.BI "Option \*qFBTexPercent\*q \*q" integer \*q +Amount of video RAM to reserve for OpenGL textures, in percent. This option only +has an effect with EXA. The remainder of video RAM is reserved for EXA offscrren +management. Specifying 0 results in all offscreen video RAM being reserved for +EXA and only GART memory being available for OpenGL textures. This may improve +EXA performance, but beware that it may cause problems with OpenGL drivers from +Mesa versions older than 6.4. +Default: +.B 50. +.TP .BI "Option \*qDMAForXv\*q \*q" boolean \*q Try or don't try to use DMA for Xv image transfers. This will reduce CPU usage when playing big videos like DVDs, but may cause instabilities. diff --git a/src/radeon_driver.c b/src/radeon_driver.c index 4a078e8c..937545ff 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -1,5 +1,5 @@ /* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c,v 1.117 2004/02/19 22:38:12 tsi Exp $ */ -/* $XdotOrg: driver/xf86-video-ati/src/radeon_driver.c,v 1.90 2006/03/01 21:35:14 benh Exp $ */ +/* $XdotOrg: driver/xf86-video-ati/src/radeon_driver.c,v 1.91 2006-03-02 02:05:17 benh Exp $ */ /* * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and * VA Linux Systems Inc., Fremont, California. @@ -156,6 +156,9 @@ typedef enum { OPTION_PAGE_FLIP, OPTION_NO_BACKBUFFER, OPTION_XV_DMA, +#ifdef USE_EXA + OPTION_FBTEX_PERCENT, +#endif #endif OPTION_PANEL_OFF, OPTION_DDC_MODE, @@ -218,6 +221,9 @@ static const OptionInfoRec RADEONOptions[] = { { OPTION_PAGE_FLIP, "EnablePageFlip", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_NO_BACKBUFFER, "NoBackBuffer", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_XV_DMA, "DMAForXv", OPTV_BOOLEAN, {0}, FALSE }, +#ifdef USE_EXA + { OPTION_FBTEX_PERCENT, "FBTexPercent", OPTV_INTEGER, {0}, FALSE }, +#endif #endif { OPTION_PANEL_OFF, "PanelOff", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_DDC_MODE, "DDCMode", OPTV_BOOLEAN, {0}, FALSE }, @@ -5747,8 +5753,28 @@ _X_EXPORT Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, RADEONTRACE(("Setting up accel memmap\n")); #ifdef USE_EXA - if (info->useEXA && !RADEONSetupMemEXA(pScreen)) - return FALSE; + if (info->useEXA) { +#ifdef XF86DRI + /* Reserve approx. half of offscreen memory for local textures by + * default, can be overridden with Option "FBTexPercent". + * Round down to a whole number of texture regions. + */ + info->textureSize = 50; + + if (xf86GetOptValInteger(info->Options, OPTION_FBTEX_PERCENT, + &(info->textureSize))) { + if (info->textureSize < 0 || info->textureSize > 100) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Illegal texture memory percentage: %dx, setting to default 50%\n", + info->textureSize); + info->textureSize = 50; + } + } +#endif /* XF86DRI */ + + if (!RADEONSetupMemEXA(pScreen)) + return FALSE; + } #endif #if defined(XF86DRI) && defined(USE_XAA) diff --git a/src/radeon_exa.c b/src/radeon_exa.c index 3cbadf01..56927c14 100644 --- a/src/radeon_exa.c +++ b/src/radeon_exa.c @@ -438,11 +438,9 @@ Bool RADEONSetupMemEXA (ScreenPtr pScreen) depth_size / 1024, info->depthOffset); } - /* Reserve approx. half of remaining offscreen memory for local - * textures. Round down to a whole number of texture regions. - */ - info->textureSize = (info->exa.card.memorySize - - info->exa.card.offScreenBase) / 2; + info->textureSize *= (info->exa.card.memorySize - + info->exa.card.offScreenBase) / 100; + l = RADEONLog2(info->textureSize / RADEON_NR_TEX_REGIONS); if (l < RADEON_LOG_TEX_GRANULARITY) l = RADEON_LOG_TEX_GRANULARITY; |