From: Mark Yao Date: Wed, 30 Nov 2016 02:10:21 +0000 (+0800) Subject: drm/rockchip: boot_logo: encoder atomic_check before enable crtc X-Git-Tag: firefly_0821_release~1184 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=cc5ac765a0311cb42ab3c6681753a1f4738b1257;p=firefly-linux-kernel-4.4.55.git drm/rockchip: boot_logo: encoder atomic_check before enable crtc We need update encoder output_mode and output_type before enable crtc. Change-Id: If0c05b4d254dcac2abd6fc024fc3ffc1c5f02323 Signed-off-by: Mark Yao --- diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c index 821e0d1d0d0a..de7f57cd66cd 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c @@ -423,10 +423,24 @@ static int update_state(struct drm_device *drm_dev, crtc_state->active = true; } else { const struct drm_crtc_helper_funcs *funcs; + const struct drm_encoder_helper_funcs *encoder_helper_funcs; + const struct drm_connector_helper_funcs *connector_helper_funcs; + struct drm_encoder *encoder; funcs = crtc->helper_private; - if (!funcs || !funcs->enable) + connector_helper_funcs = connector->helper_private; + if (!funcs || !funcs->enable || + !connector_helper_funcs || + !connector_helper_funcs->best_encoder) return -ENXIO; + encoder = connector_helper_funcs->best_encoder(connector); + encoder_helper_funcs = encoder->helper_private; + if (!encoder || !encoder_helper_funcs->atomic_check) + return -ENXIO; + ret = encoder_helper_funcs->atomic_check(encoder, crtc->state, + conn_state); + if (ret) + return ret; funcs->enable(crtc); }