[Mesa-dev] [PATCH] Rename the DEBUG macro to MESA_DEBUG
Brian Paul
brianp at vmware.com
Mon Jul 25 14:04:04 UTC 2016
On 07/22/2016 11:40 AM, Jose Fonseca wrote:
> (2nd try. 1st email is being held due to size.)
>
> On 21/07/16 18:48, Vedran Miletić wrote:
>> LLVM and Mesa both define the DEBUG macro in incompatible ways. As a
>> general practice, we should avoid using such generic names when it is
>> possible to do so.
>>
>> This patch renames all occurrences of the DEBUG macro to MESA_DEBUG,
>> and removes workarounds previously used to enable building Mesa with
>> LLVM (pop_macro() and push_macro() function calls).
>>
>> Please let me know if I missed any.
>>
>> Signed-off-by: Vedran Miletić <vedran at miletic.net>
>> ---
>> configure.ac | 2 +-
>> src/compiler/glsl/ir_validate.cpp | 4 +-
>> src/compiler/nir/nir.h | 6 +-
>> src/compiler/nir/nir_metadata.c | 4 +-
>> src/compiler/nir/nir_validate.c | 5 +-
>> src/egl/drivers/haiku/egl_haiku.cpp | 6 +-
>> src/egl/main/eglconfig.c | 6 +-
>> src/gallium/auxiliary/draw/draw_cliptest_tmp.h | 4 +-
>> src/gallium/auxiliary/gallivm/lp_bld_debug.h | 12 ++--
>> src/gallium/auxiliary/gallivm/lp_bld_init.c | 16 +++---
>> src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 23 ++------
>> src/gallium/auxiliary/gallivm/lp_bld_struct.c | 16 +++---
>> src/gallium/auxiliary/os/os_memory.h | 6 +-
>> src/gallium/auxiliary/os/os_misc.c | 4 +-
>> src/gallium/auxiliary/os/os_misc.h | 6 +-
>> .../auxiliary/pipebuffer/pb_buffer_fenced.c | 10 ++--
>> src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c | 6 +-
>> src/gallium/auxiliary/tgsi/tgsi_exec.c | 16 +++---
>> src/gallium/auxiliary/tgsi/tgsi_ureg.c | 8 +--
>> src/gallium/auxiliary/util/u_cache.c | 16 +++---
>> src/gallium/auxiliary/util/u_cpu_detect.c | 8 +--
>> src/gallium/auxiliary/util/u_debug.c | 18 +++---
>> src/gallium/auxiliary/util/u_debug.h | 66
>> +++++++++++-----------
>> src/gallium/auxiliary/util/u_debug_flush.c | 4 +-
>> src/gallium/auxiliary/util/u_debug_flush.h | 6 +-
>> src/gallium/auxiliary/util/u_debug_image.c | 4 +-
>> src/gallium/auxiliary/util/u_debug_image.h | 8 +--
>> src/gallium/drivers/freedreno/ir3/ir3.c | 16 +++---
>> src/gallium/drivers/freedreno/ir3/ir3.h | 18 +++---
>> src/gallium/drivers/freedreno/ir3/ir3_print.c | 4 +-
>> src/gallium/drivers/freedreno/ir3/ir3_ra.c | 4 +-
>> src/gallium/drivers/i915/i915_debug.c | 6 +-
>> src/gallium/drivers/i915/i915_debug.h | 6 +-
>> src/gallium/drivers/ilo/core/ilo_debug.h | 17 +++---
>> src/gallium/drivers/llvmpipe/lp_debug.h | 6 +-
>> src/gallium/drivers/llvmpipe/lp_perf.h | 6 +-
>> src/gallium/drivers/llvmpipe/lp_rast.c | 4 +-
>> src/gallium/drivers/llvmpipe/lp_rast.h | 4 +-
>> src/gallium/drivers/llvmpipe/lp_rast_priv.h | 6 +-
>> src/gallium/drivers/llvmpipe/lp_scene.c | 4 +-
>> src/gallium/drivers/llvmpipe/lp_screen.c | 8 +--
>> src/gallium/drivers/llvmpipe/lp_setup_line.c | 4 +-
>> src/gallium/drivers/llvmpipe/lp_setup_point.c | 4 +-
>> src/gallium/drivers/llvmpipe/lp_state_sampler.c | 4 +-
>> src/gallium/drivers/llvmpipe/lp_test_main.c | 4 +-
>> src/gallium/drivers/llvmpipe/lp_texture.c | 24 ++++----
>> src/gallium/drivers/llvmpipe/lp_texture.h | 4 +-
>> .../drivers/nouveau/codegen/nv50_ir_driver.h | 6 +-
>> .../drivers/nouveau/codegen/nv50_ir_inlines.h | 4 +-
>> src/gallium/drivers/nouveau/nouveau_screen.h | 4 +-
>> src/gallium/drivers/nouveau/nouveau_statebuf.h | 10 ++--
>> src/gallium/drivers/nouveau/nv50/nv50_program.c | 6 +-
>> src/gallium/drivers/nouveau/nvc0/nvc0_program.c | 14 ++---
>> src/gallium/drivers/nouveau/nvc0/nve4_compute.c | 12 ++--
>> src/gallium/drivers/r300/r300_cb.h | 6 +-
>> src/gallium/drivers/r300/r300_context.c | 6 +-
>> src/gallium/drivers/r300/r300_cs.h | 6 +-
>> src/gallium/drivers/softpipe/sp_tex_sample.c | 4 +-
>> src/gallium/drivers/svga/svga_debug.h | 8 +--
>> src/gallium/drivers/svga/svga_draw.c | 6 +-
>> src/gallium/drivers/svga/svga_format.c | 6 +-
>> src/gallium/drivers/svga/svga_pipe_draw.c | 4 +-
>> .../drivers/svga/svga_resource_buffer_upload.c | 4 +-
>> src/gallium/drivers/svga/svga_screen.c | 18 +++---
>> src/gallium/drivers/svga/svga_screen.h | 6 +-
>> src/gallium/drivers/svga/svga_state.c | 6 +-
>> src/gallium/drivers/svga/svga_state_constants.c | 4 +-
>> src/gallium/drivers/svga/svga_state_fs.c | 10 ++--
>> .../drivers/swr/rasterizer/jitter/JitManager.cpp | 5 --
>> .../drivers/swr/rasterizer/jitter/JitManager.h | 6 --
>> src/gallium/drivers/swr/swr_shader.cpp | 4 --
>> src/gallium/drivers/swr/swr_state.cpp | 4 --
>> src/gallium/drivers/trace/tr_context.h | 4 +-
>> src/gallium/drivers/vc4/vc4_cl.h | 20 +++----
>> src/gallium/drivers/vc4/vc4_qir_validate.c | 4 +-
>> src/gallium/drivers/vc4/vc4_qpu_validate.c | 4 +-
>> src/gallium/state_trackers/glx/xlib/glx_usefont.c | 16 +++---
>> src/gallium/state_trackers/hgl/hgl.c | 6 +-
>> src/gallium/state_trackers/nine/basetexture9.c | 8 +--
>> src/gallium/state_trackers/nine/basetexture9.h | 6 +-
>> src/gallium/state_trackers/nine/nine_debug.h | 30 +++++-----
>> src/gallium/state_trackers/nine/nine_dump.c | 4 +-
>> src/gallium/state_trackers/nine/nine_dump.h | 4 +-
>> src/gallium/state_trackers/nine/nine_ff.c | 4 +-
>> src/gallium/state_trackers/nine/surface9.c | 4 +-
>> src/gallium/state_trackers/nine/surface9.h | 4 +-
>> src/gallium/state_trackers/nine/volume9.c | 4 +-
>> src/gallium/state_trackers/wgl/stw_device.c | 8 +--
>> src/gallium/state_trackers/wgl/stw_device.h | 4 +-
>> src/gallium/state_trackers/wgl/stw_ext_pbuffer.c | 4 +-
>> .../targets/haiku-softpipe/GalliumContext.cpp | 6 +-
>> .../targets/haiku-softpipe/SoftwareRenderer.cpp | 6 +-
>> src/gallium/winsys/i915/drm/i915_drm_buffer.c | 4 +-
>> .../winsys/svga/drm/pb_buffer_simple_fenced.c | 10 ++--
>> src/gallium/winsys/svga/drm/vmw_buffer.c | 16 +++---
>> src/gallium/winsys/svga/drm/vmw_buffer.h | 6 +-
>> src/gallium/winsys/svga/drm/vmw_context.c | 32 +++++------
>> src/gallium/winsys/svga/drm/vmw_screen_ioctl.c | 4 +-
>> src/gallium/winsys/svga/drm/vmw_screen_pools.c | 4 +-
>> src/gallium/winsys/svga/drm/vmw_shader.c | 4 +-
>> src/gallium/winsys/svga/drm/vmw_surface.c | 4 +-
>> src/gallium/winsys/sw/hgl/hgl_sw_winsys.c | 6 +-
>> src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c | 6 +-
>> src/glx/glxext.c | 8 +--
>> src/glx/xfont.c | 18 +++---
>> src/intel/vulkan/anv_entrypoints_gen.py | 6 +-
>> src/intel/vulkan/anv_private.h | 18 +++---
>> src/mapi/mapi_abi.py | 6 +-
>> src/mesa/drivers/dri/i915/intel_batchbuffer.h | 18 +++---
>> src/mesa/drivers/dri/i965/brw_context.h | 4 +-
>> src/mesa/drivers/dri/i965/brw_disasm.c | 4 +-
>> .../drivers/dri/i965/brw_performance_monitor.c | 8 +--
>> src/mesa/drivers/dri/i965/intel_batchbuffer.c | 4 +-
>> src/mesa/drivers/dri/i965/intel_batchbuffer.h | 14 ++---
>> src/mesa/drivers/dri/radeon/radeon_debug.h | 6 +-
>> src/mesa/drivers/x11/xfonts.c | 16 +++---
>> src/mesa/drivers/x11/xm_tri.c | 10 ++--
>> src/mesa/main/context.c | 12 ++--
>> src/mesa/main/debug.c | 8 +--
>> src/mesa/main/errors.c | 22 ++++----
>> src/mesa/main/feedback.c | 4 +-
>> src/mesa/main/formats.c | 4 +-
>> src/mesa/main/imports.c | 8 +--
>> src/mesa/main/macros.h | 6 +-
>> src/mesa/main/mtypes.h | 6 +-
>> src/mesa/main/shaderapi.c | 8 +--
>> src/mesa/main/teximage.c | 4 +-
>> src/mesa/program/prog_optimize.c | 8 +--
>> src/mesa/sparc/sparc.c | 4 +-
>> src/mesa/state_tracker/st_atom.c | 12 +---
>> src/mesa/state_tracker/st_atom_framebuffer.c | 4 +-
>> src/mesa/state_tracker/st_debug.c | 8 +--
>> src/mesa/state_tracker/st_debug.h | 6 +-
>> src/mesa/state_tracker/st_format.c | 6 +-
>> src/mesa/swrast/s_lines.c | 6 +-
>> src/mesa/swrast/s_span.c | 4 +-
>> src/mesa/swrast/s_texfetch.c | 4 +-
>> src/mesa/swrast/s_triangle.c | 6 +-
>> src/mesa/vbo/vbo_exec.h | 4 +-
>> src/mesa/vbo/vbo_exec_api.c | 12 ++--
>> src/mesa/x86-64/x86-64.c | 4 +-
>> src/util/ralloc.c | 12 ++--
>> 142 files changed, 569 insertions(+), 611 deletions(-)
>>
>
> [...]
>
> Did you do
>
> $ git grep '\<DEBUG\>'
>
> after your change?
>
> Because I'm seeing several files that weren't covered by your patch.
> Particularly:
>
> bin/vmware-build-gl.sh
That script is only in our in-house git tree.
> scons/gallium.py
> docs/debugging.html
>
>
> A lesson for future: on a cross platform project, build success !=
> refactoring done. `git grep` is your friend here.
>
>
> Otherwise I don't object. There' should be no problem for us.
I'm catching up on email after vacation. One thing that I'm wondering
about is MESA_DEBUG appearing in the gallium code. We've generally
tried to keep Mesa/OpenGL language/keywords out of gallium.
-Brian
More information about the mesa-dev
mailing list