From 4a1859781f154513f19cd6392e04f50dbe6c030a Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Tue, 28 Jun 2016 14:28:20 +0200 Subject: igt_kms: Add modeset support for atomic style commits. All pipes are now updated in the loop first, before connectors are read out. The mode_id and active crtc properties are added, and crtc_id for connectors. These are required to do a modeset, and the behavior during atomic commits is changed slightly too. A lot of code will do the following: - Init. - igt_output_set_pipe(output, pipe); - commit. Since legacy setcrtc and atomic commit differ, there are some differences in how we commit pipes and connectors too. For atomic we set output->crtc during igt_output_set_pipe, and use it in atomic commit. This may be set to NULL, in which case the output is disconnected from the crtc. Unlike legacy we won't attempt to bind all connectors to all pipes, only the ones that were explicitly set. As a test, convert kms_rmfb.c Signed-off-by: Maarten Lankhorst --- tests/kms_rmfb.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tests/kms_rmfb.c') diff --git a/tests/kms_rmfb.c b/tests/kms_rmfb.c index 89aa3232..d6ad41fe 100644 --- a/tests/kms_rmfb.c +++ b/tests/kms_rmfb.c @@ -60,7 +60,7 @@ test_rmfb(struct rmfb_data *data, igt_output_t *output, enum pipe pipe, bool reo uint64_t cursor_width, cursor_height; igt_output_set_pipe(output, pipe); - igt_display_commit(&data->display); + igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY); if (!output->valid) { igt_output_set_pipe(output, PIPE_ANY); @@ -129,10 +129,16 @@ test_rmfb(struct rmfb_data *data, igt_output_t *output, enum pipe pipe, bool reo igt_assert_eq(planeres->fb_id, 0); drmModeFreePlane(planeres); + igt_plane_set_fb(plane, NULL); } + for_each_pipe(&data->display, pipe) + data->display.pipes[pipe].mode_id = 0; + igt_output_set_pipe(output, PIPE_ANY); - igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_UNIVERSAL); + + if (!data->display.is_atomic) + igt_display_commit2(&data->display, COMMIT_UNIVERSAL); return true; } -- cgit v1.2.3