diff options
author | Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> | 2020-05-22 21:49:06 -0400 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2020-05-25 16:01:18 +0000 |
commit | 1d647b1c48a8a25fd93fbaae5a6119e3f7d09ea5 (patch) | |
tree | 9bcc06ac5a41b08ce67dd1f1ad7103de015dfe4d | |
parent | 4c5d1e286003bedc52b92cef74013d2d3bb56f6f (diff) |
panfrost: Only run batch debug when specifically asked
It's expensive and in a hot path; even for general debug builds we won't
need this, only if we're specifically hacking on batch code.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5202>
-rw-r--r-- | src/gallium/drivers/panfrost/pan_job.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c index 77de212c549..a9c2a31a5ea 100644 --- a/src/gallium/drivers/panfrost/pan_job.c +++ b/src/gallium/drivers/panfrost/pan_job.c @@ -146,7 +146,7 @@ panfrost_freeze_batch(struct panfrost_batch *batch) } } -#ifndef NDEBUG +#ifdef PAN_BATCH_DEBUG static bool panfrost_batch_is_frozen(struct panfrost_batch *batch) { struct panfrost_context *ctx = batch->ctx; @@ -169,7 +169,9 @@ panfrost_free_batch(struct panfrost_batch *batch) if (!batch) return; +#ifdef PAN_BATCH_DEBUG assert(panfrost_batch_is_frozen(batch)); +#endif hash_table_foreach(batch->bos, entry) panfrost_bo_unreference((struct panfrost_bo *)entry->key); @@ -192,7 +194,7 @@ panfrost_free_batch(struct panfrost_batch *batch) ralloc_free(batch); } -#ifndef NDEBUG +#ifdef PAN_BATCH_DEBUG static bool panfrost_dep_graph_contains_batch(struct panfrost_batch *root, struct panfrost_batch *batch) @@ -228,8 +230,10 @@ panfrost_batch_add_dep(struct panfrost_batch *batch, return; } +#ifdef PAN_BATCH_DEBUG /* Make sure the dependency graph is acyclic. */ assert(!panfrost_dep_graph_contains_batch(newdep->batch, batch)); +#endif panfrost_batch_fence_reference(newdep); util_dynarray_append(&batch->dependencies, @@ -390,7 +394,7 @@ panfrost_gc_fences(struct panfrost_context *ctx) } } -#ifndef NDEBUG +#ifdef PAN_BATCH_DEBUG static bool panfrost_batch_in_readers(struct panfrost_batch *batch, struct panfrost_bo_access *access) @@ -511,10 +515,12 @@ panfrost_batch_update_bo_access(struct panfrost_batch *batch, /* We already accessed this BO before, so we should already be * in the reader array. */ +#ifdef PAN_BATCH_DEBUG if (already_accessed) { assert(panfrost_batch_in_readers(batch, access)); return; } +#endif /* Previous access was a read and we want to read this BO. * Add ourselves to the readers array and add a dependency on |