Commit 3e415680 authored by Jonas Ådahl's avatar Jonas Ådahl

kms/update: Add helper to get primary plane assignment

Replaces a private static function, with no functional changes made to
it.

!826
parent 66ae09b6
......@@ -134,24 +134,6 @@ process_plane_property (MetaKmsImpl *impl,
return TRUE;
}
static MetaKmsPlaneAssignment *
get_primary_plane_assignment (MetaKmsImpl *impl,
MetaKmsUpdate *update,
MetaKmsCrtc *crtc)
{
GList *l;
for (l = meta_kms_update_get_plane_assignments (update); l; l = l->next)
{
MetaKmsPlaneAssignment *plane_assignment = l->data;
if (plane_assignment->crtc == crtc)
return plane_assignment;
}
return NULL;
}
static CachedModeSet *
cached_mode_set_new (GList *connectors,
const drmModeModeInfo *drm_mode)
......@@ -222,7 +204,8 @@ process_mode_set (MetaKmsImpl *impl,
&connectors,
&n_connectors);
plane_assignment = get_primary_plane_assignment (impl, update, crtc);
plane_assignment = meta_kms_update_get_primary_plane_assignment (update,
crtc);
if (!plane_assignment)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
......@@ -632,7 +615,8 @@ process_page_flip (MetaKmsImpl *impl,
int ret;
crtc = page_flip->crtc;
plane_assignment = get_primary_plane_assignment (impl, update, crtc);
plane_assignment = meta_kms_update_get_primary_plane_assignment (update,
crtc);
page_flip_data = meta_kms_page_flip_data_new (impl,
crtc,
......
......@@ -97,6 +97,9 @@ void meta_kms_plane_assignment_set_plane_property (MetaKmsPlaneAssignment *plane
uint32_t prop_id,
uint64_t value);
MetaKmsPlaneAssignment * meta_kms_update_get_primary_plane_assignment (MetaKmsUpdate *update,
MetaKmsCrtc *crtc);
GList * meta_kms_update_get_plane_assignments (MetaKmsUpdate *update);
GList * meta_kms_update_get_mode_sets (MetaKmsUpdate *update);
......
......@@ -235,6 +235,23 @@ meta_kms_plane_assignment_set_plane_property (MetaKmsPlaneAssignment *plane_assi
g_list_prepend (plane_assignment->plane_properties, plane_prop);
}
MetaKmsPlaneAssignment *
meta_kms_update_get_primary_plane_assignment (MetaKmsUpdate *update,
MetaKmsCrtc *crtc)
{
GList *l;
for (l = meta_kms_update_get_plane_assignments (update); l; l = l->next)
{
MetaKmsPlaneAssignment *plane_assignment = l->data;
if (plane_assignment->crtc == crtc)
return plane_assignment;
}
return NULL;
}
GList *
meta_kms_update_get_plane_assignments (MetaKmsUpdate *update)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment