From: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
<intel-gfx@lists.freedesktop.org>
Cc: <intel-xe@lists.freedesktop.org>,
Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Subject: Re: [PATCH 3/9] drm/i915/hdmi: Restructure 4:2:0 vs. 4:4:4 mode validation
Date: Mon, 6 Apr 2026 10:58:27 +0530 [thread overview]
Message-ID: <630b95ab-7637-4397-903f-30ee9d4a286c@intel.com> (raw)
In-Reply-To: <20260330235339.29479-4-ville.syrjala@linux.intel.com>
On 3/31/2026 5:23 AM, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Restructure the HDMI mode validation to resemble the new
> intel_hdmi_compute_formats(). Keeping the two in sync helps
> to avoid different bugs in each.
>
> The main difference between mode_valid() and
> intel_hdmi_compute_formats() is that we don't want the
> Hail Mary RGB fallback for "4:2:0 only" modes.
>
> Cc: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_hdmi.c | 60 ++++++++++++-----------
> 1 file changed, 32 insertions(+), 28 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
> index 16873fc7bcb9..95bd38c620d1 100644
> --- a/drivers/gpu/drm/i915/display/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
> @@ -2045,6 +2045,27 @@ intel_hdmi_sink_format_valid(struct intel_connector *connector,
> }
> }
>
> +static enum drm_mode_status
> +intel_hdmi_mode_valid_format(struct intel_connector *connector,
> + const struct drm_display_mode *mode,
> + int clock, bool has_hdmi_sink,
> + enum intel_output_format sink_format)
> +{
> + struct intel_display *display = to_intel_display(connector);
> + enum drm_mode_status status;
> +
> + status = intel_hdmi_sink_format_valid(connector, mode,
> + has_hdmi_sink, sink_format);
> + if (status != MODE_OK)
> + return status;
> +
> + status = intel_pfit_mode_valid(display, mode, sink_format, 0);
> + if (status != MODE_OK)
> + return status;
> +
> + return intel_hdmi_mode_clock_valid(&connector->base, clock, has_hdmi_sink, sink_format);
> +}
> +
> static enum drm_mode_status
> intel_hdmi_mode_valid(struct drm_connector *_connector,
> const struct drm_display_mode *mode)
> @@ -2052,12 +2073,11 @@ intel_hdmi_mode_valid(struct drm_connector *_connector,
> struct intel_connector *connector = to_intel_connector(_connector);
> struct intel_display *display = to_intel_display(connector);
> struct intel_hdmi *hdmi = intel_attached_hdmi(connector);
> + const struct drm_display_info *info = &connector->base.display_info;
> enum drm_mode_status status;
> int clock = mode->clock;
> int max_dotclk = display->cdclk.max_dotclk_freq;
> bool has_hdmi_sink = intel_has_hdmi_sink(hdmi, connector->base.state);
> - bool ycbcr_420_only;
> - enum intel_output_format sink_format;
>
> status = intel_cpu_transcoder_mode_valid(display, mode);
> if (status != MODE_OK)
> @@ -2084,36 +2104,20 @@ intel_hdmi_mode_valid(struct drm_connector *_connector,
> if (clock > 600000)
> return MODE_CLOCK_HIGH;
>
> - ycbcr_420_only = drm_mode_is_420_only(&connector->base.display_info, mode);
> + if (drm_mode_is_420_only(info, mode)) {
> + status = intel_hdmi_mode_valid_format(connector, mode, clock, has_hdmi_sink,
> + INTEL_OUTPUT_FORMAT_YCBCR420);
> + } else {
> + status = intel_hdmi_mode_valid_format(connector, mode, clock, has_hdmi_sink,
> + INTEL_OUTPUT_FORMAT_RGB);
>
> - if (ycbcr_420_only)
> - sink_format = INTEL_OUTPUT_FORMAT_YCBCR420;
> - else
> - sink_format = INTEL_OUTPUT_FORMAT_RGB;
> -
> - status = intel_pfit_mode_valid(display, mode, sink_format, 0);
> + if (status != MODE_OK && drm_mode_is_420_also(info, mode))
> + status = intel_hdmi_mode_valid_format(connector, mode, clock, has_hdmi_sink,
> + INTEL_OUTPUT_FORMAT_YCBCR420);
> + }
> if (status != MODE_OK)
> return status;
>
> - status = intel_hdmi_mode_clock_valid(&connector->base, clock, has_hdmi_sink, sink_format);
> - if (status != MODE_OK) {
> - if (ycbcr_420_only ||
> - !connector->base.ycbcr_420_allowed ||
> - !drm_mode_is_420_also(&connector->base.display_info, mode))
> - return status;
> -
> - sink_format = INTEL_OUTPUT_FORMAT_YCBCR420;
> -
> - status = intel_pfit_mode_valid(display, mode, sink_format, 0);
> - if (status != MODE_OK)
> - return status;
> -
> - status = intel_hdmi_mode_clock_valid(&connector->base, clock, has_hdmi_sink,
> - sink_format);
> - if (status != MODE_OK)
> - return status;
> - }
> -
> return intel_mode_valid_max_plane_size(display, mode, 1);
> }
>
next prev parent reply other threads:[~2026-04-06 5:28 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-30 23:53 [PATCH 0/9] drm/i915/{dp, hdmi}: Restructure DP/HDMI sink format handling Ville Syrjala
2026-03-30 23:53 ` [PATCH 1/9] drm/i915/hdmi: Add missing intel_pfit_mode_valid() for 4:2:0 also modes Ville Syrjala
2026-04-06 5:23 ` Nautiyal, Ankit K
2026-03-30 23:53 ` [PATCH 2/9] drm/i915/hdmi: Restructure the sink/output format selection Ville Syrjala
2026-03-31 12:12 ` Nicolas Frattaroli
2026-04-06 5:26 ` Nautiyal, Ankit K
2026-04-07 7:14 ` Nicolas Frattaroli
2026-04-06 5:27 ` Nautiyal, Ankit K
2026-03-30 23:53 ` [PATCH 3/9] drm/i915/hdmi: Restructure 4:2:0 vs. 4:4:4 mode validation Ville Syrjala
2026-04-06 5:28 ` Nautiyal, Ankit K [this message]
2026-03-30 23:53 ` [PATCH 4/9] drm/i915/dp: Restructure the sink/output format selection Ville Syrjala
2026-03-31 13:35 ` Nicolas Frattaroli
2026-04-06 5:32 ` Nautiyal, Ankit K
2026-04-07 18:00 ` Ville Syrjälä
2026-04-07 18:20 ` Ville Syrjälä
2026-03-30 23:53 ` [PATCH 5/9] drm/i915/dp: Validate "4:2:0 also" modes twice Ville Syrjala
2026-04-06 8:45 ` Nautiyal, Ankit K
2026-03-30 23:53 ` [PATCH 6/9] drm/i915/dp: Require a HDMI sink for YCbCr output via PCON Ville Syrjala
2026-04-06 8:46 ` Nautiyal, Ankit K
2026-03-30 23:53 ` [PATCH 7/9] drm/i915/dp: Validate sink format in .mode_valid() Ville Syrjala
2026-04-06 8:51 ` Nautiyal, Ankit K
2026-03-30 23:53 ` [PATCH 8/9] drm/i915/hdmi: Make the RGB fallback for "4:2:0 only" modes the last resort Ville Syrjala
2026-04-06 8:52 ` Nautiyal, Ankit K
2026-03-30 23:53 ` [PATCH 9/9] drm/i915/dp: " Ville Syrjala
2026-04-06 8:52 ` Nautiyal, Ankit K
2026-03-31 0:01 ` ✓ CI.KUnit: success for drm/i915/{dp, hdmi}: Restructure DP/HDMI sink format handling Patchwork
2026-03-31 0:40 ` ✓ Xe.CI.BAT: " Patchwork
2026-03-31 4:42 ` ✗ Xe.CI.FULL: failure " 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=630b95ab-7637-4397-903f-30ee9d4a286c@intel.com \
--to=ankit.k.nautiyal@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=nicolas.frattaroli@collabora.com \
--cc=ville.syrjala@linux.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