Skip to content

Commit af28d49

Browse files
6by9popcornmix
authored andcommitted
drm/vc4: hdmi: Add a clear_infoframe hook
If you disable HDR metadata, then the hardware should stop sending the infoframe, and that is implemented by the clear_infoframe hook which wasn't implemented. Add it. Signed-off-by: Dave Stevenson <[email protected]>
1 parent 1461b39 commit af28d49

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

drivers/gpu/drm/vc4/vc4_hdmi.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,24 @@ static int vc4_hdmi_write_infoframe(struct drm_connector *connector,
779779
return ret;
780780
}
781781

782+
static int vc4_hdmi_clear_infoframe(struct drm_connector *connector,
783+
enum hdmi_infoframe_type type)
784+
{
785+
struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector);
786+
struct drm_device *drm = connector->dev;
787+
int ret;
788+
int idx;
789+
790+
if (!drm_dev_enter(drm, &idx))
791+
return 0;
792+
793+
ret = vc4_hdmi_stop_packet(vc4_hdmi, type, true);
794+
if (ret)
795+
drm_err(drm, "Failed to wait for infoframe to go idle: %d\n", ret);
796+
797+
drm_dev_exit(idx);
798+
return ret;
799+
}
782800
#define SCRAMBLING_POLLING_DELAY_MS 1000
783801

784802
static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder)
@@ -1739,6 +1757,7 @@ vc4_hdmi_connector_clock_valid(const struct drm_connector *connector,
17391757
static const struct drm_connector_hdmi_funcs vc4_hdmi_hdmi_connector_funcs = {
17401758
.tmds_char_rate_valid = vc4_hdmi_connector_clock_valid,
17411759
.write_infoframe = vc4_hdmi_write_infoframe,
1760+
.clear_infoframe = vc4_hdmi_clear_infoframe,
17421761
};
17431762

17441763
#define WIFI_2_4GHz_CH1_MIN_FREQ 2400000000ULL

0 commit comments

Comments
 (0)