Mesa (main): zink: add screen function for checking usage completion
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Jul 27 00:05:29 UTC 2021
Module: Mesa
Branch: main
Commit: 5bab4cc546f56f3e0d6afc2591258e3b799974b9
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5bab4cc546f56f3e0d6afc2591258e3b799974b9
Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date: Wed May 26 08:24:17 2021 -0400
zink: add screen function for checking usage completion
Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12008>
---
src/gallium/drivers/zink/zink_batch.c | 11 +++++++++++
src/gallium/drivers/zink/zink_batch.h | 3 +++
2 files changed, 14 insertions(+)
diff --git a/src/gallium/drivers/zink/zink_batch.c b/src/gallium/drivers/zink/zink_batch.c
index 3a706f62c74..026f00fe210 100644
--- a/src/gallium/drivers/zink/zink_batch.c
+++ b/src/gallium/drivers/zink/zink_batch.c
@@ -709,6 +709,17 @@ zink_batch_reference_image_view(struct zink_batch *batch,
zink_batch_reference_surface(batch, image_view->surface);
}
+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)
{
diff --git a/src/gallium/drivers/zink/zink_batch.h b/src/gallium/drivers/zink/zink_batch.h
index 7187cd00a3b..af5aba1c27e 100644
--- a/src/gallium/drivers/zink/zink_batch.h
+++ b/src/gallium/drivers/zink/zink_batch.h
@@ -222,6 +222,9 @@ zink_batch_usage_exists(const struct zink_batch_usage *u)
return u && (u->usage || u->unflushed);
}
+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);
More information about the mesa-commit
mailing list