crtc-kms: Get rid of meta_crtc_kms_get_modifiers

Instead get the assigned primary plane and use
meta_kms_plane_get_modifiers_for_format.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3512>
This commit is contained in:
Sebastian Wick
2024-01-10 15:00:44 +01:00
committed by Robert Mader
parent 2fda8ae6d9
commit 60fd80b616
4 changed files with 9 additions and 29 deletions

View File

@ -428,30 +428,6 @@ meta_crtc_kms_get_kms_crtc (MetaCrtcKms *crtc_kms)
return crtc_kms->kms_crtc;
}
/**
* meta_crtc_kms_get_modifiers:
* @crtc_kms: a #MetaCrtc object that has to be a #MetaCrtcKms
* @format: a DRM pixel format
*
* Returns a pointer to a #GArray containing all the supported
* modifiers for the given DRM pixel format on the CRTC's primary
* plane. The array element type is uint64_t.
*
* The caller must not modify or destroy the array or its contents.
*
* Returns NULL if the modifiers are not known or the format is not
* supported.
*/
GArray *
meta_crtc_kms_get_modifiers (MetaCrtcKms *crtc_kms,
uint32_t format)
{
g_return_val_if_fail (crtc_kms->assigned_primary_plane, NULL);
return meta_kms_plane_get_modifiers_for_format (crtc_kms->assigned_primary_plane,
format);
}
/**
* meta_crtc_kms_supports_format:
* @crtc_kms: a #MetaCrtcKms

View File

@ -47,9 +47,6 @@ void meta_crtc_kms_set_mode (MetaCrtcKms *crtc_kms,
META_EXPORT_TEST
MetaKmsCrtc * meta_crtc_kms_get_kms_crtc (MetaCrtcKms *crtc_kms);
GArray * meta_crtc_kms_get_modifiers (MetaCrtcKms *crtc_kms,
uint32_t format);
gboolean
meta_crtc_kms_supports_format (MetaCrtcKms *crtc_kms,
uint32_t drm_format);

View File

@ -1801,11 +1801,14 @@ static GArray *
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;
crtc_mods = meta_crtc_kms_get_modifiers (crtc_kms, format);
g_return_val_if_fail (plane, NULL);
crtc_mods = meta_kms_plane_get_modifiers_for_format (plane, format);
if (!crtc_mods)
return NULL;