summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-12-20 21:35:58 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-12-20 22:40:25 +0000
commit4d348425592251f49fd31b9259651e8b05e92d1e (patch)
treee67836fddb04dbc81dee04d61e77c37b33a79a4c
parente71058c9c81067cd72b1193242acbd85272ab73a (diff)
sna: Intiialise pixmap size before use
After 0c12f7cb0 we were setting the width/height of the pixmap *after* trying to use them to determine if the pixmap could be created on the GPU. Normally this would be corrected when we attempt to render, except for the core drawing protocol. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 6c655cae..87c3f3d2 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -375,6 +375,7 @@ struct kgem_bo *sna_pixmap_change_tiling(PixmapPtr pixmap, uint32_t tiling)
static inline void sna_set_pixmap(PixmapPtr pixmap, struct sna_pixmap *sna)
{
dixSetPrivate(&pixmap->devPrivates, &sna_pixmap_index, sna);
+ assert(sna_pixmap(pixmap) == sna);
}
static struct sna_pixmap *
@@ -592,17 +593,17 @@ static PixmapPtr sna_create_pixmap(ScreenPtr screen,
if (pixmap == NullPixmap)
return NullPixmap;
+ pixmap->drawable.width = width;
+ pixmap->drawable.height = height;
+ pixmap->devKind = pad;
+ pixmap->devPrivate.ptr = NULL;
+
if (sna_pixmap_attach(pixmap) == NULL) {
free(pixmap);
return create_pixmap(sna, screen,
width, height, depth,
usage);
}
-
- pixmap->drawable.width = width;
- pixmap->drawable.height = height;
- pixmap->devKind = pad;
- pixmap->devPrivate.ptr = NULL;
}
return pixmap;