utils: Merge util/debug.* into util/u_debug.* and remove util/debug.*

Rename env_var_as_unsigned() -> debug_get_num_option(), because duplicate
Rename env_var_as_bool() -> debug_get_bool_option(), because duplicate

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7177

Signed-off-by: Illia Abernikhin <illia.abernikhin@globallogic.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19336>
This commit is contained in:
Illia Abernikhin 2022-09-13 12:49:56 +03:00 committed by Marge Bot
parent 0e47171abe
commit aa4ac5ff8b
91 changed files with 150 additions and 250 deletions

View file

@ -26,7 +26,7 @@
#include "aco_builder.h" #include "aco_builder.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "c11/threads.h" #include "c11/threads.h"

View file

@ -43,7 +43,7 @@
#include <sys/inotify.h> #include <sys/inotify.h>
#endif #endif
#include "util/debug.h" #include "util/u_debug.h"
#include "util/disk_cache.h" #include "util/disk_cache.h"
#include "radv_cs.h" #include "radv_cs.h"
#include "radv_debug.h" #include "radv_debug.h"
@ -60,7 +60,6 @@ typedef void *drmDevicePtr;
#include "winsys/amdgpu/radv_amdgpu_winsys_public.h" #include "winsys/amdgpu/radv_amdgpu_winsys_public.h"
#endif #endif
#include "util/build_id.h" #include "util/build_id.h"
#include "util/debug.h"
#include "util/driconf.h" #include "util/driconf.h"
#include "util/mesa-sha1.h" #include "util/mesa-sha1.h"
#include "util/os_time.h" #include "util/os_time.h"

View file

@ -26,7 +26,7 @@
*/ */
#include "ac_drm_fourcc.h" #include "ac_drm_fourcc.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/u_atomic.h" #include "util/u_atomic.h"
#include "vulkan/util/vk_format.h" #include "vulkan/util/vk_format.h"
#include "radv_debug.h" #include "radv_debug.h"

View file

@ -41,7 +41,7 @@
#include "vk_pipeline.h" #include "vk_pipeline.h"
#include "vk_util.h" #include "vk_util.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "ac_binary.h" #include "ac_binary.h"
#include "ac_nir.h" #include "ac_nir.h"
#include "ac_shader_util.h" #include "ac_shader_util.h"

View file

@ -21,7 +21,7 @@
* IN THE SOFTWARE. * IN THE SOFTWARE.
*/ */
#include "util/debug.h" #include "util/u_debug.h"
#include "util/disk_cache.h" #include "util/disk_cache.h"
#include "util/macros.h" #include "util/macros.h"
#include "util/mesa-sha1.h" #include "util/mesa-sha1.h"

View file

@ -38,7 +38,7 @@
#include "radv_private.h" #include "radv_private.h"
#include "radv_shader_args.h" #include "radv_shader_args.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "ac_binary.h" #include "ac_binary.h"
#include "ac_nir.h" #include "ac_nir.h"
#if defined(USE_LIBELF) #if defined(USE_LIBELF)

View file

@ -50,7 +50,7 @@
#include "git_sha1.h" #include "git_sha1.h"
#include "util/build_id.h" #include "util/build_id.h"
#include "util/debug.h" #include "util/u_debug.h"
#ifdef VK_USE_PLATFORM_XCB_KHR #ifdef VK_USE_PLATFORM_XCB_KHR
#include <xcb/xcb.h> #include <xcb/xcb.h>

View file

@ -35,7 +35,7 @@
#include "ir.h" #include "ir.h"
#include "ir_hierarchical_visitor.h" #include "ir_hierarchical_visitor.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/hash_table.h" #include "util/hash_table.h"
#include "util/macros.h" #include "util/macros.h"
#include "util/set.h" #include "util/set.h"
@ -1214,7 +1214,7 @@ validate_ir_tree(exec_list *instructions)
* anything. * anything.
*/ */
#ifndef DEBUG #ifndef DEBUG
if (!env_var_as_boolean("GLSL_VALIDATE", false)) if (!debug_get_bool_option("GLSL_VALIDATE", false))
return; return;
#endif #endif
ir_validate v; ir_validate v;

View file

@ -49,7 +49,7 @@
#include <stdio.h> #include <stdio.h>
#ifndef NDEBUG #ifndef NDEBUG
#include "util/debug.h" #include "util/u_debug.h"
#endif /* NDEBUG */ #endif /* NDEBUG */
#include "nir_opcodes.h" #include "nir_opcodes.h"

View file

