onscreen/native: Simplify get_supported_kms_modifiers()

This code doesn't work like the comment suggest, it simply creates a
copy of the modifiers.

Remove the unused code.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4168>
This commit is contained in:
José Expósito 2024-12-05 13:03:59 +01:00 committed by Marge Bot
parent 18fbea0b03
commit 64847aa50f

View File

@ -2050,9 +2050,7 @@ get_supported_kms_modifiers (MetaCrtcKms *crtc_kms,
uint32_t format)
{
MetaKmsPlane *plane = meta_crtc_kms_get_assigned_primary_plane (crtc_kms);
GArray *modifiers;
GArray *crtc_mods;
unsigned int i;
g_return_val_if_fail (plane, NULL);
@ -2060,26 +2058,7 @@ get_supported_kms_modifiers (MetaCrtcKms *crtc_kms,
if (!crtc_mods)
return NULL;
modifiers = g_array_new (FALSE, FALSE, sizeof (uint64_t));
/*
* For each modifier from base_crtc, check if it's available on all other
* CRTCs.
*/
for (i = 0; i < crtc_mods->len; i++)
{
uint64_t modifier = g_array_index (crtc_mods, uint64_t, i);
g_array_append_val (modifiers, modifier);
}
if (modifiers->len == 0)
{
g_array_free (modifiers, TRUE);
return NULL;
}
return modifiers;
return g_array_copy (crtc_mods);
}
static GArray *