summaryrefslogtreecommitdiff
path: root/src/sna/sna_dri.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-06-26 14:59:37 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-06-26 16:03:43 +0100
commitf306cd557ef263ff5057e413c335cc75bc0f7895 (patch)
tree3c5fbdfa17e81e3b3cc0673deb6e651fce4876b6 /src/sna/sna_dri.c
parenta87f2b9325bfad2bb3f93226706b6f9a09598945 (diff)
sna/dri: Hold a reference to the cached DRI2 buffer on the front buffer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_dri.c')
-rw-r--r--src/sna/sna_dri.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index 3c5722c0..dddcc738 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -229,7 +229,7 @@ sna_dri_create_buffer(DrawablePtr drawable,
}
FreeResourceByType(drawable->id,
dri_drawable_type,
- TRUE);
+ FALSE);
}
bo = sna_pixmap_set_dri(sna, pixmap);
@@ -332,8 +332,9 @@ sna_dri_create_buffer(DrawablePtr drawable,
if (pixmap)
pixmap->refcnt++;
- if (attachment == DRI2BufferFrontLeft)
- (void)AddResource(drawable->id, dri_drawable_type, buffer);
+ if (attachment == DRI2BufferFrontLeft &&
+ AddResource(drawable->id, dri_drawable_type, buffer))
+ private->refcnt++;
return buffer;
@@ -843,6 +844,10 @@ static int
sna_dri_drawable_gone(void *data, XID id)
{
DBG(("%s(%ld)\n", __FUNCTION__, (long)id));
+
+ _sna_dri_destroy_buffer(to_sna_from_pixmap(get_private(data)->pixmap),
+ data);
+
return Success;
}