Mesa (main): panfrost: Bubble up errors

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 1 19:26:48 UTC 2021


Module: Mesa
Branch: main
Commit: 71f069bd7ae925aa512fb197a888ce3a86675401
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=71f069bd7ae925aa512fb197a888ce3a86675401

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Thu May 20 19:12:13 2021 -0400

panfrost: Bubble up errors

Instead of punting to PAN_MESA_DEBUG=msgs, which we can now remove.

Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11074>

---

 src/gallium/drivers/panfrost/pan_job.c    | 16 ++++++++--------
 src/gallium/drivers/panfrost/pan_screen.c |  1 -
 src/panfrost/lib/pan_util.h               |  2 +-
 3 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c
index ec6b199266d..0bbd27ba297 100644
--- a/src/gallium/drivers/panfrost/pan_job.c
+++ b/src/gallium/drivers/panfrost/pan_job.c
@@ -879,12 +879,8 @@ panfrost_batch_submit_ioctl(struct panfrost_batch *batch,
                 ret = drmIoctl(dev->fd, DRM_IOCTL_PANFROST_SUBMIT, &submit);
         free(bo_handles);
 
-        if (ret) {
-                if (dev->debug & PAN_DBG_MSGS)
-                        fprintf(stderr, "Error submitting: %m\n");
-
+        if (ret)
                 return errno;
-        }
 
         /* Trace the job if we're doing that */
         if (dev->debug & (PAN_DBG_TRACE | PAN_DBG_SYNC)) {
@@ -927,7 +923,9 @@ panfrost_batch_submit_jobs(struct panfrost_batch *batch,
         if (has_draws) {
                 ret = panfrost_batch_submit_ioctl(batch, batch->scoreboard.first_job,
                                                   0, in_sync, has_frag ? 0 : out_sync);
-                assert(!ret);
+
+                if (ret)
+                        goto done;
         }
 
         if (has_frag) {
@@ -942,9 +940,11 @@ panfrost_batch_submit_jobs(struct panfrost_batch *batch,
                 ret = panfrost_batch_submit_ioctl(batch, fragjob,
                                                   PANFROST_JD_REQ_FS, 0,
                                                   out_sync);
-                assert(!ret);
+                if (ret)
+                        goto done;
         }
 
+done:
         if (has_tiler)
                 pthread_mutex_unlock(&dev->submit_lock);
 
@@ -992,7 +992,7 @@ panfrost_batch_submit(struct panfrost_batch *batch,
 
         ret = panfrost_batch_submit_jobs(batch, &fb, in_sync, out_sync);
 
-        if (ret && dev->debug & PAN_DBG_MSGS)
+        if (ret)
                 fprintf(stderr, "panfrost_batch_submit failed: %d\n", ret);
 
         /* We must reset the damage info of our render targets here even
diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c
index 462e35b2cec..ff26b3316fb 100644
--- a/src/gallium/drivers/panfrost/pan_screen.c
+++ b/src/gallium/drivers/panfrost/pan_screen.c
@@ -58,7 +58,6 @@
 #include "panfrost-quirks.h"
 
 static const struct debug_named_value panfrost_debug_options[] = {
-        {"msgs",      PAN_DBG_MSGS,	"Print debug messages"},
         {"trace",     PAN_DBG_TRACE,    "Trace the command stream"},
         {"deqp",      PAN_DBG_DEQP,     "Hacks for dEQP"},
         {"dirty",     PAN_DBG_DIRTY,    "Always re-emit all state"},
diff --git a/src/panfrost/lib/pan_util.h b/src/panfrost/lib/pan_util.h
index 76f64e2e36e..f720e7c801a 100644
--- a/src/panfrost/lib/pan_util.h
+++ b/src/panfrost/lib/pan_util.h
@@ -28,7 +28,7 @@
 #ifndef PAN_UTIL_H
 #define PAN_UTIL_H
 
-#define PAN_DBG_MSGS		0x0001
+/* 0x0001 unused */
 #define PAN_DBG_TRACE           0x0002
 #define PAN_DBG_DEQP            0x0004
 #define PAN_DBG_DIRTY           0x0008



More information about the mesa-commit mailing list