From: Mark Yao Date: Fri, 1 Jul 2016 06:25:13 +0000 (+0800) Subject: drm/rockchip: vop: use new crtc state on atomic check X-Git-Tag: firefly_0821_release~2262 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=90efdd45310a32c7f49cb77883b800cfc59ef553;p=firefly-linux-kernel-4.4.55.git 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 --- 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,