[xf86-video-nouveau] dri2: Enable BufferAge support

Chris Wilson chris at chris-wilson.co.uk
Mon Jan 19 03:00:42 PST 2015


For enable BufferAge support, we just have to be not using the
DRI2Buffer->flags field for any purpose (i.e. it is always expected to
be 0, as it is now) and to be sure to swap the flags field whenever we
exchange buffers. As nouveau does not exactly support TripleBuffer, we
don't have to worry about setting the copying the flags field when
injecting the third buffer.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Maarten Lankhorst <maarten.lankhorst at ubuntu.com>
Cc: Mario Kleiner <mario.kleiner.de at gmail.com>
---
 src/nouveau_dri2.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/nouveau_dri2.c b/src/nouveau_dri2.c
index e3445b2..428ef92 100644
--- a/src/nouveau_dri2.c
+++ b/src/nouveau_dri2.c
@@ -711,6 +711,7 @@ nouveau_dri2_finish_swap(DrawablePtr draw, unsigned int frame,
 		}
 
 		SWAP(s->dst->name, s->src->name);
+		SWAP(s->dst->flags, s->src->flags);
 		SWAP(nouveau_pixmap(dst_pix)->bo, nouveau_pixmap(src_pix)->bo);
 
 		DamageRegionProcessPending(draw);
@@ -1003,6 +1004,12 @@ nouveau_dri2_init(ScreenPtr pScreen)
 	dri2.DestroyBuffer2 = nouveau_dri2_destroy_buffer2;
 	dri2.CopyRegion2 = nouveau_dri2_copy_region2;
 #endif
+
+#if DRI2INFOREC_VERSION >= 10
+	dri2.version = 10;
+	dri2.bufferAge = 1;
+#endif
+
 	return DRI2ScreenInit(pScreen, &dri2);
 }
 
-- 
2.1.4



More information about the dri-devel mailing list