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 <[email protected]> --- 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? 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? 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
