summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-09-17 00:27:32 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-09-17 00:27:32 +0100
commit481df2618af3c10877db0610c4cadf6fc509e72f (patch)
tree8df4206795ec2851b144ae4e0b55c30ccc811b40
parent52f93c95465151d16f588d648a58b1f979e946a3 (diff)
sna: Add debug option to force allocaiton of gpu-only pixmaps
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index c6aac0e8..44a40db4 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -54,6 +54,8 @@
#define NDEBUG 1
#endif
+#define FORCE_GPU_ONLY 0
+
DevPrivateKeyRec sna_pixmap_index;
#define PM_IS_SOLID(_draw, _pm) \
@@ -209,7 +211,7 @@ sna_pixmap_create_scratch(ScreenPtr screen,
if (!pixmap)
return NullPixmap;
- priv = malloc(sizeof(*priv));
+ priv = _sna_pixmap_attach(pixmap);
if (!priv) {
fbDestroyPixmap(pixmap);
return NullPixmap;
@@ -224,16 +226,7 @@ sna_pixmap_create_scratch(ScreenPtr screen,
return NullPixmap;
}
- priv->source_count = 0;
- priv->cpu_bo = NULL;
- priv->cpu_damage = priv->gpu_damage = NULL;
priv->gpu_only = 1;
- priv->pinned = 0;
- priv->mapped = 0;
- list_init(&priv->list);
-
- priv->pixmap = pixmap;
- sna_set_pixmap(pixmap, priv);
miModifyPixmapHeader(pixmap,
width, height, depth, bpp,
@@ -243,7 +236,6 @@ sna_pixmap_create_scratch(ScreenPtr screen,
return pixmap;
}
-
static PixmapPtr sna_create_pixmap(ScreenPtr screen,
int width, int height, int depth,
unsigned int usage)
@@ -259,6 +251,11 @@ static PixmapPtr sna_create_pixmap(ScreenPtr screen,
width, height, depth,
I915_TILING_Y);
+ if (FORCE_GPU_ONLY && width && height)
+ return sna_pixmap_create_scratch(screen,
+ width, height, depth,
+ I915_TILING_X);
+
#if FAKE_CREATE_PIXMAP_USAGE_SCRATCH_HEADER
if (width == 0 || height == 0)
usage = CREATE_PIXMAP_USAGE_SCRATCH_HEADER;