From 64847aa50f8b6a0663b16af63ad2463172200d0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= Date: Thu, 5 Dec 2024 13:03:59 +0100 Subject: [PATCH] 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: --- src/backends/native/meta-onscreen-native.c | 23 +--------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/src/backends/native/meta-onscreen-native.c b/src/backends/native/meta-onscreen-native.c index 4691a1059..1a8783adb 100644 --- a/src/backends/native/meta-onscreen-native.c +++ b/src/backends/native/meta-onscreen-native.c @@ -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 *