Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
To: igt-dev@lists.freedesktop.org, swati2.sharma@intel.com
Subject: [igt-dev] [i-g-t 2/2] tests/intel/kms_pm_lpsp: Fix Bigjoiner checks
Date: Tue, 26 Sep 2023 17:17:51 +0530	[thread overview]
Message-ID: <20230926114751.2757259-3-bhanuprakash.modem@intel.com> (raw)
In-Reply-To: <20230926114751.2757259-1-bhanuprakash.modem@intel.com>

Instead of writing a new logic to check the Bigjoiner validity,
use the existing helpers from IGT lib.

Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
 tests/intel/kms_pm_lpsp.c | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/tests/intel/kms_pm_lpsp.c b/tests/intel/kms_pm_lpsp.c
index d3e543048..cb3c3e379 100644
--- a/tests/intel/kms_pm_lpsp.c
+++ b/tests/intel/kms_pm_lpsp.c
@@ -68,6 +68,8 @@ typedef struct {
 	enum pipe pipe;
 } data_t;
 
+static int max_dotclock;
+
 static bool lpsp_is_enabled(data_t *data)
 {
 	char buf[MAX_SINK_LPSP_INFO_BUF_LEN];
@@ -123,7 +125,6 @@ static void setup_lpsp_output(data_t *data)
 {
 	igt_plane_t *primary;
 
-	igt_output_set_pipe(data->output, data->pipe);
 	primary = igt_output_get_plane_type(data->output,
 					    DRM_PLANE_TYPE_PRIMARY);
 	igt_plane_set_fb(primary, NULL);
@@ -158,20 +159,22 @@ static bool test_constraint(data_t *data)
 	int i;
 
 	igt_display_reset(&data->display);
+	igt_output_set_pipe(data->output, data->pipe);
 
 	data->mode = igt_output_get_mode(data->output);
 
-	/* For LPSP avoid pipe big joiner by atleast 4k mode */
-	if (data->mode->hdisplay > 3840 && data->mode->vdisplay > 2160)
+	/* For LPSP avoid Bigjoiner. */
+	if (igt_bigjoiner_possible(data->mode, max_dotclock)) {
 		for (i = 0; i < c->count_modes; i++) {
-			if (c->modes[i].hdisplay <= 3840 &&
-			    c->modes[i].vdisplay <= 2160) {
-				data->mode = &c->modes[i];
-				igt_output_override_mode(data->output,
-							 data->mode);
-				return true;
-			}
+			data->mode = &c->modes[i];
+			if (igt_bigjoiner_possible(data->mode, max_dotclock))
+				continue;
+
+			igt_output_override_mode(data->output, data->mode);
+
+			return true;
 		}
+	}
 
 	return false;
 }
@@ -200,6 +203,8 @@ igt_main
 		data.devid = intel_get_drm_devid(data.drm_fd);
 		igt_display_require(&data.display, data.drm_fd);
 		igt_require(igt_pm_dmc_loaded(data.debugfs_fd));
+
+		max_dotclock = igt_get_max_dotclock(data.drm_fd);
 	}
 
 	igt_describe("This test validates lpsp while all crtc are disabled");
-- 
2.40.0

  parent reply	other threads:[~2023-09-26 11:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-26 11:47 [igt-dev] [i-g-t 0/2] kms_pm_lpsp: Test optimization Bhanuprakash Modem
2023-09-26 11:47 ` [igt-dev] [i-g-t 1/2] tests/intel/kms_pm_lpsp: " Bhanuprakash Modem
2023-09-27  7:18   ` Sharma, Swati2
2023-09-27  9:21     ` Modem, Bhanuprakash
2023-10-10 15:32     ` Sharma, Swati2
2023-09-26 11:47 ` Bhanuprakash Modem [this message]
2023-10-10 15:33   ` [igt-dev] [i-g-t 2/2] tests/intel/kms_pm_lpsp: Fix Bigjoiner checks Sharma, Swati2
2023-09-26 13:11 ` [igt-dev] ✓ CI.xeBAT: success for kms_pm_lpsp: Test optimization Patchwork
2023-09-26 13:11 ` [igt-dev] ✓ Fi.CI.BAT: " Patchwork
2023-09-27  0:36 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2023-10-12 12:19 ` [igt-dev] ✓ Fi.CI.IGT: success " 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=20230926114751.2757259-3-bhanuprakash.modem@intel.com \
    --to=bhanuprakash.modem@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=swati2.sharma@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