From ae88e79f6959df71953db6314c78f68bd2799f3c Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Wed, 27 May 2020 13:42:22 -0700 Subject: [PATCH] iris: Drop redundant iris_address::write flag. The write flag is redundant since it can be inferred easily from the iris_address::access domain. This allows the iris_address struct to be laid out more efficiently in memory, leading to a measurable improvement in several Piglit Drawoverhead test-cases. Reviewed-by: Kenneth Graunke Part-of: --- src/gallium/drivers/iris/iris_genx_macros.h | 5 +++-- src/gallium/drivers/iris/iris_query.c | 1 - src/gallium/drivers/iris/iris_screen.h | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/iris/iris_genx_macros.h b/src/gallium/drivers/iris/iris_genx_macros.h index 9312175d9b1..f0e6df064ba 100644 --- a/src/gallium/drivers/iris/iris_genx_macros.h +++ b/src/gallium/drivers/iris/iris_genx_macros.h @@ -52,7 +52,8 @@ __gen_combine_address(struct iris_batch *batch, void *location, uint64_t result = addr.offset + delta; if (addr.bo) { - iris_use_pinned_bo(batch, addr.bo, addr.write, addr.access); + iris_use_pinned_bo(batch, addr.bo, + !iris_domain_is_read_only(addr.access), addr.access); /* Assume this is a general address, not relative to a base. */ result += addr.bo->gtt_offset; } @@ -129,5 +130,5 @@ UNUSED static struct iris_address rw_bo(struct iris_bo *bo, uint64_t offset, enum iris_domain access) { return (struct iris_address) { .bo = bo, .offset = offset, - .write = true, .access = access }; + .access = access }; } diff --git a/src/gallium/drivers/iris/iris_query.c b/src/gallium/drivers/iris/iris_query.c index 7f93d0f7ec7..ef46158e95d 100644 --- a/src/gallium/drivers/iris/iris_query.c +++ b/src/gallium/drivers/iris/iris_query.c @@ -101,7 +101,6 @@ query_mem64(struct iris_query *q, uint32_t offset) struct iris_address addr = { .bo = iris_resource_bo(q->query_state_ref.res), .offset = q->query_state_ref.offset + offset, - .write = true, .access = IRIS_DOMAIN_OTHER_WRITE }; return gen_mi_mem64(addr); diff --git a/src/gallium/drivers/iris/iris_screen.h b/src/gallium/drivers/iris/iris_screen.h index 4d300e302e9..b11178bc5be 100644 --- a/src/gallium/drivers/iris/iris_screen.h +++ b/src/gallium/drivers/iris/iris_screen.h @@ -137,10 +137,9 @@ struct iris_vtable { }; struct iris_address { - enum iris_domain access; struct iris_bo *bo; uint64_t offset; - bool write; + enum iris_domain access; }; struct iris_screen { -- 2.30.2