Mesa (staging/21.1): zink: add a flag indicating whether scanout object needs updating
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Apr 21 19:46:41 UTC 2021
Module: Mesa
Branch: staging/21.1
Commit: 5f748f1e11f7757a8ea9acc5c07021e53567a34e
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5f748f1e11f7757a8ea9acc5c07021e53567a34e
Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date: Tue Apr 20 15:04:11 2021 -0400
zink: add a flag indicating whether scanout object needs updating
this minimizes overhead of maintaining scanout objects
Fixes: 104603fa763 ("zink: create separate linear tiling image for scanout")
Reviewed-by: Adam Jackson <ajax at redhat.com>
Acked-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10358>
(cherry picked from commit 4dcd477d123e62f144210c6b624627f9c42d5924)
---
.pick_status.json | 2 +-
src/gallium/drivers/zink/zink_batch.c | 4 ++++
src/gallium/drivers/zink/zink_resource.h | 1 +
3 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/.pick_status.json b/.pick_status.json
index f93b5b7b1ae..0aad7d91c6f 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -85,7 +85,7 @@
"description": "zink: add a flag indicating whether scanout object needs updating",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": "104603fa763c52e98a79785dd514beab949546db"
},
diff --git a/src/gallium/drivers/zink/zink_batch.c b/src/gallium/drivers/zink/zink_batch.c
index ae696b347f7..7fe5f860d40 100644
--- a/src/gallium/drivers/zink/zink_batch.c
+++ b/src/gallium/drivers/zink/zink_batch.c
@@ -362,6 +362,8 @@ copy_scanout(struct zink_context *ctx, struct zink_resource *res)
struct pipe_box *src_box = &box;
unsigned dstz = 0;
+ if (!res->scanout_dirty)
+ return;
region.srcSubresource.aspectMask = res->aspect;
region.srcSubresource.mipLevel = 0;
switch (res->base.b.target) {
@@ -469,6 +471,7 @@ copy_scanout(struct zink_context *ctx, struct zink_resource *res)
);
/* separate flag to avoid annoying validation errors for new scanout objs */
res->scanout_obj_init = true;
+ res->scanout_dirty = false;
}
void
@@ -555,6 +558,7 @@ zink_batch_reference_resource_rw(struct zink_batch *batch, struct zink_resource
zink_batch_usage_set(&stencil->obj->writes, batch->state->fence.batch_id);
zink_batch_usage_set(&res->obj->writes, batch->state->fence.batch_id);
}
+ res->scanout_dirty = !!res->scanout_obj;
} else {
if (res->obj->reads.usage != batch->state->fence.batch_id) {
if (stencil)
diff --git a/src/gallium/drivers/zink/zink_resource.h b/src/gallium/drivers/zink/zink_resource.h
index c298c8fe3d2..74234e56055 100644
--- a/src/gallium/drivers/zink/zink_resource.h
+++ b/src/gallium/drivers/zink/zink_resource.h
@@ -90,6 +90,7 @@ struct zink_resource {
struct zink_resource_object *obj;
struct zink_resource_object *scanout_obj; //TODO: remove for wsi
bool scanout_obj_init;
+ bool scanout_dirty;
union {
struct util_range valid_buffer_range;
struct {
More information about the mesa-commit
mailing list