[mutter] crtc/kms: Use plane formats if no IN_FORMATS
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] crtc/kms: Use plane formats if no IN_FORMATS
- Date: Wed, 30 Jan 2019 12:58:40 +0000 (UTC)
commit 0789c3fb9f2536b05f6e09cdedbbee1a40b6e089
Author: Pekka Paalanen <pekka paalanen collabora com>
Date: Mon Nov 19 13:20:37 2018 +0200
crtc/kms: Use plane formats if no IN_FORMATS
If the IN_FORMATS property is not found, copy the formats from the DRM
plane instead. This is the fallback for getting a list of formats the
primary plane supports when DRM universal planes capability is enabled.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/341
src/backends/native/meta-crtc-kms.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
---
diff --git a/src/backends/native/meta-crtc-kms.c b/src/backends/native/meta-crtc-kms.c
index 2cc477808..3f423f966 100644
--- a/src/backends/native/meta-crtc-kms.c
+++ b/src/backends/native/meta-crtc-kms.c
@@ -211,6 +211,21 @@ free_modifier_array (GArray *array)
g_array_free (array, TRUE);
}
+static void
+set_formats_from_array (MetaCrtc *crtc,
+ const uint32_t *formats,
+ size_t n_formats)
+{
+ MetaCrtcKms *crtc_kms = crtc->driver_private;
+ size_t i;
+
+ for (i = 0; i < n_formats; i++)
+ {
+ g_hash_table_insert (crtc_kms->formats_modifiers,
+ GUINT_TO_POINTER (formats[i]), NULL);
+ }
+}
+
static void
parse_formats (MetaCrtc *crtc,
int kms_fd,
@@ -372,6 +387,14 @@ init_crtc_rotations (MetaCrtc *crtc,
parse_formats (crtc, kms_fd, props->prop_values[fmts_idx]);
drmModeFreeProperty (prop);
}
+
+ /* fall back to universal plane formats without modifiers */
+ if (g_hash_table_size (crtc_kms->formats_modifiers) == 0)
+ {
+ set_formats_from_array (crtc,
+ drm_plane->formats,
+ drm_plane->count_formats);
+ }
}
if (props)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]