mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-04 00:30:11 +01:00
isl: Make public the list of modifiers
This allows Vulkan and GL to iterate over the full list of modifiers instead of hard-coding in various places the "same" list as isl. (Anvil's list has already diverged from isl's list. It omits Gen12 modifiers). Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
parent
51eefbaae6
commit
6835cb7f86
2 changed files with 16 additions and 4 deletions
|
|
@ -1848,6 +1848,13 @@ isl_aux_state_has_valid_aux(enum isl_aux_state state)
|
|||
return state != ISL_AUX_STATE_AUX_INVALID;
|
||||
}
|
||||
|
||||
extern const struct isl_drm_modifier_info isl_drm_modifier_info_list[];
|
||||
|
||||
#define isl_drm_modifier_info_for_each(__info) \
|
||||
for (const struct isl_drm_modifier_info *__info = isl_drm_modifier_info_list; \
|
||||
__info->modifier != DRM_FORMAT_MOD_INVALID; \
|
||||
++__info)
|
||||
|
||||
const struct isl_drm_modifier_info * ATTRIBUTE_CONST
|
||||
isl_drm_modifier_get_info(uint64_t modifier);
|
||||
|
||||
|
|
|
|||
|
|
@ -73,7 +73,9 @@ isl_tiling_from_i915_tiling(uint32_t tiling)
|
|||
unreachable("Invalid i915 tiling");
|
||||
}
|
||||
|
||||
static const struct isl_drm_modifier_info modifier_info[] = {
|
||||
/** Sentinel is DRM_FORMAT_MOD_INVALID. */
|
||||
const struct isl_drm_modifier_info
|
||||
isl_drm_modifier_info_list[] = {
|
||||
{
|
||||
.modifier = DRM_FORMAT_MOD_NONE,
|
||||
.name = "DRM_FORMAT_MOD_NONE",
|
||||
|
|
@ -110,14 +112,17 @@ static const struct isl_drm_modifier_info modifier_info[] = {
|
|||
.aux_usage = ISL_AUX_USAGE_MC,
|
||||
.supports_clear_color = false,
|
||||
},
|
||||
{
|
||||
.modifier = DRM_FORMAT_MOD_INVALID,
|
||||
},
|
||||
};
|
||||
|
||||
const struct isl_drm_modifier_info *
|
||||
isl_drm_modifier_get_info(uint64_t modifier)
|
||||
{
|
||||
for (unsigned i = 0; i < ARRAY_SIZE(modifier_info); i++) {
|
||||
if (modifier_info[i].modifier == modifier)
|
||||
return &modifier_info[i];
|
||||
isl_drm_modifier_info_for_each(info) {
|
||||
if (info->modifier == modifier)
|
||||
return info;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue