From 324458242eeaebc09bf8c475cb3aa818f78fa7e5 Mon Sep 17 00:00:00 2001 From: Mark Yao Date: Wed, 20 Apr 2016 10:41:42 +0800 Subject: [PATCH] UPSTREAM: drm/rockchip: inno_hdmi: get rid of rockchip_drm_crtc_mode_config 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 Tested-by: John Keeping Signed-off-by: Yakir Yang (cherry picked from git.kernel.org next/linux-next.git master commit 4e257d9eee23582e36637ce7ea6b14f6f56b1839) --- drivers/gpu/drm/rockchip/inno_hdmi.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index f25244199626..f8b4feb60b25 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -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 = { -- 2.34.1