[PATCH 2/2] dri2: Export DRI2InvalidateDrawableAll()

Chris Wilson chris at chris-wilson.co.uk
Sun Sep 30 12:18:29 PDT 2012


There may be multiple clients running concurrently with the same set of
buffers, for example an OpenGL game and a redirected OpenGL compositor.
Under the normal circumstances the game has its view of the buffers kept
consistent through the use of invalidate events and throttling. However,
the compositor is not limited by the throttling and so may call
GetBuffers() immediately after the invalidate event in SwapBuffers() and
yet before the actual exchange has occurred. By exporting the invalidate
method, the drivers can notify the clients of the updated buffers at the
right point in the event sequence, notably before the compositor is
informed of the damage.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Reinis Danne <reinis.danne at gmail.com>
---
 hw/xfree86/dri2/dri2.c |    2 +-
 hw/xfree86/dri2/dri2.h |    4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index 53ef83c..c4705e9 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -782,7 +782,7 @@ DRI2InvalidateWalk(WindowPtr pWin, pointer data)
     return WT_WALKCHILDREN;
 }
 
-static void
+void
 DRI2InvalidateDrawableAll(DrawablePtr pDraw)
 {
     if (pDraw->type == DRAWABLE_WINDOW) {
diff --git a/hw/xfree86/dri2/dri2.h b/hw/xfree86/dri2/dri2.h
index 64538ea..5804e30 100644
--- a/hw/xfree86/dri2/dri2.h
+++ b/hw/xfree86/dri2/dri2.h
@@ -379,4 +379,8 @@ extern _X_EXPORT int DRI2GetParam(ClientPtr client,
                                   CARD64 *value);
 
 extern _X_EXPORT DrawablePtr DRI2UpdatePrime(DrawablePtr pDraw, DRI2BufferPtr pDest);
+
+extern _X_EXPORT void DRI2InvalidateDrawableAll(DrawablePtr pDraw);
+#define DRI2_HAS_INVALIDATE_DRAWABLE 1
+
 #endif
-- 
1.7.10.4



More information about the xorg-devel mailing list