diff options
| -rw-r--r-- | drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index fd370548d7d7..82d55bd8deb6 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c | |||
| @@ -549,6 +549,7 @@ static int vop_plane_atomic_check(struct drm_plane *plane, | |||
| 549 | struct drm_plane_state *state) | 549 | struct drm_plane_state *state) |
| 550 | { | 550 | { |
| 551 | struct drm_crtc *crtc = state->crtc; | 551 | struct drm_crtc *crtc = state->crtc; |
| 552 | struct drm_crtc_state *crtc_state; | ||
| 552 | struct drm_framebuffer *fb = state->fb; | 553 | struct drm_framebuffer *fb = state->fb; |
| 553 | struct vop_win *vop_win = to_vop_win(plane); | 554 | struct vop_win *vop_win = to_vop_win(plane); |
| 554 | struct vop_plane_state *vop_plane_state = to_vop_plane_state(state); | 555 | struct vop_plane_state *vop_plane_state = to_vop_plane_state(state); |
| @@ -563,12 +564,13 @@ static int vop_plane_atomic_check(struct drm_plane *plane, | |||
| 563 | int max_scale = win->phy->scl ? FRAC_16_16(8, 1) : | 564 | int max_scale = win->phy->scl ? FRAC_16_16(8, 1) : |
| 564 | DRM_PLANE_HELPER_NO_SCALING; | 565 | DRM_PLANE_HELPER_NO_SCALING; |
| 565 | 566 | ||
| 566 | crtc = crtc ? crtc : plane->state->crtc; | ||
| 567 | /* | ||
| 568 | * Both crtc or plane->state->crtc can be null. | ||
| 569 | */ | ||
| 570 | if (!crtc || !fb) | 567 | if (!crtc || !fb) |
| 571 | goto out_disable; | 568 | goto out_disable; |
| 569 | |||
| 570 | crtc_state = drm_atomic_get_existing_crtc_state(state->state, crtc); | ||
| 571 | if (WARN_ON(!crtc_state)) | ||
| 572 | return -EINVAL; | ||
| 573 | |||
| 572 | src->x1 = state->src_x; | 574 | src->x1 = state->src_x; |
| 573 | src->y1 = state->src_y; | 575 | src->y1 = state->src_y; |
| 574 | src->x2 = state->src_x + state->src_w; | 576 | src->x2 = state->src_x + state->src_w; |
| @@ -580,8 +582,8 @@ static int vop_plane_atomic_check(struct drm_plane *plane, | |||
| 580 | 582 | ||
| 581 | clip.x1 = 0; | 583 | clip.x1 = 0; |
| 582 | clip.y1 = 0; | 584 | clip.y1 = 0; |
| 583 | clip.x2 = crtc->mode.hdisplay; | 585 | clip.x2 = crtc_state->adjusted_mode.hdisplay; |
| 584 | clip.y2 = crtc->mode.vdisplay; | 586 | clip.y2 = crtc_state->adjusted_mode.vdisplay; |
| 585 | 587 | ||
| 586 | ret = drm_plane_helper_check_update(plane, crtc, state->fb, | 588 | ret = drm_plane_helper_check_update(plane, crtc, state->fb, |
| 587 | src, dest, &clip, | 589 | src, dest, &clip, |