@ -24,7 +24,7 @@
#include "vtn_private.h" #include "vtn_private.h"
#include "spirv_info.h" #include "spirv_info.h"
#include "nir/nir_vla.h" #include "nir/nir_vla.h"
#include "util/debug.h" #include "util/u_debug.h"
static struct vtn_block * static struct vtn_block *
vtn_block(struct vtn_builder *b, uint32_t value_id) vtn_block(struct vtn_builder *b, uint32_t value_id)
@ -1452,7 +1452,7 @@ vtn_function_emit(struct vtn_builder *b, struct vtn_function *func,
static int force_unstructured = -1; static int force_unstructured = -1;
if (force_unstructured < 0) { if (force_unstructured < 0) {
force_unstructured = force_unstructured =
env_var_as_boolean("MESA_SPIRV_FORCE_UNSTRUCTURED", false); debug_get_bool_option("MESA_SPIRV_FORCE_UNSTRUCTURED", false);
} }
nir_function_impl *impl = func->nir_func->impl; nir_function_impl *impl = func->nir_func->impl;

View file

@ -42,7 +42,7 @@
#include "egl_dri2.h" #include "egl_dri2.h"
#include "loader.h" #include "loader.h"
#include "kopper_interface.h" #include "kopper_interface.h"
#include "util/debug.h" #include "util/u_debug.h"
static __DRIimage* static __DRIimage*
device_alloc_image(struct dri2_egl_display *dri2_dpy, device_alloc_image(struct dri2_egl_display *dri2_dpy,
@ -274,7 +274,7 @@ static bool
device_probe_device(_EGLDisplay *disp) device_probe_device(_EGLDisplay *disp)
{ {
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
bool request_software = env_var_as_boolean("LIBGL_ALWAYS_SOFTWARE", false); bool request_software = debug_get_bool_option("LIBGL_ALWAYS_SOFTWARE", false);
if (request_software) if (request_software)
_eglLog(_EGL_WARNING, "Not allowed to force software rendering when " _eglLog(_EGL_WARNING, "Not allowed to force software rendering when "

View file

@ -40,7 +40,7 @@
#endif #endif
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include "util/debug.h" #include "util/u_debug.h"
#include "util/macros.h" #include "util/macros.h"
#include "util/bitscan.h" #include "util/bitscan.h"
@ -1714,12 +1714,12 @@ dri2_initialize_x11(_EGLDisplay *disp)
return dri2_initialize_x11_swrast(disp); return dri2_initialize_x11_swrast(disp);
#ifdef HAVE_DRI3 #ifdef HAVE_DRI3
if (!env_var_as_boolean("LIBGL_DRI3_DISABLE", false)) if (!debug_get_bool_option("LIBGL_DRI3_DISABLE", false))
if (dri2_initialize_x11_dri3(disp)) if (dri2_initialize_x11_dri3(disp))
return EGL_TRUE; return EGL_TRUE;
#endif #endif
if (!env_var_as_boolean("LIBGL_DRI2_DISABLE", false)) if (!debug_get_bool_option("LIBGL_DRI2_DISABLE", false))
if (dri2_initialize_x11_dri2(disp)) if (dri2_initialize_x11_dri2(disp))
return EGL_TRUE; return EGL_TRUE;

View file

@ -94,7 +94,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "c11/threads.h" #include "c11/threads.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/macros.h" #include "util/macros.h"
#include "util/perf/cpu_trace.h" #include "util/perf/cpu_trace.h"
@ -688,7 +688,7 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
if (!disp->Initialized) { if (!disp->Initialized) {
/* set options */ /* set options */
disp->Options.ForceSoftware = disp->Options.ForceSoftware =
env_var_as_boolean("LIBGL_ALWAYS_SOFTWARE", false); debug_get_bool_option("LIBGL_ALWAYS_SOFTWARE", false);
if (disp->Options.ForceSoftware) if (disp->Options.ForceSoftware)
_eglLog(_EGL_DEBUG, "Found 'LIBGL_ALWAYS_SOFTWARE' set, will use a CPU renderer"); _eglLog(_EGL_DEBUG, "Found 'LIBGL_ALWAYS_SOFTWARE' set, will use a CPU renderer");
@ -703,7 +703,7 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
if (!_eglDriver.Initialize(disp)) { if (!_eglDriver.Initialize(disp)) {
bool fail = true; bool fail = true;
if (!disp->Options.ForceSoftware && !disp->Options.Zink && if (!disp->Options.ForceSoftware && !disp->Options.Zink &&
!env_var_as_boolean("LIBGL_KOPPER_DISABLE", false) && !getenv("GALLIUM_DRIVER")) { !debug_get_bool_option("LIBGL_KOPPER_DISABLE", false) && !getenv("GALLIUM_DRIVER")) {
/* zink fallback */ /* zink fallback */
disp->Options.Zink = EGL_TRUE; disp->Options.Zink = EGL_TRUE;
disp->Options.ForceSoftware = EGL_TRUE; disp->Options.ForceSoftware = EGL_TRUE;

View file

@ -24,7 +24,7 @@
* Rob Clark <robclark@freedesktop.org> * Rob Clark <robclark@freedesktop.org>
*/ */
#include "util/debug.h" #include "util/u_debug.h"
#include "util/u_math.h" #include "util/u_math.h"
#include "ir3_compiler.h" #include "ir3_compiler.h"
@ -102,7 +102,7 @@ ir3_optimize_loop(struct ir3_compiler *compiler, nir_shader *s)
static int gcm = -1; static int gcm = -1;
if (gcm == -1) if (gcm == -1)
gcm = env_var_as_unsigned("GCM", 0); gcm = debug_get_num_option("GCM", 0);
if (gcm == 1) if (gcm == 1)
progress |= OPT(s, nir_opt_gcm, true); progress |= OPT(s, nir_opt_gcm, true);
else if (gcm == 2) else if (gcm == 2)

View file

@ -14,7 +14,7 @@
#include <sys/sysinfo.h> #include <sys/sysinfo.h>
#include "git_sha1.h" #include "git_sha1.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/disk_cache.h" #include "util/disk_cache.h"
#include "util/driconf.h" #include "util/driconf.h"
#include "util/os_misc.h" #include "util/os_misc.h"

View file

@ -22,7 +22,7 @@
#include "vk_util.h" #include "vk_util.h"
#include "drm-uapi/msm_drm.h" #include "drm-uapi/msm_drm.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/hash_table.h" #include "util/hash_table.h"
#include "util/timespec.h" #include "util/timespec.h"
#include "util/os_time.h" #include "util/os_time.h"
@ -883,7 +883,7 @@ tu_physical_device_try_create(struct vk_instance *vk_instance,
"could not get GMEM size"); "could not get GMEM size");
goto fail; goto fail;
} }
device->gmem_size = env_var_as_unsigned("TU_GMEM", device->gmem_size); device->gmem_size = debug_get_num_option("TU_GMEM", device->gmem_size);
if (tu_drm_get_gmem_base(device, &device->gmem_base)) { if (tu_drm_get_gmem_base(device, &device->gmem_base)) {
result = vk_startup_errorf(instance, VK_ERROR_INITIALIZATION_FAILED, result = vk_startup_errorf(instance, VK_ERROR_INITIALIZATION_FAILED,

View file

@ -11,7 +11,7 @@
#include "fdl/fd6_format_table.h" #include "fdl/fd6_format_table.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/format/u_format.h" #include "util/format/u_format.h"
#include "vk_util.h" #include "vk_util.h"
#include "drm-uapi/drm_fourcc.h" #include "drm-uapi/drm_fourcc.h"

View file

@ -13,7 +13,7 @@
#include "msm_kgsl.h" #include "msm_kgsl.h"
#include "vk_util.h" #include "vk_util.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "tu_cmd_buffer.h" #include "tu_cmd_buffer.h"
#include "tu_cs.h" #include "tu_cs.h"
@ -270,7 +270,7 @@ tu_enumerate_devices(struct vk_instance *vk_instance)
((info.chip_id >> 16) & 0xff) * 10 + ((info.chip_id >> 16) & 0xff) * 10 +
((info.chip_id >> 8) & 0xff); ((info.chip_id >> 8) & 0xff);
device->dev_id.chip_id = info.chip_id; device->dev_id.chip_id = info.chip_id;
device->gmem_size = env_var_as_unsigned("TU_GMEM", info.gmem_sizebytes); device->gmem_size = debug_get_num_option("TU_GMEM", info.gmem_sizebytes);
device->gmem_base = gmem_iova; device->gmem_base = gmem_iova;
device->submitqueue_priority_count = 1; device->submitqueue_priority_count = 1;

View file

@ -17,7 +17,7 @@
#include "nir/nir_builder.h" #include "nir/nir_builder.h"
#include "nir/nir_serialize.h" #include "nir/nir_serialize.h"
#include "spirv/nir_spirv.h" #include "spirv/nir_spirv.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/mesa-sha1.h" #include "util/mesa-sha1.h"
#include "vk_pipeline.h" #include "vk_pipeline.h"
#include "vk_render_pass.h" #include "vk_render_pass.h"

View file

@ -33,7 +33,7 @@
#include "tgsi/tgsi_parse.h" #include "tgsi/tgsi_parse.h"
#include "tgsi/tgsi_ureg.h" #include "tgsi/tgsi_ureg.h"
#include "tgsi/tgsi_util.h" #include "tgsi/tgsi_util.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/u_math.h" #include "util/u_math.h"
#include "util/u_memory.h" #include "util/u_memory.h"
#include "util/u_dynarray.h" #include "util/u_dynarray.h"

View file

@ -23,7 +23,7 @@
*/ */
#include "util/blob.h" #include "util/blob.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/disk_cache.h" #include "util/disk_cache.h"
#include "util/u_memory.h" #include "util/u_memory.h"
#include "util/ralloc.h" #include "util/ralloc.h"

View file

@ -5,7 +5,6 @@
#include "pipe/p_compiler.h" #include "pipe/p_compiler.h"
#include "pipe/p_screen.h" #include "pipe/p_screen.h"
#include "util/u_debug.h" #include "util/u_debug.h"
#include "util/debug.h"
#include "frontend/sw_winsys.h" #include "frontend/sw_winsys.h"
#include "target-helpers/inline_debug_helper.h" #include "target-helpers/inline_debug_helper.h"
@ -79,7 +78,7 @@ sw_screen_create_named(struct sw_winsys *winsys, const char *driver)
static inline struct pipe_screen * static inline struct pipe_screen *
sw_screen_create_vk(struct sw_winsys *winsys, bool sw_vk) sw_screen_create_vk(struct sw_winsys *winsys, bool sw_vk)
{ {
UNUSED bool only_sw = env_var_as_boolean("LIBGL_ALWAYS_SOFTWARE", false); UNUSED bool only_sw = debug_get_bool_option("LIBGL_ALWAYS_SOFTWARE", false);
const char *drivers[] = { const char *drivers[] = {
(sw_vk ? "" : debug_get_option("GALLIUM_DRIVER", "")), (sw_vk ? "" : debug_get_option("GALLIUM_DRIVER", "")),
#if defined(GALLIUM_D3D12) #if defined(GALLIUM_D3D12)

View file

@ -4,7 +4,6 @@
#include "pipe/p_compiler.h" #include "pipe/p_compiler.h"
#include "util/u_debug.h" #include "util/u_debug.h"
#include "util/debug.h"
#include "target-helpers/sw_helper_public.h" #include "target-helpers/sw_helper_public.h"
#include "frontend/sw_winsys.h" #include "frontend/sw_winsys.h"
@ -82,7 +81,7 @@ sw_screen_create_named(struct sw_winsys *winsys, const struct pipe_screen_config
struct pipe_screen * struct pipe_screen *
sw_screen_create_vk(struct sw_winsys *winsys, const struct pipe_screen_config *config, bool sw_vk) sw_screen_create_vk(struct sw_winsys *winsys, const struct pipe_screen_config *config, bool sw_vk)
{ {
UNUSED bool only_sw = env_var_as_boolean("LIBGL_ALWAYS_SOFTWARE", false); UNUSED bool only_sw = debug_get_bool_option("LIBGL_ALWAYS_SOFTWARE", false);
const char *drivers[] = { const char *drivers[] = {
(sw_vk ? "" : debug_get_option("GALLIUM_DRIVER", "")), (sw_vk ? "" : debug_get_option("GALLIUM_DRIVER", "")),
#if defined(GALLIUM_D3D12) #if defined(GALLIUM_D3D12)

View file

@ -55,7 +55,7 @@
#include "dev/intel_debug.h" #include "dev/intel_debug.h"
#include "common/intel_gem.h" #include "common/intel_gem.h"
#include "dev/intel_device_info.h" #include "dev/intel_device_info.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/macros.h" #include "util/macros.h"
#include "util/hash_table.h" #include "util/hash_table.h"
#include "util/list.h" #include "util/list.h"

View file

@ -37,7 +37,7 @@
#include "pipe/p_screen.h" #include "pipe/p_screen.h"
#include "util/u_atomic.h" #include "util/u_atomic.h"
#include "util/u_upload_mgr.h" #include "util/u_upload_mgr.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/u_prim.h" #include "util/u_prim.h"
#include "compiler/nir/nir.h" #include "compiler/nir/nir.h"
#include "compiler/nir/nir_builder.h" #include "compiler/nir/nir_builder.h"
@ -790,7 +790,7 @@ skip_compacting_binding_tables(void)
{ {
static int skip = -1; static int skip = -1;
if (skip < 0) if (skip < 0)
skip = env_var_as_boolean("INTEL_DISABLE_COMPACT_BINDING_TABLE", false); skip = debug_get_bool_option("INTEL_DISABLE_COMPACT_BINDING_TABLE", false);
return skip; return skip;
} }

View file

@ -37,7 +37,7 @@
#include "pipe/p_state.h" #include "pipe/p_state.h"
#include "pipe/p_context.h" #include "pipe/p_context.h"
#include "pipe/p_screen.h" #include "pipe/p_screen.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/u_inlines.h" #include "util/u_inlines.h"
#include "util/format/u_format.h" #include "util/format/u_format.h"
#include "util/u_transfer_helper.h" #include "util/u_transfer_helper.h"
@ -767,7 +767,7 @@ crocus_screen_create(int fd, const struct pipe_screen_config *config)
screen->driconf.lower_depth_range_rate = screen->driconf.lower_depth_range_rate =
driQueryOptionf(config->options, "lower_depth_range_rate"); driQueryOptionf(config->options, "lower_depth_range_rate");
screen->precompile = env_var_as_boolean("shader_precompile", true); screen->precompile = debug_get_bool_option("shader_precompile", true);
isl_device_init(&screen->isl_dev, &screen->devinfo); isl_device_init(&screen->isl_dev, &screen->devinfo);

View file

@ -24,7 +24,7 @@
#include "d3d12_screen.h" #include "d3d12_screen.h"
#include "d3d12_public.h" #include "d3d12_public.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/u_memory.h" #include "util/u_memory.h"
#include "util/u_dl.h" #include "util/u_dl.h"

View file

@ -25,7 +25,7 @@
#include "d3d12_public.h" #include "d3d12_public.h"
#include "d3d12_debug.h" #include "d3d12_debug.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/u_memory.h" #include "util/u_memory.h"
#include "util/u_dl.h" #include "util/u_dl.h"
@ -81,7 +81,7 @@ choose_dxgi_adapter(IDXGIFactory4 *factory, LUID *adapter)
debug_printf("D3D12: requested adapter missing, falling back to auto-detection...\n"); debug_printf("D3D12: requested adapter missing, falling back to auto-detection...\n");
} }
bool want_warp = env_var_as_boolean("LIBGL_ALWAYS_SOFTWARE", false); bool want_warp = debug_get_bool_option("LIBGL_ALWAYS_SOFTWARE", false);
if (want_warp) { if (want_warp) {
if (SUCCEEDED(factory->EnumWarpAdapter(IID_PPV_ARGS(&ret)))) if (SUCCEEDED(factory->EnumWarpAdapter(IID_PPV_ARGS(&ret))))
return ret; return ret;

View file

@ -37,7 +37,7 @@
#include "d3d12_nir_passes.h" #include "d3d12_nir_passes.h"
#include "pipebuffer/pb_bufmgr.h" #include "pipebuffer/pb_bufmgr.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/u_math.h" #include "util/u_math.h"
#include "util/u_memory.h" #include "util/u_memory.h"
#include "util/u_screen.h" #include "util/u_screen.h"

View file

@ -25,7 +25,7 @@
*/ */
#include "pipe/p_state.h" #include "pipe/p_state.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/format/u_format.h" #include "util/format/u_format.h"
#include "util/hash_table.h" #include "util/hash_table.h"
#include "util/u_dump.h" #include "util/u_dump.h"
@ -334,8 +334,8 @@ gmem_stateobj_init(struct fd_screen *screen, struct gmem_key *key)
} }
#ifdef DEBUG #ifdef DEBUG
tpp_x = env_var_as_unsigned("TPP_X", tpp_x); tpp_x = debug_get_num_option("TPP_X", tpp_x);
tpp_y = env_var_as_unsigned("TPP_Y", tpp_x); tpp_y = debug_get_num_option("TPP_Y", tpp_x);
#endif #endif
gmem->maxpw = tpp_x; gmem->maxpw = tpp_x;

View file

@ -1006,7 +1006,7 @@ fd_screen_create(struct fd_device *dev, struct renderonly *ro,
DBG("could not get GMEM size"); DBG("could not get GMEM size");
goto fail; goto fail;
} }
screen->gmemsize_bytes = env_var_as_unsigned("FD_MESA_GMEM", val); screen->gmemsize_bytes = debug_get_num_option("FD_MESA_GMEM", val);
if (fd_device_version(dev) >= FD_VERSION_GMEM_BASE) { if (fd_device_version(dev) >= FD_VERSION_GMEM_BASE) {
fd_pipe_get_param(screen->pipe, FD_GMEM_BASE, &screen->gmem_base); fd_pipe_get_param(screen->pipe, FD_GMEM_BASE, &screen->gmem_base);

View file

@ -34,7 +34,7 @@
#include "pipe/p_screen.h" #include "pipe/p_screen.h"
#include "renderonly/renderonly.h" #include "renderonly/renderonly.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/simple_mtx.h" #include "util/simple_mtx.h"
#include "util/slab.h" #include "util/slab.h"
#include "util/u_idalloc.h" #include "util/u_idalloc.h"

View file

@ -49,7 +49,7 @@
#include "intel/common/intel_gem.h" #include "intel/common/intel_gem.h"
#include "intel/ds/intel_tracepoints.h" #include "intel/ds/intel_tracepoints.h"
#include "util/hash_table.h" #include "util/hash_table.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/set.h" #include "util/set.h"
#include "util/u_upload_mgr.h" #include "util/u_upload_mgr.h"
@ -292,7 +292,7 @@ iris_create_engines_context(struct iris_context *ice, int priority)
/* Blitter is only supported on Gfx12+ */ /* Blitter is only supported on Gfx12+ */
unsigned num_batches = IRIS_BATCH_COUNT - (devinfo->ver >= 12 ? 0 : 1); unsigned num_batches = IRIS_BATCH_COUNT - (devinfo->ver >= 12 ? 0 : 1);
if (env_var_as_boolean("INTEL_COMPUTE_CLASS", false) && if (debug_get_bool_option("INTEL_COMPUTE_CLASS", false) &&
intel_engines_count(engines_info, INTEL_ENGINE_CLASS_COMPUTE) > 0) intel_engines_count(engines_info, INTEL_ENGINE_CLASS_COMPUTE) > 0)
engine_classes[IRIS_BATCH_COMPUTE] = INTEL_ENGINE_CLASS_COMPUTE; engine_classes[IRIS_BATCH_COMPUTE] = INTEL_ENGINE_CLASS_COMPUTE;

View file

@ -55,7 +55,7 @@
#include "dev/intel_device_info.h" #include "dev/intel_device_info.h"
#include "isl/isl.h" #include "isl/isl.h"
#include "os/os_mman.h" #include "os/os_mman.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/macros.h" #include "util/macros.h"
#include "util/hash_table.h" #include "util/hash_table.h"
#include "util/list.h" #include "util/list.h"

View file

@ -24,7 +24,7 @@
#include <time.h> #include <time.h>
#include "pipe/p_defines.h" #include "pipe/p_defines.h"
#include "pipe/p_state.h" #include "pipe/p_state.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/ralloc.h" #include "util/ralloc.h"
#include "util/u_inlines.h" #include "util/u_inlines.h"
#include "util/format/u_format.h" #include "util/format/u_format.h"

View file

@ -25,7 +25,7 @@
*/ */
#include <stdio.h> #include <stdio.h>
#include "util/debug.h" #include "util/u_debug.h"
#include "util/list.h" #include "util/list.h"
#include "util/crc32.h" #include "util/crc32.h"
#include "iris_context.h" #include "iris_context.h"

View file

@ -37,7 +37,7 @@
#include "pipe/p_screen.h" #include "pipe/p_screen.h"
#include "util/u_atomic.h" #include "util/u_atomic.h"
#include "util/u_upload_mgr.h" #include "util/u_upload_mgr.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/u_async_debug.h" #include "util/u_async_debug.h"
#include "compiler/nir/nir.h" #include "compiler/nir/nir.h"
#include "compiler/nir/nir_builder.h" #include "compiler/nir/nir_builder.h"
@ -873,7 +873,7 @@ skip_compacting_binding_tables(void)
{ {
static int skip = -1; static int skip = -1;
if (skip < 0) if (skip < 0)
skip = env_var_as_boolean("INTEL_DISABLE_COMPACT_BINDING_TABLE", false); skip = debug_get_bool_option("INTEL_DISABLE_COMPACT_BINDING_TABLE", false);
return skip; return skip;
} }

View file

@ -37,7 +37,7 @@
#include "pipe/p_state.h" #include "pipe/p_state.h"
#include "pipe/p_context.h" #include "pipe/p_context.h"
#include "pipe/p_screen.h" #include "pipe/p_screen.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/os_file.h" #include "util/os_file.h"
#include "util/u_cpu_detect.h" #include "util/u_cpu_detect.h"
#include "util/u_inlines.h" #include "util/u_inlines.h"
@ -115,7 +115,7 @@ iris_enable_clover()
{ {
static int enable = -1; static int enable = -1;
if (enable < 0) if (enable < 0)
enable = env_var_as_boolean("IRIS_ENABLE_CLOVER", false); enable = debug_get_bool_option("IRIS_ENABLE_CLOVER", false);
return enable; return enable;
} }
@ -858,7 +858,7 @@ iris_screen_create(int fd, const struct pipe_screen_config *config)
screen->driconf.lower_depth_range_rate = screen->driconf.lower_depth_range_rate =
driQueryOptionf(config->options, "lower_depth_range_rate"); driQueryOptionf(config->options, "lower_depth_range_rate");
screen->precompile = env_var_as_boolean("shader_precompile", true); screen->precompile = debug_get_bool_option("shader_precompile", true);
isl_device_init(&screen->isl_dev, &screen->devinfo); isl_device_init(&screen->isl_dev, &screen->devinfo);

View file

@ -39,7 +39,7 @@
#include "state_tracker/st_context.h" #include "state_tracker/st_context.h"
#include "util/u_memory.h" #include "util/u_memory.h"
#include "util/debug.h" #include "util/u_debug.h"
GLboolean GLboolean
dri_create_context(gl_api api, const struct gl_config * visual, dri_create_context(gl_api api, const struct gl_config * visual,
@ -162,7 +162,7 @@ dri_create_context(gl_api api, const struct gl_config * visual,
/* KHR_no_error is likely to crash, overflow memory, etc if an application /* KHR_no_error is likely to crash, overflow memory, etc if an application
* has errors so don't enable it for setuid processes. * has errors so don't enable it for setuid processes.
*/ */
if (env_var_as_boolean("MESA_NO_ERROR", false) || if (debug_get_bool_option("MESA_NO_ERROR", false) ||
driQueryOptionb(&screen->dev->option_cache, "mesa_no_error")) driQueryOptionb(&screen->dev->option_cache, "mesa_no_error"))
#if !defined(_WIN32) #if !defined(_WIN32)
if (geteuid() == getuid()) if (geteuid() == getuid())

View file

@ -28,7 +28,6 @@
#include <windows.h> #include <windows.h>
#include "glapi/glapi.h" #include "glapi/glapi.h"
#include "util/debug.h"
#include "util/u_debug.h" #include "util/u_debug.h"
#include "util/u_math.h" #include "util/u_math.h"
#include "util/u_memory.h" #include "util/u_memory.h"
@ -128,7 +127,7 @@ stw_init(const struct stw_winsys *stw_winsys)
{ {
static struct stw_device stw_dev_storage; static struct stw_device stw_dev_storage;
if (env_var_as_boolean("WGL_DISABLE_ERROR_DIALOGS", false)) if (debug_get_bool_option("WGL_DISABLE_ERROR_DIALOGS", false))
debug_disable_win32_error_dialogs(); debug_disable_win32_error_dialogs();
assert(!stw_dev); assert(!stw_dev);

View file

@ -37,7 +37,6 @@
#include <windows.h> #include <windows.h>
#include "util/u_debug.h" #include "util/u_debug.h"
#include "util/debug.h"
#include "stw_winsys.h" #include "stw_winsys.h"
#include "stw_device.h" #include "stw_device.h"
#include "gdi/gdi_sw_winsys.h" #include "gdi/gdi_sw_winsys.h"
@ -115,7 +114,7 @@ static struct pipe_screen *
wgl_screen_create(HDC hDC) wgl_screen_create(HDC hDC)
{ {
struct sw_winsys *winsys; struct sw_winsys *winsys;
UNUSED bool sw_only = env_var_as_boolean("LIBGL_ALWAYS_SOFTWARE", false); UNUSED bool sw_only = debug_get_bool_option("LIBGL_ALWAYS_SOFTWARE", false);
winsys = gdi_create_sw_winsys(); winsys = gdi_create_sw_winsys();
if (!winsys) if (!winsys)

View file

@ -50,7 +50,7 @@
#include "loader_dri_helper.h" #include "loader_dri_helper.h"
#include "kopper_interface.h" #include "kopper_interface.h"
#include "loader.h" #include "loader.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/macros.h" #include "util/macros.h"
/* For importing wl_buffer */ /* For importing wl_buffer */
@ -1478,7 +1478,7 @@ dri_device_create(int fd, uint32_t gbm_backend_version)
mtx_init(&dri->mutex, mtx_plain); mtx_init(&dri->mutex, mtx_plain);
force_sw = env_var_as_boolean("GBM_ALWAYS_SOFTWARE", false); force_sw = debug_get_bool_option("GBM_ALWAYS_SOFTWARE", false);
if (!force_sw) { if (!force_sw) {
ret = dri_screen_create(dri); ret = dri_screen_create(dri);
if (ret) if (ret)

View file

@ -55,7 +55,7 @@
#include "apple_cgl.h" #include "apple_cgl.h"
#include "apple_glx_drawable.h" #include "apple_glx_drawable.h"
#include "util/debug.h" #include "util/u_debug.h"
static pthread_mutex_t context_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t context_lock = PTHREAD_MUTEX_INITIALIZER;

View file

@ -37,7 +37,7 @@
#include <pthread.h> #include <pthread.h>
#include "glxclient.h" #include "glxclient.h"
#include "apple_glx_log.h" #include "apple_glx_log.h"
#include "util/debug.h" #include "util/u_debug.h"
static aslclient aslc; static aslclient aslc;

View file

@ -48,7 +48,7 @@
#include "apple_glx.h" #include "apple_glx.h"
#include "glxconfig.h" #include "glxconfig.h"
#include "apple_cgl.h" #include "apple_cgl.h"
#include "util/debug.h" #include "util/u_debug.h"
/* mesa defines in glew.h, Apple in glext.h. /* mesa defines in glew.h, Apple in glext.h.
* Due to namespace nightmares, just do it here. * Due to namespace nightmares, just do it here.

View file

@ -83,7 +83,7 @@ apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * m
int numattr = 0; int numattr = 0;
GLint vsref = 0; GLint vsref = 0;
CGLError error = 0; CGLError error = 0;
bool use_core_profile = env_var_as_boolean("LIBGL_PROFILE_CORE", false); bool use_core_profile = debug_get_bool_option("LIBGL_PROFILE_CORE", false);
if (offscreen) { if (offscreen) {
apple_glx_diagnostic apple_glx_diagnostic
@ -91,13 +91,13 @@ apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * m
attr[numattr++] = kCGLPFAOffScreen; attr[numattr++] = kCGLPFAOffScreen;
} }
else if (env_var_as_boolean("LIBGL_ALWAYS_SOFTWARE", false)) { else if (debug_get_bool_option("LIBGL_ALWAYS_SOFTWARE", false)) {
apple_glx_diagnostic apple_glx_diagnostic
("Software rendering requested. Using kCGLRendererGenericFloatID.\n"); ("Software rendering requested. Using kCGLRendererGenericFloatID.\n");
attr[numattr++] = kCGLPFARendererID; attr[numattr++] = kCGLPFARendererID;
attr[numattr++] = kCGLRendererGenericFloatID; attr[numattr++] = kCGLRendererGenericFloatID;
} }
else if (env_var_as_boolean("LIBGL_ALLOW_SOFTWARE", false)) { else if (debug_get_bool_option("LIBGL_ALLOW_SOFTWARE", false)) {
apple_glx_diagnostic apple_glx_diagnostic
("Software rendering is not being excluded. Not using kCGLPFAAccelerated.\n"); ("Software rendering is not being excluded. Not using kCGLPFAAccelerated.\n");
} }

View file

@ -33,7 +33,7 @@
#include "drisw_priv.h" #include "drisw_priv.h"
#include <X11/extensions/shmproto.h> #include <X11/extensions/shmproto.h>
#include <assert.h> #include <assert.h>
#include "util/debug.h" #include "util/u_debug.h"
#include "kopper_interface.h" #include "kopper_interface.h"
#include "loader_dri_helper.h" #include "loader_dri_helper.h"

View file

@ -43,7 +43,7 @@
#ifdef GLX_USE_APPLEGL #ifdef GLX_USE_APPLEGL
#include "apple/apple_glx_context.h" #include "apple/apple_glx_context.h"
#include "apple/apple_glx.h" #include "apple/apple_glx.h"
#include "util/debug.h" #include "util/u_debug.h"
#else #else
#ifndef GLX_USE_WINDOWSGL #ifndef GLX_USE_WINDOWSGL
#include <X11/extensions/xf86vmode.h> #include <X11/extensions/xf86vmode.h>
@ -1304,7 +1304,7 @@ glXChooseVisual(Display * dpy, int screen, int *attribList)
} }
#ifdef GLX_USE_APPLEGL #ifdef GLX_USE_APPLEGL
if(visualList && env_var_as_boolean("LIBGL_DUMP_VISUALID", false)) { if(visualList && debug_get_bool_option("LIBGL_DUMP_VISUALID", false)) {
printf("visualid 0x%lx\n", visualList[0].visualid); printf("visualid 0x%lx\n", visualList[0].visualid);
} }
#endif #endif

View file

@ -50,7 +50,7 @@
#endif #endif
#include "glxextensions.h" #include "glxextensions.h"
#include "util/debug.h" #include "util/u_debug.h"
#ifndef GLX_USE_APPLEGL #ifndef GLX_USE_APPLEGL
#include "dri_common.h" #include "dri_common.h"
#endif #endif
@ -921,8 +921,8 @@ __glXInitialize(Display * dpy)
dpyPriv->glXDrawHash = __glxHashCreate(); dpyPriv->glXDrawHash = __glxHashCreate();
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
Bool glx_direct = !env_var_as_boolean("LIBGL_ALWAYS_INDIRECT", false); Bool glx_direct = !debug_get_bool_option("LIBGL_ALWAYS_INDIRECT", false);
Bool glx_accel = !env_var_as_boolean("LIBGL_ALWAYS_SOFTWARE", false); Bool glx_accel = !debug_get_bool_option("LIBGL_ALWAYS_SOFTWARE", false);
const char *env = getenv("MESA_LOADER_DRIVER_OVERRIDE"); const char *env = getenv("MESA_LOADER_DRIVER_OVERRIDE");
Bool explicit_zink = env && !strcmp(env, "zink"); Bool explicit_zink = env && !strcmp(env, "zink");
Bool infer_zink = false; Bool infer_zink = false;
@ -942,14 +942,14 @@ __glXInitialize(Display * dpy)
#if defined(GLX_USE_DRM) #if defined(GLX_USE_DRM)
if (glx_direct && glx_accel && !explicit_zink) { if (glx_direct && glx_accel && !explicit_zink) {
#if defined(HAVE_DRI3) #if defined(HAVE_DRI3)
if (!env_var_as_boolean("LIBGL_DRI3_DISABLE", false)) if (!debug_get_bool_option("LIBGL_DRI3_DISABLE", false))
dpyPriv->dri3Display = dri3_create_display(dpy); dpyPriv->dri3Display = dri3_create_display(dpy);
#endif /* HAVE_DRI3 */ #endif /* HAVE_DRI3 */
if (!env_var_as_boolean("LIBGL_DRI2_DISABLE", false)) if (!debug_get_bool_option("LIBGL_DRI2_DISABLE", false))
dpyPriv->dri2Display = dri2CreateDisplay(dpy); dpyPriv->dri2Display = dri2CreateDisplay(dpy);
/* zink fallback */ /* zink fallback */
if (!dpyPriv->dri3Display && !dpyPriv->dri2Display) if (!dpyPriv->dri3Display && !dpyPriv->dri2Display)
infer_zink = !env_var_as_boolean("LIBGL_KOPPER_DISABLE", false) && !getenv("GALLIUM_DRIVER"); infer_zink = !debug_get_bool_option("LIBGL_KOPPER_DISABLE", false) && !getenv("GALLIUM_DRIVER");
} }
#endif /* GLX_USE_DRM */ #endif /* GLX_USE_DRM */
if (glx_direct) if (glx_direct)

View file

@ -35,7 +35,7 @@
#include "glapi.h" #include "glapi.h"
#include "glxclient.h" #include "glxclient.h"
#include "indirect.h" #include "indirect.h"
#include "util/debug.h" #include "util/u_debug.h"
#ifndef GLX_USE_APPLEGL #ifndef GLX_USE_APPLEGL
@ -338,7 +338,7 @@ indirect_create_context_attribs(struct glx_screen *psc,
return NULL; return NULL;
} }
gc->client_state_private = state; gc->client_state_private = state;
state->NoDrawArraysProtocol = env_var_as_boolean("LIBGL_NO_DRAWARRAYS", false); state->NoDrawArraysProtocol = debug_get_bool_option("LIBGL_NO_DRAWARRAYS", false);
/* /*
** Create a temporary buffer to hold GLX rendering commands. The size ** Create a temporary buffer to hold GLX rendering commands. The size

View file

@ -38,9 +38,8 @@
#include <inttypes.h> #include <inttypes.h>
#include "dev/intel_device_info.h" #include "dev/intel_device_info.h"
#include "util/debug.h"
#include "util/macros.h"
#include "util/u_debug.h" #include "util/u_debug.h"
#include "util/macros.h"
static const struct debug_control debug_control[] = { static const struct debug_control debug_control[] = {

View file

@ -24,7 +24,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <math.h> #include <math.h>
#include "util/debug.h" #include "util/u_debug.h"
#include "util/macros.h" #include "util/macros.h"
#include "util/u_math.h" #include "util/u_math.h"
#include "compiler/shader_enums.h" #include "compiler/shader_enums.h"
@ -333,7 +333,7 @@ intel_get_mesh_urb_config(const struct intel_device_info *devinfo,
static int task_urb_share_percentage = -1; static int task_urb_share_percentage = -1;
if (task_urb_share_percentage < 0) { if (task_urb_share_percentage < 0) {
task_urb_share_percentage = task_urb_share_percentage =
MIN2(env_var_as_unsigned("INTEL_MESH_TASK_URB_SHARE", 10), 100); MIN2(debug_get_num_option("INTEL_MESH_TASK_URB_SHARE", 10), 100);
} }
task_urb_share = task_urb_share_percentage / 100.0f; task_urb_share = task_urb_share_percentage / 100.0f;
} }

View file

@ -27,7 +27,7 @@
#include "dev/intel_debug.h" #include "dev/intel_debug.h"
#include "compiler/nir/nir.h" #include "compiler/nir/nir.h"
#include "main/errors.h" #include "main/errors.h"
#include "util/debug.h" #include "util/u_debug.h"
#define COMMON_OPTIONS \ #define COMMON_OPTIONS \
.lower_fdiv = true, \ .lower_fdiv = true, \
@ -115,7 +115,7 @@ brw_compiler_create(void *mem_ctx, const struct intel_device_info *devinfo)
if (devinfo->ver < 8) if (devinfo->ver < 8)
brw_vec4_alloc_reg_set(compiler); brw_vec4_alloc_reg_set(compiler);
compiler->precise_trig = env_var_as_boolean("INTEL_PRECISE_TRIG", false); compiler->precise_trig = debug_get_bool_option("INTEL_PRECISE_TRIG", false);
compiler->use_tcs_multi_patch = devinfo->ver >= 12; compiler->use_tcs_multi_patch = devinfo->ver >= 12;

View file

@ -36,7 +36,7 @@
#include "dev/intel_debug.h" #include "dev/intel_debug.h"
#include "git_sha1.h" #include "git_sha1.h"
#include "util/macros.h" #include "util/macros.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "c11/threads.h" #include "c11/threads.h"
uint64_t intel_debug = 0; uint64_t intel_debug = 0;

View file

@ -34,7 +34,7 @@
#include "intel_hwconfig.h" #include "intel_hwconfig.h"
#include "intel/common/intel_gem.h" #include "intel/common/intel_gem.h"
#include "util/bitscan.h" #include "util/bitscan.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/log.h" #include "util/log.h"
#include "util/macros.h" #include "util/macros.h"
#include "util/os_misc.h" #include "util/os_misc.h"
@ -2037,7 +2037,7 @@ intel_get_device_info_from_fd(int fd, struct intel_device_info *devinfo)
devinfo->pci_device_id = drmdev->deviceinfo.pci->device_id; devinfo->pci_device_id = drmdev->deviceinfo.pci->device_id;
devinfo->pci_revision_id = drmdev->deviceinfo.pci->revision_id; devinfo->pci_revision_id = drmdev->deviceinfo.pci->revision_id;
drmFreeDevice(&drmdev); drmFreeDevice(&drmdev);
devinfo->no_hw = env_var_as_boolean("INTEL_NO_HW", false); devinfo->no_hw = debug_get_bool_option("INTEL_NO_HW", false);
if (devinfo->ver == 10) { if (devinfo->ver == 10) {
mesa_loge("Gfx10 support is redacted."); mesa_loge("Gfx10 support is redacted.");

View file

@ -29,7 +29,7 @@
#include <vulkan/vulkan.h> #include <vulkan/vulkan.h>
#include <vulkan/vk_layer.h> #include <vulkan/vk_layer.h>
#include "util/debug.h" #include "util/u_debug.h"
#include "util/hash_table.h" #include "util/hash_table.h"
#include "util/macros.h" #include "util/macros.h"
#include "util/simple_mtx.h" #include "util/simple_mtx.h"

View file

@ -36,7 +36,7 @@
#include "genxml/genX_bits.h" #include "genxml/genX_bits.h"
#include "perf/intel_perf.h" #include "perf/intel_perf.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/perf/u_trace.h" #include "util/perf/u_trace.h"
/** \file anv_batch_chain.c /** \file anv_batch_chain.c

View file

@ -41,7 +41,7 @@
#include "anv_private.h" #include "anv_private.h"
#include "anv_measure.h" #include "anv_measure.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/build_id.h" #include "util/build_id.h"
#include "util/disk_cache.h" #include "util/disk_cache.h"
#include "util/mesa-sha1.h" #include "util/mesa-sha1.h"
@ -184,7 +184,7 @@ get_device_extensions(const struct anv_physical_device *device,
(device->sync_syncobj_type.features & VK_SYNC_FEATURE_CPU_WAIT) != 0; (device->sync_syncobj_type.features & VK_SYNC_FEATURE_CPU_WAIT) != 0;
const bool nv_mesh_shading_enabled = const bool nv_mesh_shading_enabled =
env_var_as_boolean("ANV_EXPERIMENTAL_NV_MESH_SHADER", false); debug_get_bool_option("ANV_EXPERIMENTAL_NV_MESH_SHADER", false);
*ext = (struct vk_device_extension_table) { *ext = (struct vk_device_extension_table) {
.KHR_8bit_storage = true, .KHR_8bit_storage = true,
@ -685,7 +685,7 @@ anv_physical_device_init_queue_families(struct anv_physical_device *pdevice)
INTEL_ENGINE_CLASS_RENDER); INTEL_ENGINE_CLASS_RENDER);
int g_count = 0; int g_count = 0;
int c_count = 0; int c_count = 0;
if (env_var_as_boolean("INTEL_COMPUTE_CLASS", false)) if (debug_get_bool_option("INTEL_COMPUTE_CLASS", false))
c_count = intel_engines_count(pdevice->engine_info, c_count = intel_engines_count(pdevice->engine_info,
INTEL_ENGINE_CLASS_COMPUTE); INTEL_ENGINE_CLASS_COMPUTE);
enum intel_engine_class compute_class = enum intel_engine_class compute_class =
@ -912,7 +912,7 @@ anv_physical_device_try_create(struct vk_instance *vk_instance,
if (result != VK_SUCCESS) if (result != VK_SUCCESS)
goto fail_base; goto fail_base;
if (env_var_as_boolean("ANV_QUEUE_THREAD_DISABLE", false)) if (debug_get_bool_option("ANV_QUEUE_THREAD_DISABLE", false))
device->has_exec_timeline = false; device->has_exec_timeline = false;
unsigned st_idx = 0; unsigned st_idx = 0;
@ -937,10 +937,10 @@ anv_physical_device_try_create(struct vk_instance *vk_instance,
device->vk.pipeline_cache_import_ops = anv_cache_import_ops; device->vk.pipeline_cache_import_ops = anv_cache_import_ops;
device->always_use_bindless = device->always_use_bindless =
env_var_as_boolean("ANV_ALWAYS_BINDLESS", false); debug_get_bool_option("ANV_ALWAYS_BINDLESS", false);
device->use_call_secondary = device->use_call_secondary =
!env_var_as_boolean("ANV_DISABLE_SECONDARY_CMD_BUFFER_CALLS", false); !debug_get_bool_option("ANV_DISABLE_SECONDARY_CMD_BUFFER_CALLS", false);
device->has_implicit_ccs = device->info.has_aux_map || device->has_implicit_ccs = device->info.has_aux_map ||
device->info.verx10 >= 125; device->info.verx10 >= 125;

View file

@ -30,7 +30,7 @@
#include "drm-uapi/drm_fourcc.h" #include "drm-uapi/drm_fourcc.h"
#include "anv_private.h" #include "anv_private.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "vk_util.h" #include "vk_util.h"
#include "util/u_math.h" #include "util/u_math.h"

View file

@ -28,7 +28,7 @@
#include <sys/types.h> #include <sys/types.h>
#include "common/intel_measure.h" #include "common/intel_measure.h"
#include "util/debug.h" #include "util/u_debug.h"
struct anv_measure_batch { struct anv_measure_batch {
struct anv_bo *bo; struct anv_bo *bo;

View file

@ -23,7 +23,7 @@
#include "anv_nir.h" #include "anv_nir.h"
#include "nir/nir_builder.h" #include "nir/nir_builder.h"
#include "util/debug.h" #include "util/u_debug.h"
/** /**
* This file implements the lowering required for VK_KHR_multiview. * This file implements the lowering required for VK_KHR_multiview.
@ -305,7 +305,7 @@ anv_check_for_primitive_replication(struct anv_device *device,
primitive_replication_max_views = primitive_replication_max_views =
MIN2(MAX_VIEWS_FOR_PRIMITIVE_REPLICATION, MIN2(MAX_VIEWS_FOR_PRIMITIVE_REPLICATION,
env_var_as_unsigned("ANV_PRIMITIVE_REPLICATION_MAX_VIEWS", debug_get_num_option("ANV_PRIMITIVE_REPLICATION_MAX_VIEWS",
default_max_views)); default_max_views));
} }

View file

@ -23,7 +23,7 @@
#include "util/blob.h" #include "util/blob.h"
#include "util/hash_table.h" #include "util/hash_table.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/disk_cache.h" #include "util/disk_cache.h"
#include "util/mesa-sha1.h" #include "util/mesa-sha1.h"
#include "nir/nir_serialize.h" #include "nir/nir_serialize.h"

View file

@ -25,7 +25,7 @@
#include <math.h> #include <math.h>
#include "util/debug.h" #include "util/u_debug.h"
#include "util/half_float.h" #include "util/half_float.h"
#include "util/u_atomic.h" #include "util/u_atomic.h"

View file

@ -36,7 +36,7 @@
#include "genxml/genX_bits.h" #include "genxml/genX_bits.h"
#include "perf/intel_perf.h" #include "perf/intel_perf.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/perf/u_trace.h" #include "util/perf/u_trace.h"
/** \file anv_batch_chain.c /** \file anv_batch_chain.c
@ -1510,7 +1510,7 @@ execbuf_can_skip_relocations(struct anv_execbuf *exec)
static int userspace_relocs = -1; static int userspace_relocs = -1;
if (userspace_relocs < 0) if (userspace_relocs < 0)
userspace_relocs = env_var_as_boolean("ANV_USERSPACE_RELOCS", true); userspace_relocs = debug_get_bool_option("ANV_USERSPACE_RELOCS", true);
if (!userspace_relocs) if (!userspace_relocs)
return false; return false;

View file

@ -41,7 +41,7 @@
#include "anv_private.h" #include "anv_private.h"
#include "anv_measure.h" #include "anv_measure.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/build_id.h" #include "util/build_id.h"
#include "util/disk_cache.h" #include "util/disk_cache.h"
#include "util/mesa-sha1.h" #include "util/mesa-sha1.h"
@ -818,7 +818,7 @@ anv_physical_device_try_create(struct vk_instance *vk_instance,
device->has_exec_timeline = device->has_exec_timeline =
anv_gem_get_param(fd, I915_PARAM_HAS_EXEC_TIMELINE_FENCES); anv_gem_get_param(fd, I915_PARAM_HAS_EXEC_TIMELINE_FENCES);
if (env_var_as_boolean("ANV_QUEUE_THREAD_DISABLE", false)) if (debug_get_bool_option("ANV_QUEUE_THREAD_DISABLE", false))
device->has_exec_timeline = false; device->has_exec_timeline = false;
unsigned st_idx = 0; unsigned st_idx = 0;
@ -843,11 +843,11 @@ anv_physical_device_try_create(struct vk_instance *vk_instance,
device->vk.pipeline_cache_import_ops = anv_cache_import_ops; device->vk.pipeline_cache_import_ops = anv_cache_import_ops;
device->always_use_bindless = device->always_use_bindless =
env_var_as_boolean("ANV_ALWAYS_BINDLESS", false); debug_get_bool_option("ANV_ALWAYS_BINDLESS", false);
device->use_call_secondary = device->use_call_secondary =
device->use_softpin && device->use_softpin &&
!env_var_as_boolean("ANV_DISABLE_SECONDARY_CMD_BUFFER_CALLS", false); !debug_get_bool_option("ANV_DISABLE_SECONDARY_CMD_BUFFER_CALLS", false);
/* We first got the A64 messages on broadwell and we can only use them if /* We first got the A64 messages on broadwell and we can only use them if
* we can pass addresses directly into the shader which requires softpin. * we can pass addresses directly into the shader which requires softpin.

View file

@ -30,7 +30,7 @@
#include "drm-uapi/drm_fourcc.h" #include "drm-uapi/drm_fourcc.h"
#include "anv_private.h" #include "anv_private.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "vk_util.h" #include "vk_util.h"
#include "util/u_math.h" #include "util/u_math.h"

View file

@ -28,7 +28,7 @@
#include <sys/types.h> #include <sys/types.h>
#include "common/intel_measure.h" #include "common/intel_measure.h"
#include "util/debug.h" #include "util/u_debug.h"
struct anv_measure_batch { struct anv_measure_batch {
struct anv_bo *bo; struct anv_bo *bo;

View file

@ -23,7 +23,7 @@
#include "anv_nir.h" #include "anv_nir.h"
#include "nir/nir_builder.h" #include "nir/nir_builder.h"
#include "util/debug.h" #include "util/u_debug.h"
/** /**
* This file implements the lowering required for VK_KHR_multiview. * This file implements the lowering required for VK_KHR_multiview.
@ -305,7 +305,7 @@ anv_check_for_primitive_replication(struct anv_device *device,
primitive_replication_max_views = primitive_replication_max_views =
MIN2(MAX_VIEWS_FOR_PRIMITIVE_REPLICATION, MIN2(MAX_VIEWS_FOR_PRIMITIVE_REPLICATION,
env_var_as_unsigned("ANV_PRIMITIVE_REPLICATION_MAX_VIEWS", debug_get_num_option("ANV_PRIMITIVE_REPLICATION_MAX_VIEWS",
default_max_views)); default_max_views));
} }

View file

@ -23,7 +23,7 @@
#include "util/blob.h" #include "util/blob.h"
#include "util/hash_table.h" #include "util/hash_table.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/disk_cache.h" #include "util/disk_cache.h"
#include "util/mesa-sha1.h" #include "util/mesa-sha1.h"
#include "nir/nir_serialize.h" #include "nir/nir_serialize.h"

View file

@ -32,7 +32,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <inttypes.h> /* for PRId64 macro */ #include <inttypes.h> /* for PRId64 macro */
#include "util/debug.h" #include "util/u_debug.h"
#include "glheader.h" #include "glheader.h"
#include "enums.h" #include "enums.h"
#include "hash.h" #include "hash.h"
@ -1062,7 +1062,7 @@ get_no_minmax_cache()
static bool disable = false; static bool disable = false;
if (!read) { if (!read) {
disable = env_var_as_boolean("MESA_NO_MINMAX_CACHE", false); disable = debug_get_bool_option("MESA_NO_MINMAX_CACHE", false);
read = true; read = true;
} }

View file

@ -124,7 +124,7 @@
#include "shaderobj.h" #include "shaderobj.h"
#include "shaderimage.h" #include "shaderimage.h"
#include "state.h" #include "state.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/disk_cache.h" #include "util/disk_cache.h"
#include "util/strtod.h" #include "util/strtod.h"
#include "util/u_call_once.h" #include "util/u_call_once.h"
@ -714,7 +714,7 @@ init_attrib_groups(struct gl_context *ctx)
ctx->ErrorValue = GL_NO_ERROR; ctx->ErrorValue = GL_NO_ERROR;
ctx->ShareGroupReset = false; ctx->ShareGroupReset = false;
ctx->VertexProgram._VaryingInputs = VERT_BIT_ALL; ctx->VertexProgram._VaryingInputs = VERT_BIT_ALL;
ctx->IntelBlackholeRender = env_var_as_boolean("INTEL_BLACKHOLE_DEFAULT", false); ctx->IntelBlackholeRender = debug_get_bool_option("INTEL_BLACKHOLE_DEFAULT", false);
return GL_TRUE; return GL_TRUE;
} }

View file

@ -33,7 +33,7 @@
#include "git_sha1.h" #include "git_sha1.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/disk_cache.h" #include "util/disk_cache.h"
#include "util/macros.h" #include "util/macros.h"
#include "util/mesa-sha1.h" #include "util/mesa-sha1.h"

View file

@ -45,7 +45,7 @@
#include "drm-uapi/panfrost_drm.h" #include "drm-uapi/panfrost_drm.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/disk_cache.h" #include "util/disk_cache.h"
#include "util/strtod.h" #include "util/strtod.h"
#include "vk_format.h" #include "vk_format.h"
@ -76,7 +76,7 @@ _panvk_device_set_lost(struct panvk_device *device,
vfprintf(stderr, msg, ap); vfprintf(stderr, msg, ap);
va_end(ap); va_end(ap);
if (env_var_as_boolean("PANVK_ABORT_ON_DEVICE_LOSS", false)) if (debug_get_bool_option("PANVK_ABORT_ON_DEVICE_LOSS", false))
abort(); abort();
return VK_ERROR_DEVICE_LOST; return VK_ERROR_DEVICE_LOST;

View file

@ -28,7 +28,7 @@
#include "panvk_private.h" #include "panvk_private.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/u_atomic.h" #include "util/u_atomic.h"
#include "vk_format.h" #include "vk_format.h"
#include "vk_object.h" #include "vk_object.h"

View file

@ -34,7 +34,7 @@
#include "nir/nir.h" #include "nir/nir.h"
#include "nir/nir_builder.h" #include "nir/nir_builder.h"
#include "spirv/nir_spirv.h" #include "spirv/nir_spirv.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/mesa-sha1.h" #include "util/mesa-sha1.h"
#include "util/u_atomic.h" #include "util/u_atomic.h"
#include "vk_format.h" #include "vk_format.h"

View file

@ -29,7 +29,7 @@
#include "genxml/gen_macros.h" #include "genxml/gen_macros.h"
#include "panvk_private.h" #include "panvk_private.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/u_atomic.h" #include "util/u_atomic.h"
#include "vk_format.h" #include "vk_format.h"
#include "vk_object.h" #include "vk_object.h"

View file

@ -34,7 +34,7 @@
#include "nir/nir.h" #include "nir/nir.h"
#include "nir/nir_builder.h" #include "nir/nir_builder.h"
#include "spirv/nir_spirv.h" #include "spirv/nir_spirv.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/mesa-sha1.h" #include "util/mesa-sha1.h"
#include "util/u_atomic.h" #include "util/u_atomic.h"
#include "vk_format.h" #include "vk_format.h"

View file

@ -1,46 +0,0 @@
/*
* Copyright © 2015 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
#include <errno.h>
#include <string.h>
#include "debug.h"
/**
* Reads an environment variable and interprets its value as a boolean.
*
* Recognizes 0/false/no and 1/true/yes. Other values result in the default value.
*/
bool
env_var_as_boolean(const char *var_name, bool default_value)
{
return debug_get_bool_option(var_name, default_value);
}
/**
* Reads an environment variable and interprets its value as a unsigned.
*/
unsigned
env_var_as_unsigned(const char *var_name, unsigned default_value)
{
return debug_get_num_option(var_name, default_value);
}

View file

@ -1,45 +0,0 @@
/*
* Copyright © 2015 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
#ifndef _UTIL_DEBUG_H
#define _UTIL_DEBUG_H
#include <stdint.h>
#include <stdbool.h>
#include "u_debug.h"
#ifdef __cplusplus
extern "C" {
#endif
bool
env_var_as_boolean(const char *var_name, bool default_value);
unsigned
env_var_as_unsigned(const char *var_name, unsigned default_value);
#ifdef __cplusplus
} /* extern C */
#endif
#endif /* _UTIL_DEBUG_H */

View file

@ -38,7 +38,7 @@
#include <inttypes.h> #include <inttypes.h>
#include "util/crc32.h" #include "util/crc32.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/rand_xor.h" #include "util/rand_xor.h"
#include "util/u_atomic.h" #include "util/u_atomic.h"
#include "util/mesa-sha1.h" #include "util/mesa-sha1.h"
@ -118,10 +118,10 @@ disk_cache_create(const char *gpu_name, const char *driver_id,
if (strcmp(driver_id, "make_check_uncompressed") == 0) if (strcmp(driver_id, "make_check_uncompressed") == 0)
cache->compression_disabled = true; cache->compression_disabled = true;
if (env_var_as_boolean("MESA_DISK_CACHE_SINGLE_FILE", false)) { if (debug_get_bool_option("MESA_DISK_CACHE_SINGLE_FILE", false)) {
if (!disk_cache_load_cache_index_foz(local, cache)) if (!disk_cache_load_cache_index_foz(local, cache))
goto path_fail; goto path_fail;
} else if (env_var_as_boolean("MESA_DISK_CACHE_DATABASE", false)) { } else if (debug_get_bool_option("MESA_DISK_CACHE_DATABASE", false)) {
if (!disk_cache_db_load_cache_index(local, cache)) if (!disk_cache_db_load_cache_index(local, cache))
goto path_fail; goto path_fail;
@ -257,7 +257,7 @@ disk_cache_destroy(struct disk_cache *cache)
util_queue_finish(&cache->cache_queue); util_queue_finish(&cache->cache_queue);
util_queue_destroy(&cache->cache_queue); util_queue_destroy(&cache->cache_queue);
if (env_var_as_boolean("MESA_DISK_CACHE_SINGLE_FILE", false)) if (debug_get_bool_option("MESA_DISK_CACHE_SINGLE_FILE", false))
foz_destroy(&cache->foz_db); foz_destroy(&cache->foz_db);
if (cache->use_cache_db) if (cache->use_cache_db)
@ -363,7 +363,7 @@ cache_put(void *job, void *gdata, int thread_index)
char *filename = NULL; char *filename = NULL;
struct disk_cache_put_job *dc_job = (struct disk_cache_put_job *) job; struct disk_cache_put_job *dc_job = (struct disk_cache_put_job *) job;
if (env_var_as_boolean("MESA_DISK_CACHE_SINGLE_FILE", false)) { if (debug_get_bool_option("MESA_DISK_CACHE_SINGLE_FILE", false)) {
disk_cache_write_item_to_disk_foz(dc_job); disk_cache_write_item_to_disk_foz(dc_job);
} else if (dc_job->cache->use_cache_db) { } else if (dc_job->cache->use_cache_db) {
disk_cache_db_write_item_to_disk(dc_job); disk_cache_db_write_item_to_disk(dc_job);
@ -463,7 +463,7 @@ disk_cache_get(struct disk_cache *cache, const cache_key key, size_t *size)
return blob; return blob;
} }
if (env_var_as_boolean("MESA_DISK_CACHE_SINGLE_FILE", false)) { if (debug_get_bool_option("MESA_DISK_CACHE_SINGLE_FILE", false)) {
return disk_cache_load_item_foz(cache, key, size); return disk_cache_load_item_foz(cache, key, size);
} else if (cache->use_cache_db) { } else if (cache->use_cache_db) {
return disk_cache_db_load_item(cache, key, size); return disk_cache_db_load_item(cache, key, size);

View file

@ -97,7 +97,7 @@ disk_cache_get_function_identifier(void *ptr, struct mesa_sha1 *ctx)
#include "util/blob.h" #include "util/blob.h"
#include "util/crc32.h" #include "util/crc32.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/ralloc.h" #include "util/ralloc.h"
#include "util/rand_xor.h" #include "util/rand_xor.h"
@ -832,9 +832,9 @@ disk_cache_generate_cache_dir(void *mem_ctx, const char *gpu_name,
const char *driver_id) const char *driver_id)
{ {
char *cache_dir_name = CACHE_DIR_NAME; char *cache_dir_name = CACHE_DIR_NAME;
if (env_var_as_boolean("MESA_DISK_CACHE_SINGLE_FILE", false)) if (debug_get_bool_option("MESA_DISK_CACHE_SINGLE_FILE", false))
cache_dir_name = CACHE_DIR_NAME_SF; cache_dir_name = CACHE_DIR_NAME_SF;
else if (env_var_as_boolean("MESA_DISK_CACHE_DATABASE", false)) else if (debug_get_bool_option("MESA_DISK_CACHE_DATABASE", false))
cache_dir_name = CACHE_DIR_NAME_DB; cache_dir_name = CACHE_DIR_NAME_DB;
char *path = getenv("MESA_SHADER_CACHE_DIR"); char *path = getenv("MESA_SHADER_CACHE_DIR");
@ -904,7 +904,7 @@ disk_cache_generate_cache_dir(void *mem_ctx, const char *gpu_name,
return NULL; return NULL;
} }
if (env_var_as_boolean("MESA_DISK_CACHE_SINGLE_FILE", false)) { if (debug_get_bool_option("MESA_DISK_CACHE_SINGLE_FILE", false)) {
path = concatenate_and_mkdir(mem_ctx, path, driver_id); path = concatenate_and_mkdir(mem_ctx, path, driver_id);
if (!path) if (!path)
return NULL; return NULL;
@ -939,7 +939,7 @@ disk_cache_enabled()
"use MESA_SHADER_CACHE_DISABLE instead ***\n"); "use MESA_SHADER_CACHE_DISABLE instead ***\n");
} }
if (env_var_as_boolean(envvar_name, disable_by_default)) if (debug_get_bool_option(envvar_name, disable_by_default))
return false; return false;
return true; return true;

View file

@ -40,8 +40,6 @@ files_mesa_util = files(
'crc32.c', 'crc32.c',
'crc32.h', 'crc32.h',
'dag.c', 'dag.c',
'debug.c',
'debug.h',
'disk_cache.c', 'disk_cache.c',
'disk_cache.h', 'disk_cache.h',
'disk_cache_os.c', 'disk_cache_os.c',

View file

@ -304,7 +304,7 @@ src_template = """\
% endfor % endfor
#define __NEEDS_TRACE_PRIV #define __NEEDS_TRACE_PRIV
#include "util/debug.h" #include "util/u_debug.h"
#include "util/perf/u_trace_priv.h" #include "util/perf/u_trace_priv.h"
% if trace_toggle_name is not None: % if trace_toggle_name is not None:

View file

@ -12,10 +12,9 @@
#include <stdarg.h> #include <stdarg.h>
#include "util/debug.h" #include "util/u_debug.h"
#include "util/log.h" #include "util/log.h"
#include "util/os_misc.h" #include "util/os_misc.h"
#include "util/u_debug.h"
#include "venus-protocol/vn_protocol_driver_info.h" #include "venus-protocol/vn_protocol_driver_info.h"
#include "vk_enum_to_str.h" #include "vk_enum_to_str.h"

View file

@ -34,7 +34,7 @@
#include "overlay_params.h" #include "overlay_params.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/hash_table.h" #include "util/hash_table.h"
#include "util/list.h" #include "util/list.h"
#include "util/ralloc.h" #include "util/ralloc.h"

View file

@ -31,7 +31,7 @@
#include "vk_sync.h" #include "vk_sync.h"
#include "vk_sync_timeline.h" #include "vk_sync_timeline.h"
#include "vk_util.h" #include "vk_util.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/hash_table.h" #include "util/hash_table.h"
#include "util/ralloc.h" #include "util/ralloc.h"
@ -200,7 +200,7 @@ vk_device_init(struct vk_device *device,
break; break;
case VK_DEVICE_TIMELINE_MODE_ASSISTED: case VK_DEVICE_TIMELINE_MODE_ASSISTED:
if (env_var_as_boolean("MESA_VK_ENABLE_SUBMIT_THREAD", false)) { if (debug_get_bool_option("MESA_VK_ENABLE_SUBMIT_THREAD", false)) {
device->submit_mode = VK_QUEUE_SUBMIT_MODE_THREADED; device->submit_mode = VK_QUEUE_SUBMIT_MODE_THREADED;
} else { } else {
device->submit_mode = VK_QUEUE_SUBMIT_MODE_THREADED_ON_DEMAND; device->submit_mode = VK_QUEUE_SUBMIT_MODE_THREADED_ON_DEMAND;
@ -338,7 +338,7 @@ _vk_device_set_lost(struct vk_device *device,
vk_logd(VK_LOG_OBJS(device), "Timeline mode is %s.", vk_logd(VK_LOG_OBJS(device), "Timeline mode is %s.",
timeline_mode_str(device)); timeline_mode_str(device));
if (env_var_as_boolean("MESA_VK_ABORT_ON_DEVICE_LOSS", false)) if (debug_get_bool_option("MESA_VK_ABORT_ON_DEVICE_LOSS", false))
abort(); abort();
return VK_ERROR_DEVICE_LOST; return VK_ERROR_DEVICE_LOST;

View file

@ -32,7 +32,7 @@
#include "compiler/nir/nir_serialize.h" #include "compiler/nir/nir_serialize.h"
#include "util/blob.h" #include "util/blob.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/disk_cache.h" #include "util/disk_cache.h"
#include "util/hash_table.h" #include "util/hash_table.h"
#include "util/set.h" #include "util/set.h"
@ -606,7 +606,7 @@ vk_pipeline_cache_create(struct vk_device *device,
simple_mtx_init(&cache->lock, mtx_plain); simple_mtx_init(&cache->lock, mtx_plain);
if (info->force_enable || if (info->force_enable ||
env_var_as_boolean("VK_ENABLE_PIPELINE_CACHE", true)) { debug_get_bool_option("VK_ENABLE_PIPELINE_CACHE", true)) {
cache->object_cache = _mesa_set_create(NULL, object_key_hash, cache->object_cache = _mesa_set_create(NULL, object_key_hash,
object_keys_equal); object_keys_equal);
} }

View file

@ -23,7 +23,7 @@
#include "vk_queue.h" #include "vk_queue.h"
#include "util/debug.h" #include "util/u_debug.h"
#include <inttypes.h> #include <inttypes.h>
#include "vk_alloc.h" #include "vk_alloc.h"
@ -129,7 +129,7 @@ _vk_queue_set_lost(struct vk_queue *queue,
p_atomic_inc(&queue->base.device->_lost.lost); p_atomic_inc(&queue->base.device->_lost.lost);
if (env_var_as_boolean("MESA_VK_ABORT_ON_DEVICE_LOSS", false)) { if (debug_get_bool_option("MESA_VK_ABORT_ON_DEVICE_LOSS", false)) {
_vk_device_report_lost(queue->base.device); _vk_device_report_lost(queue->base.device);
abort(); abort();
} }

View file

@ -26,7 +26,7 @@
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
#include "util/debug.h" #include "util/u_debug.h"
#include "util/macros.h" #include "util/macros.h"
#include "util/os_time.h" #include "util/os_time.h"
@ -202,7 +202,7 @@ get_max_abs_timeout_ns(void)
{ {
static int max_timeout_ms = -1; static int max_timeout_ms = -1;
if (max_timeout_ms < 0) if (max_timeout_ms < 0)
max_timeout_ms = env_var_as_unsigned("MESA_VK_MAX_TIMEOUT", 0); max_timeout_ms = debug_get_num_option("MESA_VK_MAX_TIMEOUT", 0);
if (max_timeout_ms == 0) if (max_timeout_ms == 0)
return UINT64_MAX; return UINT64_MAX;

View file

@ -27,7 +27,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "vk_util.h" #include "vk_util.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "compiler/spirv/nir_spirv.h" #include "compiler/spirv/nir_spirv.h"
@ -75,7 +75,7 @@ uint32_t vk_get_version_override(void)
void void
vk_warn_non_conformant_implementation(const char *driver_name) vk_warn_non_conformant_implementation(const char *driver_name)
{ {
if (env_var_as_boolean("MESA_VK_IGNORE_CONFORMANCE_WARNING", false)) if (debug_get_bool_option("MESA_VK_IGNORE_CONFORMANCE_WARNING", false))
return; return;
fprintf(stderr, "WARNING: %s is not a conformant Vulkan implementation, " fprintf(stderr, "WARNING: %s is not a conformant Vulkan implementation, "

View file

@ -23,7 +23,7 @@
#include "wsi_common_private.h" #include "wsi_common_private.h"
#include "wsi_common_entrypoints.h" #include "wsi_common_entrypoints.h"
#include "util/debug.h" #include "util/u_debug.h"
#include "util/macros.h" #include "util/macros.h"
#include "util/os_file.h" #include "util/os_file.h"
#include "util/xmlconfig.h" #include "util/xmlconfig.h"