summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJessica Zhang <quic_jesszhan@quicinc.com>2022-05-13 16:48:38 -0700
committerAbhinav Kumar <quic_abhinavk@quicinc.com>2022-05-17 15:58:27 -0700
commit7c3ceb08b633a66f77f42e596593de394da5dccc (patch)
tree5d3ec04419dea2e078be73bef72f650812f13c26
parent70cfef35851891aeaa829f5e8dcb7fd43b454bde (diff)
tests/kms_writeback: Add helper method to detach pipe from output when test finishes
Currently, after a writeback test is run, the writeback connecter doesn't release the pipe for other connecters to use. This can cause the device to crash if another connector tries to use the same pipe (for other IGT tests, for example). In addition, a slight change [1] to DRM's implementation of the rmfb ioctl means that calling igt_remove_fb() alone will not detach the CRTC -- instead, an explicit disable will be needed to do that. [1] https://gitlab.freedesktop.org/drm/msm/-/blob/msm-next/drivers/gpu/drm/drm_framebuffer.c#L997 Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
-rw-r--r--tests/kms_writeback.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/kms_writeback.c b/tests/kms_writeback.c
index 21d62faa..b6c815db 100644
--- a/tests/kms_writeback.c
+++ b/tests/kms_writeback.c
@@ -139,6 +139,11 @@ static igt_output_t *kms_writeback_get_output(igt_display_t *display)
return NULL;
}
+static void detach_crtc(igt_display_t *display, igt_output_t *output) {
+ igt_output_set_pipe(output, PIPE_NONE);
+ igt_display_commit2(display, COMMIT_ATOMIC);
+}
+
static void check_writeback_fb_id(igt_output_t *output)
{
uint64_t check_fb_id;
@@ -449,6 +454,7 @@ igt_main
}
igt_fixture {
+ detach_crtc(&display, output);
igt_remove_fb(display.drm_fd, &input_fb);
igt_display_fini(&display);
}