Skip to contentSkip to conversation

drm: Don't block HDR_OUTPUT_METADATA on unknown EOTF

PATCH Superseded Harry Wentland 2 participants 2 messages May 24, 2022 – May 25, 2022

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: Don't block HDR_OUTPUT_METADATA on unknown EOTF

The supported EOTFs are defined in eotf_supported in drm_edid but userspace has no way of knowing what is and isn't supported when creating an HDR_OUTPUT_METADATA and will only know something is wrong when the atomic commit fails.

Since it is expected that userspace reads the EDID to understand what the display supports it doesn't make sense for DRM to block an HDR_OUTPUT_METADATA if it contains an EOTF the kernel doesn't understand.

This comes with the added benefit of future-proofing metadata support. If the spec defines a new EOTF there is no need to update DRM and an compositor can immediately make use of it.

---
 drivers/gpu/drm/drm_edid.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_edid.c +2 -4
index 12893e7be89b..223f96a72064 100644
@@ -5691,10 +5691,8 @@ drm_hdmi_infoframe_set_hdr_metadata(struct hdmi_drm_infoframe *frame,
 
 	/* Sink EOTF is Bit map while infoframe is absolute values */
 	if (!is_eotf_supported(hdr_metadata->hdmi_metadata_type1.eotf,
-	    connector->hdr_sink_metadata.hdmi_type1.eotf)) {
-		DRM_DEBUG_KMS("EOTF Not Supported\n");
-		return -EINVAL;
-	}
+	    connector->hdr_sink_metadata.hdmi_type1.eotf))
+		DRM_DEBUG_KMS("Unknown EOTF %d\n", hdr_metadata->hdmi_metadata_type1.eotf);
 
 	err = hdmi_drm_infoframe_init(frame);
 	if (err < 0)
Signature · 1 line
2.36.1
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · On Tue, 24 May 2022 14:33:20 -0400 Harry Wentland <[email protected]>…

The supported EOTFs are defined in eotf_supported in drm_edid but userspace has no way of knowing what is and isn't supported when creating an HDR_OUTPUT_METADATA and will only know something is wrong when the atomic commit fails.

Hi Harry,

maybe clarify here the two different sets of "supported": EDID data vs. kernel code? I think the paragraph uses the same word for both meanings.

Quoted 10 lines

Since it is expected that userspace reads the EDID to understand what the display supports it doesn't make sense for DRM to block an HDR_OUTPUT_METADATA if it contains an EOTF the kernel doesn't understand.

This comes with the added benefit of future-proofing metadata support. If the spec defines a new EOTF there is no need to update DRM and an compositor can immediately make use of it.

Quoted 7 lines

Thanks,
pq

Quoted 21 lines
---
 drivers/gpu/drm/drm_edid.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_edid.c +2 -4
index 12893e7be89b..223f96a72064 100644
@@ -5691,10 +5691,8 @@ drm_hdmi_infoframe_set_hdr_metadata(struct hdmi_drm_infoframe *frame,
 
 	/* Sink EOTF is Bit map while infoframe is absolute values */
 	if (!is_eotf_supported(hdr_metadata->hdmi_metadata_type1.eotf,
-	    connector->hdr_sink_metadata.hdmi_type1.eotf)) {
-		DRM_DEBUG_KMS("EOTF Not Supported\n");
-		return -EINVAL;
-	}
+	    connector->hdr_sink_metadata.hdmi_type1.eotf))
+		DRM_DEBUG_KMS("Unknown EOTF %d\n", hdr_metadata->hdmi_metadata_type1.eotf);
 
 	err = hdmi_drm_infoframe_init(frame);
 	if (err < 0)