tests: Check that mirroring is configured properly
This test checks that mirroring works when using separate CRTCs. It does not check cloning. https://bugzilla.gnome.org/show_bug.cgi?id=777732
This commit is contained in:
parent
4e17017501
commit
4e03e89869
35
src/tests/monitor-configs/mirrored.xml
Normal file
35
src/tests/monitor-configs/mirrored.xml
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<monitors version="2">
|
||||||
|
<configuration>
|
||||||
|
<logicalmonitor>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<primary>yes</primary>
|
||||||
|
<monitor>
|
||||||
|
<monitorspec>
|
||||||
|
<connector>DP-1</connector>
|
||||||
|
<vendor>MetaProduct's Inc.</vendor>
|
||||||
|
<product>MetaMonitor</product>
|
||||||
|
<serial>0x123456</serial>
|
||||||
|
</monitorspec>
|
||||||
|
<mode>
|
||||||
|
<width>800</width>
|
||||||
|
<height>600</height>
|
||||||
|
<rate>60.000495910644531</rate>
|
||||||
|
</mode>
|
||||||
|
</monitor>
|
||||||
|
<monitor>
|
||||||
|
<monitorspec>
|
||||||
|
<connector>DP-2</connector>
|
||||||
|
<vendor>MetaProduct's Inc.</vendor>
|
||||||
|
<product>MetaMonitor</product>
|
||||||
|
<serial>0x123456</serial>
|
||||||
|
</monitorspec>
|
||||||
|
<mode>
|
||||||
|
<width>800</width>
|
||||||
|
<height>600</height>
|
||||||
|
<rate>60.000495910644531</rate>
|
||||||
|
</mode>
|
||||||
|
</monitor>
|
||||||
|
</logicalmonitor>
|
||||||
|
</configuration>
|
||||||
|
</monitors>
|
@ -511,6 +511,66 @@ meta_test_monitor_store_scale (void)
|
|||||||
check_monitor_configurations (&expect);
|
check_monitor_configurations (&expect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
meta_test_monitor_store_mirrored (void)
|
||||||
|
{
|
||||||
|
MonitorStoreTestExpect expect = {
|
||||||
|
.configurations = {
|
||||||
|
{
|
||||||
|
.logical_monitors = {
|
||||||
|
{
|
||||||
|
.layout = {
|
||||||
|
.x = 0,
|
||||||
|
.y = 0,
|
||||||
|
.width = 800,
|
||||||
|
.height = 600
|
||||||
|
},
|
||||||
|
.scale = 1,
|
||||||
|
.is_primary = TRUE,
|
||||||
|
.monitors = {
|
||||||
|
{
|
||||||
|
.connector = "DP-1",
|
||||||
|
.vendor = "MetaProduct's Inc.",
|
||||||
|
.product = "MetaMonitor",
|
||||||
|
.serial = "0x123456",
|
||||||
|
.mode = {
|
||||||
|
.width = 800,
|
||||||
|
.height = 600,
|
||||||
|
.refresh_rate = 60.000495910644531
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.connector = "DP-2",
|
||||||
|
.vendor = "MetaProduct's Inc.",
|
||||||
|
.product = "MetaMonitor",
|
||||||
|
.serial = "0x123456",
|
||||||
|
.mode = {
|
||||||
|
.width = 800,
|
||||||
|
.height = 600,
|
||||||
|
.refresh_rate = 60.000495910644531
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
.n_monitors = 2,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
.n_logical_monitors = 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
.n_configurations = 1
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!is_using_monitor_config_manager ())
|
||||||
|
{
|
||||||
|
g_test_skip ("Not using MetaMonitorConfigManager");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
set_custom_monitor_config ("mirrored.xml");
|
||||||
|
|
||||||
|
check_monitor_configurations (&expect);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
init_monitor_store_tests (void)
|
init_monitor_store_tests (void)
|
||||||
{
|
{
|
||||||
@ -524,4 +584,6 @@ init_monitor_store_tests (void)
|
|||||||
meta_test_monitor_store_underscanning);
|
meta_test_monitor_store_underscanning);
|
||||||
g_test_add_func ("/backends/monitor-store/scale",
|
g_test_add_func ("/backends/monitor-store/scale",
|
||||||
meta_test_monitor_store_scale);
|
meta_test_monitor_store_scale);
|
||||||
|
g_test_add_func ("/backends/monitor-store/mirrored",
|
||||||
|
meta_test_monitor_store_mirrored);
|
||||||
}
|
}
|
||||||
|
@ -2860,6 +2860,138 @@ meta_test_monitor_custom_tiled_config (void)
|
|||||||
check_monitor_configuration (&test_case);
|
check_monitor_configuration (&test_case);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
meta_test_monitor_custom_mirrored_config (void)
|
||||||
|
{
|
||||||
|
MonitorTestCase test_case = {
|
||||||
|
.setup = {
|
||||||
|
.modes = {
|
||||||
|
{
|
||||||
|
.width = 800,
|
||||||
|
.height = 600,
|
||||||
|
.refresh_rate = 60.000495910644531
|
||||||
|
}
|
||||||
|
},
|
||||||
|
.n_modes = 1,
|
||||||
|
.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 = { 0 },
|
||||||
|
.n_modes = 1,
|
||||||
|
.preferred_mode = 0,
|
||||||
|
.possible_crtcs = { 1 },
|
||||||
|
.n_possible_crtcs = 1,
|
||||||
|
.width_mm = 220,
|
||||||
|
.height_mm = 124
|
||||||
|
}
|
||||||
|
},
|
||||||
|
.n_outputs = 2,
|
||||||
|
.crtcs = {
|
||||||
|
{
|
||||||
|
.current_mode = 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.current_mode = 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
.n_crtcs = 2
|
||||||
|
},
|
||||||
|
|
||||||
|
.expect = {
|
||||||
|
.monitors = {
|
||||||
|
{
|
||||||
|
.outputs = { 0 },
|
||||||
|
.n_outputs = 1,
|
||||||
|
.modes = {
|
||||||
|
{
|
||||||
|
.width = 800,
|
||||||
|
.height = 600,
|
||||||
|
.crtc_modes = {
|
||||||
|
{
|
||||||
|
.output = 0,
|
||||||
|
.crtc_mode = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
.n_modes = 1,
|
||||||
|
.current_mode = 0,
|
||||||
|
.width_mm = 222,
|
||||||
|
.height_mm = 125
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.outputs = { 1 },
|
||||||
|
.n_outputs = 1,
|
||||||
|
.modes = {
|
||||||
|
{
|
||||||
|
.width = 800,
|
||||||
|
.height = 600,
|
||||||
|
.crtc_modes = {
|
||||||
|
{
|
||||||
|
.output = 1,
|
||||||
|
.crtc_mode = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
.n_modes = 1,
|
||||||
|
.current_mode = 0,
|
||||||
|
.width_mm = 220,
|
||||||
|
.height_mm = 124
|
||||||
|
}
|
||||||
|
},
|
||||||
|
.n_monitors = 2,
|
||||||
|
.logical_monitors = {
|
||||||
|
{
|
||||||
|
.monitors = { 0, 1 },
|
||||||
|
.n_monitors = 2,
|
||||||
|
.layout = { .x = 0, .y = 0, .width = 800, .height = 600 },
|
||||||
|
.scale = 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
.n_logical_monitors = 1,
|
||||||
|
.primary_logical_monitor = 0,
|
||||||
|
.n_outputs = 2,
|
||||||
|
.crtcs = {
|
||||||
|
{
|
||||||
|
.current_mode = 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.current_mode = 0,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
.n_crtcs = 2,
|
||||||
|
.n_tiled_monitors = 0,
|
||||||
|
.screen_width = 800,
|
||||||
|
.screen_height = 600
|
||||||
|
}
|
||||||
|
};
|
||||||
|
MetaMonitorTestSetup *test_setup;
|
||||||
|
|
||||||
|
if (!is_using_monitor_config_manager ())
|
||||||
|
{
|
||||||
|
g_test_skip ("Not using MetaMonitorConfigManager");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
test_setup = create_monitor_test_setup (&test_case,
|
||||||
|
MONITOR_TEST_FLAG_NONE);
|
||||||
|
set_custom_monitor_config ("mirrored.xml");
|
||||||
|
emulate_hotplug (test_setup);
|
||||||
|
|
||||||
|
check_monitor_configuration (&test_case);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
init_monitor_tests (void)
|
init_monitor_tests (void)
|
||||||
{
|
{
|
||||||
@ -2906,4 +3038,6 @@ init_monitor_tests (void)
|
|||||||
meta_test_monitor_custom_scale_config);
|
meta_test_monitor_custom_scale_config);
|
||||||
g_test_add_func ("/backends/monitor/custom/tiled-config",
|
g_test_add_func ("/backends/monitor/custom/tiled-config",
|
||||||
meta_test_monitor_custom_tiled_config);
|
meta_test_monitor_custom_tiled_config);
|
||||||
|
g_test_add_func ("/backends/monitor/custom/mirrored-config",
|
||||||
|
meta_test_monitor_custom_mirrored_config);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user