Mesa (master): panfrost: Use DBG macro to avoid noise in the console

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jan 31 06:24:31 UTC 2020


Module: Mesa
Branch: master
Commit: d902e23d8094a01f752d3404ec484e0c059eb193
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d902e23d8094a01f752d3404ec484e0c059eb193

Author: Tomeu Vizoso <tomeu.vizoso at collabora.com>
Date:   Mon Jan  6 10:48:20 2020 +0100

panfrost: Use DBG macro to avoid noise in the console

It pollutes the output of programs that use Panfrost and can confuse its
callers, such as test runners.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso at collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3625>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3625>

---

 src/gallium/drivers/panfrost/pan_blit.c    | 5 ++---
 src/gallium/drivers/panfrost/pan_bo.c      | 2 +-
 src/gallium/drivers/panfrost/pan_context.c | 2 +-
 src/gallium/drivers/panfrost/pan_format.c  | 2 +-
 src/gallium/drivers/panfrost/pan_job.c     | 6 +++---
 src/gallium/drivers/panfrost/pan_screen.c  | 4 ++--
 6 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_blit.c b/src/gallium/drivers/panfrost/pan_blit.c
index 361e39bd8a2..038a05b0181 100644
--- a/src/gallium/drivers/panfrost/pan_blit.c
+++ b/src/gallium/drivers/panfrost/pan_blit.c
@@ -28,6 +28,7 @@
  */
 
 #include "pan_context.h"
+#include "pan_util.h"
 #include "util/format/u_format.h"
 
 static void
@@ -67,7 +68,7 @@ panfrost_u_blitter_blit(struct pipe_context *pipe,
         struct panfrost_context *ctx = pan_context(pipe);
 
         if (!util_blitter_is_blit_supported(ctx->blitter, info)) {
-                fprintf(stderr, "blit unsupported %s -> %s\n",
+                DBG("blit unsupported %s -> %s\n",
                         util_format_short_name(info->src.resource->format),
                         util_format_short_name(info->dst.resource->format));
                 return false;
@@ -92,8 +93,6 @@ panfrost_blit(struct pipe_context *pipe,
         if (panfrost_u_blitter_blit(pipe, info))
                 return;
 
-        fprintf(stderr, "Unhandled blit");
-
         return;
 }
 
diff --git a/src/gallium/drivers/panfrost/pan_bo.c b/src/gallium/drivers/panfrost/pan_bo.c
index 1a945daf237..ccbc19ea628 100644
--- a/src/gallium/drivers/panfrost/pan_bo.c
+++ b/src/gallium/drivers/panfrost/pan_bo.c
@@ -73,7 +73,7 @@ panfrost_bo_alloc(struct panfrost_screen *screen, size_t size,
 
         ret = drmIoctl(screen->fd, DRM_IOCTL_PANFROST_CREATE_BO, &create_bo);
         if (ret) {
-                fprintf(stderr, "DRM_IOCTL_PANFROST_CREATE_BO failed: %m\n");
+                DBG("DRM_IOCTL_PANFROST_CREATE_BO failed: %m\n");
                 return NULL;
         }
 
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index a3d95a31584..c32254adf81 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -2506,7 +2506,7 @@ panfrost_begin_query(struct pipe_context *pipe, struct pipe_query *q)
                 break;
 
         default:
-                fprintf(stderr, "Skipping query %u\n", query->type);
+                DBG("Skipping query %u\n", query->type);
                 break;
         }
 
diff --git a/src/gallium/drivers/panfrost/pan_format.c b/src/gallium/drivers/panfrost/pan_format.c
index 48b937dfdb8..fd9d0eb973d 100644
--- a/src/gallium/drivers/panfrost/pan_format.c
+++ b/src/gallium/drivers/panfrost/pan_format.c
@@ -99,7 +99,7 @@ panfrost_translate_channel_width(unsigned size)
         case 32:
                 return MALI_CHANNEL_32;
         default: {
-                printf ("Invalid width: %d\n", size);
+                fprintf(stderr, "Invalid width: %d\n", size);
                 assert(0);
         }
         }
diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c
index 8ec00022999..747e9c95556 100644
--- a/src/gallium/drivers/panfrost/pan_job.c
+++ b/src/gallium/drivers/panfrost/pan_job.c
@@ -893,7 +893,7 @@ panfrost_batch_submit_ioctl(struct panfrost_batch *batch,
         free(in_syncs);
 
         if (ret) {
-                fprintf(stderr, "Error submitting: %m\n");
+                DBG("Error submitting: %m\n");
                 return errno;
         }
 
@@ -907,7 +907,7 @@ panfrost_batch_submit_ioctl(struct panfrost_batch *batch,
                 status = header->exception_status;
 
                 if (status && status != 0x1) {
-                        fprintf(stderr, "Job %" PRIx64 " failed: source ID: 0x%x access: %s exception: 0x%x (exception_status 0x%x) fault_pointer 0x%" PRIx64 " \n",
+                        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),
@@ -995,7 +995,7 @@ panfrost_batch_submit(struct panfrost_batch *batch)
         ret = panfrost_batch_submit_jobs(batch);
 
         if (ret)
-                fprintf(stderr, "panfrost_batch_submit failed: %d\n", ret);
+                DBG("panfrost_batch_submit failed: %d\n", ret);
 
         /* We must reset the damage info of our render targets here even
          * though a damage reset normally happens when the DRI layer swaps
diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c
index 8b8de9d6ef2..0fe6062df91 100644
--- a/src/gallium/drivers/panfrost/pan_screen.c
+++ b/src/gallium/drivers/panfrost/pan_screen.c
@@ -357,7 +357,7 @@ panfrost_get_shader_param(struct pipe_screen *screen,
                 return 0;
 
         default:
-                fprintf(stderr, "unknown shader param %d\n", param);
+                DBG("unknown shader param %d\n", param);
                 return 0;
         }
 
@@ -734,7 +734,7 @@ panfrost_create_screen(int fd, struct renderonly *ro)
         if (ro) {
                 screen->ro = renderonly_dup(ro);
                 if (!screen->ro) {
-                        fprintf(stderr, "Failed to dup renderonly object\n");
+                        DBG("Failed to dup renderonly object\n");
                         free(screen);
                         return NULL;
                 }



More information about the mesa-commit mailing list