[PATCH i-g-t v7 40/48] lib/i915/dp: Use igt_output_name instead of private field

Louis Chauvet
2026-02-23T12:09:29Z

output->name is a private field, use the common helper igt_output_name
instead of the field directly.

Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
---
lib/i915/i915_dp.c | 43 ++++++++++++++++++++++---------------------
1 file changed, 22 insertions(+), 21 deletions(-)

diff --git a/lib/i915/i915_dp.c b/lib/i915/i915_dp.c
index c2cddb955d75..e54058580ff2 100644
--- a/lib/i915/i915_dp.c
+++ b/lib/i915/i915_dp.c
@@ -35,6 +35,7 @@

#include "i915_dp.h"
#include "igt_core.h"
+#include "igt_kms.h"

/**
* i915_dp_parse_marked_value:
@@ -78,13 +79,13 @@ int i915_dp_get_current_link_rate(int drm_fd, igt_output_t *output)
char buf[512];
int res, ret;

- res = igt_debugfs_read_connector_file(drm_fd, output->name,
+ res = igt_debugfs_read_connector_file(drm_fd, igt_output_name(output),
"i915_dp_force_link_rate",
buf, sizeof(buf));
igt_assert_f(res == 0, "Unable to read %s/i915_dp_force_link_rate\n",
- output->name);
+ igt_output_name(output));
res = i915_dp_parse_marked_value(buf, '*', &ret);
- igt_assert_f(res == 0, "Output %s not enabled\n", output->name);
+ igt_assert_f(res == 0, "Output %s not enabled\n", igt_output_name(output));
return ret;
}

@@ -100,13 +101,13 @@ int i915_dp_get_current_lane_count(int drm_fd, igt_output_t *output)
char buf[512];
int res, ret;

- res = igt_debugfs_read_connector_file(drm_fd, output->name,
+ res = igt_debugfs_read_connector_file(drm_fd, igt_output_name(output),
"i915_dp_force_lane_count",
buf, sizeof(buf));
igt_assert_f(res == 0, "Unable to read %s/i915_dp_force_lane_count\n",
- output->name);
+ igt_output_name(output));
res = i915_dp_parse_marked_value(buf, '*', &ret);
- igt_assert_f(res == 0, "Output %s not enabled\n", output->name);
+ igt_assert_f(res == 0, "Output %s not enabled\n", igt_output_name(output));
return ret;
}

@@ -122,11 +123,11 @@ int i915_dp_get_max_link_rate(int drm_fd, igt_output_t *output)
char buf[512];
int res, ret;

- res = igt_debugfs_read_connector_file(drm_fd, output->name,
+ res = igt_debugfs_read_connector_file(drm_fd, igt_output_name(output),
"i915_dp_max_link_rate",
buf, sizeof(buf));
igt_assert_f(res == 0, "Unable to read %s/i915_dp_max_link_rate\n",
- output->name);
+ igt_output_name(output));

igt_assert_f(sscanf(buf, "%d", &ret) == 1,
"Failed to parse max link rate from %s\n", buf);
@@ -146,11 +147,11 @@ int i915_dp_get_max_lane_count(int drm_fd, igt_output_t *output)
char buf[512];
int res, ret;

- res = igt_debugfs_read_connector_file(drm_fd, output->name,
+ res = igt_debugfs_read_connector_file(drm_fd, igt_output_name(output),
"i915_dp_max_lane_count",
buf, sizeof(buf));
igt_assert_f(res == 0, "Unable to read %s/i915_dp_max_lane_count\n",
- output->name);
+ igt_output_name(output));

igt_assert_f(sscanf(buf, "%d", &ret) == 1,
"Failed to parse max lane count from %s\n", buf);
@@ -172,11 +173,11 @@ void i915_dp_force_link_retrain(int drm_fd, igt_output_t *output, int retrain_co
int res;

snprintf(value, sizeof(value), "%d", retrain_count);
- res = igt_debugfs_write_connector_file(drm_fd, output->name,
+ res = igt_debugfs_write_connector_file(drm_fd, igt_output_name(output),
"i915_dp_force_link_retrain",
value, strlen(value));
igt_assert_f(res == 0, "Unable to write to %s/i915_dp_force_link_retrain\n",
- output->name);
+ igt_output_name(output));
}

/**
@@ -196,11 +197,11 @@ void i915_dp_force_lt_failure(int drm_fd, igt_output_t *output, int failure_coun
int res;

snprintf(value, sizeof(value), "%d", failure_count);
- res = igt_debugfs_write_connector_file(drm_fd, output->name,
+ res = igt_debugfs_write_connector_file(drm_fd, igt_output_name(output),
"i915_dp_force_link_training_failure",
value, strlen(value));
igt_assert_f(res == 0, "Unable to write to %s/i915_dp_force_link_training_failure\n",
- output->name);
+ igt_output_name(output));
}

/**
@@ -215,11 +216,11 @@ bool i915_dp_get_link_retrain_disabled(int drm_fd, igt_output_t *output)
char buf[512];
int res;

- res = igt_debugfs_read_connector_file(drm_fd, output->name,
+ res = igt_debugfs_read_connector_file(drm_fd, igt_output_name(output),
"i915_dp_link_retrain_disabled",
buf, sizeof(buf));
igt_assert_f(res == 0, "Unable to read %s/i915_dp_link_retrain_disabled\n",
- output->name);
+ igt_output_name(output));
return strstr(buf, "yes");
}

@@ -238,7 +239,7 @@ bool i915_dp_has_force_link_training_failure_debugfs(int drmfd, igt_output_t *ou
char buf[512];
int res;

- res = igt_debugfs_read_connector_file(drmfd, output->name,
+ res = igt_debugfs_read_connector_file(drmfd, igt_output_name(output),
"i915_dp_link_retrain_disabled",
buf, sizeof(buf));
return res == 0;
@@ -256,11 +257,11 @@ int i915_dp_get_pending_lt_failures(int drm_fd, igt_output_t *output)
char buf[512];
int res, ret;

- res = igt_debugfs_read_connector_file(drm_fd, output->name,
+ res = igt_debugfs_read_connector_file(drm_fd, igt_output_name(output),
"i915_dp_force_link_training_failure",
buf, sizeof(buf));
igt_assert_f(res == 0, "Unable to read %s/i915_dp_force_link_training_failure\n",
- output->name);
+ igt_output_name(output));

igt_assert_f(sscanf(buf, "%d", &ret) == 1,
"Failed to parse pending link training failures from %s\n", buf);
@@ -280,11 +281,11 @@ int i915_dp_get_pending_retrain(int drm_fd, igt_output_t *output)
char buf[512];
int res, ret;

- res = igt_debugfs_read_connector_file(drm_fd, output->name,
+ res = igt_debugfs_read_connector_file(drm_fd, igt_output_name(output),
"i915_dp_force_link_retrain",
buf, sizeof(buf));
igt_assert_f(res == 0, "Unable to read %s/i915_dp_force_link_retrain\n",
- output->name);
+ igt_output_name(output));

igt_assert_f(sscanf(buf, "%d", &ret) == 1,
"Failed to parse pending link retrains from %s\n", buf);

--
2.52.0