diff options
-rw-r--r-- | man/radeon.man | 9 | ||||
-rw-r--r-- | src/radeon.h | 3 | ||||
-rw-r--r-- | src/radeon_dri2.c | 8 | ||||
-rw-r--r-- | src/radeon_exa.c | 14 | ||||
-rw-r--r-- | src/radeon_kms.c | 15 | ||||
-rw-r--r-- | src/radeon_textured_video.c | 2 |
6 files changed, 50 insertions, 1 deletions
diff --git a/man/radeon.man b/man/radeon.man index 47fa9f5e..5f6d9fb0 100644 --- a/man/radeon.man +++ b/man/radeon.man @@ -606,6 +606,15 @@ The default is This option enables modesetting on R/RV4xx chips using atombios. The default is .B off. +.TP +.BI "Option \*qEXALowVRAM\*q \*q" integer \*q +(KMS Only) Under kernel modesetting to avoid thrashing pixmaps in/out +of VRAM on low memory cards, we set a threshhold for the amount of VRAM +a GPU should have before we start using VRAM to accelerate pixmaps that +aren't required to be used by the GPU. Value is in MB. This shouldn't +really be changed apart from testing. +The default is +.B 32. .SH TEXTURED VIDEO ATTRIBUTES The driver supports the following X11 Xv attributes for Textured Video. diff --git a/src/radeon.h b/src/radeon.h index 1e479f4e..0dbaa52a 100644 --- a/src/radeon.h +++ b/src/radeon.h @@ -173,6 +173,7 @@ typedef enum { OPTION_PCIAPER_SIZE, #ifdef USE_EXA OPTION_ACCEL_DFS, + OPTION_EXA_LOW_VRAM, #endif #endif OPTION_IGNORE_EDID, @@ -894,6 +895,7 @@ typedef struct { Bool accelOn; Bool useEXA; #ifdef USE_EXA + Bool exa_force_create; XF86ModReqInfo exaReq; #endif #ifdef USE_XAA @@ -1004,6 +1006,7 @@ typedef struct { uint64_t vram_size; uint64_t gart_size; drmmode_rec drmmode; + int exa_low_vram_threshhold_mb; #else /* fake bool */ Bool cs; diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c index db46d27a..56c00a32 100644 --- a/src/radeon_dri2.c +++ b/src/radeon_dri2.c @@ -65,6 +65,8 @@ radeon_dri2_create_buffers(DrawablePtr drawable, int count) { ScreenPtr pScreen = drawable->pScreen; + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + RADEONInfoPtr info = RADEONPTR(pScrn); BufferPtr buffers; struct dri2_buffer_priv *privates; PixmapPtr pixmap, depth_pixmap; @@ -120,7 +122,9 @@ radeon_dri2_create_buffers(DrawablePtr drawable, if (attachments[i] == DRI2BufferDepth) { depth_pixmap = pixmap; } + info->exa_force_create = TRUE; exaMoveInPixmap(pixmap); + info->exa_force_create = FALSE; driver_priv = exaGetPixmapDriverPrivate(pixmap); r = radeon_gem_get_kernel_name(driver_priv->bo, &buffers[i].name); if (r) @@ -143,6 +147,8 @@ radeon_dri2_create_buffer(DrawablePtr drawable, unsigned int format) { ScreenPtr pScreen = drawable->pScreen; + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + RADEONInfoPtr info = RADEONPTR(pScrn); BufferPtr buffers; struct dri2_buffer_priv *privates; PixmapPtr pixmap, depth_pixmap; @@ -198,7 +204,9 @@ radeon_dri2_create_buffer(DrawablePtr drawable, if (attachment == DRI2BufferDepth) { depth_pixmap = pixmap; } + info->exa_force_create = TRUE; exaMoveInPixmap(pixmap); + info->exa_force_create = FALSE; driver_priv = exaGetPixmapDriverPrivate(pixmap); r = radeon_gem_get_kernel_name(driver_priv->bo, &buffers->name); if (r) diff --git a/src/radeon_exa.c b/src/radeon_exa.c index 99a93a4e..b2456c87 100644 --- a/src/radeon_exa.c +++ b/src/radeon_exa.c @@ -391,6 +391,12 @@ void *RADEONEXACreatePixmap(ScreenPtr pScreen, int size, int align) RADEONInfoPtr info = RADEONPTR(pScrn); struct radeon_exa_pixmap_priv *new_priv; + if (info->accel_state->exa->flags & EXA_MIXED_PIXMAPS) { + if (size != 0 && !info->exa_force_create && + info->vram_size <= (info->exa_low_vram_threshhold_mb*1024*1024)) + return NULL; + } + new_priv = xcalloc(1, sizeof(struct radeon_exa_pixmap_priv)); if (!new_priv) return NULL; @@ -421,7 +427,13 @@ void *RADEONEXACreatePixmap2(ScreenPtr pScreen, int width, int height, uint32_t size; uint32_t tiling = 0; int pixmap_align = 0; - + + if (info->accel_state->exa->flags & EXA_MIXED_PIXMAPS) { + if (width != 0 && height != 0 && !info->exa_force_create && + info->vram_size <= (info->exa_low_vram_threshhold_mb*1024*1024)) + return NULL; + } + if (usage_hint) { if (info->allowColorTiling) { if (usage_hint & RADEON_CREATE_PIXMAP_TILING_MACRO) diff --git a/src/radeon_kms.c b/src/radeon_kms.c index 5a4255f9..e624f86d 100644 --- a/src/radeon_kms.c +++ b/src/radeon_kms.c @@ -67,6 +67,7 @@ const OptionInfoRec RADEONOptions_KMS[] = { { OPTION_DRI, "DRI", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_TVSTD, "TVStandard", OPTV_STRING, {0}, FALSE }, { OPTION_EXA_VSYNC, "EXAVSync", OPTV_BOOLEAN, {0}, FALSE }, + { OPTION_EXA_LOW_VRAM, "EXALowVRAM", OPTV_INTEGER, {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE } }; @@ -450,6 +451,20 @@ Bool RADEONPreInit_KMS(ScrnInfoPtr pScrn, int flags) (unsigned long long)mminfo.vram_visible); } } + + info->exa_low_vram_threshhold_mb = 32; + if (xf86GetOptValInteger(info->Options, OPTION_EXA_LOW_VRAM, + &(info->exa_low_vram_threshhold_mb))) { + if (info->exa_low_vram_threshhold_mb < 0 || + info->exa_low_vram_threshhold_mb > (info->vram_size * 1024 * 1024)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Illegal Low VRAM limit selected %d, total %lld\n", + info->exa_low_vram_threshhold_mb, + info->vram_size / (1024*1024)); + info->exa_low_vram_threshhold_mb = 32; + } + } + RADEONSetPitch(pScrn); /* Set display resolution */ diff --git a/src/radeon_textured_video.c b/src/radeon_textured_video.c index 39c75749..7396f6f0 100644 --- a/src/radeon_textured_video.c +++ b/src/radeon_textured_video.c @@ -349,7 +349,9 @@ RADEONPutImageTextured(ScrnInfoPtr pScrn, #ifdef USE_EXA if (info->useEXA) { /* Force the pixmap into framebuffer so we can draw to it. */ + info->exa_force_create = TRUE; exaMoveInPixmap(pPriv->pPixmap); + info->exa_force_create = FALSE; } #endif |