From e5d6ce6e5ed3f9608a860d71cc40ea4efcac957d Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 7 Jul 2021 09:33:16 -0400 Subject: [PATCH] zink: collapse a conditional in zink_batch_resource_usage_set() Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_batch.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/gallium/drivers/zink/zink_batch.c b/src/gallium/drivers/zink/zink_batch.c index 026f00f..9e13264 100644 --- a/src/gallium/drivers/zink/zink_batch.c +++ b/src/gallium/drivers/zink/zink_batch.c @@ -584,13 +584,9 @@ zink_end_batch(struct zink_context *ctx, struct zink_batch *batch) void zink_batch_resource_usage_set(struct zink_batch *batch, struct zink_resource *res, bool write) { - if (write) { - zink_batch_usage_set(&res->obj->writes, batch->state); - if (res->scanout_obj) - batch->state->scanout_flush = true; - } else { - zink_batch_usage_set(&res->obj->reads, batch->state); - } + zink_resource_usage_set(res, batch->state, write); + if (write && res->scanout_obj) + batch->state->scanout_flush = true; /* multiple array entries are fine */ if (!res->obj->coherent && res->obj->persistent_maps) util_dynarray_append(&batch->state->persistent_resources, struct zink_resource_object*, res->obj); -- 2.7.4