summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-06-10 17:49:13 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-06-10 19:41:16 +0100
commitcf6c7901825bb831443615ef21555c5843184bdb (patch)
tree0672e2e76d4f56c708b0d07257ac0a5faffc3c44
parent3f19270d6795738b58d9ce1721896b3067b38c9f (diff)
sna: Use the ScreenPixmap->serialNumber as a generation count
DRI2 presumes that the pixmap->serialNumber can be used as unique id. If it changes revokes *all* the buffers, it presumes a new pixmap has been attached to the window, for example after a reconfiguration event (resizing of a window, or a mode switch). However, as we updated the root pixmap upon a pageflip, we were triggering revocations everytime, causing further revocations and massive aperture thrashing. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_display.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index b21ce39b..6131be19 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -1575,10 +1575,19 @@ sna_do_pageflip(struct sna *sna,
*/
count = do_page_flip(sna, data, ref_crtc_hw_id);
if (count > 0) {
+ int id = sna->front->drawable.serialNumber;
+
sna->front = pixmap;
pixmap->refcnt++;
+
sna_redirect_screen_pixmap(scrn, *old_front, sna->front);
scrn->displayWidth = bo->pitch / sna->mode.cpp;
+
+ /* DRI2 uses the serialNumber as a means for detecting
+ * when to revoke its buffers after a reconfigureatin event.
+ * For the ScreenPixmap this means set_size.
+ */
+ pixmap->drawable.serialNumber = id;
} else {
drmModeRmFB(sna->kgem.fd, mode->fb_id);
mode->fb_id = *old_fb;