Mesa (master): treewide: Disambiguate various variables named "debug_options"

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jan 4 21:18:36 UTC 2021


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

Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Dec 17 11:07:30 2020 -0500

treewide: Disambiguate various variables named "debug_options"

Name them after what they control so 'vi -t' can take you somewhere
useful.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8165>

---

 src/gallium/drivers/d3d12/d3d12_screen.cpp       | 4 ++--
 src/gallium/drivers/etnaviv/etnaviv_screen.c     | 4 ++--
 src/gallium/drivers/freedreno/freedreno_screen.c | 4 ++--
 src/gallium/drivers/i915/i915_debug.c            | 4 ++--
 src/gallium/drivers/lima/lima_screen.c           | 4 ++--
 src/gallium/drivers/panfrost/pan_screen.c        | 4 ++--
 src/gallium/drivers/r300/r300_debug.c            | 4 ++--
 src/gallium/drivers/radeonsi/si_pipe.c           | 6 +++---
 src/gallium/drivers/vc4/vc4_screen.c             | 4 ++--
 src/gallium/drivers/virgl/virgl_screen.c         | 4 ++--
 src/gallium/drivers/zink/zink_screen.c           | 4 ++--
 src/microsoft/clc/clc_compiler.c                 | 4 ++--
 src/microsoft/clc/compute_test.cpp               | 4 ++--
 src/microsoft/compiler/nir_to_dxil.c             | 4 ++--
 src/panfrost/bifrost/bifrost_compile.c           | 4 ++--
 src/panfrost/midgard/midgard_compile.c           | 4 ++--
 16 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/src/gallium/drivers/d3d12/d3d12_screen.cpp b/src/gallium/drivers/d3d12/d3d12_screen.cpp
index 75cdaaff78a..b3bd1f40be0 100644
--- a/src/gallium/drivers/d3d12/d3d12_screen.cpp
+++ b/src/gallium/drivers/d3d12/d3d12_screen.cpp
@@ -47,7 +47,7 @@
 #include <dxguids/dxguids.h>
 
 static const struct debug_named_value
