mesa/src/intel/dev
Marcin Ślusarz 2d6c11843d 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>
(cherry picked from commit d05f7b4a2c)
2021-10-20 20:40:58 +01:00
..
intel_debug.c intel: Rename GEN_DEBUG prefix to INTEL_DEBUG 2021-04-20 20:06:33 +00:00
intel_debug.h intel: fix INTEL_DEBUG environment variable on 32-bit systems 2021-10-20 20:40:58 +01:00
intel_dev_info.c intel/dev: Put the device name in intel_device_info 2021-07-14 23:02:34 +00:00
intel_device_info.c intel: Add and use max_constant_urb_size_kb 2021-09-27 20:51:28 +00:00
intel_device_info.h intel: Add and use max_constant_urb_size_kb 2021-09-27 20:51:28 +00:00
intel_device_info_test.c intel: Add and use max_constant_urb_size_kb 2021-09-27 20:51:28 +00:00
meson.build intel: Rename gen_device prefix to intel_device 2021-04-20 20:06:33 +00:00