[mutter] kms/update: Add helper to get primary plane assignment
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] kms/update: Add helper to get primary plane assignment
- Date: Mon, 7 Oct 2019 15:11:25 +0000 (UTC)
commit 3e41568074d594f80e1383517d4a5f98c0829671
Author: Jonas Ådahl <jadahl gmail com>
Date: Fri Oct 4 11:48:46 2019 +0200
kms/update: Add helper to get primary plane assignment
Replaces a private static function, with no functional changes made to
it.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/826
src/backends/native/meta-kms-impl-simple.c | 24 ++++--------------------
src/backends/native/meta-kms-update-private.h | 3 +++
src/backends/native/meta-kms-update.c | 17 +++++++++++++++++
3 files changed, 24 insertions(+), 20 deletions(-)
---
diff --git a/src/backends/native/meta-kms-impl-simple.c b/src/backends/native/meta-kms-impl-simple.c
index 929dd950a..19c4b2b33 100644
--- a/src/backends/native/meta-kms-impl-simple.c
+++ b/src/backends/native/meta-kms-impl-simple.c
@@ -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,
diff --git a/src/backends/native/meta-kms-update-private.h b/src/backends/native/meta-kms-update-private.h
index fe320e9b3..88e2590af 100644
--- a/src/backends/native/meta-kms-update-private.h
+++ b/src/backends/native/meta-kms-update-private.h
@@ -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);
diff --git a/src/backends/native/meta-kms-update.c b/src/backends/native/meta-kms-update.c
index b6658e7c8..2a4a05c3e 100644
--- a/src/backends/native/meta-kms-update.c
+++ b/src/backends/native/meta-kms-update.c
@@ -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)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]