From e3dab707542cf3e528e4b4aa816d39e5cab0360a Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 7 Oct 2016 16:52:43 +0200 Subject: [PATCH] backends: Use fallback rotation if native DRM plane rotation failed Blacklist the HW mode so we fallback gracefully to our own paths. https://bugzilla.gnome.org/show_bug.cgi?id=772512 --- src/backends/native/meta-monitor-manager-kms.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/backends/native/meta-monitor-manager-kms.c b/src/backends/native/meta-monitor-manager-kms.c index 2db7495e5..9daa0105d 100644 --- a/src/backends/native/meta-monitor-manager-kms.c +++ b/src/backends/native/meta-monitor-manager-kms.c @@ -1357,11 +1357,19 @@ meta_monitor_manager_kms_apply_configuration (MetaMonitorManager *manager, else hw_transform = META_MONITOR_TRANSFORM_NORMAL; - drmModeObjectSetProperty (manager_kms->fd, - crtc_kms->primary_plane_id, - DRM_MODE_OBJECT_PLANE, - crtc_kms->rotation_prop_id, - crtc_kms->rotation_map[hw_transform]); + if (drmModeObjectSetProperty (manager_kms->fd, + crtc_kms->primary_plane_id, + DRM_MODE_OBJECT_PLANE, + crtc_kms->rotation_prop_id, + crtc_kms->rotation_map[hw_transform]) != 0) + { + g_warning ("Failed to apply DRM plane transform: %m", hw_transform); + + /* Blacklist this HW transform, we want to fallback to our + * fallbacks in this case. + */ + crtc_kms->all_hw_transforms &= ~(1 << hw_transform); + } } /* Disable CRTCs not mentioned in the list (they have is_dirty == FALSE, because they weren't seen in the first loop) */