[PATCH i-g-t 07/14] lib/igt_kms: add function to check force link training failure support
Samala, Pranay
pranay.samala at intel.com
Tue Sep 3 08:01:04 UTC 2024
> -----Original Message-----
> From: igt-dev <igt-dev-bounces at lists.freedesktop.org> On Behalf Of Kunal Joshi
> Sent: Monday, August 26, 2024 1:36 AM
> To: igt-dev at lists.freedesktop.org
> Cc: Joshi, Kunal1 <kunal1.joshi at intel.com>
> Subject: [PATCH i-g-t 07/14] lib/igt_kms: add function to check force link training
> failure support
>
> add helper to check if platform support forcing link training failures
>
> Signed-off-by: Kunal Joshi <kunal1.joshi at intel.com>
LGTM.
Reviewed-by: Pranay Samala <pranay.samala at intel.com>
> ---
> lib/igt_kms.c | 25 +++++++++++++++++++++++++ lib/igt_kms.h | 1 +
> 2 files changed, 26 insertions(+)
>
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 2720095d4..4ab47e2e9 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -6893,3 +6893,28 @@ bool igt_get_dp_link_retrain_disabled(int drm_fd,
> igt_output_t *output)
> igt_require(res > 0);
> return strstr(buf, "yes");
> }
> +
> +/**
> + * Checks if the force link training failure debugfs
> + * is available for a specific output.
> + *
> + * @drmfd: file descriptor of the DRM device.
> + * @output: output to check.
> + * Returns:
> + * true if the debugfs is available, false otherwise.
> + */
> +bool igt_has_force_link_training_failure_debugfs(int drmfd,
> +igt_output_t *output) {
> + int debugfs_fd, ret;
> + char buf[512];
> +
> + igt_assert_f(output->name, "Invalid output\n");
> + debugfs_fd = igt_debugfs_connector_dir(drmfd, output->name,
> O_RDONLY);
> + if (debugfs_fd < 0)
> + return false;
> + ret = igt_debugfs_simple_read(debugfs_fd,
> + "i915_dp_force_link_training_failure",
> + buf, sizeof(buf));
> + close(debugfs_fd);
> + return ret >= 0;
> +}
> diff --git a/lib/igt_kms.h b/lib/igt_kms.h index 2d69d794a..5ae324f6f 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -1254,5 +1254,6 @@ enum dp_lane_count igt_get_dp_max_lane_count(int
> drm_fd, igt_output_t *output); void igt_force_link_retrain(int drm_fd,
> igt_output_t *output, int retrain_count); void igt_force_lt_failure(int drm_fd,
> igt_output_t *output, int failure_count); bool
> igt_get_dp_link_retrain_disabled(int drm_fd, igt_output_t *output);
> +bool igt_has_force_link_training_failure_debugfs(int drmfd,
> +igt_output_t *output);
>
> #endif /* __IGT_KMS_H__ */
> --
> 2.34.1
More information about the igt-dev
mailing list