Mesa (master): iris: Simplify iris_batch_prepare_noop().
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Jun 3 22:43:38 UTC 2020
Module: Mesa
Branch: master
Commit: 45918e0d8c1ac3128b743fc4e549a60d744e3bc5
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=45918e0d8c1ac3128b743fc4e549a60d744e3bc5
Author: Francisco Jerez <currojerez at riseup.net>
Date: Fri May 29 16:54:35 2020 -0700
iris: Simplify iris_batch_prepare_noop().
This makes iris_batch_prepare_noop() return a boolean instead of
passing through the relevant set of dirty flags. It will make it
easier to change the representation of dirty flags.
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5279>
---
src/gallium/drivers/iris/iris_batch.c | 9 +++++----
src/gallium/drivers/iris/iris_batch.h | 4 +---
src/gallium/drivers/iris/iris_state.c | 11 +++++------
3 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/src/gallium/drivers/iris/iris_batch.c b/src/gallium/drivers/iris/iris_batch.c
index 0982e8aa8c0..fabea867b48 100644
--- a/src/gallium/drivers/iris/iris_batch.c
+++ b/src/gallium/drivers/iris/iris_batch.c
@@ -765,10 +765,11 @@ iris_batch_references(struct iris_batch *batch, struct iris_bo *bo)
}
/**
- * Updates the state of the noop feature.
+ * Updates the state of the noop feature. Returns true if there was a noop
+ * transition that led to state invalidation.
*/
-uint64_t
-iris_batch_prepare_noop(struct iris_batch *batch, bool noop_enable, uint64_t dirty_flags)
+bool
+iris_batch_prepare_noop(struct iris_batch *batch, bool noop_enable)
{
if (batch->noop_enabled == noop_enable)
return 0;
@@ -784,5 +785,5 @@ iris_batch_prepare_noop(struct iris_batch *batch, bool noop_enable, uint64_t dir
/* We only need to update the entire state if we transition from noop ->
* not-noop.
*/
- return !batch->noop_enabled ? dirty_flags : 0;
+ return !batch->noop_enabled;
}
diff --git a/src/gallium/drivers/iris/iris_batch.h b/src/gallium/drivers/iris/iris_batch.h
index 421d8e064d4..c95fd23491f 100644
--- a/src/gallium/drivers/iris/iris_batch.h
+++ b/src/gallium/drivers/iris/iris_batch.h
@@ -162,9 +162,7 @@ void _iris_batch_flush(struct iris_batch *batch, const char *file, int line);
bool iris_batch_references(struct iris_batch *batch, struct iris_bo *bo);
-uint64_t iris_batch_prepare_noop(struct iris_batch *batch,
- bool noop_enable,
- uint64_t dirty_flags);
+bool iris_batch_prepare_noop(struct iris_batch *batch, bool noop_enable);
#define RELOC_WRITE EXEC_OBJECT_WRITE
diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c
index 92f20415385..2546efd308d 100644
--- a/src/gallium/drivers/iris/iris_state.c
+++ b/src/gallium/drivers/iris/iris_state.c
@@ -7512,12 +7512,11 @@ iris_set_frontend_noop(struct pipe_context *ctx, bool enable)
{
struct iris_context *ice = (struct iris_context *) ctx;
- ice->state.dirty |= iris_batch_prepare_noop(&ice->batches[IRIS_BATCH_RENDER],
- enable,
- IRIS_ALL_DIRTY_FOR_RENDER);
- ice->state.dirty |= iris_batch_prepare_noop(&ice->batches[IRIS_BATCH_COMPUTE],
- enable,
- IRIS_ALL_DIRTY_FOR_COMPUTE);
+ if (iris_batch_prepare_noop(&ice->batches[IRIS_BATCH_RENDER], enable))
+ ice->state.dirty |= IRIS_ALL_DIRTY_FOR_RENDER;
+
+ if (iris_batch_prepare_noop(&ice->batches[IRIS_BATCH_COMPUTE], enable))
+ ice->state.dirty |= IRIS_ALL_DIRTY_FOR_COMPUTE;
}
void
More information about the mesa-commit
mailing list