st/xorg: abstract flushing and syncing for the exa code
authorZack Rusin <zackr@vmware.com>
Wed, 9 Sep 2009 19:43:09 +0000 (15:43 -0400)
committerZack Rusin <zackr@vmware.com>
Thu, 10 Sep 2009 21:21:06 +0000 (17:21 -0400)
src/gallium/state_trackers/xorg/xorg_exa.c
src/gallium/state_trackers/xorg/xorg_exa.h

index 458ddb66bb8d2b596bd3107d3212072f58362a12..8d9555136399d23501e9f8fd0c78b40809a7d76e 100644 (file)
@@ -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);
+}
+
index 64b6de70485b120fac7d3e891c990db8945e69e0..8157c7117283c7c5dffb089a65f26947d2900fc4 100644 (file)
@@ -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