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

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