From: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>
To: Jeevan B <jeevan.b@intel.com>, <igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH i-g-t] tests/kms_setmode: Add HDMI 2.0 clock limit for mode selection
Date: Mon, 30 Mar 2026 15:02:46 +0530 [thread overview]
Message-ID: <1319a8bf-3c58-4d57-ac32-440380401a13@intel.com> (raw)
In-Reply-To: <20260130055416.198799-1-jeevan.b@intel.com>
On 1/30/2026 11:24 AM, Jeevan B wrote:
> eDP modes with high clock rates were being forced on HDMI 2.0 displays,
> causing kernel to reject with EINVAL. Add clock validation to skip
> incompatible eDP modes and fall back to supported modes.
>
> Signed-off-by: Jeevan B <jeevan.b@intel.com>
> ---
> tests/kms_setmode.c | 24 ++++++++++++++++++++++--
> 1 file changed, 22 insertions(+), 2 deletions(-)
>
> diff --git a/tests/kms_setmode.c b/tests/kms_setmode.c
> index 9c0649e17..4b2f16751 100644
> --- a/tests/kms_setmode.c
> +++ b/tests/kms_setmode.c
> @@ -79,6 +79,9 @@
> /* restricted pipe count */
> #define CRTC_RESTRICT_CNT 2
>
> +/* Clock limit for HDMI 2.0 */
> +#define HDMI_2_0_MAX_CLOCK_KHZ 600000
> +
> static int drm_fd;
> static drmModeRes *drm_resources;
> static int filter_test_id;
> @@ -270,8 +273,25 @@ static void get_mode_for_crtc(struct crtc_config *crtc,
> if (conn->modes[j].clock < mode->clock)
> mode = &conn->modes[j];
> }
> - *mode_ret = *mode;
> - return;
> +
> + /* Check clock limit for HDMI 2.0 */
> + bool hdmi_compatible = true;
> +
> + for (int k = 0; k < crtc->connector_count; k++) {
> + drmModeConnector *other_conn = crtc->cconfs[k].connector;
> +
> + if ((other_conn->connector_type == DRM_MODE_CONNECTOR_HDMIA ||
> + other_conn->connector_type == DRM_MODE_CONNECTOR_HDMIB) &&
> + mode->clock > HDMI_2_0_MAX_CLOCK_KHZ) {
Hmm perhaps can use a helper : hdmi_connector_exceeds_hdmi20_limit()
static bool hdmi_connector_mode_exceeds_hdmi20_limit(drmModeConnector
*connector,
drmModeModeInfo *mode)
{
if (connector->connector_type != DRM_MODE_CONNECTOR_HDMIA &&
connector->connector_type != DRM_MODE_CONNECTOR_HDMIB)
return false;
return mode->clock > HDMI_2_0_MAX_CLOCK_KHZ;
}
> + hdmi_compatible = false;
> + break;
> + }
> + }
> +
> + if (hdmi_compatible && crtc_supports_mode(crtc, mode)) {
Need to drop crtc_supports_mode(crtc, mode) here, otherwise it will try
to match this mode.
This will prevent the test to use eDP modes that might not be enumerated
in external panels but can still be supported.
Regards,
Ankit
> + *mode_ret = *mode;
> + return;
> + }
> }
> }
>
prev parent reply other threads:[~2026-03-30 9:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-30 5:54 [PATCH i-g-t] tests/kms_setmode: Add HDMI 2.0 clock limit for mode selection Jeevan B
2026-01-30 7:51 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-01-30 8:20 ` ✓ i915.CI.BAT: " Patchwork
2026-01-30 16:33 ` ✗ i915.CI.Full: failure " Patchwork
2026-03-30 9:32 ` Nautiyal, Ankit K [this message]
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=1319a8bf-3c58-4d57-ac32-440380401a13@intel.com \
--to=ankit.k.nautiyal@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jeevan.b@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