diff options
author | Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> | 2020-02-18 07:50:19 -0500 |
---|---|---|
committer | Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> | 2020-02-18 08:45:14 -0500 |
commit | c46a090942b3d76b8bcbfde75c5454d449799360 (patch) | |
tree | 03a5b5bce62c7e7f268589b5978749c253e6afcd | |
parent | 59986461255474cfb11c18e7ea8a6303e2d25afb (diff) |
panfrost: Implement PAN_DBG_SYNC with pandecode/minimal
This way we avoid duplicating job traversal logic.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3836>
-rw-r--r-- | src/gallium/drivers/panfrost/pan_bo.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/panfrost/pan_job.c | 27 | ||||
-rw-r--r-- | src/gallium/drivers/panfrost/pan_screen.c | 2 |
3 files changed, 8 insertions, 25 deletions
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; |