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, karthik.b.s@intel.com
Subject: [igt-dev] [i-g-t] tests/intel/kms_pm_lpsp: Use lib helper to iterate connector modes
Date: Fri, 24 Nov 2023 11:16:56 +0530	[thread overview]
Message-ID: <20231124054656.2314283-1-bhanuprakash.modem@intel.com> (raw)

Instead of writing a new logic at test level, use library helper
to iterate all connector modes.

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

diff --git a/tests/intel/kms_pm_lpsp.c b/tests/intel/kms_pm_lpsp.c
index a85e4e795..9a6ef1be9 100644
--- a/tests/intel/kms_pm_lpsp.c
+++ b/tests/intel/kms_pm_lpsp.c
@@ -63,7 +63,6 @@ typedef struct {
 	char *pwr_dmn_info;
 	igt_display_t display;
 	struct igt_fb fb;
-	drmModeModeInfo *mode;
 	igt_output_t *output;
 	enum pipe pipe;
 } data_t;
@@ -124,12 +123,13 @@ static void screens_disabled_subtest(data_t *data)
 static void setup_lpsp_output(data_t *data)
 {
 	igt_plane_t *primary;
+	drmModeModeInfo *mode = igt_output_get_mode(data->output);
 
 	primary = igt_output_get_plane_type(data->output,
 					    DRM_PLANE_TYPE_PRIMARY);
 	igt_plane_set_fb(primary, NULL);
 	igt_create_pattern_fb(data->drm_fd,
-			      data->mode->hdisplay, data->mode->vdisplay,
+			      mode->hdisplay, mode->vdisplay,
 			      DRM_FORMAT_XRGB8888,
 			      DRM_FORMAT_MOD_LINEAR,
 			      &data->fb);
@@ -155,22 +155,22 @@ static void test_cleanup(data_t *data)
 
 static bool test_constraint(data_t *data)
 {
-	drmModeConnectorPtr c = data->output->config.connector;
-	int i;
+	drmModeModeInfo *mode;
 
 	igt_display_reset(&data->display);
 	igt_output_set_pipe(data->output, data->pipe);
 
-	data->mode = igt_output_get_mode(data->output);
+	mode = igt_output_get_mode(data->output);
 
 	/* For LPSP avoid Bigjoiner. */
-	if (igt_bigjoiner_possible(data->mode, max_dotclock)) {
-		for (i = 0; i < c->count_modes; i++) {
-			data->mode = &c->modes[i];
-			if (igt_bigjoiner_possible(data->mode, max_dotclock))
+	if (igt_bigjoiner_possible(mode, max_dotclock)) {
+		for_each_connector_mode(data->output) {
+			mode = &data->output->config.connector->modes[j__];
+
+			if (igt_bigjoiner_possible(mode, max_dotclock))
 				continue;
 
-			igt_output_override_mode(data->output, data->mode);
+			igt_output_override_mode(data->output, mode);
 
 			return true;
 		}
-- 
2.40.0

             reply	other threads:[~2023-11-24  5:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-24  5:46 Bhanuprakash Modem [this message]
2023-11-24  7:07 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/intel/kms_pm_lpsp: Use lib helper to iterate connector modes Patchwork
2023-11-24  7:12   ` Modem, Bhanuprakash
2023-11-24  7:15 ` [igt-dev] ✓ CI.xeBAT: success " Patchwork
2023-11-26  6:05 ` [igt-dev] ✓ CI.xeBAT: success for tests/intel/kms_pm_lpsp: Use lib helper to iterate connector modes (rev2) Patchwork
2023-11-26  6:15 ` [igt-dev] ✗ Fi.CI.BAT: failure " Patchwork
2023-11-26  8:55 ` [igt-dev] ✗ GitLab.Pipeline: warning for tests/intel/kms_pm_lpsp: Use lib helper to iterate connector modes (rev3) Patchwork
2023-11-26  9:25 ` [igt-dev] ✓ CI.xeBAT: success " Patchwork
2023-11-26  9:28 ` [igt-dev] ✓ Fi.CI.BAT: " Patchwork
2023-11-26 10:47 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2023-11-27  5:36 ` [igt-dev] [i-g-t] tests/intel/kms_pm_lpsp: Use lib helper to iterate connector modes Karthik B S

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=20231124054656.2314283-1-bhanuprakash.modem@intel.com \
    --to=bhanuprakash.modem@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=karthik.b.s@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