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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 01/19/2015 12:00 PM, Chris Wilson wrote:
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@xxxxxxxxxxxxxxxxxx>
Cc: Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxx>
Cc: Mario Kleiner <mario.kleiner.de@xxxxxxxxx>
---
  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);
  }



Seems ok to me.

Reviewed-by: Mario Kleiner <mario.kleiner.de@xxxxxxxxx>

-mario
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel





[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux