Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Naladala Ramanaidu <ramanaidu.naladala@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: suraj.kandpal@intel.com, jeevan.b@intel.com,
	Naladala Ramanaidu <ramanaidu.naladala@intel.com>
Subject: [PATCH i-g-t v4 1/4] tests/intel/kms_pm_dc: Update VRR handling and eDP output check
Date: Mon, 12 Aug 2024 01:33:56 +0530	[thread overview]
Message-ID: <20240811200359.1086166-2-ramanaidu.naladala@intel.com> (raw)
In-Reply-To: <20240811200359.1086166-1-ramanaidu.naladala@intel.com>

It should be enhance the test_deep_pkgc_state function to include
the following changes:
- Removed the unused variable `vrr_supported` to clean up the code.
- Added a check for the eDP connector to ensure proper connector handling.
- Updated VRR handling to disable VRR and commit atomic changes.
- Modified the delay calculation for connector modes to ensure proper
  vblank time.
- Removed redundant VRR capability check and skip logic.

v2: Correct indentation and update comments. (Suraj, Jeevan)
v3: Update Commit subject/message. (Kamil)
v4: Update commit subject/message. (Suraj)

Signed-off-by: Naladala Ramanaidu <ramanaidu.naladala@intel.com>
---
 tests/intel/kms_pm_dc.c | 34 +++++++++++++++++++++++++---------
 1 file changed, 25 insertions(+), 9 deletions(-)

diff --git a/tests/intel/kms_pm_dc.c b/tests/intel/kms_pm_dc.c
index 1aef1e02d..367bf4303 100644
--- a/tests/intel/kms_pm_dc.c
+++ b/tests/intel/kms_pm_dc.c
@@ -594,36 +594,52 @@ static void test_deep_pkgc_state(data_t *data)
 	time_t start = time(NULL), duration = 2, delay;
 	enum pipe pipe;
 	bool pkgc_flag = false;
-	bool vrr_supported = false, flip = true;
+	bool flip = true;
 
 	igt_display_t *display = &data->display;
 	igt_plane_t *primary;
 	igt_output_t *output = NULL;
 
 	for_each_pipe_with_valid_output(display, pipe, output) {
+		if (output->config.connector->connector_type != DRM_MODE_CONNECTOR_eDP)
+			igt_skip("No eDP output found, skipping the test.\n");
+
 		/* Check VRR capabilities before setting up */
 		if (igt_output_has_prop(output, IGT_CONNECTOR_VRR_CAPABLE) &&
 		    igt_output_get_prop(output, IGT_CONNECTOR_VRR_CAPABLE)) {
-			vrr_supported = true;
+			/*
+			 * TODO: Add check for vmin = vmax = flipline if VRR enabled.
+			 * KMD patches still under review. Need to wait till KMD
+			 * patches merge.
+			 */
+			igt_pipe_set_prop_value(display, pipe,
+						IGT_CRTC_VRR_ENABLED, false);
+			igt_assert(igt_display_try_commit_atomic(display,
+								 DRM_MODE_ATOMIC_ALLOW_MODESET,
+								 NULL) == 0);
 			break;
 		}
 	}
 
-	/* Skip the test if no VRR capable output is found */
-	igt_skip_on_f(!vrr_supported,
-		      "No VRR capable output found, skipping the test.\n");
-
 	igt_display_reset(display);
-
 	igt_output_set_pipe(output, pipe);
 
+	for_each_connector_mode(output) {
+		data->mode = &output->config.connector->modes[j__];
+		delay = 1 * (MSECS / (data->mode->vrefresh));
+		/*
+		 * Should be 5ms vblank time required to program higher
+		 * watermark levels
+		 */
+		if (delay >= (5 * MSECS))
+			break;
+	}
+
 	data->output = output;
-	data->mode = igt_output_get_mode(output);
 	setup_videoplayback(data);
 
 	primary = igt_output_get_plane_type(data->output, DRM_PLANE_TYPE_PRIMARY);
 	pre_val = read_pkgc_counter(data->debugfs_root_fd);
-	delay = 1 * (MSECS / (data->mode->vrefresh - 10));
 
 	igt_plane_set_fb(primary, &data->fb_rgb);
 	igt_display_commit(&data->display);
-- 
2.43.0


  reply	other threads:[~2024-08-11 20:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-11 20:03 [PATCH i-g-t v4 0/4] Improvise-the-deep-pkgc Naladala Ramanaidu
2024-08-11 20:03 ` Naladala Ramanaidu [this message]
2024-08-13  9:21   ` [PATCH i-g-t v4 1/4] tests/intel/kms_pm_dc: Update VRR handling and eDP output check Kandpal, Suraj
2024-08-11 20:03 ` [PATCH i-g-t v4 2/4] tests/intel/kms_pm_dc: Update test duration to 4 seconds Naladala Ramanaidu
2024-08-13  9:23   ` Kandpal, Suraj
2024-08-22  9:31     ` Naladala, Ramanaidu
2024-08-11 20:03 ` [PATCH i-g-t v4 3/4] tests/intel/kms_pm_dc: Add polling for deep-pkgc Naladala Ramanaidu
2024-08-13  9:26   ` Kandpal, Suraj
2024-08-11 20:03 ` [PATCH i-g-t v4 4/4] HAX patch do not merge Naladala Ramanaidu
2024-08-11 20:24 ` ✗ CI.xeBAT: failure for Improvise-the-deep-pkgc (rev4) Patchwork
2024-08-11 20:40 ` ✗ Fi.CI.BAT: " Patchwork
2024-08-11 21:22 ` ✗ CI.xeFULL: " Patchwork
2024-08-12  4:03 ` [PATCH i-g-t v4 0/4] Improvise-the-deep-pkgc Kandpal, Suraj

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=20240811200359.1086166-2-ramanaidu.naladala@intel.com \
    --to=ramanaidu.naladala@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jeevan.b@intel.com \
    --cc=suraj.kandpal@intel.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