Skip to content

Commit d343577

Browse files
ManMowermripard
authored andcommitted
drm/connector: Allow clearing HDMI infoframes
Our infoframe setting code currently lacks the ability to clear infoframes. For some of the infoframes, we only need to replace them, so if an error occurred when generating a new infoframe we would leave a stale frame instead of clearing the frame. However, the Dynamic Range and Mastering (DRM) infoframe should only be present when displaying HDR content (ie: the HDR_OUTPUT_METADATA blob is set). If we can't clear infoframes, the stale DRM infoframe will remain and we can never set the display back to SDR mode. With this change, we clear infoframes when they can not, or should not, be generated. This fixes switching to an SDR mode from an HDR one. Fixes: f378b77 ("drm/connector: hdmi: Add Infoframes generation") Signed-off-by: Derek Foreman <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
1 parent 9ce43bb commit d343577

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/gpu/drm/display/drm_hdmi_state_helper.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,8 @@ static int hdmi_generate_avi_infoframe(const struct drm_connector *connector,
347347
is_limited_range ? HDMI_QUANTIZATION_RANGE_LIMITED : HDMI_QUANTIZATION_RANGE_FULL;
348348
int ret;
349349

350+
infoframe->set = false;
351+
350352
ret = drm_hdmi_avi_infoframe_from_display_mode(frame, connector, mode);
351353
if (ret)
352354
return ret;
@@ -376,6 +378,8 @@ static int hdmi_generate_spd_infoframe(const struct drm_connector *connector,
376378
&infoframe->data.spd;
377379
int ret;
378380

381+
infoframe->set = false;
382+
379383
ret = hdmi_spd_infoframe_init(frame,
380384
connector->hdmi.vendor,
381385
connector->hdmi.product);
@@ -398,6 +402,8 @@ static int hdmi_generate_hdr_infoframe(const struct drm_connector *connector,
398402
&infoframe->data.drm;
399403
int ret;
400404

405+
infoframe->set = false;
406+
401407
if (connector->max_bpc < 10)
402408
return 0;
403409

@@ -425,6 +431,8 @@ static int hdmi_generate_hdmi_vendor_infoframe(const struct drm_connector *conne
425431
&infoframe->data.vendor.hdmi;
426432
int ret;
427433

434+
infoframe->set = false;
435+
428436
if (!info->has_hdmi_infoframe)
429437
return 0;
430438

0 commit comments

Comments
 (0)