[PATCH i-g-t 11/14] lib/igt_kms: add function to reset link params

Joshi, Kunal1 kunal1.joshi at intel.com
Thu Sep 12 06:01:28 UTC 2024


Hello Imre,

-----Original Message-----
From: Deak, Imre <imre.deak at intel.com> 
Sent: Tuesday, September 3, 2024 7:56 PM
To: Joshi, Kunal1 <kunal1.joshi at intel.com>
Cc: igt-dev at lists.freedesktop.org
Subject: Re: [PATCH i-g-t 11/14] lib/igt_kms: add function to reset link params

On Mon, Aug 26, 2024 at 01:36:09AM +0530, Kunal Joshi wrote:
> Writing auto to i915_dp_force_(link_rate/lane_count) and retraing 
> afterwards sets max link param's supported by sink.Reset link rate and 
> lane count to auto, also installs exit handler to set link rate and 
> lane count to auto on exit
> ---
>  lib/igt_kms.c | 36 ++++++++++++++++++++++++++++++++++++
>  lib/igt_kms.h |  1 +
>  2 files changed, 37 insertions(+)
> 
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c index e0533f6ae..b7511ccfc 
> 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -7000,3 +7000,39 @@ int igt_get_dp_pending_retrain(int drm_fd, igt_output_t *output)
>  	sscanf(buf, "%d", &ret);
>  	return ret;
>  }
> +
> +/**
> + * igt_reset_link_params:
> + * @drm_fd: A drm file descriptor
> + * @output: Target output
> + *
> + * Reset link rate and lane count to auto, also installs exit handler
> + * to set link rate and lane count to auto on exit  */ void 
> +igt_reset_link_params(int drm_fd, igt_output_t *output) {
> +	bool valid;
> +	drmModeConnector *temp;
> +
> +	igt_require_f(output->name, "Invalid output");
> +	valid = true;
> +	valid = valid && connector_attr_set_debugfs(drm_fd, output->config.connector,
> +						    "i915_dp_force_link_rate",
> +						    "auto", "auto");
> +	valid = valid && connector_attr_set_debugfs(drm_fd, output->config.connector,
> +						    "i915_dp_force_lane_count",
> +						    "auto", "auto");

Couldn't the above use the corresponding helpers added? I don't see those used elsewhere.[Joshi, Kunal1


More information about the igt-dev mailing list