mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-24 08:10:22 +01:00
anv/image: Use isl_drm_modifier_get_score()
It replaces anv_drm_format_mod_score(). Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
parent
01bad67a94
commit
f665bae4eb
2 changed files with 5 additions and 18 deletions
|
|
@ -731,6 +731,7 @@ get_wsi_format_modifier_properties_list(const struct anv_physical_device *physic
|
|||
VkFormat vk_format,
|
||||
VkDrmFormatModifierPropertiesListEXT *list)
|
||||
{
|
||||
const struct gen_device_info *devinfo = &physical_device->info;
|
||||
const struct anv_format *anv_format = anv_get_format(vk_format);
|
||||
|
||||
VK_OUTARRAY_MAKE(out, list->pDrmFormatModifierProperties,
|
||||
|
|
@ -753,16 +754,14 @@ get_wsi_format_modifier_properties_list(const struct anv_physical_device *physic
|
|||
const struct isl_drm_modifier_info *mod_info =
|
||||
isl_drm_modifier_get_info(modifiers[i]);
|
||||
|
||||
if (!isl_drm_modifier_get_score(devinfo, mod_info->modifier))
|
||||
continue;
|
||||
|
||||
if (mod_info->aux_usage == ISL_AUX_USAGE_CCS_E &&
|
||||
!isl_format_supports_ccs_e(&physical_device->info,
|
||||
anv_format->planes[0].isl_format))
|
||||
continue;
|
||||
|
||||
/* Gen12's CCS layout changes compared to Gen9-11. */
|
||||
if (mod_info->modifier == I915_FORMAT_MOD_Y_TILED_CCS &&
|
||||
physical_device->info.gen >= 12)
|
||||
continue;
|
||||
|
||||
vk_outarray_append(&out, mod_props) {
|
||||
mod_props->drmFormatModifier = modifiers[i];
|
||||
if (isl_drm_modifier_has_aux(modifiers[i]))
|
||||
|
|
|
|||
|
|
@ -651,18 +651,6 @@ make_surface(struct anv_device *device,
|
|||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
score_drm_format_mod(uint64_t modifier)
|
||||
{
|
||||
switch (modifier) {
|
||||
case DRM_FORMAT_MOD_LINEAR: return 1;
|
||||
case I915_FORMAT_MOD_X_TILED: return 2;
|
||||
case I915_FORMAT_MOD_Y_TILED: return 3;
|
||||
case I915_FORMAT_MOD_Y_TILED_CCS: return 4;
|
||||
default: unreachable("bad DRM format modifier");
|
||||
}
|
||||
}
|
||||
|
||||
static const struct isl_drm_modifier_info *
|
||||
choose_drm_format_mod(const struct anv_physical_device *device,
|
||||
uint32_t modifier_count, const uint64_t *modifiers)
|
||||
|
|
@ -671,7 +659,7 @@ choose_drm_format_mod(const struct anv_physical_device *device,
|
|||
uint32_t best_score = 0;
|
||||
|
||||
for (uint32_t i = 0; i < modifier_count; ++i) {
|
||||
uint32_t score = score_drm_format_mod(modifiers[i]);
|
||||
uint32_t score = isl_drm_modifier_get_score(&device->info, modifiers[i]);
|
||||
if (score > best_score) {
|
||||
best_mod = modifiers[i];
|
||||
best_score = score;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue