From: Alyssa Rosenzweig Date: Tue, 18 Feb 2020 12:50:19 +0000 (-0500) Subject: panfrost: Implement PAN_DBG_SYNC with pandecode/minimal X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c46a090942b3d76b8bcbfde75c5454d449799360;p=mesa.git panfrost: Implement PAN_DBG_SYNC with pandecode/minimal This way we avoid duplicating job traversal logic. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Boris Brezillon Part-of: --- diff --git a/src/gallium/drivers/panfrost/pan_bo.c b/src/gallium/drivers/panfrost/pan_bo.c index ccbc19ea628..dfe04ed2ccc 100644 --- a/src/gallium/drivers/panfrost/pan_bo.c +++ b/src/gallium/drivers/panfrost/pan_bo.c @@ -347,7 +347,7 @@ panfrost_bo_mmap(struct panfrost_bo *bo) } /* Record the mmap if we're tracing */ - if (pan_debug & PAN_DBG_TRACE) + if (pan_debug & (PAN_DBG_TRACE | PAN_DBG_SYNC)) pandecode_inject_mmap(bo->gpu, bo->cpu, bo->size, NULL); } @@ -406,7 +406,7 @@ panfrost_bo_create(struct panfrost_screen *screen, size_t size, if (!(flags & (PAN_BO_INVISIBLE | PAN_BO_DELAY_MMAP))) panfrost_bo_mmap(bo); else if (flags & PAN_BO_INVISIBLE) { - if (pan_debug & PAN_DBG_TRACE) + if (pan_debug & (PAN_DBG_TRACE | PAN_DBG_SYNC)) pandecode_inject_mmap(bo->gpu, NULL, bo->size, NULL); } diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c index 8502f24e566..35d5e0be67e 100644 --- a/src/gallium/drivers/panfrost/pan_job.c +++ b/src/gallium/drivers/panfrost/pan_job.c @@ -917,32 +917,15 @@ panfrost_batch_submit_ioctl(struct panfrost_batch *batch, return errno; } - if (pan_debug & PAN_DBG_SYNC) { - u32 status; - - /* Wait so we can get errors reported back */ - drmSyncobjWait(screen->fd, &batch->out_sync->syncobj, 1, - INT64_MAX, 0, NULL); - - status = header->exception_status; - - if (status && status != 0x1) { - DBG("Job %" PRIx64 " failed: source ID: 0x%x access: %s exception: 0x%x (exception_status 0x%x) fault_pointer 0x%" PRIx64 " \n", - first_job_desc, - (status >> 16) & 0xFFFF, - pandecode_exception_access((status >> 8) & 0x3), - status & 0xFF, - status, - header->fault_pointer); - } - } - /* Trace the job if we're doing that */ - if (pan_debug & PAN_DBG_TRACE) { + if (pan_debug & (PAN_DBG_TRACE | PAN_DBG_SYNC)) { /* Wait so we can get errors reported back */ drmSyncobjWait(screen->fd, &batch->out_sync->syncobj, 1, INT64_MAX, 0, NULL); - pandecode_jc(submit.jc, FALSE, screen->gpu_id, false); + + /* Trace gets priority over sync */ + bool minimal = !(pan_debug & PAN_DBG_TRACE); + pandecode_jc(submit.jc, FALSE, screen->gpu_id, minimal); } return 0; diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c index 19d646bf7e7..7cd90107382 100644 --- a/src/gallium/drivers/panfrost/pan_screen.c +++ b/src/gallium/drivers/panfrost/pan_screen.c @@ -774,7 +774,7 @@ panfrost_create_screen(int fd, struct renderonly *ro) for (unsigned i = 0; i < ARRAY_SIZE(screen->bo_cache.buckets); ++i) list_inithead(&screen->bo_cache.buckets[i]); - if (pan_debug & PAN_DBG_TRACE) + if (pan_debug & (PAN_DBG_TRACE | PAN_DBG_SYNC)) pandecode_initialize(); screen->base.destroy = panfrost_destroy_screen;