Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Chung <chiahsuan.chung@amd.com>
To: <igt-dev@lists.freedesktop.org>
Cc: Tom Chung <chiahsuan.chung@amd.com>
Subject: [igt-dev] [PATCH i-g-t 6/8] tests/amdgpu/amd_freesync_video_mode: Move the vrr setting and display reset
Date: Wed, 21 Jun 2023 14:57:31 +0800	[thread overview]
Message-ID: <20230621065733.840316-6-chiahsuan.chung@amd.com> (raw)
In-Reply-To: <20230621065733.840316-1-chiahsuan.chung@amd.com>

[Why]
We don't need to do the display reset and vrr enable/disable in the middle of the test.

[How]
Move the display reset output and vrr enable/disable setting to the begin/end of the test.

Signed-off-by: Tom Chung <chiahsuan.chung@amd.com>
---
 tests/amdgpu/amd_freesync_video_mode.c | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/tests/amdgpu/amd_freesync_video_mode.c b/tests/amdgpu/amd_freesync_video_mode.c
index fd27c39e5..000de4c84 100644
--- a/tests/amdgpu/amd_freesync_video_mode.c
+++ b/tests/amdgpu/amd_freesync_video_mode.c
@@ -552,12 +552,6 @@ static void prepare_test(
 		enum pipe pipe,
 		drmModeModeInfo *mode)
 {
-	/* Reset output */
-	igt_display_reset(&data->display);
-	igt_output_set_pipe(output, pipe);
-
-	igt_output_override_mode(output, mode);
-
 	/* Prepare resources */
 	if (!data->fb_initialized) {
 		int fb_id;
@@ -581,15 +575,11 @@ static void prepare_test(
 		data->fb_initialized = true;
 	}
 
+	/* set output mode */
+	igt_output_override_mode(output, mode);
 	/* Take care of any required modesetting before the test begins. */
 	data->primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
 	igt_plane_set_fb(data->primary, &data->fbs[0]);
-
-	/* Clear vrr_enabled state before enabling it, because
-	 * it might be left enabled if the previous test fails.
-	 */
-	igt_pipe_set_prop_value(&data->display, pipe, IGT_CRTC_VRR_ENABLED, 0);
-
 	igt_display_commit2(&data->display, COMMIT_ATOMIC);
 }
 
@@ -750,7 +740,6 @@ static void init_data(data_t *data, igt_output_t *output) {
 
 static void finish_test(data_t *data, enum pipe pipe, igt_output_t *output)
 {
-	set_vrr_on_pipe(data, pipe, 0);
 	igt_plane_set_fb(data->primary, NULL);
 	igt_output_set_pipe(output, PIPE_NONE);
 	igt_output_override_mode(output, NULL);
@@ -826,6 +815,8 @@ mode_transition(data_t *data, enum pipe pipe, igt_output_t *output, uint32_t sce
 	result = flip_and_measure(data, output, pipe, interval, 2 * NSECS_PER_SEC, ANIM_TYPE_CIRCLE_WAVE);
 	result = flip_and_measure(data, output, pipe, interval, TEST_DURATION_NS, ANIM_TYPE_CIRCLE_WAVE);
 	igt_assert_f(result > 75, "Target refresh rate not meet 75%% (result=%d%%\n", result);
+	set_vrr_on_pipe(data, pipe, false);
+
 	finish_test(data, pipe, output);
 }
 
@@ -847,6 +838,9 @@ run_test(data_t *data, uint32_t scene)
 
 		for_each_pipe(&data->display, pipe)
 			if (igt_pipe_connector_valid(pipe, output)) {
+				igt_display_reset(&data->display);
+				igt_output_set_pipe(output, pipe);
+
 				igt_dynamic_f("pipe-%s-%s",
 					      kmstest_pipe_name(pipe), output->name)
 				mode_transition(data, pipe, output, scene);
-- 
2.34.1

  parent reply	other threads:[~2023-06-21  6:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-21  6:57 [igt-dev] [PATCH i-g-t 1/8] tests/amdgpu/amd_freesync_video_mode: Adjust indents and spacing Tom Chung
2023-06-21  6:57 ` [igt-dev] [PATCH i-g-t 2/8] tests/amdgpu/amd_freesync_video_mode: Fix memory leak and corruption Tom Chung
2023-06-21  6:57 ` [igt-dev] [PATCH i-g-t 3/8] tests/amdgpu/amd_freesync_video_mode: Fix wrong resolution setting during the test Tom Chung
2023-06-21  6:57 ` [igt-dev] [PATCH i-g-t 4/8] tests/amdgpu/amd_freesync_video_mode: Add some code from kms_vrr to resolve tearing issue Tom Chung
2023-06-21  6:57 ` [igt-dev] [PATCH i-g-t 5/8] tests/amdgpu/amd_freesync_video_mode: Add/remove some test progress messages Tom Chung
2023-06-21  6:57 ` Tom Chung [this message]
2023-06-21  6:57 ` [igt-dev] [PATCH i-g-t 7/8] tests/amdgpu/amd_freesync_video_mode: Fix wrong resolution setting for some panel Tom Chung
2023-06-21  6:57 ` [igt-dev] [PATCH i-g-t 8/8] tests/amdgpu/amd_freesync_video_mode: Add amd_freesync_video_mode to meson.build Tom Chung
2023-06-21 14:55 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/8] tests/amdgpu/amd_freesync_video_mode: Adjust indents and spacing Patchwork
2023-06-22  3:34 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2023-06-28 20:57 ` [igt-dev] [PATCH i-g-t 1/8] " Kamil Konieczny
2023-06-28 21:06   ` vitaly prosyak
2023-06-29 10:16   ` Chung, ChiaHsuan (Tom)

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=20230621065733.840316-6-chiahsuan.chung@amd.com \
    --to=chiahsuan.chung@amd.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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