summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2020-04-14 10:41:37 +0200
committerJonas Ådahl <jadahl@gmail.com>2020-04-15 15:29:55 +0000
commitb55e2e1df9674e1f808647149c34f417b6387e66 (patch)
treefc9aca5e6df1728e61afc7c6b45def1ee5506eb7
parent43baf643d4f4ff62939160167ab273b9bc93f5b6 (diff)
downloadmutter-b55e2e1df9674e1f808647149c34f417b6387e66.tar.gz
tests/monitor-unit-tests: Test non-hw-transform rotated tiled monitors
Should affect the assigned transform, but not the layout, as that is the layout on the stage, not the coordinates in any buffer. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1199
-rw-r--r--src/tests/monitor-unit-tests.c194
1 files changed, 194 insertions, 0 deletions
diff --git a/src/tests/monitor-unit-tests.c b/src/tests/monitor-unit-tests.c
index 883de1bd0..13f0f21eb 100644
--- a/src/tests/monitor-unit-tests.c
+++ b/src/tests/monitor-unit-tests.c
@@ -4861,6 +4861,198 @@ meta_test_monitor_custom_second_rotated_tiled_config (void)
}
static void
+meta_test_monitor_custom_second_rotated_nonnative_tiled_config (void)
+{
+ MonitorTestCase test_case = {
+ .setup = {
+ .modes = {
+ {
+ .width = 1024,
+ .height = 768,
+ .refresh_rate = 60.000495910644531
+ },
+ {
+ .width = 400,
+ .height = 600,
+ .refresh_rate = 60.000495910644531
+ }
+ },
+ .n_modes = 2,
+ .outputs = {
+ {
+ .crtc = 0,
+ .modes = { 0 },
+ .n_modes = 1,
+ .preferred_mode = 0,
+ .possible_crtcs = { 0 },
+ .n_possible_crtcs = 1,
+ .width_mm = 222,
+ .height_mm = 125,
+ },
+ {
+ .crtc = -1,
+ .modes = { 1 },
+ .n_modes = 1,
+ .preferred_mode = 1,
+ .possible_crtcs = { 1, 2 },
+ .n_possible_crtcs = 2,
+ .width_mm = 222,
+ .height_mm = 125,
+ .tile_info = {
+ .group_id = 1,
+ .max_h_tiles = 2,
+ .max_v_tiles = 1,
+ .loc_h_tile = 0,
+ .loc_v_tile = 0,
+ .tile_w = 400,
+ .tile_h = 600
+ }
+ },
+ {
+ .crtc = -1,
+ .modes = { 1 },
+ .n_modes = 1,
+ .preferred_mode = 1,
+ .possible_crtcs = { 1, 2 },
+ .n_possible_crtcs = 2,
+ .width_mm = 222,
+ .height_mm = 125,
+ .tile_info = {
+ .group_id = 1,
+ .max_h_tiles = 2,
+ .max_v_tiles = 1,
+ .loc_h_tile = 1,
+ .loc_v_tile = 0,
+ .tile_w = 400,
+ .tile_h = 600
+ }
+ }
+ },
+ .n_outputs = 3,
+ .crtcs = {
+ {
+ .current_mode = -1
+ },
+ {
+ .current_mode = -1
+ },
+ {
+ .current_mode = -1
+ }
+ },
+ .n_crtcs = 3
+ },
+
+ .expect = {
+ .monitors = {
+ {
+ .outputs = { 0 },
+ .n_outputs = 1,
+ .modes = {
+ {
+ .width = 1024,
+ .height = 768,
+ .refresh_rate = 60.000495910644531,
+ .crtc_modes = {
+ {
+ .output = 0,
+ .crtc_mode = 0
+ }
+ }
+ }
+ },
+ .n_modes = 1,
+ .current_mode = 0,
+ .width_mm = 222,
+ .height_mm = 125,
+ },
+ {
+ .outputs = { 1, 2 },
+ .n_outputs = 2,
+ .modes = {
+ {
+ .width = 800,
+ .height = 600,
+ .refresh_rate = 60.000495910644531,
+ .crtc_modes = {
+ {
+ .output = 1,
+ .crtc_mode = 1,
+ },
+ {
+ .output = 2,
+ .crtc_mode = 1,
+ }
+ }
+ }
+ },
+ .n_modes = 1,
+ .current_mode = 0,
+ .width_mm = 222,
+ .height_mm = 125,
+ }
+ },
+ .n_monitors = 2,
+ .logical_monitors = {
+ {
+ .monitors = { 0 },
+ .n_monitors = 1,
+ .layout = { .x = 0, .y = 256, .width = 1024, .height = 768 },
+ .scale = 1
+ },
+ {
+ .monitors = { 1 },
+ .n_monitors = 1,
+ .layout = { .x = 1024, .y = 0, .width = 600, .height = 800 },
+ .scale = 1,
+ .transform = META_MONITOR_TRANSFORM_90
+ }
+ },
+ .n_logical_monitors = 2,
+ .primary_logical_monitor = 0,
+ .n_outputs = 3,
+ .crtcs = {
+ {
+ .current_mode = 0,
+ .y = 256,
+ },
+ {
+ .current_mode = 1,
+ .transform = META_MONITOR_TRANSFORM_NORMAL,
+ .x = 1024,
+ .y = 0,
+ },
+ {
+ .current_mode = 1,
+ .transform = META_MONITOR_TRANSFORM_NORMAL,
+ .x = 1024,
+ .y = 400,
+ }
+ },
+ .n_crtcs = 3,
+ .n_tiled_monitors = 1,
+ .screen_width = 1024 + 600,
+ .screen_height = 1024
+ }
+ };
+ MetaMonitorTestSetup *test_setup;
+ MetaBackend *backend = meta_get_backend ();
+ MetaMonitorManager *monitor_manager =
+ meta_backend_get_monitor_manager (backend);
+ MetaMonitorManagerTest *monitor_manager_test =
+ META_MONITOR_MANAGER_TEST (monitor_manager);
+
+ meta_monitor_manager_test_set_handles_transforms (monitor_manager_test,
+ FALSE);
+
+ test_setup = create_monitor_test_setup (&test_case,
+ MONITOR_TEST_FLAG_NONE);
+ set_custom_monitor_config ("second-rotated-tiled.xml");
+ emulate_hotplug (test_setup);
+ check_monitor_configuration (&test_case);
+}
+
+static void
meta_test_monitor_custom_second_rotated_nonnative_config (void)
{
MonitorTestCase test_case = {
@@ -6094,6 +6286,8 @@ init_monitor_tests (void)
meta_test_monitor_custom_second_rotated_config);
add_monitor_test ("/backends/monitor/custom/second-rotated-tiled-config",
meta_test_monitor_custom_second_rotated_tiled_config);
+ add_monitor_test ("/backends/monitor/custom/second-rotated-nonnative-tiled-config",
+ meta_test_monitor_custom_second_rotated_nonnative_tiled_config);
add_monitor_test ("/backends/monitor/custom/second-rotated-nonnative-config",
meta_test_monitor_custom_second_rotated_nonnative_config);
add_monitor_test ("/backends/monitor/custom/interlaced-config",