<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Aug 28, 2018, 6:04 PM Jeykumar Sankaran <<a href="mailto:jsanka@codeaurora.org">jsanka@codeaurora.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 2018-08-28 13:50, Sean Paul wrote:<br>
> From: Sean Paul <<a href="mailto:seanpaul@chromium.org" target="_blank" rel="noreferrer">seanpaul@chromium.org</a>><br>
> <br>
> The atomic_check is a bit too aggressive with respect to planes which<br>
> leave the active area. This caused a bunch of log spew when the cursor<br>
> got to the edge of the screen and stopped it from going all the way.<br>
> <br>
> This patch removes the conservative bounds checks from atomic and clips<br>
> the dst rect such that we properly display planes which go off the<br>
> screen.<br>
> <br>
> Changes in v2:<br>
> - Apply the clip to src as well (taking into account scaling)<br>
> <br>
> Cc: Sravanthi Kollukuduru <<a href="mailto:skolluku@codeaurora.org" target="_blank" rel="noreferrer">skolluku@codeaurora.org</a>><br>
> Cc: Jeykumar Sankaran <<a href="mailto:jsanka@codeaurora.org" target="_blank" rel="noreferrer">jsanka@codeaurora.org</a>><br>
> Signed-off-by: Sean Paul <<a href="mailto:seanpaul@chromium.org" target="_blank" rel="noreferrer">seanpaul@chromium.org</a>><br>
> ---<br>
>  drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c  |  3 +--<br>
>  drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 14 +++++++++++++-<br>
>  2 files changed, 14 insertions(+), 3 deletions(-)<br>
> <br>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c<br>
> b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c<br>
> index 07c2d15b45f2..f0a5e776ba32 100644<br>
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c<br>
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c<br>
> @@ -1551,8 +1551,7 @@ static int dpu_crtc_atomic_check(struct drm_crtc<br>
> *crtc,<br>
>               cnt++;<br>
> <br>
>               dst = drm_plane_state_dest(pstate);<br>
> -             if (!drm_rect_intersect(&clip, &dst) ||<br>
> -                 !drm_rect_equals(&clip, &dst)) {<br>
> +             if (!drm_rect_intersect(&clip, &dst)) {<br>
>                       DPU_ERROR("invalid vertical/horizontal<br>
> destination\n");<br>
>                       DPU_ERROR("display: " DRM_RECT_FMT " plane: "<br>
>                                 DRM_RECT_FMT "\n",<br>
> DRM_RECT_ARG(&crtc_rect),<br>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c<br>
> b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c<br>
> index efdf9b200dd9..adfd16625188 100644<br>
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c<br>
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c<br>
> @@ -1254,7 +1254,8 @@ static int dpu_plane_sspp_atomic_update(struct<br>
> drm_plane *plane,<br>
>       const struct dpu_format *fmt;<br>
>       struct drm_crtc *crtc;<br>
>       struct drm_framebuffer *fb;<br>
> -     struct drm_rect src, dst;<br>
> +     struct drm_rect clip = { 0 }, src, dst;<br>
> +     int hscale, vscale;<br>
> <br>
>       if (!plane) {<br>
>               DPU_ERROR("invalid plane\n");<br>
> @@ -1300,6 +1301,17 @@ static int dpu_plane_sspp_atomic_update(struct<br>
> drm_plane *plane,<br>
> <br>
>       dst = drm_plane_state_dest(state);<br>
> <br>
> +     hscale = drm_rect_calc_hscale(&src, &dst,<br>
> +                                   pdpu->pipe_sblk->maxupscale,<br>
> +                                   pdpu->pipe_sblk->maxdwnscale);<br>
> +     vscale = drm_rect_calc_vscale(&src, &dst,<br>
> +                                   pdpu->pipe_sblk->maxupscale,<br>
> +                                   pdpu->pipe_sblk->maxdwnscale);<br>
> +<br>
> +     clip.x2 = crtc->state->adjusted_mode.hdisplay;<br>
> +     clip.y2 = crtc->state->adjusted_mode.vdisplay;<br>
> +     drm_rect_clip_scaled(&src, &dst, &clip, hscale, vscale);<br>
> +<br>
>       DPU_DEBUG_PLANE(pdpu, "FB[%u] " DRM_RECT_FMT "->crtc%u "<br>
> DRM_RECT_FMT<br>
>                       ", %4.4s ubwc %d\n", fb-><a href="http://base.id" rel="noreferrer noreferrer" target="_blank">base.id</a>,<br>
> DRM_RECT_ARG(&src),<br>
>                       crtc-><a href="http://base.id" rel="noreferrer noreferrer" target="_blank">base.id</a>, DRM_RECT_ARG(&dst),<br>
<br>
Don't you have to update pdpu->pipe_cfg.src_rect and <br>
pdpu->pipe_cfg.dst_rect with clip?<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">No, clip is the active area, so it'll always be equal to the adjusted mode. </div><div dir="auto"><br></div><div dir="auto">Sean</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
-- <br>
Jeykumar S<br>
</blockquote></div></div></div>