drm/rockchip: boot_logo: encoder atomic_check before enable crtc
authorMark Yao <mark.yao@rock-chips.com>
Wed, 30 Nov 2016 02:10:21 +0000 (10:10 +0800)
committerMark Yao <mark.yao@rock-chips.com>
Thu, 1 Dec 2016 09:11:46 +0000 (17:11 +0800)
We need update encoder output_mode and output_type before enable crtc.

Change-Id: If0c05b4d254dcac2abd6fc024fc3ffc1c5f02323
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
drivers/gpu/drm/rockchip/rockchip_drm_drv.c

index 821e0d1d0d0a7ffccd15ca019d893828dacf6fb2..de7f57cd66cd901d964a4d6280038c813142fff1 100644 (file)
@@ -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);
        }