isl: handle DRM_FORMAT_MOD_INVALID in isl_drm_modifier_has_aux

This fixes crashes with piglit.spec.ext_external_objects.* tests on TGL
that started to trigger with commit 8bc7bcfa0c.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23718>
This commit is contained in:
Tapani Pälli 2023-06-19 11:20:38 +03:00 committed by Marge Bot
parent b8f8146c6e
commit e1d7861dd6

View file

@ -42,6 +42,7 @@
#include <stdbool.h>
#include <stdint.h>
#include "drm-uapi/drm_fourcc.h"
#include "util/compiler.h"
#include "util/macros.h"
#include "util/format/u_format.h"
@ -2246,6 +2247,9 @@ isl_drm_modifier_get_info(uint64_t modifier);
static inline bool
isl_drm_modifier_has_aux(uint64_t modifier)
{
if (modifier == DRM_FORMAT_MOD_INVALID)
return false;
return isl_drm_modifier_get_info(modifier)->aux_usage != ISL_AUX_USAGE_NONE;
}