drm/verisilicon: hdmi: Fix to timming for hdmi_setup
authorHoegeun Kwon <hoegeun.kwon@samsung.com>
Wed, 14 Jun 2023 08:06:14 +0000 (17:06 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Mon, 24 Jul 2023 23:25:17 +0000 (08:25 +0900)
When changing the mode, a problem occurs because we try to write a
value to reg in a state that is not resumed after suspend. Move the
timing of writing values to reg to enable.

Change-Id: I49db485e947c164129b1412cdff2a16d6306895e
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
drivers/gpu/drm/verisilicon/starfive_hdmi.c

index 128ecca03309ade445fac700ab6341a4ca7582b6..720e06f578bb80f7eda90116945aee617a25a7ef 100644 (file)
@@ -424,8 +424,6 @@ static void starfive_hdmi_encoder_mode_set(struct drm_encoder *encoder,
 {
        struct starfive_hdmi *hdmi = encoder_to_hdmi(encoder);
 
-       starfive_hdmi_setup(hdmi, adj_mode);
-
        memcpy(&hdmi->previous_mode, adj_mode, sizeof(hdmi->previous_mode));
 }
 
@@ -434,6 +432,9 @@ static void starfive_hdmi_encoder_enable(struct drm_encoder *encoder)
        struct starfive_hdmi *hdmi = encoder_to_hdmi(encoder);
 
        pm_runtime_get_sync(hdmi->dev);
+
+       mdelay(10);
+       starfive_hdmi_setup(hdmi, &hdmi->previous_mode);
 }
 
 static void starfive_hdmi_encoder_disable(struct drm_encoder *encoder)