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
Cc: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
Subject: [PATCH i-g-t 1/3] tests/kms_color_helper: Add a helper to get high resolution mode
Date: Fri, 24 May 2024 15:42:00 +0530	[thread overview]
Message-ID: <20240524101202.2735010-1-bhanuprakash.modem@intel.com> (raw)

Add a helper to get the mode with highest possible resolution.

Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
 tests/kms_color_helper.c | 14 ++++++++++++++
 tests/kms_color_helper.h |  1 +
 2 files changed, 15 insertions(+)

diff --git a/tests/kms_color_helper.c b/tests/kms_color_helper.c
index 143dff43e..f7d5a0931 100644
--- a/tests/kms_color_helper.c
+++ b/tests/kms_color_helper.c
@@ -24,11 +24,25 @@
 
 #include "kms_color_helper.h"
 
+drmModeModeInfo *output_mode_with_max_resolution(igt_output_t *output)
+{
+	igt_info("Default mode: ");
+	kmstest_dump_mode(igt_output_get_mode(output));
+
+	igt_sort_connector_modes(output->config.connector, sort_drm_modes_by_res_dsc);
+
+	igt_info("High resolution mode: ");
+	kmstest_dump_mode(&output->config.connector->modes[0]);
+
+	return &output->config.connector->modes[0];
+}
+
 bool pipe_output_combo_valid(data_t *data, enum pipe pipe)
 {
 	bool ret = true;
 
 	igt_output_set_pipe(data->output, pipe);
+	igt_output_override_mode(data->output, data->mode);
 	if (!intel_pipe_output_combo_valid(&data->display))
 		ret = false;
 	igt_output_set_pipe(data->output, PIPE_NONE);
diff --git a/tests/kms_color_helper.h b/tests/kms_color_helper.h
index 23463b944..8162c440d 100644
--- a/tests/kms_color_helper.h
+++ b/tests/kms_color_helper.h
@@ -69,6 +69,7 @@ typedef struct {
 	color_t coeffs[];
 } gamma_lut_t;
 
+drmModeModeInfo *output_mode_with_max_resolution(igt_output_t *output);
 bool pipe_output_combo_valid(data_t *data, enum pipe pipe);
 bool panel_supports_deep_color(int fd, char *output_name);
 uint64_t get_max_bpc(igt_output_t *output);
-- 
2.43.2


             reply	other threads:[~2024-05-24 10:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-24 10:12 Bhanuprakash Modem [this message]
2024-05-24 10:12 ` [PATCH i-g-t 2/3] tests/kms_color: Add connector name to dynamic subtests Bhanuprakash Modem
2024-06-27  5:17   ` Karthik B S
2024-05-24 10:12 ` [PATCH i-g-t 3/3] tests/kms_color: Update all tests to use high resolution mode Bhanuprakash Modem
2024-05-24 12:05 ` ✓ CI.xeBAT: success for series starting with [i-g-t,1/3] tests/kms_color_helper: Add a helper to get " Patchwork
2024-05-24 12:13 ` ✓ Fi.CI.BAT: " Patchwork
2024-05-24 14:43 ` ✗ CI.xeFULL: failure " Patchwork
2024-05-25 10:37 ` ✓ 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=20240524101202.2735010-1-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