public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [PATCH i-g-t 10/19] lib/kms: Pass igt_crtc_t* to igt_max_bpc_constraint()
Date: Wed, 25 Feb 2026 14:50:59 +0200	[thread overview]
Message-ID: <20260225125108.31119-11-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20260225125108.31119-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Pass the igt_crtc_t* instead of the pipe to
igt_max_bpc_constraint(). All callers already have
the crtc around.

 #include "scripts/iterators.cocci"

@@
typedef igt_crtc_t;
identifier DISPLAY, PIPE;
@@
igt_max_bpc_constraint(igt_display_t *DISPLAY,
-	enum pipe PIPE,
+	igt_crtc_t *crtc,
	...)
{
<...
- PIPE
+ crtc->pipe
...>
}

@@
expression DISPLAY, PIPE;
@@
igt_max_bpc_constraint(DISPLAY,
-	PIPE,
+	igt_crtc_for_pipe(DISPLAY, PIPE),
	...)

@@
igt_crtc_t *CRTC;
@@
- igt_crtc_for_pipe(..., CRTC->pipe)
+ CRTC

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 lib/igt_kms.c      | 4 ++--
 lib/igt_kms.h      | 4 ++--
 tests/kms_color.c  | 2 +-
 tests/kms_dither.c | 4 +++-
 tests/kms_hdr.c    | 4 ++--
 5 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 2170e775b3a5..8855ba845ed2 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -6699,7 +6699,7 @@ bool igt_check_output_bpc_equal(int drmfd, enum pipe pipe,
  *
  * Returns: True if suitable mode found to use requested bpc, else False.
  */
-bool igt_max_bpc_constraint(igt_display_t *display, enum pipe pipe,
+bool igt_max_bpc_constraint(igt_display_t *display, igt_crtc_t *crtc,
 			    igt_output_t *output, int bpc)
 {
 	drmModeConnector *connector = output->config.connector;
@@ -6717,7 +6717,7 @@ bool igt_max_bpc_constraint(igt_display_t *display, enum pipe pipe,
 					    display->is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY))
 			continue;
 
-		if (!igt_check_output_bpc_equal(display->drm_fd, pipe,
+		if (!igt_check_output_bpc_equal(display->drm_fd, crtc->pipe,
 						output->name, bpc))
 			continue;
 
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 2d1f14330617..9dc933d537ef 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -1262,8 +1262,8 @@ int sort_drm_modes_by_res_asc(const void *a, const void *b);
 void igt_sort_connector_modes(drmModeConnector *connector,
 		int (*comparator)(const void *, const void*));
 
-bool igt_max_bpc_constraint(igt_display_t *display, enum pipe pipe,
-		igt_output_t *output, int bpc);
+bool igt_max_bpc_constraint(igt_display_t *display, igt_crtc_t *crtc,
+			    igt_output_t *output, int bpc);
 int igt_get_max_dotclock(int fd);
 int igt_get_max_cdclk(int fd);
 int igt_get_current_cdclk(int fd);
diff --git a/tests/kms_color.c b/tests/kms_color.c
index 0008a15a05b4..a26225c1e99a 100644
--- a/tests/kms_color.c
+++ b/tests/kms_color.c
@@ -897,7 +897,7 @@ run_deep_color_tests_for_pipe(data_t *data, igt_crtc_t *crtc)
 				    crtc);
 
 		if (is_intel_device(data->drm_fd) &&
-		    !igt_max_bpc_constraint(&data->display, crtc->pipe, output, 10)) {
+		    !igt_max_bpc_constraint(&data->display, crtc, output, 10)) {
 			igt_info("Output %s: Doesn't support 10-bpc.\n",
 				 igt_output_name(output));
 			continue;
diff --git a/tests/kms_dither.c b/tests/kms_dither.c
index 347580e60f4e..fc6f794f5ea1 100644
--- a/tests/kms_dither.c
+++ b/tests/kms_dither.c
@@ -140,7 +140,9 @@ static void test_dithering(data_t *data, igt_crtc_t *crtc,
 	if (ret)
 		goto cleanup;
 
-	constraint = igt_max_bpc_constraint(display, crtc->pipe, output,
+	constraint = igt_max_bpc_constraint(display,
+					    crtc,
+					    output,
 					    output_bpc);
 	if (!constraint)
 		goto cleanup;
diff --git a/tests/kms_hdr.c b/tests/kms_hdr.c
index f677c6629430..d9d8a17adaf8 100644
--- a/tests/kms_hdr.c
+++ b/tests/kms_hdr.c
@@ -338,7 +338,7 @@ static void test_bpc_switch(data_t *data, uint32_t flags)
 				     crtc);
 
 			if (is_intel_device(data->fd) &&
-			    !igt_max_bpc_constraint(display, crtc->pipe, output, 10)) {
+			    !igt_max_bpc_constraint(display, crtc, output, 10)) {
 				igt_info("%s: No suitable mode found to use 10 bpc.\n",
 					 igt_output_name(output));
 
@@ -762,7 +762,7 @@ static void test_hdr(data_t *data, uint32_t flags)
 			}
 
 			if (is_intel_device(data->fd) &&
-			    !igt_max_bpc_constraint(display, crtc->pipe, output, 10)) {
+			    !igt_max_bpc_constraint(display, crtc, output, 10)) {
 				igt_info("%s: No suitable mode found to use 10 bpc.\n",
 					 igt_output_name(output));
 
-- 
2.52.0


  parent reply	other threads:[~2026-02-25 12:51 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-25 12:50 [PATCH i-g-t 00/19] lib/kms: Clean up more of igt_kms API Ville Syrjala
2026-02-25 12:50 ` [PATCH i-g-t 01/19] tests/kms_plane_multiple: Clean up n_planes stuff Ville Syrjala
2026-02-25 12:50 ` [PATCH i-g-t 02/19] tests/kms_async_flips: Remove redundant data.crtc_id Ville Syrjala
2026-02-25 13:58   ` Jani Nikula
2026-02-25 12:50 ` [PATCH i-g-t 03/19] tests/kms_lease: Consolidate igt_crtc_for_pipe() calls Ville Syrjala
2026-02-25 12:50 ` [PATCH i-g-t 04/19] tests/kms: " Ville Syrjala
2026-02-25 12:50 ` [PATCH i-g-t 05/19] lib/kms: Introduce igt_first_crtc_with_single_output() Ville Syrjala
2026-02-25 13:59   ` Jani Nikula
2026-02-25 12:50 ` [PATCH i-g-t 06/19] tests/kms: Use igt_first_crtc_with_single_output() Ville Syrjala
2026-02-25 12:50 ` [PATCH i-g-t 07/19] lib/kms: Introduce and use igt_first_crtc() Ville Syrjala
2026-02-25 14:00   ` Jani Nikula
2026-02-25 12:50 ` [PATCH i-g-t 08/19] tests/kms: Stop using igt_require_pipe() Ville Syrjala
2026-02-25 12:50 ` [PATCH i-g-t 09/19] lib/kms: Replace get_num_scalers() with igt_crtc_num_scalers() Ville Syrjala
2026-02-25 12:50 ` Ville Syrjala [this message]
2026-02-25 12:51 ` [PATCH i-g-t 11/19] lib/kms: Introduce for_each_plane_on_crtc() Ville Syrjala
2026-02-25 12:51 ` [PATCH i-g-t 12/19] tests/kms: Use for_each_plane_on_crtc() Ville Syrjala
2026-02-25 13:53   ` Jani Nikula
2026-02-25 12:51 ` [PATCH i-g-t 13/19] lib/kms: Nuke for_each_plane_on_pipe() Ville Syrjala
2026-02-25 12:51 ` [PATCH i-g-t 14/19] tests/kms: Switch to for_each_valid_output_on_crtc_local() Ville Syrjala
2026-02-25 12:51 ` [PATCH i-g-t 15/19] tests/kms: Replace igt_pipe_connector_valid() with igt_crtc_connector_valid() Ville Syrjala
2026-02-25 12:51 ` [PATCH i-g-t 16/19] lib/kms: Intreoduce for_each_valid_output_on_crtc() Ville Syrjala
2026-02-25 12:51 ` [PATCH i-g-t 17/19] tests/intel/kms_frontbuffer_tracking: Use for_each_valid_output_on_crtc() Ville Syrjala
2026-02-25 12:51 ` [PATCH i-g-t 18/19] tests/kms: " Ville Syrjala
2026-02-25 12:51 ` [PATCH i-g-t 19/19] lib/kms: Nuke for_each_valid_output_on_pipe() Ville Syrjala
2026-02-25 14:06   ` Jani Nikula
2026-02-25 14:07 ` [PATCH i-g-t 00/19] lib/kms: Clean up more of igt_kms API Jani Nikula
2026-02-25 23:34 ` ✗ Xe.CI.BAT: failure for " Patchwork
2026-02-26  0:05 ` ✓ i915.CI.BAT: success " Patchwork
2026-02-26  1:57 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-02-26 22:06 ` ✓ Xe.CI.BAT: success for lib/kms: Clean up more of igt_kms API (rev2) Patchwork
2026-02-26 22:09 ` ✓ i915.CI.BAT: " Patchwork
2026-02-27  2:55 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-02-27  4:24 ` ✗ i915.CI.Full: " 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=20260225125108.31119-11-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.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