Skip to content

Commit 92a206b

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 d2f00af commit 92a206b

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
@@ -736,6 +736,24 @@ static int vc4_hdmi_write_infoframe(struct drm_connector *connector,
736736
return ret;
737737
}
738738

739+
static int vc4_hdmi_clear_infoframe(struct drm_connector *connector,
740+
enum hdmi_infoframe_type type)
741+
{
742+
struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector);
743+
struct drm_device *drm = connector->dev;
744+
int ret;
745+
int idx;
746+
747+
if (!drm_dev_enter(drm, &idx))
748+
return 0;
749+
750+
ret = vc4_hdmi_stop_packet(vc4_hdmi, type, true);
751+
if (ret)
752+
drm_err(drm, "Failed to wait for infoframe to go idle: %d\n", ret);
753+
754+
drm_dev_exit(idx);
755+
return ret;
756+
}
739757
#define SCRAMBLING_POLLING_DELAY_MS 1000
740758

741759
static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder)
@@ -1694,6 +1712,7 @@ vc4_hdmi_connector_clock_valid(const struct drm_connector *connector,
16941712
static const struct drm_connector_hdmi_funcs vc4_hdmi_hdmi_connector_funcs = {
16951713
.tmds_char_rate_valid = vc4_hdmi_connector_clock_valid,
16961714
.write_infoframe = vc4_hdmi_write_infoframe,
1715+
.clear_infoframe = vc4_hdmi_clear_infoframe,
16971716
};
16981717

16991718
#define WIFI_2_4GHz_CH1_MIN_FREQ 2400000000ULL

0 commit comments

Comments
 (0)