-debug_options[] = {
+d3d12_debug_options[] = {
    { "verbose",      D3D12_DEBUG_VERBOSE,       NULL },
    { "blit",         D3D12_DEBUG_BLIT,          "Trace blit and copy resource calls" },
    { "experimental", D3D12_DEBUG_EXPERIMENTAL,  "Enable experimental shader models feature" },
@@ -59,7 +59,7 @@ debug_options[] = {
    DEBUG_NAMED_VALUE_END
 };
 
-DEBUG_GET_ONCE_FLAGS_OPTION(d3d12_debug, "D3D12_DEBUG", debug_options, 0)
+DEBUG_GET_ONCE_FLAGS_OPTION(d3d12_debug, "D3D12_DEBUG", d3d12_debug_options, 0)
 
 uint32_t
 d3d12_debug;
diff --git a/src/gallium/drivers/etnaviv/etnaviv_screen.c b/src/gallium/drivers/etnaviv/etnaviv_screen.c
index aca9ed34e5b..aa6a7370189 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_screen.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_screen.c
@@ -53,7 +53,7 @@
 #define ETNA_DRM_VERSION_FENCE_FD      ETNA_DRM_VERSION(1, 1)
 #define ETNA_DRM_VERSION_PERFMON       ETNA_DRM_VERSION(1, 2)
 
-static const struct debug_named_value debug_options[] = {
+static const struct debug_named_value etna_debug_options[] = {
    {"dbg_msgs",       ETNA_DBG_MSGS, "Print debug messages"},
    {"frame_msgs",     ETNA_DBG_FRAME_MSGS, "Print frame messages"},
    {"resource_msgs",  ETNA_DBG_RESOURCE_MSGS, "Print resource messages"},
@@ -78,7 +78,7 @@ static const struct debug_named_value debug_options[] = {
    DEBUG_NAMED_VALUE_END
 };
 
-DEBUG_GET_ONCE_FLAGS_OPTION(etna_mesa_debug, "ETNA_MESA_DEBUG", debug_options, 0)
+DEBUG_GET_ONCE_FLAGS_OPTION(etna_mesa_debug, "ETNA_MESA_DEBUG", etna_debug_options, 0)
 int etna_mesa_debug = 0;
 
 static void
diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c b/src/gallium/drivers/freedreno/freedreno_screen.c
index 3f986a9e807..9f1e6e8759d 100644
--- a/src/gallium/drivers/freedreno/freedreno_screen.c
+++ b/src/gallium/drivers/freedreno/freedreno_screen.c
@@ -64,7 +64,7 @@
 #include "ir3/ir3_compiler.h"
 #include "a2xx/ir2.h"
 
-static const struct debug_named_value debug_options[] = {
+static const struct debug_named_value fd_debug_options[] = {
 		{"msgs",      FD_DBG_MSGS,   "Print debug messages"},
 		{"disasm",    FD_DBG_DISASM, "Dump TGSI and adreno shader disassembly (a2xx only, see IR3_SHADER_DEBUG)"},
 		{"dclear",    FD_DBG_DCLEAR, "Mark all state dirty after clear"},
@@ -97,7 +97,7 @@ static const struct debug_named_value debug_options[] = {
 		DEBUG_NAMED_VALUE_END
 };
 
-DEBUG_GET_ONCE_FLAGS_OPTION(fd_mesa_debug, "FD_MESA_DEBUG", debug_options, 0)
+DEBUG_GET_ONCE_FLAGS_OPTION(fd_mesa_debug, "FD_MESA_DEBUG", fd_debug_options, 0)
 
 int fd_mesa_debug = 0;
 bool fd_binning_enabled = true;
diff --git a/src/gallium/drivers/i915/i915_debug.c b/src/gallium/drivers/i915/i915_debug.c
index 19f887bab8c..dbf81f76d85 100644
--- a/src/gallium/drivers/i915/i915_debug.c
+++ b/src/gallium/drivers/i915/i915_debug.c
@@ -35,7 +35,7 @@
 
 
 
-static const struct debug_named_value debug_options[] = {
+static const struct debug_named_value i915_debug_options[] = {
    {"blit",      DBG_BLIT,      "Print when using the 2d blitter"},
    {"emit",      DBG_EMIT,      "State emit information"},
    {"atoms",     DBG_ATOMS,     "Print dirty state atoms"},
@@ -47,7 +47,7 @@ static const struct debug_named_value debug_options[] = {
 
 unsigned i915_debug = 0;
 
-DEBUG_GET_ONCE_FLAGS_OPTION(i915_debug, "I915_DEBUG", debug_options, 0)
+DEBUG_GET_ONCE_FLAGS_OPTION(i915_debug, "I915_DEBUG", i915_debug_options, 0)
 DEBUG_GET_ONCE_BOOL_OPTION(i915_no_tiling, "I915_NO_TILING", FALSE)
 DEBUG_GET_ONCE_BOOL_OPTION(i915_lie, "I915_LIE", TRUE)
 DEBUG_GET_ONCE_BOOL_OPTION(i915_use_blitter, "I915_USE_BLITTER", FALSE)
diff --git a/src/gallium/drivers/lima/lima_screen.c b/src/gallium/drivers/lima/lima_screen.c
index 28a40e3e1cb..25eb28e2ffb 100644
--- a/src/gallium/drivers/lima/lima_screen.c
+++ b/src/gallium/drivers/lima/lima_screen.c
@@ -541,7 +541,7 @@ lima_screen_is_dmabuf_modifier_supported(struct pipe_screen *pscreen,
    return false;
 }
 
-static const struct debug_named_value debug_options[] = {
+static const struct debug_named_value lima_debug_options[] = {
         { "gp",       LIMA_DEBUG_GP,
           "print GP shader compiler result of each stage" },
         { "pp",       LIMA_DEBUG_PP,
@@ -563,7 +563,7 @@ static const struct debug_named_value debug_options[] = {
         { NULL }
 };
 
-DEBUG_GET_ONCE_FLAGS_OPTION(lima_debug, "LIMA_DEBUG", debug_options, 0)
+DEBUG_GET_ONCE_FLAGS_OPTION(lima_debug, "LIMA_DEBUG", lima_debug_options, 0)
 uint32_t lima_debug;
 
 static void
diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c
index 7e085fe9a69..3c2f93b6b0d 100644
--- a/src/gallium/drivers/panfrost/pan_screen.c
+++ b/src/gallium/drivers/panfrost/pan_screen.c
@@ -55,7 +55,7 @@
 #include "bifrost/bifrost_compile.h"
 #include "panfrost-quirks.h"
 
-static const struct debug_named_value debug_options[] = {
+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"},
@@ -779,7 +779,7 @@ panfrost_create_screen(int fd, struct renderonly *ro)
         struct panfrost_device *dev = pan_device(&screen->base);
         panfrost_open_device(screen, fd, dev);
 
-        dev->debug = debug_get_flags_option("PAN_MESA_DEBUG", debug_options, 0);
+        dev->debug = debug_get_flags_option("PAN_MESA_DEBUG", panfrost_debug_options, 0);
 
         if (dev->debug & PAN_DBG_NO_AFBC)
                 dev->quirks |= MIDGARD_NO_AFBC;
diff --git a/src/gallium/drivers/r300/r300_debug.c b/src/gallium/drivers/r300/r300_debug.c
index ff1f16d913a..13acb634cd1 100644
--- a/src/gallium/drivers/r300/r300_debug.c
+++ b/src/gallium/drivers/r300/r300_debug.c
@@ -26,7 +26,7 @@
 
 #include <stdio.h>
 
-static const struct debug_named_value debug_options[] = {
+static const struct debug_named_value r300_debug_options[] = {
     { "info", DBG_INFO, "Print hardware info (printed by default on debug builds"},
     { "fp", DBG_FP, "Log fragment program compilation" },
     { "vp", DBG_VP, "Log vertex program compilation" },
@@ -58,7 +58,7 @@ static const struct debug_named_value debug_options[] = {
 
 void r300_init_debug(struct r300_screen * screen)
 {
-    screen->debug = debug_get_flags_option("RADEON_DEBUG", debug_options, 0);
+    screen->debug = debug_get_flags_option("RADEON_DEBUG", r300_debug_options, 0);
 }
 
 void r500_dump_rs_block(struct r300_rs_block *rs)
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
index ac16028e60c..fec3197b705 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -47,7 +47,7 @@
 
 static struct pipe_context *si_create_context(struct pipe_screen *screen, unsigned flags);
 
-static const struct debug_named_value debug_options[] = {
+static const struct debug_named_value radeonsi_debug_options[] = {
    /* Shader logging options: */
    {"vs", DBG(VS), "Print vertex shaders"},
    {"ps", DBG(PS), "Print pixel shaders"},
@@ -970,8 +970,8 @@ static struct pipe_screen *radeonsi_screen_create_impl(struct radeon_winsys *ws,
                            &sscreen->pa_sc_raster_config_1, &sscreen->se_tile_repeat);
    }
 
-   sscreen->debug_flags = debug_get_flags_option("R600_DEBUG", debug_options, 0);
-   sscreen->debug_flags |= debug_get_flags_option("AMD_DEBUG", debug_options, 0);
+   sscreen->debug_flags = debug_get_flags_option("R600_DEBUG", radeonsi_debug_options, 0);
+   sscreen->debug_flags |= debug_get_flags_option("AMD_DEBUG", radeonsi_debug_options, 0);
    test_flags = debug_get_flags_option("AMD_TEST", test_options, 0);
 
    if (sscreen->debug_flags & DBG(NO_GFX))
diff --git a/src/gallium/drivers/vc4/vc4_screen.c b/src/gallium/drivers/vc4/vc4_screen.c
index 7529cd551bb..f8903687648 100644
--- a/src/gallium/drivers/vc4/vc4_screen.c
+++ b/src/gallium/drivers/vc4/vc4_screen.c
@@ -43,7 +43,7 @@
 #include "vc4_context.h"
 #include "vc4_resource.h"
 
-static const struct debug_named_value debug_options[] = {
+static const struct debug_named_value vc4_debug_options[] = {
         { "cl",       VC4_DEBUG_CL,
           "Dump command list during creation" },
         { "surf",       VC4_DEBUG_SURFACE,
@@ -73,7 +73,7 @@ static const struct debug_named_value debug_options[] = {
         { NULL }
 };
 
-DEBUG_GET_ONCE_FLAGS_OPTION(vc4_debug, "VC4_DEBUG", debug_options, 0)
+DEBUG_GET_ONCE_FLAGS_OPTION(vc4_debug, "VC4_DEBUG", vc4_debug_options, 0)
 uint32_t vc4_debug;
 
 static const char *
diff --git a/src/gallium/drivers/virgl/virgl_screen.c b/src/gallium/drivers/virgl/virgl_screen.c
index f287329e640..20d5ac2c759 100644
--- a/src/gallium/drivers/virgl/virgl_screen.c
+++ b/src/gallium/drivers/virgl/virgl_screen.c
@@ -40,7 +40,7 @@
 #include "virtio-gpu/virgl_protocol.h"
 
 int virgl_debug = 0;
-static const struct debug_named_value debug_options[] = {
+static const struct debug_named_value virgl_debug_options[] = {
    { "verbose",   VIRGL_DEBUG_VERBOSE,             NULL },
    { "tgsi",      VIRGL_DEBUG_TGSI,                NULL },
    { "noemubgra", VIRGL_DEBUG_NO_EMULATE_BGRA,     "Disable tweak to emulate BGRA as RGBA on GLES hosts"},
@@ -49,7 +49,7 @@ static const struct debug_named_value debug_options[] = {
    { "xfer",      VIRGL_DEBUG_XFER,                "Do not optimize for transfers" },
    DEBUG_NAMED_VALUE_END
 };
-DEBUG_GET_ONCE_FLAGS_OPTION(virgl_debug, "VIRGL_DEBUG", debug_options, 0)
+DEBUG_GET_ONCE_FLAGS_OPTION(virgl_debug, "VIRGL_DEBUG", virgl_debug_options, 0)
 
 static const char *
 virgl_get_vendor(struct pipe_screen *screen)
diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c
index 2350e2375e9..0a5fdb8271d 100644
--- a/src/gallium/drivers/zink/zink_screen.c
+++ b/src/gallium/drivers/zink/zink_screen.c
@@ -43,7 +43,7 @@
 #include "frontend/sw_winsys.h"
 
 static const struct debug_named_value
-debug_options[] = {
+zink_debug_options[] = {
    { "nir", ZINK_DEBUG_NIR, "Dump NIR during program compile" },
    { "spirv", ZINK_DEBUG_SPIRV, "Dump SPIR-V during program compile" },
    { "tgsi", ZINK_DEBUG_TGSI, "Dump TGSI during program compile" },
@@ -51,7 +51,7 @@ debug_options[] = {
    DEBUG_NAMED_VALUE_END
 };
 
-DEBUG_GET_ONCE_FLAGS_OPTION(zink_debug, "ZINK_DEBUG", debug_options, 0)
+DEBUG_GET_ONCE_FLAGS_OPTION(zink_debug, "ZINK_DEBUG", zink_debug_options, 0)
 
 uint32_t
 zink_debug;
diff --git a/src/microsoft/clc/clc_compiler.c b/src/microsoft/clc/clc_compiler.c
index 642dca16872..15b1380293c 100644
--- a/src/microsoft/clc/clc_compiler.c
+++ b/src/microsoft/clc/clc_compiler.c
@@ -45,13 +45,13 @@ enum clc_debug_flags {
    CLC_DEBUG_VERBOSE = 1 << 1,
 };
 
-static const struct debug_named_value debug_options[] = {
+static const struct debug_named_value clc_debug_options[] = {
    { "dump_spirv",  CLC_DEBUG_DUMP_SPIRV, "Dump spirv blobs" },
    { "verbose",  CLC_DEBUG_VERBOSE, NULL },
    DEBUG_NAMED_VALUE_END
 };
 
-DEBUG_GET_ONCE_FLAGS_OPTION(debug_clc, "CLC_DEBUG", debug_options, 0)
+DEBUG_GET_ONCE_FLAGS_OPTION(debug_clc, "CLC_DEBUG", clc_debug_options, 0)
 
 static void
 clc_print_kernels_info(const struct clc_object *obj)
diff --git a/src/microsoft/clc/compute_test.cpp b/src/microsoft/clc/compute_test.cpp
index 647523d3142..6611a96174a 100644
--- a/src/microsoft/clc/compute_test.cpp
+++ b/src/microsoft/clc/compute_test.cpp
@@ -45,7 +45,7 @@ enum compute_test_debug_flags {
    COMPUTE_DEBUG_SERIALIZE_LIBCLC     = 1 << 3,
 };
 
-static const struct debug_named_value debug_options[] = {
+static const struct debug_named_value compute_debug_options[] = {
    { "experimental_shaders",  COMPUTE_DEBUG_EXPERIMENTAL_SHADERS, "Enable experimental shaders" },
    { "use_hw_d3d",            COMPUTE_DEBUG_USE_HW_D3D,           "Use a hardware D3D device"   },
    { "optimize_libclc",       COMPUTE_DEBUG_OPTIMIZE_LIBCLC,      "Optimize the clc_context before using it" },
@@ -53,7 +53,7 @@ static const struct debug_named_value debug_options[] = {
    DEBUG_NAMED_VALUE_END
 };
 
-DEBUG_GET_ONCE_FLAGS_OPTION(debug_compute, "COMPUTE_TEST_DEBUG", debug_options, 0)
+DEBUG_GET_ONCE_FLAGS_OPTION(debug_compute, "COMPUTE_TEST_DEBUG", compute_debug_options, 0)
 
 static void warning_callback(void *priv, const char *msg)
 {
diff --git a/src/microsoft/compiler/nir_to_dxil.c b/src/microsoft/compiler/nir_to_dxil.c
index 97334a73329..e59b1b35287 100644
--- a/src/microsoft/compiler/nir_to_dxil.c
+++ b/src/microsoft/compiler/nir_to_dxil.c
@@ -42,7 +42,7 @@
 int debug_dxil = 0;
 
 static const struct debug_named_value
-debug_options[] = {
+dxil_debug_options[] = {
    { "verbose", DXIL_DEBUG_VERBOSE, NULL },
    { "dump_blob",  DXIL_DEBUG_DUMP_BLOB , "Write shader blobs" },
    { "trace",  DXIL_DEBUG_TRACE , "Trace instruction conversion" },
@@ -50,7 +50,7 @@ debug_options[] = {
    DEBUG_NAMED_VALUE_END
 };
 
-DEBUG_GET_ONCE_FLAGS_OPTION(debug_dxil, "DXIL_DEBUG", debug_options, 0)
+DEBUG_GET_ONCE_FLAGS_OPTION(debug_dxil, "DXIL_DEBUG", dxil_debug_options, 0)
 
 #define NIR_INSTR_UNSUPPORTED(instr) \
    if (debug_dxil & DXIL_DEBUG_VERBOSE) \
diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c
index 110734db01c..17fd7f8d78d 100644
--- a/src/panfrost/bifrost/bifrost_compile.c
+++ b/src/panfrost/bifrost/bifrost_compile.c
@@ -37,7 +37,7 @@
 #include "bi_quirks.h"
 #include "bi_builder.h"
 
-static const struct debug_named_value debug_options[] = {
+static const struct debug_named_value bifrost_debug_options[] = {
         {"msgs",      BIFROST_DBG_MSGS,		"Print debug messages"},
         {"shaders",   BIFROST_DBG_SHADERS,	"Dump shaders in NIR and MIR"},
         {"shaderdb",  BIFROST_DBG_SHADERDB,	"Print statistics"},
@@ -45,7 +45,7 @@ static const struct debug_named_value debug_options[] = {
         DEBUG_NAMED_VALUE_END
 };
 
-DEBUG_GET_ONCE_FLAGS_OPTION(bifrost_debug, "BIFROST_MESA_DEBUG", debug_options, 0)
+DEBUG_GET_ONCE_FLAGS_OPTION(bifrost_debug, "BIFROST_MESA_DEBUG", bifrost_debug_options, 0)
 
 /* TODO: This is not thread safe!! */
 static unsigned SHADER_DB_COUNT = 0;
diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c
index 09230fa2f26..631aae293b0 100644
--- a/src/panfrost/midgard/midgard_compile.c
+++ b/src/panfrost/midgard/midgard_compile.c
@@ -54,14 +54,14 @@
 
 #include "disassemble.h"
 
-static const struct debug_named_value debug_options[] = {
+static const struct debug_named_value midgard_debug_options[] = {
         {"msgs",      MIDGARD_DBG_MSGS,		"Print debug messages"},
         {"shaders",   MIDGARD_DBG_SHADERS,	"Dump shaders in NIR and MIR"},
         {"shaderdb",  MIDGARD_DBG_SHADERDB,     "Prints shader-db statistics"},
         DEBUG_NAMED_VALUE_END
 };
 
-DEBUG_GET_ONCE_FLAGS_OPTION(midgard_debug, "MIDGARD_MESA_DEBUG", debug_options, 0)
+DEBUG_GET_ONCE_FLAGS_OPTION(midgard_debug, "MIDGARD_MESA_DEBUG", midgard_debug_options, 0)
 
 /* TODO: This is not thread safe!! */
 static unsigned SHADER_DB_COUNT = 0;



More information about the mesa-commit mailing list