Mesa (master): intel/dev: switch over to mesa log infrastructure

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Mar 12 18:59:56 UTC 2021


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

Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date:   Tue Feb 16 09:53:14 2021 +0200

intel/dev: switch over to mesa log infrastructure

v2: Deal with line wrapping (Jordan)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Suggested-by: Jordan Justen <jordan.l.justen at intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9052>

---

 src/intel/dev/gen_device_info.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/intel/dev/gen_device_info.c b/src/intel/dev/gen_device_info.c
index 234754ba5bf..5fb02946669 100644
--- a/src/intel/dev/gen_device_info.c
+++ b/src/intel/dev/gen_device_info.c
@@ -31,6 +31,7 @@
 #include "compiler/shader_enums.h"
 #include "intel/common/intel_gem.h"
 #include "util/bitscan.h"
+#include "util/log.h"
 #include "util/macros.h"
 
 #include "drm-uapi/i915_drm.h"
@@ -1228,7 +1229,7 @@ gen_get_device_info_from_pci_id(int pci_id,
 #include "pci_ids/i915_pci_ids.h"
 
    default:
-      fprintf(stderr, "Driver does not support the 0x%x PCI ID.\n", pci_id);
+      mesa_logw("Driver does not support the 0x%x PCI ID.", pci_id);
       return false;
    }
 
@@ -1313,7 +1314,7 @@ getparam_topology(struct gen_device_info *devinfo, int fd)
     * be detected at runtime.
     */
    if (devinfo->gen >= 8)
-      fprintf(stderr, "Kernel 4.1 required to properly query GPU properties.\n");
+      mesa_logw("Kernel 4.1 required to properly query GPU properties.");
 
    return false;
 }
@@ -1406,17 +1407,16 @@ gen_get_device_info_from_fd(int fd, struct gen_device_info *devinfo)
          if (devid <= 0)
             devid = strtol(devid_override, NULL, 0);
          if (devid <= 0) {
-            fprintf(stderr, "Invalid INTEL_DEVID_OVERRIDE=\"%s\". "
+            mesa_loge("Invalid INTEL_DEVID_OVERRIDE=\"%s\". "
                     "Use a valid numeric PCI ID or one of the supported "
-                    "platform names: %s", devid_override, name_map[0].name);
-            for (unsigned i = 1; i < ARRAY_SIZE(name_map); i++)
-               fprintf(stderr, ", %s", name_map[i].name);
-            fprintf(stderr, "\n");
+                    "platform names:", devid_override);
+            for (unsigned i = 0; i < ARRAY_SIZE(name_map); i++)
+               mesa_loge("   %s", name_map[i].name);
             return false;
          }
       } else {
-         fprintf(stderr, "Ignoring INTEL_DEVID_OVERRIDE=\"%s\" because "
-                 "real and effective user ID don't match.\n", devid_override);
+         mesa_logi("Ignoring INTEL_DEVID_OVERRIDE=\"%s\" because "
+                   "real and effective user ID don't match.", devid_override);
       }
    }
 
@@ -1434,7 +1434,7 @@ gen_get_device_info_from_fd(int fd, struct gen_device_info *devinfo)
    }
 
    if (devinfo->gen == 10) {
-      fprintf(stderr, "Gen10 support is redacted.\n");
+      mesa_loge("Gen10 support is redacted.");
       return false;
    }
 
@@ -1447,7 +1447,7 @@ gen_get_device_info_from_fd(int fd, struct gen_device_info *devinfo)
                 &timestamp_frequency))
       devinfo->timestamp_frequency = timestamp_frequency;
    else if (devinfo->gen >= 10) {
-      fprintf(stderr, "Kernel 4.15 required to read the CS timestamp frequency.\n");
+      mesa_loge("Kernel 4.15 required to read the CS timestamp frequency.");
       return false;
    }
 



More information about the mesa-commit mailing list