UPSTREAM: drm/rockchip: inno_hdmi: get rid of rockchip_drm_crtc_mode_config
authorMark Yao <mark.yao@rock-chips.com>
Wed, 20 Apr 2016 02:41:42 +0000 (10:41 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Wed, 1 Jun 2016 09:14:35 +0000 (17:14 +0800)
Save output_type and output_mode into rockchip_crtc_state,
it's nice to make them into atomic.

Change-Id: I35b000a5dc599449dccf98c1fe58de24073b5246
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
Tested-by: John Keeping <john@metanate.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
(cherry picked from git.kernel.org next/linux-next.git master
 commit 4e257d9eee23582e36637ce7ea6b14f6f56b1839)

drivers/gpu/drm/rockchip/inno_hdmi.c

index f2524419962683890c9f5d9d26179e83cd85f4fa..f8b4feb60b256f6e21d8f36b8050c22c7fa02f3e 100644 (file)
@@ -500,9 +500,6 @@ static void inno_hdmi_encoder_enable(struct drm_encoder *encoder)
 {
        struct inno_hdmi *hdmi = to_inno_hdmi(encoder);
 
-       rockchip_drm_crtc_mode_config(encoder->crtc, DRM_MODE_CONNECTOR_HDMIA,
-                                     ROCKCHIP_OUT_MODE_P888);
-
        inno_hdmi_set_pwr_mode(hdmi, NORMAL);
 }
 
@@ -520,11 +517,25 @@ static bool inno_hdmi_encoder_mode_fixup(struct drm_encoder *encoder,
        return true;
 }
 
+static int
+inno_hdmi_encoder_atomic_check(struct drm_encoder *encoder,
+                              struct drm_crtc_state *crtc_state,
+                              struct drm_connector_state *conn_state)
+{
+       struct rockchip_crtc_state *s = to_rockchip_crtc_state(crtc_state);
+
+       s->output_mode = ROCKCHIP_OUT_MODE_P888;
+       s->output_type = DRM_MODE_CONNECTOR_HDMIA;
+
+       return 0;
+}
+
 static struct drm_encoder_helper_funcs inno_hdmi_encoder_helper_funcs = {
        .enable     = inno_hdmi_encoder_enable,
        .disable    = inno_hdmi_encoder_disable,
        .mode_fixup = inno_hdmi_encoder_mode_fixup,
        .mode_set   = inno_hdmi_encoder_mode_set,
+       .atomic_check = inno_hdmi_encoder_atomic_check,
 };
 
 static struct drm_encoder_funcs inno_hdmi_encoder_funcs = {