monitor-config-manager: Let CRTC assignment transform be logical

This means that it doesn't necessarily mean what transform / rotation
the hardware resource gets, e.g. it instead represents the logical
transform related to the configured mode. This allows us to postpone
checking the plane capabilities until later (as rotation capabilities
depends is a plane property), when a plane has been assigned.

This was in practice already handled when configuring the
transform-via-offscreen case, handled when creating the view, and the
mode setting configuration.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3428>
This commit is contained in:
Jonas Ådahl 2023-11-28 21:35:47 +01:00 committed by Marge Bot
parent 429e65b993
commit 48145a91f9
2 changed files with 4 additions and 11 deletions

View File

@ -177,7 +177,6 @@ assign_monitor_crtc (MetaMonitor *monitor,
MetaCrtc *crtc; MetaCrtc *crtc;
MetaMonitorTransform transform; MetaMonitorTransform transform;
MetaMonitorTransform crtc_transform; MetaMonitorTransform crtc_transform;
MetaMonitorTransform crtc_hw_transform;
int crtc_x, crtc_y; int crtc_x, crtc_y;
float x_offset, y_offset; float x_offset, y_offset;
float scale = 0.0; float scale = 0.0;
@ -209,12 +208,6 @@ assign_monitor_crtc (MetaMonitor *monitor,
transform = data->logical_monitor_config->transform; transform = data->logical_monitor_config->transform;
crtc_transform = meta_monitor_logical_to_crtc_transform (monitor, transform); crtc_transform = meta_monitor_logical_to_crtc_transform (monitor, transform);
if (meta_monitor_manager_is_transform_handled (data->monitor_manager,
crtc,
crtc_transform))
crtc_hw_transform = crtc_transform;
else
crtc_hw_transform = META_MONITOR_TRANSFORM_NORMAL;
meta_monitor_calculate_crtc_pos (monitor, mode, output, crtc_transform, meta_monitor_calculate_crtc_pos (monitor, mode, output, crtc_transform,
&crtc_x, &crtc_y); &crtc_x, &crtc_y);
@ -256,7 +249,7 @@ assign_monitor_crtc (MetaMonitor *monitor,
.crtc = crtc, .crtc = crtc,
.mode = crtc_mode, .mode = crtc_mode,
.layout = crtc_layout, .layout = crtc_layout,
.transform = crtc_hw_transform, .transform = crtc_transform,
.outputs = g_ptr_array_new () .outputs = g_ptr_array_new ()
}; };
g_ptr_array_add (crtc_assignment->outputs, output); g_ptr_array_add (crtc_assignment->outputs, output);

View File

@ -7380,13 +7380,13 @@ meta_test_monitor_custom_second_rotated_nonnative_tiled_config (void)
}, },
{ {
.current_mode = 1, .current_mode = 1,
.transform = META_MONITOR_TRANSFORM_NORMAL, .transform = META_MONITOR_TRANSFORM_90,
.x = 1024, .x = 1024,
.y = 0, .y = 0,
}, },
{ {
.current_mode = 1, .current_mode = 1,
.transform = META_MONITOR_TRANSFORM_NORMAL, .transform = META_MONITOR_TRANSFORM_90,
.x = 1024, .x = 1024,
.y = 400, .y = 400,
} }
@ -7538,7 +7538,7 @@ meta_test_monitor_custom_second_rotated_nonnative_config (void)
}, },
{ {
.current_mode = 0, .current_mode = 0,
.transform = META_MONITOR_TRANSFORM_NORMAL, .transform = META_MONITOR_TRANSFORM_90,
.x = 1024, .x = 1024,
} }
}, },