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 <dave.stevenson@raspberrypi.com>
This commit is contained in:
Dave Stevenson
2024-11-21 18:28:22 +00:00
committed by Dom Cobley
parent 1461b39405
commit af28d497a4

View File

@@ -779,6 +779,24 @@ out:
return ret;
}
static int vc4_hdmi_clear_infoframe(struct drm_connector *connector,
enum hdmi_infoframe_type type)
{
struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector);
struct drm_device *drm = connector->dev;
int ret;
int idx;
if (!drm_dev_enter(drm, &idx))
return 0;
ret = vc4_hdmi_stop_packet(vc4_hdmi, type, true);
if (ret)
drm_err(drm, "Failed to wait for infoframe to go idle: %d\n", ret);
drm_dev_exit(idx);
return ret;
}
#define SCRAMBLING_POLLING_DELAY_MS 1000
static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder)
@@ -1739,6 +1757,7 @@ vc4_hdmi_connector_clock_valid(const struct drm_connector *connector,
static const struct drm_connector_hdmi_funcs vc4_hdmi_hdmi_connector_funcs = {
.tmds_char_rate_valid = vc4_hdmi_connector_clock_valid,
.write_infoframe = vc4_hdmi_write_infoframe,
.clear_infoframe = vc4_hdmi_clear_infoframe,
};
#define WIFI_2_4GHz_CH1_MIN_FREQ 2400000000ULL