panfrost: Implement PAN_DBG_SYNC with pandecode/minimal
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 18 Feb 2020 12:50:19 +0000 (07:50 -0500)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 18 Feb 2020 13:45:14 +0000 (08:45 -0500)
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>

src/gallium/drivers/panfrost/pan_bo.c
src/gallium/drivers/panfrost/pan_job.c
src/gallium/drivers/panfrost/pan_screen.c

index ccbc19ea6280fec8fc1bf75fd9e1f76eb16f40c6..dfe04ed2ccc41d1ef4879caae985fd6a3d374397 100644 (file)
@@ -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);
         }
 
index 8502f24e5660dee593b6f74fa16e96aefd474211..35d5e0be67e6caa5b71ba69a5bb54483fe21a8b4 100644 (file)
@@ -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;
index 19d646bf7e7c52946d6ab4c7e22d385be7273a18..7cd90107382ef320f32a5bb4ed9cd8f0e70f880b 100644 (file)
@@ -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;