monitor: Add foreach output helper and fix foreach crtc helper

The foreach CRTC monitor mode helper incorrectly iterated over outputs
without CRTC when non-tiled modes were set on tiled monitors. This was
not expected by callers, so fix the helper to only iterate over active
outputs (that has or should have a CRTC).

The test cases uses the incorrect behaviour of the foreach CRTC helper
to check that the disabled outputs mode are set to NULL, so add a
foreach output helper and change the tests to use that instead.

https://bugzilla.gnome.org/show_bug.cgi?id=730551
This commit is contained in:
Jonas Ådahl
2017-08-18 14:04:02 +08:00
parent be11c32815
commit 522eec00cd
3 changed files with 40 additions and 8 deletions

View File

@ -659,10 +659,10 @@ check_monitor_configuration (MonitorTestCase *test_case)
.expect_crtc_mode_iter =
test_case->expect.monitors[i].modes[j].crtc_modes
};
meta_monitor_mode_foreach_crtc (monitor, mode,
check_monitor_mode,
&data,
NULL);
meta_monitor_mode_foreach_output (monitor, mode,
check_monitor_mode,
&data,
NULL);
}
current_mode = meta_monitor_get_current_mode (monitor);
@ -688,10 +688,10 @@ check_monitor_configuration (MonitorTestCase *test_case)
.expect_crtc_mode_iter =
test_case->expect.monitors[i].modes[expected_current_mode_index].crtc_modes
};
meta_monitor_mode_foreach_crtc (monitor, expected_current_mode,
check_current_monitor_mode,
&data,
NULL);
meta_monitor_mode_foreach_output (monitor, expected_current_mode,
check_current_monitor_mode,
&data,
NULL);
}
meta_monitor_derive_current_mode (monitor);