summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-03-01 15:34:45 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-03-01 15:34:45 +0000
commit904af323914e05830f17621a78b6e55b371ae5fc (patch)
tree7b32a5754529a51bc3f44b4bddf90a09906e224d
parentd4164de5ccb82068e2858a90b2cd44eef82b6037 (diff)
sna: Assert that we do not resurrect stale pixmap across a server regen
References: https://bugs.freedesktop.org/show_bug.cgi?id=56608 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c6
-rw-r--r--src/sna/sna_driver.c5
2 files changed, 9 insertions, 2 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index fd2337ff..328ce303 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -955,6 +955,9 @@ sna_pixmap_create_scratch(ScreenPtr screen,
priv->header = true;
sna_damage_all(&priv->gpu_damage, width, height);
+ assert(to_sna_from_pixmap(pixmap) == sna);
+ assert(pixmap->drawable.pScreen == screen);
+
return pixmap;
}
@@ -1265,6 +1268,9 @@ static PixmapPtr sna_create_pixmap(ScreenPtr screen,
priv->create = flags;
priv->ptr = ptr;
+ assert(to_sna_from_pixmap(pixmap) == sna);
+ assert(pixmap->drawable.pScreen == screen);
+
return pixmap;
fallback:
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index 2250e925..bf60fcff 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -836,8 +836,7 @@ static Bool sna_early_close_screen(CLOSE_SCREEN_ARGS_DECL)
static Bool sna_late_close_screen(CLOSE_SCREEN_ARGS_DECL)
{
- ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
- struct sna *sna = to_sna(scrn);
+ struct sna *sna = to_sna_from_screen(screen);
DepthPtr depths;
int d;
@@ -922,6 +921,8 @@ sna_screen_init(SCREEN_INIT_ARGS_DECL)
assert(sna->scrn == scrn);
assert(scrn->pScreen == NULL); /* set afterwards */
+ assert(sna->freed_pixmap == NULL);
+
if (!sna_register_all_privates())
return FALSE;