summaryrefslogtreecommitdiff
path: root/src/radeon_exa.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2009-11-20 12:15:02 +1000
committerDave Airlie <airlied@itt42.(none)>2009-11-23 13:04:44 +1000
commite20af9c94982ec6487dae42c141d33cf6a7a2eb4 (patch)
tree6c933d03f4b0978751d5b6277f5ff3741f9035a3 /src/radeon_exa.c
parentdd3eab848cf352bb96c3d01fe6028d8a4a8e451e (diff)
radeon: avoid using hw pixmaps when we have little VRAM.
This patch returns NULL for pixmap creation when we are using mixed pixmaps and the pixmap has a size. The size check is necessary for the front buffer. We add a flag to force pixmap creation for certain pixmaps that need to be hw, like the DRI2 and Xv ones. Idea from Michel and workarounds from Ben Skeggs. v2: add Option "EXALowVRAM" to allow configuring this, value in MBs. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/radeon_exa.c')
-rw-r--r--src/radeon_exa.c14
1 files changed, 13 insertions, 1 deletions
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)