iris: Simplify iris_batch_prepare_noop().
authorFrancisco Jerez <currojerez@riseup.net>
Fri, 29 May 2020 23:54:35 +0000 (16:54 -0700)
committerMarge Bot <eric+marge@anholt.net>
Wed, 3 Jun 2020 22:22:19 +0000 (22:22 +0000)
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@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5279>

src/gallium/drivers/iris/iris_batch.c
src/gallium/drivers/iris/iris_batch.h
src/gallium/drivers/iris/iris_state.c

index 0982e8aa8c08d59f0eef7818846c6219334bfb8f..fabea867b48bf3dd727b8539009097ba17ccfb75 100644 (file)
@@ -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;
 }
index 421d8e064d40242e4ac3bf4eb668c9c0bb0a329b..c95fd23491fb9f58ecfc23ca7265222f330c6b1e 100644 (file)
@@ -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
 
index 92f204153855fa55c330901c6438ab5615e2dbba..2546efd308d1bfb035df380b2530530209351f7d 100644 (file)
@@ -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