Blame SOURCES/0001-renderer-native-Check-calculated-transform-when-crea.patch

41c151
From 91c5c94434b22895f97b3ae47a889ccb902b86aa Mon Sep 17 00:00:00 2001
41c151
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
41c151
Date: Mon, 23 Jul 2018 21:36:57 +0200
41c151
Subject: [PATCH] renderer/native: Check calculated transform when creating
41c151
 view
41c151
41c151
The "backends: Move MetaOutput::crtc field into private struct"
41c151
accidentally changed the view transform calculation code to assume that
41c151
"MetaCrtc::transform" corresponds to the transform of the CRTC; so is
41c151
not the case yet; one must calculate the transform from the logical
41c151
monitor, and check whether it is supported by the CRTC using
41c151
meta_monitor_manager_is_transform_handled(). This commit restores the
41c151
old behaviour that doesn't use MetaCrtc::transform when calculating the
41c151
view transform.
41c151
41c151
Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/216
41c151
---
41c151
 src/backends/native/meta-renderer-native.c         | 9 +++++++--
41c151
 src/backends/x11/nested/meta-renderer-x11-nested.c | 8 ++++++--
41c151
 2 files changed, 13 insertions(+), 4 deletions(-)
41c151
41c151
diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c
41c151
index fc6b223026..8dc0da7104 100644
41c151
--- a/src/backends/native/meta-renderer-native.c
41c151
+++ b/src/backends/native/meta-renderer-native.c
41c151
@@ -2720,9 +2720,14 @@ calculate_view_transform (MetaMonitorManager *monitor_manager,
41c151
   MetaMonitor *main_monitor;
41c151
   MetaOutput *main_output;
41c151
   MetaCrtc *crtc;
41c151
+  MetaMonitorTransform crtc_transform;
41c151
+
41c151
   main_monitor = meta_logical_monitor_get_monitors (logical_monitor)->data;
41c151
   main_output = meta_monitor_get_main_output (main_monitor);
41c151
   crtc = meta_output_get_assigned_crtc (main_output);
41c151
+  crtc_transform =
41c151
+    meta_monitor_logical_to_crtc_transform (main_monitor,
41c151
+                                            logical_monitor->transform);
41c151
 
41c151
   /*
41c151
    * Pick any monitor and output and check; all CRTCs of a logical monitor will
41c151
@@ -2731,10 +2736,10 @@ calculate_view_transform (MetaMonitorManager *monitor_manager,
41c151
 
41c151
   if (meta_monitor_manager_is_transform_handled (monitor_manager,
41c151
                                                  crtc,
41c151
-                                                 crtc->transform))
41c151
+                                                 crtc_transform))
41c151
     return META_MONITOR_TRANSFORM_NORMAL;
41c151
   else
41c151
-    return crtc->transform;
41c151
+    return crtc_transform;
41c151
 }
41c151
 
41c151
 static MetaRendererView *
41c151
diff --git a/src/backends/x11/nested/meta-renderer-x11-nested.c b/src/backends/x11/nested/meta-renderer-x11-nested.c
41c151
index 8fdf46b0b5..b29b9c69e2 100644
41c151
--- a/src/backends/x11/nested/meta-renderer-x11-nested.c
41c151
+++ b/src/backends/x11/nested/meta-renderer-x11-nested.c
41c151
@@ -51,10 +51,14 @@ calculate_view_transform (MetaMonitorManager *monitor_manager,
41c151
   MetaMonitor *main_monitor;
41c151
   MetaOutput *main_output;
41c151
   MetaCrtc *crtc;
41c151
+  MetaMonitorTransform crtc_transform;
41c151
 
41c151
   main_monitor = meta_logical_monitor_get_monitors (logical_monitor)->data;
41c151
   main_output = meta_monitor_get_main_output (main_monitor);
41c151
   crtc = meta_output_get_assigned_crtc (main_output);
41c151
+  crtc_transform =
41c151
+    meta_monitor_logical_to_crtc_transform (main_monitor,
41c151
+                                            logical_monitor->transform);
41c151
   /*
41c151
    * Pick any monitor and output and check; all CRTCs of a logical monitor will
41c151
    * always have the same transform assigned to them.
41c151
@@ -62,10 +66,10 @@ calculate_view_transform (MetaMonitorManager *monitor_manager,
41c151
 
41c151
   if (meta_monitor_manager_is_transform_handled (monitor_manager,
41c151
                                                  crtc,
41c151
-                                                 crtc->transform))
41c151
+                                                 crtc_transform))
41c151
     return META_MONITOR_TRANSFORM_NORMAL;
41c151
   else
41c151
-    return crtc->transform;
41c151
+    return crtc_transform;
41c151
 }
41c151
 
41c151
 static MetaRendererView *
41c151
-- 
41c151
2.17.1
41c151