Message ID | 20241129213801.617864-1-derek.foreman@collabora.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | drm/connector: Allow clearing hdr infoframe | expand |
On Fri, Nov 29, 2024 at 03:38:01PM -0600, Derek Foreman wrote: > 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") > Signed-off-by: Derek Foreman <derek.foreman@collabora.com> > --- > 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. > > diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c > index feb7a3a75981..1cc4b49b1013 100644 > --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c > +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c > @@ -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; > > -- > 2.45.2 >
diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c index feb7a3a75981..1cc4b49b1013 100644 --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c @@ -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;
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") Signed-off-by: Derek Foreman <derek.foreman@collabora.com> --- drivers/gpu/drm/display/drm_hdmi_state_helper.c | 2 ++ 1 file changed, 2 insertions(+)