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

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