drm/connector: Allow clearing hdr infoframe
Subsystems (2)
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.
--- 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
@@ -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
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_METADATAblob, 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")Signed-off-by Derek Foreman <[email protected]>--- 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@@ -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
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_METADATAblob, 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")Signed-off-by Derek Foreman <[email protected]>--- 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->setin 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@@ -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