]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/msm/hdmi: get rid of hdmi_mode
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Wed, 26 Feb 2025 08:59:27 +0000 (10:59 +0200)
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Wed, 5 Mar 2025 02:34:13 +0000 (04:34 +0200)
Use connector->display_info.is_hdmi instead of manually using
drm_detect_hdmi_monitor().

Acked-by: Maxime Ripard <mripard@kernel.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/639657/
Link: https://lore.kernel.org/r/20250226-bridge-hdmi-connector-v8-4-340af24b35cc@linaro.org
drivers/gpu/drm/msm/hdmi/hdmi.c
drivers/gpu/drm/msm/hdmi/hdmi.h
drivers/gpu/drm/msm/hdmi/hdmi_bridge.c

index b14205cb9e977edd0d849e0eafe9b69c0da594bd..6b77e0fb8d5ec218dfbf58215e2e12ad1dfb1b85 100644 (file)
@@ -25,7 +25,7 @@ void msm_hdmi_set_mode(struct hdmi *hdmi, bool power_on)
        spin_lock_irqsave(&hdmi->reg_lock, flags);
        if (power_on) {
                ctrl |= HDMI_CTRL_ENABLE;
-               if (!hdmi->hdmi_mode) {
+               if (!hdmi->connector->display_info.is_hdmi) {
                        ctrl |= HDMI_CTRL_HDMI;
                        hdmi_write(hdmi, REG_HDMI_CTRL, ctrl);
                        ctrl &= ~HDMI_CTRL_HDMI;
index 8faad8440cf70f792da353978b990861b0677ed8..cdd3bd4f37831f9a606a4c3627a48364f5d4025f 100644 (file)
@@ -67,8 +67,6 @@ struct hdmi {
        /* the encoder we are hooked to (outside of hdmi block) */
        struct drm_encoder *encoder;
 
-       bool hdmi_mode;               /* are we in hdmi mode? */
-
        int irq;
        struct workqueue_struct *workq;
 
index f85eeeae083635799e38224d2b2d60129fab42da..96e860dc80fadad2da5700de829547fa110b818a 100644 (file)
@@ -231,7 +231,7 @@ static void msm_hdmi_bridge_atomic_pre_enable(struct drm_bridge *bridge,
                msm_hdmi_phy_resource_enable(phy);
                msm_hdmi_power_on(bridge);
                hdmi->power_on = true;
-               if (hdmi->hdmi_mode)
+               if (connector->display_info.is_hdmi)
                        msm_hdmi_audio_update(hdmi);
        }
 
@@ -263,7 +263,7 @@ static void msm_hdmi_bridge_atomic_post_disable(struct drm_bridge *bridge,
        if (hdmi->power_on) {
                power_off(bridge);
                hdmi->power_on = false;
-               if (hdmi->hdmi_mode)
+               if (hdmi->connector->display_info.is_hdmi)
                        msm_hdmi_audio_update(hdmi);
                msm_hdmi_phy_resource_disable(phy);
        }
@@ -319,7 +319,7 @@ static void msm_hdmi_set_timings(struct hdmi *hdmi,
        DBG("frame_ctrl=%08x", frame_ctrl);
        hdmi_write(hdmi, REG_HDMI_FRAME_CTRL, frame_ctrl);
 
-       if (hdmi->hdmi_mode)
+       if (hdmi->connector->display_info.is_hdmi)
                msm_hdmi_audio_update(hdmi);
 }
 
@@ -338,17 +338,6 @@ static const struct drm_edid *msm_hdmi_bridge_edid_read(struct drm_bridge *bridg
 
        hdmi_write(hdmi, REG_HDMI_CTRL, hdmi_ctrl);
 
-       if (drm_edid) {
-               /*
-                * FIXME: This should use connector->display_info.is_hdmi from a
-                * path that has read the EDID and called
-                * drm_edid_connector_update().
-                */
-               const struct edid *edid = drm_edid_raw(drm_edid);
-
-               hdmi->hdmi_mode = drm_detect_hdmi_monitor(edid);
-       }
-
        return drm_edid;
 }