summaryrefslogtreecommitdiff
path: root/tests/kms_rmfb.c
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2016-06-28 14:28:20 +0200
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2016-06-29 14:57:11 +0200
commit4a1859781f154513f19cd6392e04f50dbe6c030a (patch)
treeda14cdfd797fff62301fa0423532f51b02bd589f /tests/kms_rmfb.c
parentd31b9b307f164668ddd23da6bef619c002e75a14 (diff)
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 <maarten.lankhorst@linux.intel.com>
Diffstat (limited to 'tests/kms_rmfb.c')
-rw-r--r--tests/kms_rmfb.c10
1 files changed, 8 insertions, 2 deletions
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;
}