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)