[PATCH i-g-t 07/17] tests/intel/kms_dsc*: Use igt_crtc_t instead of enum pipe

Ville Syrjala
2026-02-11T16:34:38Z

Convert the use of enum pipe to igt_crtc_t tests/intel/kms_dsc*.

The data.pipe thing complicates this one, so it was mostly done
by hand. Mainly I wanted to get the tests/intel/kms_dsc_helper.c
part out of the way.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
tests/intel/kms_dsc.c | 15 +++++++--------
tests/intel/kms_dsc_helper.c | 8 +++++---
tests/intel/kms_dsc_helper.h | 3 ++-
3 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/tests/intel/kms_dsc.c b/tests/intel/kms_dsc.c
index ab9793f5168a..f832500b7eeb 100644
--- a/tests/intel/kms_dsc.c
+++ b/tests/intel/kms_dsc.c
@@ -79,7 +79,7 @@ typedef struct {
igt_output_t *output;
int input_bpc;
int disp_ver;
- enum pipe pipe;
+ igt_crtc_t *crtc;
bool limited;
} data_t;

@@ -164,8 +164,7 @@ static void update_display(data_t *data, uint32_t test_type)
force_dsc_fractional_bpp_enable(data->drm_fd, data->output);
}

- igt_output_set_crtc(output,
- igt_crtc_for_pipe(display, data->pipe));
+ igt_output_set_crtc(output, data->crtc);
primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);

igt_skip_on(!igt_plane_has_format_mod(primary, data->plane_format,
@@ -227,7 +226,7 @@ static void update_display(data_t *data, uint32_t test_type)
restore_force_dsc_fractional_bpp_en();

if (test_type & TEST_DSC_BPC) {
- current_bpc = igt_get_pipe_current_bpc(data->drm_fd, data->pipe);
+ current_bpc = igt_get_pipe_current_bpc(data->drm_fd, data->crtc->pipe);
igt_skip_on_f(data->input_bpc != current_bpc,
"Input bpc = %d is not equal to current bpc = %d\n",
data->input_bpc, current_bpc);
@@ -236,7 +235,7 @@ static void update_display(data_t *data, uint32_t test_type)
igt_assert_f(enabled,
"Default DSC enable failed on connector: %s pipe: %s\n",
output->name,
- kmstest_pipe_name(data->pipe));
+ igt_crtc_name(data->crtc));
reset:
test_reset(data);

@@ -265,10 +264,10 @@ static void test_dsc(data_t *data, uint32_t test_type, int bpc,
data->plane_format = plane_format;
data->input_bpc = bpc;
data->output = output;
- data->pipe = crtc->pipe;
+ data->crtc = crtc;

if (!is_dsc_supported_by_sink(data->drm_fd, data->output) ||
- !check_gen11_dp_constraint(data->drm_fd, data->output, data->pipe))
+ !check_gen11_dp_constraint(data->drm_fd, data->output, data->crtc))
continue;

if (igt_get_output_max_bpc(data->drm_fd, output->name) < MIN_DSC_BPC) {
@@ -293,7 +292,7 @@ static void test_dsc(data_t *data, uint32_t test_type, int bpc,
if (test_type & TEST_DSC_BPC)
snprintf(&name[2][0], LEN, "-%dbpc", data->input_bpc);

- igt_dynamic_f("pipe-%s-%s%s%s%s", kmstest_pipe_name(data->pipe), data->output->name,
+ igt_dynamic_f("pipe-%s-%s%s%s%s", igt_crtc_name(data->crtc), data->output->name,
&name[0][0], &name[1][0], &name[2][0])
update_display(data, test_type);

diff --git a/tests/intel/kms_dsc_helper.c b/tests/intel/kms_dsc_helper.c
index cea4304e48d3..77165b41f4bc 100644
--- a/tests/intel/kms_dsc_helper.c
+++ b/tests/intel/kms_dsc_helper.c
@@ -84,14 +84,16 @@ bool is_dsc_supported_by_sink(int drmfd, igt_output_t *output)
return true;
}

-bool check_gen11_dp_constraint(int drmfd, igt_output_t *output, enum pipe pipe)
+bool check_gen11_dp_constraint(int drmfd, igt_output_t *output,
+ igt_crtc_t *crtc)
{
uint32_t devid = intel_get_drm_devid(drmfd);
drmModeConnector *connector = output->config.connector;

if ((connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) &&
- (pipe == PIPE_A) && IS_GEN11(devid)) {
- igt_info("DSC not supported on pipe %s on %s in gen11 platforms\n", kmstest_pipe_name(pipe), output->name);
+ (crtc->pipe == PIPE_A) && IS_GEN11(devid)) {
+ igt_info("DSC not supported on pipe %s on %s in gen11 platforms\n",
+ kmstest_pipe_name(crtc->pipe), output->name);
return false;
}

diff --git a/tests/intel/kms_dsc_helper.h b/tests/intel/kms_dsc_helper.h
index 4dbd88fe7b95..ee419c849836 100644
--- a/tests/intel/kms_dsc_helper.h
+++ b/tests/intel/kms_dsc_helper.h
@@ -28,7 +28,8 @@ void restore_force_dsc_en(void);
void kms_dsc_exit_handler(int sig);
bool is_dsc_supported_by_sink(int drmfd, igt_output_t *output);
bool is_dsc_supported_by_source(int drmfd);
-bool check_gen11_dp_constraint(int drmfd, igt_output_t *output, enum pipe pipe);
+bool check_gen11_dp_constraint(int drmfd, igt_output_t *output,
+ igt_crtc_t *crtc);
bool check_gen11_bpc_constraint(int drmfd, int input_bpc);
void force_dsc_output_format(int drmfd, igt_output_t *output,
enum dsc_output_format output_format);
--
2.52.0