From: Imre Deak <imre.deak@intel.com>
To: Kunal Joshi <kunal1.joshi@intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [PATCH i-g-t 4/6] lib/igt_kms: add function to reset link params
Date: Wed, 18 Sep 2024 17:35:31 +0300 [thread overview]
Message-ID: <ZurlM6IhzPX2ALXw@ideak-desk.fi.intel.com> (raw)
In-Reply-To: <20240912062839.760661-5-kunal1.joshi@intel.com>
On Thu, Sep 12, 2024 at 11:58:37AM +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
>
> v2: no need to do link retraining (Imre)
>
> Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com>
> ---
> lib/igt_kms.c | 33 +++++++++++++++++++++++++++++++++
> lib/igt_kms.h | 1 +
> 2 files changed, 34 insertions(+)
>
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index a7f8d0f83..f841a69da 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -6957,3 +6957,36 @@ 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");
The above check got removed for the rest of similar helpers.
> + valid = true;
> + valid = valid && connector_attr_set_debugfs(drm_fd, output->config.connector,
> + "i915_dp_force_link_rate",
> + "auto", "auto", true);
> + valid = valid && connector_attr_set_debugfs(drm_fd, output->config.connector,
> + "i915_dp_force_lane_count",
> + "auto", "auto", true);
> + igt_assert_f(valid, "Unable to set attr or install exit handler\n");
> + dump_connector_attrs();
> + igt_install_exit_handler(reset_connectors_at_exit);
> +
> + /*
> + * To allow callers to always use GetConnectorCurrent we need to force a
> + * redetection here.
> + */
> + temp = drmModeGetConnector(drm_fd, output->config.connector->connector_id);
> + drmModeFreeConnector(temp);
> +}
> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> index 9dca09d93..3c867031e 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -1236,5 +1236,6 @@ 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);
> int igt_get_dp_pending_lt_failures(int drm_fd, igt_output_t *output);
> int igt_get_dp_pending_retrain(int drm_fd, igt_output_t *output);
> +void igt_reset_link_params(int drm_fd, igt_output_t *output);
>
> #endif /* __IGT_KMS_H__ */
> --
> 2.43.0
>
next prev parent reply other threads:[~2024-09-18 14:35 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-12 6:28 [PATCH i-g-t 0/6] add test to validate fallback Kunal Joshi
2024-09-12 6:28 ` [PATCH i-g-t 1/6] lib/igt_kms: add DP link management helper functions Kunal Joshi
2024-09-12 11:15 ` Joshi, Kunal1
2024-09-18 14:29 ` Imre Deak
2024-09-12 6:28 ` [PATCH i-g-t 2/6] lib/igt_kms: add helper to set connector link status Kunal Joshi
2024-09-12 6:28 ` [PATCH i-g-t 3/6] lib/igt_kms: allow set and reset value to be same Kunal Joshi
2024-09-18 14:33 ` Imre Deak
2024-09-12 6:28 ` [PATCH i-g-t 4/6] lib/igt_kms: add function to reset link params Kunal Joshi
2024-09-18 14:35 ` Imre Deak [this message]
2024-09-12 6:28 ` [PATCH i-g-t 5/6] tests/intel/kms_dp_fallback: add test for validating fallback Kunal Joshi
2024-09-18 15:22 ` Imre Deak
2024-09-12 6:28 ` [PATCH i-g-t 6/6] HAX: Do not merge Kunal Joshi
2024-09-12 8:07 ` ✗ GitLab.Pipeline: warning for add test to validate fallback (rev5) Patchwork
2024-09-12 8:35 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-09-12 8:35 ` ✗ CI.xeBAT: " Patchwork
2024-09-12 14:26 ` ✗ CI.xeFULL: " 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=ZurlM6IhzPX2ALXw@ideak-desk.fi.intel.com \
--to=imre.deak@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=kunal1.joshi@intel.com \
/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