renderer/native: Check calculated transform when creating view

The "backends: Move MetaOutput::crtc field into private struct"
accidentally changed the view transform calculation code to assume that
"MetaCrtc::transform" corresponds to the transform of the CRTC; so is
not the case yet; one must calculate the transform from the logical
monitor, and check whether it is supported by the CRTC using
meta_monitor_manager_is_transform_handled(). This commit restores the
old behaviour that doesn't use MetaCrtc::transform when calculating the
view transform.

Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/216
This commit is contained in:
Jonas Ådahl 2018-07-23 21:36:57 +02:00
parent 0d134522d8
commit ce3278b4b7
2 changed files with 13 additions and 4 deletions

View File

@ -2731,9 +2731,14 @@ calculate_view_transform (MetaMonitorManager *monitor_manager,
MetaMonitor *main_monitor; MetaMonitor *main_monitor;
MetaOutput *main_output; MetaOutput *main_output;
MetaCrtc *crtc; MetaCrtc *crtc;
MetaMonitorTransform crtc_transform;
main_monitor = meta_logical_monitor_get_monitors (logical_monitor)->data; main_monitor = meta_logical_monitor_get_monitors (logical_monitor)->data;
main_output = meta_monitor_get_main_output (main_monitor); main_output = meta_monitor_get_main_output (main_monitor);
crtc = meta_output_get_assigned_crtc (main_output); crtc = meta_output_get_assigned_crtc (main_output);
crtc_transform =
meta_monitor_logical_to_crtc_transform (main_monitor,
logical_monitor->transform);
/* /*
* Pick any monitor and output and check; all CRTCs of a logical monitor will * Pick any monitor and output and check; all CRTCs of a logical monitor will
@ -2742,10 +2747,10 @@ calculate_view_transform (MetaMonitorManager *monitor_manager,
if (meta_monitor_manager_is_transform_handled (monitor_manager, if (meta_monitor_manager_is_transform_handled (monitor_manager,
crtc, crtc,
crtc->transform)) crtc_transform))
return META_MONITOR_TRANSFORM_NORMAL; return META_MONITOR_TRANSFORM_NORMAL;
else else
return crtc->transform; return crtc_transform;
} }
static MetaRendererView * static MetaRendererView *

View File

@ -51,10 +51,14 @@ calculate_view_transform (MetaMonitorManager *monitor_manager,
MetaMonitor *main_monitor; MetaMonitor *main_monitor;
MetaOutput *main_output; MetaOutput *main_output;
MetaCrtc *crtc; MetaCrtc *crtc;
MetaMonitorTransform crtc_transform;
main_monitor = meta_logical_monitor_get_monitors (logical_monitor)->data; main_monitor = meta_logical_monitor_get_monitors (logical_monitor)->data;
main_output = meta_monitor_get_main_output (main_monitor); main_output = meta_monitor_get_main_output (main_monitor);
crtc = meta_output_get_assigned_crtc (main_output); crtc = meta_output_get_assigned_crtc (main_output);
crtc_transform =
meta_monitor_logical_to_crtc_transform (main_monitor,
logical_monitor->transform);
/* /*
* Pick any monitor and output and check; all CRTCs of a logical monitor will * Pick any monitor and output and check; all CRTCs of a logical monitor will
* always have the same transform assigned to them. * always have the same transform assigned to them.
@ -62,10 +66,10 @@ calculate_view_transform (MetaMonitorManager *monitor_manager,
if (meta_monitor_manager_is_transform_handled (monitor_manager, if (meta_monitor_manager_is_transform_handled (monitor_manager,
crtc, crtc,
crtc->transform)) crtc_transform))
return META_MONITOR_TRANSFORM_NORMAL; return META_MONITOR_TRANSFORM_NORMAL;
else else
return crtc->transform; return crtc_transform;
} }
static MetaRendererView * static MetaRendererView *