freedreno/drm: Add FD_BO_PREP_FLUSH
authorRob Clark <robdclark@chromium.org>
Thu, 22 Apr 2021 22:17:37 +0000 (15:17 -0700)
committerMarge Bot <eric+marge@anholt.net>
Wed, 28 Apr 2021 15:36:42 +0000 (15:36 +0000)
There are a couple cases where we want to use _NOSYNC, but at the same
time we want to ensure that rendering related to a bo is actually
flushed.

This doesn't do anything yet, but when we start deferring/merging
submits we'll need a way to trigger anything deferred to flush.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>

src/freedreno/drm/freedreno_drmif.h
src/gallium/drivers/freedreno/freedreno_query_acc.c
src/gallium/drivers/freedreno/freedreno_query_hw.c

index 41ea98e..9f5058c 100644 (file)
@@ -72,6 +72,7 @@ enum fd_param_id {
 #define FD_BO_PREP_READ   BITSET_BIT(0)
 #define FD_BO_PREP_WRITE  BITSET_BIT(1)
 #define FD_BO_PREP_NOSYNC BITSET_BIT(2)
+#define FD_BO_PREP_FLUSH  BITSET_BIT(3)
 
 
 /* device functions:
index c1db0f5..77268e6 100644 (file)
@@ -170,7 +170,7 @@ fd_acc_get_query_result(struct fd_context *ctx, struct fd_query *q, bool wait,
       }
 
       ret = fd_resource_wait(
-         ctx, rsc, FD_BO_PREP_READ | FD_BO_PREP_NOSYNC);
+         ctx, rsc, FD_BO_PREP_READ | FD_BO_PREP_NOSYNC | FD_BO_PREP_FLUSH);
       if (ret)
          return false;
 
index b70156a..feab589 100644 (file)
@@ -229,7 +229,7 @@ fd_hw_get_query_result(struct fd_context *ctx, struct fd_query *q, bool wait,
          return false;
 
       ret = fd_resource_wait(
-         ctx, rsc, FD_BO_PREP_READ | FD_BO_PREP_NOSYNC);
+         ctx, rsc, FD_BO_PREP_READ | FD_BO_PREP_NOSYNC | FD_BO_PREP_FLUSH);
       if (ret)
          return false;