Mesa (master): st/xorg: abstract flushing and syncing for the exa code

Zack Rusin zack at kemper.freedesktop.org
Thu Sep 10 21:17:15 UTC 2009


Module: Mesa
Branch: master
Commit: 974dec2e7b86474af75708dd2cc8236416f25662
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=974dec2e7b86474af75708dd2cc8236416f25662

Author: Zack Rusin <zackr at vmware.com>
Date:   Wed Sep  9 15:43:09 2009 -0400

st/xorg: abstract flushing and syncing for the exa code

---

 src/gallium/state_trackers/xorg/xorg_exa.c |   25 ++++++++++++++++++++-----
 src/gallium/state_trackers/xorg/xorg_exa.h |    3 +++
 2 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/src/gallium/state_trackers/xorg/xorg_exa.c b/src/gallium/state_trackers/xorg/xorg_exa.c
index 458ddb6..8d95551 100644
--- a/src/gallium/state_trackers/xorg/xorg_exa.c
+++ b/src/gallium/state_trackers/xorg/xorg_exa.c
@@ -227,15 +227,14 @@ ExaDone(PixmapPtr pPixmap)
     modesettingPtr ms = modesettingPTR(pScrn);
     struct exa_pixmap_priv *priv = exaGetPixmapDriverPrivate(pPixmap);
     struct exa_context *exa = ms->exa;
-    struct pipe_fence_handle *fence = NULL;
 
     if (!priv)
 	return;
 
-    exa->ctx->flush(exa->ctx, PIPE_FLUSH_RENDER_CACHE, &fence);
-#if 0
-    exa->ctx->screen->fence_finish(exa->ctx->screen, fence, 0);
-    exa->ctx->screen->fence_reference(exa->ctx->screen, &fence, NULL);
+#if 1
+    xorg_exa_flush(exa, PIPE_FLUSH_RENDER_CACHE, NULL);
+#else
+    xorg_finish(exa);
 #endif
 
     if (priv->src_surf)
@@ -728,3 +727,19 @@ exa_gpu_surface(struct exa_context *exa, struct exa_pixmap_priv *priv)
 
 }
 
+void xorg_exa_flush(struct exa_context *exa, uint pipeFlushFlags,
+                    struct pipe_fence_handle **fence)
+{
+   exa->ctx->flush(exa->ctx, pipeFlushFlags, fence);
+}
+
+void xorg_exa_finish(struct exa_context *exa)
+{
+   struct pipe_fence_handle *fence = NULL;
+
+   xorg_exa_flush(exa, PIPE_FLUSH_RENDER_CACHE, &fence);
+
+   exa->ctx->screen->fence_finish(exa->ctx->screen, fence, 0);
+   exa->ctx->screen->fence_reference(exa->ctx->screen, &fence, NULL);
+}
+
diff --git a/src/gallium/state_trackers/xorg/xorg_exa.h b/src/gallium/state_trackers/xorg/xorg_exa.h
index 64b6de7..8157c71 100644
--- a/src/gallium/state_trackers/xorg/xorg_exa.h
+++ b/src/gallium/state_trackers/xorg/xorg_exa.h
@@ -46,5 +46,8 @@ struct exa_pixmap_priv
 struct pipe_surface *
 exa_gpu_surface(struct exa_context *exa, struct exa_pixmap_priv *priv);
 
+void xorg_exa_flush(struct exa_context *exa, uint pipeFlushFlags,
+                    struct pipe_fence_handle **fence);
+void xorg_exa_finish(struct exa_context *exa);
 
 #endif




More information about the mesa-commit mailing list