[Mesa-dev] [PATCH 4/6] nvc0: introduce a flushed flag for compute validation path

Samuel Pitoiset samuel.pitoiset at gmail.com
Sun Feb 21 14:19:47 UTC 2016


Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/gallium/drivers/nouveau/nvc0/nvc0_compute.c | 4 +++-
 src/gallium/drivers/nouveau/nvc0/nvc0_context.c | 4 +++-
 src/gallium/drivers/nouveau/nvc0/nvc0_screen.h  | 1 +
 src/gallium/drivers/nouveau/nvc0/nve4_compute.c | 4 +++-
 4 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c
index 0717583..f76a10c 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c
@@ -281,8 +281,10 @@ nvc0_compute_state_validate(struct nvc0_context *nvc0)
    nouveau_pushbuf_bufctx(nvc0->base.pushbuf, nvc0->bufctx_cp);
    if (unlikely(nouveau_pushbuf_validate(nvc0->base.pushbuf)))
       return false;
-   if (unlikely(nvc0->state.flushed_3d))
+   if (unlikely(nvc0->state.flushed_cp)) {
+      nvc0->state.flushed_cp = false;
       nvc0_bufctx_fence(nvc0, nvc0->bufctx_cp, true);
+   }
 
    return true;
 
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c
index 683fc20..cfd4cab 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c
@@ -176,8 +176,10 @@ nvc0_default_kick_notify(struct nouveau_pushbuf *push)
    if (screen) {
       nouveau_fence_next(&screen->base);
       nouveau_fence_update(&screen->base, true);
-      if (screen->cur_ctx)
+      if (screen->cur_ctx) {
          screen->cur_ctx->state.flushed_3d = true;
+         screen->cur_ctx->state.flushed_cp = true;
+      }
       NOUVEAU_DRV_STAT(&screen->base, pushbuf_count, 1);
    }
 }
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.h b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.h
index 9a58da5..f47beee 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.h
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.h
@@ -31,6 +31,7 @@ struct nvc0_blitter;
 
 struct nvc0_graph_state {
    bool flushed_3d;
+   bool flushed_cp;
    bool rasterizer_discard;
    bool early_z_forced;
    bool prim_restart;
diff --git a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c
index e33458b..fae8c60 100644
--- a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c
+++ b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c
@@ -338,8 +338,10 @@ nve4_compute_state_validate(struct nvc0_context *nvc0)
    nouveau_pushbuf_bufctx(nvc0->base.pushbuf, nvc0->bufctx_cp);
    if (unlikely(nouveau_pushbuf_validate(nvc0->base.pushbuf)))
       return false;
-   if (unlikely(nvc0->state.flushed_3d))
+   if (unlikely(nvc0->state.flushed_cp)) {
+      nvc0->state.flushed_cp = false;
       nvc0_bufctx_fence(nvc0, nvc0->bufctx_cp, true);
+   }
 
    return true;
 }
-- 
2.6.4



More information about the mesa-dev mailing list