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
@@ -551,7 +551,7 @@ add_aux_surface_if_supported(struct anv_device *device,
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
if (INTEL_DEBUG & DEBUG_NO_HIZ)
|
||||
if (INTEL_DEBUG(DEBUG_NO_HIZ))
|
||||
return VK_SUCCESS;
|
||||
|
||||
ok = isl_surf_get_hiz_surf(&device->isl_dev,
|
||||
@@ -592,7 +592,7 @@ add_aux_surface_if_supported(struct anv_device *device,
|
||||
return add_aux_state_tracking_buffer(device, image, plane);
|
||||
} else if (aspect == VK_IMAGE_ASPECT_STENCIL_BIT) {
|
||||
|
||||
if (INTEL_DEBUG & DEBUG_NO_RBC)
|
||||
if (INTEL_DEBUG(DEBUG_NO_RBC))
|
||||
return VK_SUCCESS;
|
||||
|
||||
if (!isl_surf_supports_ccs(&device->isl_dev,
|
||||
@@ -648,7 +648,7 @@ add_aux_surface_if_supported(struct anv_device *device,
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
if (INTEL_DEBUG & DEBUG_NO_RBC)
|
||||
if (INTEL_DEBUG(DEBUG_NO_RBC))
|
||||
return VK_SUCCESS;
|
||||
|
||||
ok = isl_surf_get_ccs_surf(&device->isl_dev,
|
||||
@@ -2238,7 +2238,7 @@ anv_layout_to_fast_clear_type(const struct intel_device_info * const devinfo,
|
||||
const VkImageAspectFlagBits aspect,
|
||||
const VkImageLayout layout)
|
||||
{
|
||||
if (INTEL_DEBUG & DEBUG_NO_FAST_CLEAR)
|
||||
if (INTEL_DEBUG(DEBUG_NO_FAST_CLEAR))
|
||||
return ANV_FAST_CLEAR_NONE;
|
||||
|
||||
const uint32_t plane = anv_image_aspect_to_plane(image, aspect);
|
||||
|
Reference in New Issue
Block a user