Skip to content

Commit 57d13a8

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 6b1559b commit 57d13a8

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
@@ -764,6 +764,24 @@ static int vc4_hdmi_write_infoframe(struct drm_connector *connector,
764764
return ret;
765765
}
766766

767+
static int vc4_hdmi_clear_infoframe(struct drm_connector *connector,
768+
enum hdmi_infoframe_type type)
769+
{
770+
struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector);
771+
struct drm_device *drm = connector->dev;
772+
int ret;
773+
int idx;
774+
775+
if (!drm_dev_enter(drm, &idx))
776+
return 0;
777+
778+
ret = vc4_hdmi_stop_packet(vc4_hdmi, type, true);
779+
if (ret)
780+
drm_err(drm, "Failed to wait for infoframe to go idle: %d\n", ret);
781+
782+
drm_dev_exit(idx);
783+
return ret;
784+
}
767785
#define SCRAMBLING_POLLING_DELAY_MS 1000
768786

769787
static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder)
@@ -1722,6 +1740,7 @@ vc4_hdmi_connector_clock_valid(const struct drm_connector *connector,
17221740
static const struct drm_connector_hdmi_funcs vc4_hdmi_hdmi_connector_funcs = {
17231741
.tmds_char_rate_valid = vc4_hdmi_connector_clock_valid,
17241742
.write_infoframe = vc4_hdmi_write_infoframe,
1743+
.clear_infoframe = vc4_hdmi_clear_infoframe,
17251744
};
17261745

17271746
#define WIFI_2_4GHz_CH1_MIN_FREQ 2400000000ULL

0 commit comments

Comments
 (0)