freedreno: Drop batch-cache orphan tracking.

Let's let valgrind/asan handle leak detection.  This means you can use the
flag even on non-DEBUG builds.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11368>
This commit is contained in:
Emma Anholt 2021-06-14 11:42:43 -07:00 committed by Marge Bot
parent 0cec71d7ce
commit a960b0e477
5 changed files with 7 additions and 43 deletions

View file

@ -141,11 +141,6 @@ fd_batch_create(struct fd_context *ctx, bool nondraw)
batch_init(batch);
fd_screen_assert_locked(ctx->screen);
if (BATCH_DEBUG) {
_mesa_set_add(ctx->screen->live_batches, batch);
}
return batch;
}
@ -305,10 +300,6 @@ __fd_batch_destroy(struct fd_batch *batch)
fd_screen_assert_locked(batch->ctx->screen);
if (BATCH_DEBUG) {
_mesa_set_remove_key(ctx->screen->live_batches, batch);
}
fd_bc_invalidate_batch(batch, true);
batch_reset_resources(batch);

View file

@ -41,12 +41,6 @@
extern "C" {
#endif
#ifdef DEBUG
#define BATCH_DEBUG FD_DBG(MSGS)
#else
#define BATCH_DEBUG 0
#endif
struct fd_resource;
struct fd_batch_key;
struct fd_batch_result;

View file

@ -204,24 +204,12 @@ fd_bc_flush_deferred(struct fd_batch_cache *cache, struct fd_context *ctx)
bc_flush(cache, ctx, true);
}
static bool
batch_in_cache(struct fd_batch_cache *cache, struct fd_batch *batch)
{
struct fd_batch *b;
foreach_batch (b, cache, cache->batch_mask)
if (b == batch)
return true;
return false;
}
void
fd_bc_dump(struct fd_screen *screen, const char *fmt, ...)
{
struct fd_batch_cache *cache = &screen->batch_cache;
if (!BATCH_DEBUG)
if (!FD_DBG(MSGS))
return;
fd_screen_lock(screen);
@ -231,11 +219,12 @@ fd_bc_dump(struct fd_screen *screen, const char *fmt, ...)
vprintf(fmt, ap);
va_end(ap);
set_foreach (screen->live_batches, entry) {
struct fd_batch *batch = (struct fd_batch *)entry->key;
printf(" %p<%u>%s%s\n", batch, batch->seqno,
batch->needs_flush ? ", NEEDS FLUSH" : "",
batch_in_cache(cache, batch) ? "" : ", ORPHAN");
for (int i = 0; i < ARRAY_SIZE(cache->batches); i++) {
struct fd_batch *batch = cache->batches[i];
if (batch) {
printf(" %p<%u>%s\n", batch, batch->seqno,
batch->needs_flush ? ", NEEDS FLUSH" : "");
}
}
printf("----\n");

View file

@ -170,8 +170,6 @@ fd_screen_destroy(struct pipe_screen *pscreen)
if (screen->compiler)
ir3_screen_fini(pscreen);
ralloc_free(screen->live_batches);
free(screen->perfcntr_queries);
free(screen);
}
@ -1078,9 +1076,6 @@ fd_screen_create(struct fd_device *dev, struct renderonly *ro)
if (fd_device_version(dev) >= FD_VERSION_UNLIMITED_CMDS)
screen->reorder = !FD_DBG(INORDER);
if (BATCH_DEBUG)
screen->live_batches = _mesa_pointer_set_create(NULL);
fd_bc_init(&screen->batch_cache);
list_inithead(&screen->context_list);

View file

@ -144,11 +144,6 @@ struct fd_screen {
const uint64_t *supported_modifiers;
struct renderonly *ro;
/* when BATCH_DEBUG is enabled, tracking for fd_batch's which are not yet
* freed:
*/
struct set *live_batches;
};
static inline struct fd_screen *