]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/vc4: hdmi: implement clear_infoframe
authorDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Wed, 7 Jan 2026 18:14:59 +0000 (20:14 +0200)
committerDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Mon, 19 Jan 2026 11:10:35 +0000 (13:10 +0200)
Implement the clear_infoframe callback, disabling corresponding
InfoFrame type.

Acked-by: Maxime Ripard <mripard@kernel.org>
Link: https://patch.msgid.link/20260107-limit-infoframes-2-v4-2-213d0d3bd490@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
drivers/gpu/drm/vc4/vc4_hdmi.c

index 1798d1156d10bd355ee0d64d165ca66fa6833920..4cfb7ebc0c81246793bdb36bd0999e03975f911d 100644 (file)
@@ -624,6 +624,30 @@ static int vc4_hdmi_stop_packet(struct vc4_hdmi *vc4_hdmi,
        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;
+
+       WARN_ONCE(!(HDMI_READ(HDMI_RAM_PACKET_CONFIG) &
+                   VC4_HDMI_RAM_PACKET_ENABLE),
+                 "Packet RAM has to be on to store the packet.");
+
+       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;
+}
+
 static int vc4_hdmi_write_infoframe(struct drm_connector *connector,
                                    enum hdmi_infoframe_type type,
                                    const u8 *infoframe, size_t len)
@@ -1660,6 +1684,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,
+       .clear_infoframe        = vc4_hdmi_clear_infoframe,
        .write_infoframe        = vc4_hdmi_write_infoframe,
 };