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
Subject: [igt-dev] [i-g-t V3 3/6] tests/i915/kms_dsc: Update bigjoiner pipe constraint
Date: Fri, 14 Apr 2023 14:07:00 +0530	[thread overview]
Message-ID: <20230414083703.1219101-4-bhanuprakash.modem@intel.com> (raw)
In-Reply-To: <20230414083703.1219101-1-bhanuprakash.modem@intel.com>

Instead of writing own logic at test level, use existing IGT
helper to check the bigjoiner support.

V2: - git squash to include i915_pipe_output_combo_valid()

Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
 tests/i915/kms_dsc.c        | 30 +++++++++++++++---------------
 tests/i915/kms_dsc_helper.h |  2 --
 2 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/tests/i915/kms_dsc.c b/tests/i915/kms_dsc.c
index b3c5e60c773..cf34dc8a8b0 100644
--- a/tests/i915/kms_dsc.c
+++ b/tests/i915/kms_dsc.c
@@ -47,7 +47,6 @@ typedef struct {
 	unsigned int plane_format;
 	igt_output_t *output;
 	int input_bpc;
-	int n_pipes;
 	int disp_ver;
 	enum pipe pipe;
 } data_t;
@@ -72,19 +71,24 @@ static drmModeModeInfo *get_highres_mode(igt_output_t *output)
 	return highest_mode;
 }
 
-static bool check_big_joiner_pipe_constraint(data_t *data)
+static bool pipe_output_combo_valid(data_t *data)
 {
 	igt_output_t *output = data->output;
-	drmModeModeInfo *mode = get_highres_mode(output);
+	drmModeModeInfo *mode;
+	bool ret = true;
 
-	if (mode->hdisplay >= HDISPLAY_5K &&
-	    data->pipe == (data->n_pipes - 1)) {
-		igt_debug("Pipe-%s not supported due to bigjoiner limitation\n",
-			   kmstest_pipe_name(data->pipe));
-		return false;
-	}
+	igt_display_reset(&data->display);
+	mode = get_highres_mode(output);
+
+	igt_output_set_pipe(output, data->pipe);
+	igt_output_override_mode(output, mode);
+
+	if (!i915_pipe_output_combo_valid(&data->display))
+		ret = false;
+
+	igt_output_set_pipe(output, PIPE_NONE);
 
-	return true;
+	return ret;
 }
 
 static void test_cleanup(data_t *data)
@@ -190,7 +194,7 @@ static void test_dsc(data_t *data, enum dsc_test_type test_type, int bpc,
 		if (!check_gen11_bpc_constraint(data->drm_fd, data->output, data->input_bpc))
 			continue;
 
-		if (!check_big_joiner_pipe_constraint(data))
+		if (!pipe_output_combo_valid(data))
 			continue;
 
 		if (test_type == TEST_DSC_BPC)
@@ -206,7 +210,6 @@ static void test_dsc(data_t *data, enum dsc_test_type test_type, int bpc,
 igt_main
 {
 	data_t data = {};
-	int i;
 
 	igt_fixture {
 		data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
@@ -217,9 +220,6 @@ igt_main
 		igt_display_require(&data.display, data.drm_fd);
 		igt_display_require_output(&data.display);
 		igt_require(data.disp_ver >= 11);
-		data.n_pipes = 0;
-		for_each_pipe(&data.display, i)
-			data.n_pipes++;
 	}
 
 	igt_describe("Tests basic display stream compression functionality if supported "
diff --git a/tests/i915/kms_dsc_helper.h b/tests/i915/kms_dsc_helper.h
index fe479dac472..b3828dcd44a 100644
--- a/tests/i915/kms_dsc_helper.h
+++ b/tests/i915/kms_dsc_helper.h
@@ -21,8 +21,6 @@
 #include <fcntl.h>
 #include <termios.h>
 
-#define HDISPLAY_5K	5120
-
 void force_dsc_enable(int drmfd, igt_output_t *output);
 void force_dsc_enable_bpc(int drmfd, igt_output_t *output, int input_bpc);
 void save_force_dsc_en(int drmfd, igt_output_t *output);
-- 
2.40.0

  parent reply	other threads:[~2023-04-14  8:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-14  8:36 [igt-dev] [i-g-t V3 0/6] Fix Bigjoiner checks Bhanuprakash Modem
2023-04-14  8:36 ` [igt-dev] [i-g-t V3 1/6] lib/igt_kms: " Bhanuprakash Modem
2023-04-14  8:36 ` [igt-dev] [i-g-t V3 2/6] tests/i915/kms_big_joiner: " Bhanuprakash Modem
2023-04-14  8:37 ` Bhanuprakash Modem [this message]
2023-04-14  9:53   ` [igt-dev] [i-g-t V3 3/6] tests/i915/kms_dsc: Update bigjoiner pipe constraint Karthik B S
2023-04-14  8:37 ` [igt-dev] [i-g-t V3 4/6] tests/kms_invalid_mode: Use helpers from IGT lib Bhanuprakash Modem
2023-04-14  8:37 ` [igt-dev] [i-g-t V3 5/6] tests/kms_flip: Fix Bigjoiner checks Bhanuprakash Modem
2023-04-14  8:37 ` [igt-dev] [i-g-t V3 6/6] tests/kms_setmode: " Bhanuprakash Modem
2023-04-14 11:39 ` [igt-dev] ✓ Fi.CI.BAT: success for Fix Bigjoiner checks (rev5) Patchwork
2023-04-14 15:05 ` [igt-dev] ✓ Fi.CI.IGT: " 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=20230414083703.1219101-4-bhanuprakash.modem@intel.com \
    --to=bhanuprakash.modem@intel.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