From 90efdd45310a32c7f49cb77883b800cfc59ef553 Mon Sep 17 00:00:00 2001 From: Mark Yao Date: Fri, 1 Jul 2016 14:25:13 +0800 Subject: [PATCH] drm/rockchip: vop: use new crtc state on atomic check That is wrong use old crtc mode on atomic check. Change-Id: Ie37bd842f8bafca04303d641269a84a6016457f4 Signed-off-by: Mark Yao --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index 51bf2929d2c5..c816b3db4b28 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -616,6 +616,7 @@ static int vop_plane_atomic_check(struct drm_plane *plane, struct drm_framebuffer *fb = state->fb; struct vop_win *win = to_vop_win(plane); struct vop_plane_state *vop_plane_state = to_vop_plane_state(state); + struct drm_crtc_state *crtc_state; bool visible; int ret; struct drm_rect *dest = &vop_plane_state->dest; @@ -632,6 +633,11 @@ static int vop_plane_atomic_check(struct drm_plane *plane, */ if (!crtc || !fb) goto out_disable; + + crtc_state = drm_atomic_get_crtc_state(state->state, crtc); + if (IS_ERR(crtc_state)) + return PTR_ERR(crtc_state); + src->x1 = state->src_x; src->y1 = state->src_y; src->x2 = state->src_x + state->src_w; @@ -643,8 +649,8 @@ static int vop_plane_atomic_check(struct drm_plane *plane, clip.x1 = 0; clip.y1 = 0; - clip.x2 = crtc->mode.hdisplay; - clip.y2 = crtc->mode.vdisplay; + clip.x2 = crtc_state->mode.hdisplay; + clip.y2 = crtc_state->mode.vdisplay; ret = drm_plane_helper_check_update(plane, crtc, state->fb, src, dest, &clip, -- 2.34.1