Skip to contentSkip to conversation

drm/connector: Allow clearing hdr infoframe

PATCH In review Derek Foreman 2 participants 3 messages Nov 29, 2024 – Dec 2, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/connector: Allow clearing hdr infoframe

When a display isn't presenting HDR content, the infoframe shouldn't be present at all. Currently if we set the HDR_OUTPUT_METADATA blob, we'll set a Dynamic Range and Mastering (DRM) infoframe. If we remove that blob later, the DRM infoframe will linger in its previous state, when we expect it to clear.

Disable the infoframe when no output metadata is present to prevent this from happening.

Fixes f378b77227bc4 ("drm/connector: hdmi: Add Infoframes generation")
---
 drivers/gpu/drm/display/drm_hdmi_state_helper.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/display/drm_hdmi_state_helper.c +2 -0
index feb7a3a75981..1cc4b49b1013 100644
@@ -398,6 +398,8 @@ static int hdmi_generate_hdr_infoframe(const struct drm_connector *connector,
 		&infoframe->data.drm;
 	int ret;
 
+	infoframe->set = false;
+
 	if (connector->max_bpc < 10)
 		return 0;
 
Signature · 1 line
2.45.2
#1 lore raw
Quoted 6 lines · Derek Foreman

When a display isn't presenting HDR content, the infoframe shouldn't be present at all. Currently if we set the HDR_OUTPUT_METADATA blob, we'll set a Dynamic Range and Mastering (DRM) infoframe. If we remove that blob later, the DRM infoframe will linger in its previous state, when we expect it to clear.

Quoted 8 lines

Disable the infoframe when no output metadata is present to prevent this from happening.

Fixes f378b77227bc4 ("drm/connector: hdmi: Add Infoframes generation")
---
 drivers/gpu/drm/display/drm_hdmi_state_helper.c | 2 ++
 1 file changed, 2 insertions(+)

The fix is fine, however please consider extending it to other infoframe types. Clear infoframe->set in the beginning of the corresponding function.

Quoted 17 lines
drivers/gpu/drm/display/drm_hdmi_state_helper.c +2 -0
index feb7a3a75981..1cc4b49b1013 100644
@@ -398,6 +398,8 @@ static int hdmi_generate_hdr_infoframe(const struct drm_connector *connector,
 		&infoframe->data.drm;
 	int ret;
 
+	infoframe->set = false;
+
 	if (connector->max_bpc < 10)
 		return 0;
 
Signature · 1 line
2.45.2
Signature · 2 lines
With best wishes
Dmitry
#2 lore raw
Quoted 10 lines · Dmitry Baryshkov
Quoted 9 lines · Derek Foreman

When a display isn't presenting HDR content, the infoframe shouldn't be present at all. Currently if we set the HDR_OUTPUT_METADATA blob, we'll set a Dynamic Range and Mastering (DRM) infoframe. If we remove that blob later, the DRM infoframe will linger in its previous state, when we expect it to clear.

Disable the infoframe when no output metadata is present to prevent this from happening.

Quoted 8 lines
Quoted 5 lines
Fixes f378b77227bc4 ("drm/connector: hdmi: Add Infoframes generation")
---
  drivers/gpu/drm/display/drm_hdmi_state_helper.c | 2 ++
  1 file changed, 2 insertions(+)

The fix is fine, however please consider extending it to other infoframe types. Clear infoframe->set in the beginning of the corresponding function.

I thought that might be the case, but the other infoframes looked like they would only be cleared if there was an error, where the DRM infoframe was the only one that must be intentionally cleared.

I wasn't certain if it was better to leave a stale infoframe in the highly unlikely case that creating the new one caused an error, or to have the infoframe disappear entirely.

I'll make a new patch to replace this one, and include AVI, SPD, and VSIF infoframes this time.

Thanks,
Derek

Quoted 16 lines
Quoted 16 lines
drivers/gpu/drm/display/drm_hdmi_state_helper.c +2 -0
index feb7a3a75981..1cc4b49b1013 100644
@@ -398,6 +398,8 @@ static int hdmi_generate_hdr_infoframe(const struct drm_connector *connector,
  		&infoframe->data.drm;
  	int ret;
 
+	infoframe->set = false;
+
  	if (connector->max_bpc < 10)
  		return 0;
 
Signature · 1 line
2.45.2