intel: fix INTEL_DEBUG environment variable on 32-bit systems
INTEL_DEBUG is defined (since 4015e1876a
) as:
#define INTEL_DEBUG __builtin_expect(intel_debug, 0)
which unfortunately chops off upper 32 bits from intel_debug
on platforms where sizeof(long) != sizeof(uint64_t) because
__builtin_expect is defined only for the long type.
Fix this by changing the definition of INTEL_DEBUG to be function-like
macro with "flags" argument. New definition returns 0 or 1 when
any of the flags match.
Most of the changes in this commit were generated using:
for c in `git grep INTEL_DEBUG | grep "&" | grep -v i915 | awk -F: '{print $1}' | sort | uniq`; do
perl -pi -e "s/INTEL_DEBUG & ([A-Z0-9a-z_]+)/INTEL_DBG(\1)/" $c
perl -pi -e "s/INTEL_DEBUG & (\([A-Z0-9_ |]+\))/INTEL_DBG\1/" $c
done
but it didn't handle all cases and required minor cleanups (like removal
of round brackets which were not needed anymore).
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13334>
This commit is contained in:

committed by
Marge Bot

parent
182237e1e8
commit
d05f7b4a2c
@@ -110,7 +110,7 @@ brw_compiler_create(void *mem_ctx, const struct intel_device_info *devinfo)
|
||||
|
||||
compiler->use_tcs_8_patch =
|
||||
devinfo->ver >= 12 ||
|
||||
(devinfo->ver >= 9 && (INTEL_DEBUG & DEBUG_TCS_EIGHT_PATCH));
|
||||
(devinfo->ver >= 9 && INTEL_DEBUG(DEBUG_TCS_EIGHT_PATCH));
|
||||
|
||||
/* Default to the sampler since that's what we've done since forever */
|
||||
compiler->indirect_ubos_use_sampler = true;
|
||||
@@ -142,7 +142,7 @@ brw_compiler_create(void *mem_ctx, const struct intel_device_info *devinfo)
|
||||
nir_lower_dsub |
|
||||
nir_lower_ddiv;
|
||||
|
||||
if (!devinfo->has_64bit_float || (INTEL_DEBUG & DEBUG_SOFT64)) {
|
||||
if (!devinfo->has_64bit_float || INTEL_DEBUG(DEBUG_SOFT64)) {
|
||||
int64_options |= (nir_lower_int64_options)~0;
|
||||
fp64_options |= nir_lower_fp64_full_software;
|
||||
}
|
||||
@@ -226,11 +226,10 @@ brw_get_compiler_config_value(const struct brw_compiler *compiler)
|
||||
insert_u64_bit(&config, compiler->scalar_stage[MESA_SHADER_TESS_EVAL]);
|
||||
insert_u64_bit(&config, compiler->scalar_stage[MESA_SHADER_GEOMETRY]);
|
||||
}
|
||||
uint64_t debug_bits = INTEL_DEBUG;
|
||||
uint64_t mask = DEBUG_DISK_CACHE_MASK;
|
||||
while (mask != 0) {
|
||||
const uint64_t bit = 1ULL << (ffsll(mask) - 1);
|
||||
insert_u64_bit(&config, (debug_bits & bit) != 0);
|
||||
insert_u64_bit(&config, INTEL_DEBUG(bit));
|
||||
mask &= ~bit;
|
||||
}
|
||||
return config;
|
||||
|
Reference in New Issue
Block a user