Skip to content

Commit 0110d75

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 0fb0d4d commit 0110d75

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
@@ -708,6 +708,24 @@ static int vc4_hdmi_write_infoframe(struct drm_connector *connector,
708708
return ret;
709709
}
710710

711+
static int vc4_hdmi_clear_infoframe(struct drm_connector *connector,
712+
enum hdmi_infoframe_type type)
713+
{
714+
struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector);
715+
struct drm_device *drm = connector->dev;
716+
int ret;
717+
int idx;
718+
719+
if (!drm_dev_enter(drm, &idx))
720+
return 0;
721+
722+
ret = vc4_hdmi_stop_packet(vc4_hdmi, type, true);
723+
if (ret)
724+
drm_err(drm, "Failed to wait for infoframe to go idle: %d\n", ret);
725+
726+
drm_dev_exit(idx);
727+
return ret;
728+
}
711729
#define SCRAMBLING_POLLING_DELAY_MS 1000
712730

713731
static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder)
@@ -1666,6 +1684,7 @@ vc4_hdmi_connector_clock_valid(const struct drm_connector *connector,
16661684
static const struct drm_connector_hdmi_funcs vc4_hdmi_hdmi_connector_funcs = {
16671685
.tmds_char_rate_valid = vc4_hdmi_connector_clock_valid,
16681686
.write_infoframe = vc4_hdmi_write_infoframe,
1687+
.clear_infoframe = vc4_hdmi_clear_infoframe,
16691688
};
16701689

16711690
#define WIFI_2_4GHz_CH1_MIN_FREQ 2400000000ULL

0 commit comments

Comments
 (0)