Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Yitian Shao <fighters390@qq.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	jani.nikula@intel.com, sebastian.wick@redhat.com,
	uma.shankar@intel.com, suraj.kandpal@intel.com
Subject: Re: [PATCH] drm/i915/dp: Attach HDR_OUTPUT_METADATA on eDP when TCON supports HDR
Date: Fri, 20 Nov 2026 16:51:57 +0200	[thread overview]
Message-ID: <awBejWRhQ7VQSL45@intel.com> (raw)
In-Reply-To: <tencent_083AD2514CBC235A9F55EE00BDF72D3B9209@qq.com>

On Fri, Nov 20, 2026 at 01:50:48PM +0800, Yitian Shao wrote:
> intel_dp_has_gamut_metadata_dip() returns false for port A on pre-ICL
> platforms. intel_dp_add_properties() uses that helper to decide whether
> to attach the HDR_OUTPUT_METADATA connector property, so eDP panels on
> those platforms never expose it even when the panel advertises HDR in
> its EDID.
> 
> On such panels the HDR metadata is not sent as a gamut metadata SDP, but
> programmed through the Intel AUX HDR interface instead. The TCON is
> already probed during intel_edp_backlight_setup(), which runs before
> intel_dp_add_properties(), so the capability is known at that point.
> 
> Attach the property when the panel's TCON advertises PQ (ST2084) decode
> support, so that userspace can enable HDR on these panels.
> 
> Since no SDP is transmitted in that case, also bail out early from
> intel_dp_compute_hdr_metadata_infoframe_sdp() when the encoder cannot
> send gamut metadata. Otherwise the computed infoframe state would be
> inconsistent with what is actually programmed, and the state checker
> would complain.
> 
> Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/work_items/10415
> Signed-off-by: Yitian Shao <fighters390@qq.com>
> ---
> Reviewer notes, not part of the commit message:
> 
> Tested on a CometLake-U (Gen9.5) laptop with a 3840x2160 10bpc eDP panel that
> advertises BT2020 + ST2084 in its EDID. With this change the connector gains
> the HDR_OUTPUT_METADATA property, GNOME 50 exposes the HDR switch, and the
> panel enters PQ/BT2020 mode (the DP Colorspace property switches to
> BT2020_RGB). The Intel TCON HDR backlight interface was already in use before
> this change, so the hardware path existed and only the property was missing.
> 
> Two things I am not sure about:
> 
> 1. intel_dp_aux_write_content_luminance() also returns early when
>    !intel_dp_has_gamut_metadata_dip(), which is exactly the PORT_A case where
>    the AUX path is used. max_cll/max_fall therefore never reach the TCON. In
>    my testing Mutter sends all-zero mastering metadata anyway, so I could not
>    tell whether this shows up in practice. Should this check be relaxed too,
>    or is it intentional?

My reading of the "spec" is that we should do the content luminance
write. On the platforms where the SDP is used, I believe the SDP
should actually take precedence over the DPCD based information.

> 
> 2. panel->backlight.edp.intel_cap shares a union with the VESA backlight
>    info, so supports_2084_decode would read unrelated bits if the VESA
>    interface had been selected instead of the Intel one. Would you prefer an
>    explicit "Intel HDR backlight is in use" check here?

Yeah, we probably want that. Maybe a small helper function that does all
the checks we need, so as to not clog up the if-statement too much.

> 
>  drivers/gpu/drm/i915/display/intel_dp.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index afd4169..49142f4 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -3088,6 +3088,9 @@ intel_dp_compute_hdr_metadata_infoframe_sdp(struct intel_dp *intel_dp,
>  	int ret;
>  	struct hdmi_drm_infoframe *drm_infoframe = &crtc_state->infoframes.drm.drm;
>  
> +	if (!intel_dp_has_gamut_metadata_dip(&dp_to_dig_port(intel_dp)->base))
> +		return;
> +
>  	if (!conn_state->hdr_output_metadata)
>  		return;
>  
> @@ -6715,7 +6718,9 @@ intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *_connec
>  		intel_attach_dp_colorspace_property(&connector->base);
>  	}
>  
> -	if (intel_dp_has_gamut_metadata_dip(&dp_to_dig_port(intel_dp)->base))
> +	if (intel_dp_has_gamut_metadata_dip(&dp_to_dig_port(intel_dp)->base) ||
> +	    (intel_dp_is_edp(intel_dp) &&
> +	     connector->panel.backlight.edp.intel_cap.supports_2084_decode))
>  		drm_connector_attach_hdr_output_metadata_property(&connector->base);
>  
>  	if (HAS_VRR(display))
> -- 
> 2.53.0

-- 
Ville Syrjälä
Intel

      parent reply	other threads:[~2026-11-20 14:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20  5:50 [PATCH] drm/i915/dp: Attach HDR_OUTPUT_METADATA on eDP when TCON supports HDR Yitian Shao
2026-11-20  6:15 ` sashiko-bot
2026-11-20 16:10   ` Ville Syrjälä
2026-11-20 14:51 ` Ville Syrjälä [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=awBejWRhQ7VQSL45@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=fighters390@qq.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=sebastian.wick@redhat.com \
    --cc=suraj.kandpal@intel.com \
    --cc=uma.shankar@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