Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jessica Zhang <quic_jesszhan@quicinc.com>
To: Petri Latvala <adrinael@adrinael.net>,
	Arkadiusz Hiler <arek@hiler.eu>,
	Kamil Konieczny <kamil.konieczny@linux.intel.com>,
	Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
	Bhanuprakash Modem <bhanuprakash.modem@intel.com>,
	Ashutosh Dixit <ashutosh.dixit@intel.com>
Cc: Alex Hung <alex.hung@amd.com>, <quic_abhinavk@quicinc.com>,
	<igt-dev@lists.freedesktop.org>,
	Jessica Zhang <quic_jesszhan@quicinc.com>
Subject: [PATCH i-g-t v4 1/4] tests/kms_writeback: clear writeback properties in teardown path
Date: Wed, 25 Sep 2024 13:37:18 -0700	[thread overview]
Message-ID: <20240925-igt-cwb-v4-1-e516cd1e888e@quicinc.com> (raw)
In-Reply-To: <20240925-igt-cwb-v4-0-e516cd1e888e@quicinc.com>

Drop the WRITEBACK_FB_ID property check and refactor detach_crtc() so
that it properly clears all writeback-related properties before calling
a NULL commit.

The current WRITEBACK_FB_ID check in detach_crtc() will always return 0
due to the return value being hardcoded to 0 in the framework [1].
Because of this, detach_crtc() will never call the NULL commit to clean
up the atomic state.

Since the NULL commit is failing for cases where the WRITEBACK_FB_ID and
OUT_FENCE_PTR haven't been cleared by a non-NULL commit, let's
explicitly clear these properties before calling the NULL commit.

[1] https://elixir.bootlin.com/linux/v6.10.6/source/drivers/gpu/drm/drm_atomic_uapi.c#L853

Fixes: 7c3ceb08b ("tests/kms_writeback: Add helper method to detach pipe from output when test finishes")
Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com>
---
 tests/kms_writeback.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/tests/kms_writeback.c b/tests/kms_writeback.c
index e1d31bb93..4155961a0 100644
--- a/tests/kms_writeback.c
+++ b/tests/kms_writeback.c
@@ -213,15 +213,11 @@ static igt_output_t *kms_writeback_get_output(igt_display_t *display)
 	return NULL;
 }
 
-static uint64_t get_writeback_fb_id(igt_output_t *output)
+static void cleanup_writeback(igt_display_t *display, igt_output_t *output)
 {
-	return igt_output_get_prop(output, IGT_CONNECTOR_WRITEBACK_FB_ID);
-}
-
-static void detach_crtc(igt_display_t *display, igt_output_t *output)
-{
-	if (get_writeback_fb_id(output) == 0)
-		return;
+	igt_output_set_prop_value(output, IGT_CONNECTOR_WRITEBACK_OUT_FENCE_PTR,
+			to_user_pointer(NULL));
+	igt_output_set_writeback_fb(output, NULL);
 
 	igt_output_set_pipe(output, PIPE_NONE);
 	igt_display_commit2(display, COMMIT_ATOMIC);
@@ -726,7 +722,7 @@ igt_main_args("b:c:f:dl", long_options, help_str, opt_handler, NULL)
 	}
 
 	igt_fixture {
-		detach_crtc(&display, output);
+		cleanup_writeback(&display, output);
 		igt_remove_fb(display.drm_fd, &input_fb);
 		igt_remove_fb(display.drm_fd, &input_fb_10bit);
 		igt_display_fini(&display);

-- 
2.34.1


  reply	other threads:[~2024-09-25 20:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-25 20:37 [PATCH i-g-t v4 0/4] tests/kms_writeback: Add clone mode subtest Jessica Zhang
2024-09-25 20:37 ` Jessica Zhang [this message]
2024-09-25 20:46   ` [PATCH i-g-t v4 1/4] tests/kms_writeback: clear writeback properties in teardown path Abhinav Kumar
2024-10-14 13:52     ` Kamil Konieczny
2024-10-14 19:05       ` Abhinav Kumar
2024-09-25 20:37 ` [PATCH i-g-t v4 2/4] lib/igt_kms: Add helper to get encoder index Jessica Zhang
2024-09-25 21:10   ` Abhinav Kumar
2024-09-25 20:37 ` [PATCH i-g-t v4 3/4] lib/igt_kms: loosen duplicate check in igt_display_refresh Jessica Zhang
2024-09-25 21:00   ` Abhinav Kumar
2024-09-25 20:37 ` [PATCH i-g-t v4 4/4] tests/kms_writeback: Add dump for valid clone mode Jessica Zhang
2024-09-25 21:55   ` Abhinav Kumar
2024-10-14 12:32     ` Juha-Pekka Heikkila
2024-09-26  9:20 ` ✗ Fi.CI.BAT: failure for tests/kms_writeback: Add clone mode subtest (rev4) Patchwork
2024-09-26  9:39 ` ✗ CI.xeBAT: " Patchwork
2024-09-27  0:56 ` ✗ CI.xeFULL: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240925-igt-cwb-v4-1-e516cd1e888e@quicinc.com \
    --to=quic_jesszhan@quicinc.com \
    --cc=adrinael@adrinael.net \
    --cc=alex.hung@amd.com \
    --cc=arek@hiler.eu \
    --cc=ashutosh.dixit@intel.com \
    --cc=bhanuprakash.modem@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=juhapekka.heikkila@gmail.com \
    --cc=kamil.konieczny@linux.intel.com \
    --cc=quic_abhinavk@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox