aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorArchit Taneja <architt@codeaurora.org>2017-10-27 06:57:32 -0400
committerRob Clark <robdclark@gmail.com>2017-10-28 14:02:59 -0400
commit18075d0d4849c670a09ec2056a4fecb994c6ee3e (patch)
treebdd504648e3b646f98bc9f93ad252e4ca0775ace /drivers/gpu
parentaa649e875daf6919bae8d406f115d38a6f39e59c (diff)
drm/msm/mdp5: Don't use async plane update path if plane visibility changes
When a plane moves out of bounds (i.e, outside the crtc clip region), the plane state's "visible" parameter changes to false. When this happens, we (a) release the hwpipe resources away from it, and (b) unstage the corresponding hwpipe(s) from the Layer Mixers in the CRTC. (a) requires use to acquire the global atomic state and assign a new hwpipe. (b) requires us to re-configure the Layer Mixer, which is done in the CRTC. We don't want to do these things in the async plane update path, so return an error if the new state's "visible" isn't the same as the current state's "visible". Cc: Gustavo Padovan <gustavo.padovan@collabora.com> Signed-off-by: Archit Taneja <architt@codeaurora.org> Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
index f1cf367e853d..be50445f9901 100644
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
@@ -470,6 +470,9 @@ static int mdp5_plane_atomic_async_check(struct drm_plane *plane,
470{ 470{
471 struct mdp5_plane_state *mdp5_state = to_mdp5_plane_state(state); 471 struct mdp5_plane_state *mdp5_state = to_mdp5_plane_state(state);
472 struct drm_crtc_state *crtc_state; 472 struct drm_crtc_state *crtc_state;
473 struct drm_rect clip;
474 int min_scale, max_scale;
475 int ret;
473 476
474 crtc_state = drm_atomic_get_existing_crtc_state(state->state, 477 crtc_state = drm_atomic_get_existing_crtc_state(state->state,
475 state->crtc); 478 state->crtc);
@@ -495,6 +498,28 @@ static int mdp5_plane_atomic_async_check(struct drm_plane *plane,
495 plane->state->fb != state->fb) 498 plane->state->fb != state->fb)
496 return -EINVAL; 499 return -EINVAL;
497 500
501 clip.x1 = 0;
502 clip.y1 = 0;
503 clip.x2 = crtc_state->adjusted_mode.hdisplay;
504 clip.y2 = crtc_state->adjusted_mode.vdisplay;
505 min_scale = FRAC_16_16(1, 8);
506 max_scale = FRAC_16_16(8, 1);
507
508 ret = drm_plane_helper_check_state(state, &clip, min_scale,
509 max_scale, true, true);
510 if (ret)
511 return ret;
512
513 /*
514 * if the visibility of the plane changes (i.e, if the cursor is
515 * clipped out completely, we can't take the async path because
516 * we need to stage/unstage the plane from the Layer Mixer(s). We
517 * also assign/unassign the hwpipe(s) tied to the plane. We avoid
518 * taking the fast path for both these reasons.
519 */
520 if (state->visible != plane->state->visible)
521 return -EINVAL;
522
498 return 0; 523 return 0;
499} 524}
500 525