zink: add screen function for checking usage completion
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Wed, 26 May 2021 12:24:17 +0000 (08:24 -0400)
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Mon, 26 Jul 2021 23:48:07 +0000 (19:48 -0400)
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12008>

src/gallium/drivers/zink/zink_batch.c
src/gallium/drivers/zink/zink_batch.h

index 3a706f6..026f00f 100644 (file)
@@ -710,6 +710,17 @@ zink_batch_reference_image_view(struct zink_batch *batch,
 }
 
 bool
+zink_screen_usage_check_completion(struct zink_screen *screen, const struct zink_batch_usage *u)
+{
+   if (!zink_batch_usage_exists(u))
+      return true;
+   if (zink_batch_usage_is_unflushed(u))
+      return false;
+
+   return zink_screen_batch_id_wait(screen, u->usage, 0);
+}
+
+bool
 zink_batch_usage_check_completion(struct zink_context *ctx, const struct zink_batch_usage *u)
 {
    if (!zink_batch_usage_exists(u))
index 7187cd0..af5aba1 100644 (file)
@@ -223,6 +223,9 @@ zink_batch_usage_exists(const struct zink_batch_usage *u)
 }
 
 bool
+zink_screen_usage_check_completion(struct zink_screen *screen, const struct zink_batch_usage *u);
+
+bool
 zink_batch_usage_check_completion(struct zink_context *ctx, const struct zink_batch_usage *u);
 
 void