summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-06-12 20:07:20 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-06-12 20:12:55 +0100
commitbb08e73c557c379ef131225ffea5aa729ca781d6 (patch)
tree19046bd2defc6fadb3b7c347d81a74b7e2bff177
parentff262aca9c46b7616c59d8e8f04d33a5bbc6e324 (diff)
sna: Prevent tracking scratch pixmaps on older xservers
Before the xserver is patched to send notification of release of the scratch pixmaps, we cannot associated GPU resources with them. In practice, the only advantage for doing so is for SHM pixmaps... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna.h1
-rw-r--r--src/sna/sna_accel.c8
2 files changed, 9 insertions, 0 deletions
diff --git a/src/sna/sna.h b/src/sna/sna.h
index 1173b7b2..7456f05a 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -121,6 +121,7 @@ static inline void list_add_tail(struct list *new, struct list *head)
}
#ifndef CREATE_PIXMAP_USAGE_SCRATCH_HEADER
+#define FAKE_CREATE_PIXMAP_USAGE_SCRATCH_HEADER 1
#define CREATE_PIXMAP_USAGE_SCRATCH_HEADER -1
#endif
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 8a8165e8..9e03caf5 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -150,6 +150,9 @@ struct sna_pixmap *sna_pixmap_attach(PixmapPtr pixmap)
switch (pixmap->usage_hint) {
case CREATE_PIXMAP_USAGE_GLYPH_PICTURE:
+#if FAKE_CREATE_PIXMAP_USAGE_SCRATCH_HEADER
+ case CREATE_PIXMAP_USAGE_SCRATCH_HEADER:
+#endif
return NULL;
}
@@ -249,6 +252,11 @@ static PixmapPtr sna_create_pixmap(ScreenPtr screen,
width, height, depth,
I915_TILING_Y);
+#if FAKE_CREATE_PIXMAP_USAGE_SCRATCH_HEADER
+ if (width == 0 || height == 0)
+ usage = CREATE_PIXMAP_USAGE_SCRATCH_HEADER;
+#endif
+
/* XXX could use last deferred free? */
pixmap = fbCreatePixmap(screen, width, height, depth, usage);