[igt-dev] [PATCH i-g-t v1] tests/kms_writeback: Add helper method to detach pipe from output when test finishes

Jessica Zhang quic_jesszhan at quicinc.com
Fri May 13 23:48:38 UTC 2022


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 at quicinc.com>
---
 tests/kms_writeback.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/kms_writeback.c b/tests/kms_writeback.c
index 21d62faabf6b..b6c815db413c 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);
 	}
-- 
2.31.0



More information about the igt-dev mailing list