* [PATCH v2] drm/msm: dpu: Allow planes to extend past active display @ 2018-08-28 20:50 Sean Paul 2018-08-28 22:04 ` Jeykumar Sankaran [not found] ` <20180828205106.15168-1-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org> 0 siblings, 2 replies; 6+ messages in thread From: Sean Paul @ 2018-08-28 20:50 UTC (permalink / raw) To: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA, freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW Cc: Rajesh Yadav, Rob Clark, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Jordan Crouse, Sean Paul, Jeykumar Sankaran, Sravanthi Kollukuduru From: Sean Paul <seanpaul@chromium.org> The atomic_check is a bit too aggressive with respect to planes which leave the active area. This caused a bunch of log spew when the cursor got to the edge of the screen and stopped it from going all the way. This patch removes the conservative bounds checks from atomic and clips the dst rect such that we properly display planes which go off the screen. Changes in v2: - Apply the clip to src as well (taking into account scaling) Cc: Sravanthi Kollukuduru <skolluku@codeaurora.org> Cc: Jeykumar Sankaran <jsanka@codeaurora.org> Signed-off-by: Sean Paul <seanpaul@chromium.org> --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 3 +-- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 14 +++++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c index 07c2d15b45f2..f0a5e776ba32 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c @@ -1551,8 +1551,7 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc, cnt++; dst = drm_plane_state_dest(pstate); - if (!drm_rect_intersect(&clip, &dst) || - !drm_rect_equals(&clip, &dst)) { + if (!drm_rect_intersect(&clip, &dst)) { DPU_ERROR("invalid vertical/horizontal destination\n"); DPU_ERROR("display: " DRM_RECT_FMT " plane: " DRM_RECT_FMT "\n", DRM_RECT_ARG(&crtc_rect), diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c index efdf9b200dd9..adfd16625188 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c @@ -1254,7 +1254,8 @@ static int dpu_plane_sspp_atomic_update(struct drm_plane *plane, const struct dpu_format *fmt; struct drm_crtc *crtc; struct drm_framebuffer *fb; - struct drm_rect src, dst; + struct drm_rect clip = { 0 }, src, dst; + int hscale, vscale; if (!plane) { DPU_ERROR("invalid plane\n"); @@ -1300,6 +1301,17 @@ static int dpu_plane_sspp_atomic_update(struct drm_plane *plane, dst = drm_plane_state_dest(state); + hscale = drm_rect_calc_hscale(&src, &dst, + pdpu->pipe_sblk->maxupscale, + pdpu->pipe_sblk->maxdwnscale); + vscale = drm_rect_calc_vscale(&src, &dst, + pdpu->pipe_sblk->maxupscale, + pdpu->pipe_sblk->maxdwnscale); + + clip.x2 = crtc->state->adjusted_mode.hdisplay; + clip.y2 = crtc->state->adjusted_mode.vdisplay; + drm_rect_clip_scaled(&src, &dst, &clip, hscale, vscale); + DPU_DEBUG_PLANE(pdpu, "FB[%u] " DRM_RECT_FMT "->crtc%u " DRM_RECT_FMT ", %4.4s ubwc %d\n", fb->base.id, DRM_RECT_ARG(&src), crtc->base.id, DRM_RECT_ARG(&dst), -- Sean Paul, Software Engineer, Google / Chromium OS _______________________________________________ Freedreno mailing list Freedreno@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/freedreno ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2] drm/msm: dpu: Allow planes to extend past active display 2018-08-28 20:50 [PATCH v2] drm/msm: dpu: Allow planes to extend past active display Sean Paul @ 2018-08-28 22:04 ` Jeykumar Sankaran [not found] ` <8e057e8759588455e8a1816dd8336c33-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> [not found] ` <20180828205106.15168-1-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org> 1 sibling, 1 reply; 6+ messages in thread From: Jeykumar Sankaran @ 2018-08-28 22:04 UTC (permalink / raw) To: Sean Paul Cc: Rajesh Yadav, linux-arm-msm, dri-devel, Sean Paul, freedreno, Sravanthi Kollukuduru On 2018-08-28 13:50, Sean Paul wrote: > From: Sean Paul <seanpaul@chromium.org> > > The atomic_check is a bit too aggressive with respect to planes which > leave the active area. This caused a bunch of log spew when the cursor > got to the edge of the screen and stopped it from going all the way. > > This patch removes the conservative bounds checks from atomic and clips > the dst rect such that we properly display planes which go off the > screen. > > Changes in v2: > - Apply the clip to src as well (taking into account scaling) > > Cc: Sravanthi Kollukuduru <skolluku@codeaurora.org> > Cc: Jeykumar Sankaran <jsanka@codeaurora.org> > Signed-off-by: Sean Paul <seanpaul@chromium.org> > --- > drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 3 +-- > drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 14 +++++++++++++- > 2 files changed, 14 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c > b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c > index 07c2d15b45f2..f0a5e776ba32 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c > @@ -1551,8 +1551,7 @@ static int dpu_crtc_atomic_check(struct drm_crtc > *crtc, > cnt++; > > dst = drm_plane_state_dest(pstate); > - if (!drm_rect_intersect(&clip, &dst) || > - !drm_rect_equals(&clip, &dst)) { > + if (!drm_rect_intersect(&clip, &dst)) { > DPU_ERROR("invalid vertical/horizontal > destination\n"); > DPU_ERROR("display: " DRM_RECT_FMT " plane: " > DRM_RECT_FMT "\n", > DRM_RECT_ARG(&crtc_rect), > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > index efdf9b200dd9..adfd16625188 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > @@ -1254,7 +1254,8 @@ static int dpu_plane_sspp_atomic_update(struct > drm_plane *plane, > const struct dpu_format *fmt; > struct drm_crtc *crtc; > struct drm_framebuffer *fb; > - struct drm_rect src, dst; > + struct drm_rect clip = { 0 }, src, dst; > + int hscale, vscale; > > if (!plane) { > DPU_ERROR("invalid plane\n"); > @@ -1300,6 +1301,17 @@ static int dpu_plane_sspp_atomic_update(struct > drm_plane *plane, > > dst = drm_plane_state_dest(state); > > + hscale = drm_rect_calc_hscale(&src, &dst, > + pdpu->pipe_sblk->maxupscale, > + pdpu->pipe_sblk->maxdwnscale); > + vscale = drm_rect_calc_vscale(&src, &dst, > + pdpu->pipe_sblk->maxupscale, > + pdpu->pipe_sblk->maxdwnscale); > + > + clip.x2 = crtc->state->adjusted_mode.hdisplay; > + clip.y2 = crtc->state->adjusted_mode.vdisplay; > + drm_rect_clip_scaled(&src, &dst, &clip, hscale, vscale); > + > DPU_DEBUG_PLANE(pdpu, "FB[%u] " DRM_RECT_FMT "->crtc%u " > DRM_RECT_FMT > ", %4.4s ubwc %d\n", fb->base.id, > DRM_RECT_ARG(&src), > crtc->base.id, DRM_RECT_ARG(&dst), Don't you have to update pdpu->pipe_cfg.src_rect and pdpu->pipe_cfg.dst_rect with clip? -- Jeykumar S _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <8e057e8759588455e8a1816dd8336c33-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>]
* Re: [PATCH v2] drm/msm: dpu: Allow planes to extend past active display [not found] ` <8e057e8759588455e8a1816dd8336c33-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> @ 2018-08-28 22:52 ` Sean Paul [not found] ` <CAMavQKLERkicusw3d4FPuxrZSzHs+-dfkUuCyhij6=-CMGfUMw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Sean Paul @ 2018-08-28 22:52 UTC (permalink / raw) To: Jeykumar Sankaran Cc: Rajesh Yadav, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA, Jordan Crouse, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Rob Clark, Sean Paul, freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Sravanthi Kollukuduru [-- Attachment #1.1: Type: text/plain, Size: 3767 bytes --] On Tue, Aug 28, 2018, 6:04 PM Jeykumar Sankaran <jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> wrote: > On 2018-08-28 13:50, Sean Paul wrote: > > From: Sean Paul <seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> > > > > The atomic_check is a bit too aggressive with respect to planes which > > leave the active area. This caused a bunch of log spew when the cursor > > got to the edge of the screen and stopped it from going all the way. > > > > This patch removes the conservative bounds checks from atomic and clips > > the dst rect such that we properly display planes which go off the > > screen. > > > > Changes in v2: > > - Apply the clip to src as well (taking into account scaling) > > > > Cc: Sravanthi Kollukuduru <skolluku-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> > > Cc: Jeykumar Sankaran <jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> > > Signed-off-by: Sean Paul <seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> > > --- > > drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 3 +-- > > drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 14 +++++++++++++- > > 2 files changed, 14 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c > > b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c > > index 07c2d15b45f2..f0a5e776ba32 100644 > > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c > > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c > > @@ -1551,8 +1551,7 @@ static int dpu_crtc_atomic_check(struct drm_crtc > > *crtc, > > cnt++; > > > > dst = drm_plane_state_dest(pstate); > > - if (!drm_rect_intersect(&clip, &dst) || > > - !drm_rect_equals(&clip, &dst)) { > > + if (!drm_rect_intersect(&clip, &dst)) { > > DPU_ERROR("invalid vertical/horizontal > > destination\n"); > > DPU_ERROR("display: " DRM_RECT_FMT " plane: " > > DRM_RECT_FMT "\n", > > DRM_RECT_ARG(&crtc_rect), > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > > b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > > index efdf9b200dd9..adfd16625188 100644 > > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > > @@ -1254,7 +1254,8 @@ static int dpu_plane_sspp_atomic_update(struct > > drm_plane *plane, > > const struct dpu_format *fmt; > > struct drm_crtc *crtc; > > struct drm_framebuffer *fb; > > - struct drm_rect src, dst; > > + struct drm_rect clip = { 0 }, src, dst; > > + int hscale, vscale; > > > > if (!plane) { > > DPU_ERROR("invalid plane\n"); > > @@ -1300,6 +1301,17 @@ static int dpu_plane_sspp_atomic_update(struct > > drm_plane *plane, > > > > dst = drm_plane_state_dest(state); > > > > + hscale = drm_rect_calc_hscale(&src, &dst, > > + pdpu->pipe_sblk->maxupscale, > > + pdpu->pipe_sblk->maxdwnscale); > > + vscale = drm_rect_calc_vscale(&src, &dst, > > + pdpu->pipe_sblk->maxupscale, > > + pdpu->pipe_sblk->maxdwnscale); > > + > > + clip.x2 = crtc->state->adjusted_mode.hdisplay; > > + clip.y2 = crtc->state->adjusted_mode.vdisplay; > > + drm_rect_clip_scaled(&src, &dst, &clip, hscale, vscale); > > + > > DPU_DEBUG_PLANE(pdpu, "FB[%u] " DRM_RECT_FMT "->crtc%u " > > DRM_RECT_FMT > > ", %4.4s ubwc %d\n", fb->base.id, > > DRM_RECT_ARG(&src), > > crtc->base.id, DRM_RECT_ARG(&dst), > > Don't you have to update pdpu->pipe_cfg.src_rect and > pdpu->pipe_cfg.dst_rect with clip? > No, clip is the active area, so it'll always be equal to the adjusted mode. Sean > -- > Jeykumar S > [-- Attachment #1.2: Type: text/html, Size: 5823 bytes --] [-- Attachment #2: Type: text/plain, Size: 160 bytes --] _______________________________________________ Freedreno mailing list Freedreno@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/freedreno ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <CAMavQKLERkicusw3d4FPuxrZSzHs+-dfkUuCyhij6=-CMGfUMw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH v2] drm/msm: dpu: Allow planes to extend past active display [not found] ` <CAMavQKLERkicusw3d4FPuxrZSzHs+-dfkUuCyhij6=-CMGfUMw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2018-08-29 0:01 ` Jeykumar Sankaran [not found] ` <2c924a940e02978b470e98ee4331f33a-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Jeykumar Sankaran @ 2018-08-29 0:01 UTC (permalink / raw) To: Sean Paul Cc: Rajesh Yadav, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA, Jordan Crouse, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Rob Clark, Sean Paul, freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Sravanthi Kollukuduru On 2018-08-28 15:52, Sean Paul wrote: > On Tue, Aug 28, 2018, 6:04 PM Jeykumar Sankaran > <jsanka@codeaurora.org> wrote: > >> On 2018-08-28 13:50, Sean Paul wrote: >>> From: Sean Paul <seanpaul@chromium.org> >>> >>> The atomic_check is a bit too aggressive with respect to planes >> which >>> leave the active area. This caused a bunch of log spew when the >> cursor >>> got to the edge of the screen and stopped it from going all the >> way. >>> >>> This patch removes the conservative bounds checks from atomic and >> clips >>> the dst rect such that we properly display planes which go off the >>> screen. >>> >>> Changes in v2: >>> - Apply the clip to src as well (taking into account scaling) >>> >>> Cc: Sravanthi Kollukuduru <skolluku@codeaurora.org> >>> Cc: Jeykumar Sankaran <jsanka@codeaurora.org> >>> Signed-off-by: Sean Paul <seanpaul@chromium.org> >>> --- >>> drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 3 +-- >>> drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 14 +++++++++++++- >>> 2 files changed, 14 insertions(+), 3 deletions(-) >>> >>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c >>> b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c >>> index 07c2d15b45f2..f0a5e776ba32 100644 >>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c >>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c >>> @@ -1551,8 +1551,7 @@ static int dpu_crtc_atomic_check(struct >> drm_crtc >>> *crtc, >>> cnt++; >>> >>> dst = drm_plane_state_dest(pstate); >>> - if (!drm_rect_intersect(&clip, &dst) || >>> - !drm_rect_equals(&clip, &dst)) { >>> + if (!drm_rect_intersect(&clip, &dst)) { >>> DPU_ERROR("invalid vertical/horizontal >>> destination\n"); >>> DPU_ERROR("display: " DRM_RECT_FMT " plane: >> " >>> DRM_RECT_FMT "\n", >>> DRM_RECT_ARG(&crtc_rect), >>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c >>> b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c >>> index efdf9b200dd9..adfd16625188 100644 >>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c >>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c >>> @@ -1254,7 +1254,8 @@ static int >> dpu_plane_sspp_atomic_update(struct >>> drm_plane *plane, >>> const struct dpu_format *fmt; >>> struct drm_crtc *crtc; >>> struct drm_framebuffer *fb; >>> - struct drm_rect src, dst; >>> + struct drm_rect clip = { 0 }, src, dst; >>> + int hscale, vscale; >>> >>> if (!plane) { >>> DPU_ERROR("invalid plane\n"); >>> @@ -1300,6 +1301,17 @@ static int >> dpu_plane_sspp_atomic_update(struct >>> drm_plane *plane, >>> >>> dst = drm_plane_state_dest(state); >>> >>> + hscale = drm_rect_calc_hscale(&src, &dst, >>> + pdpu->pipe_sblk->maxupscale, >>> + pdpu->pipe_sblk->maxdwnscale); >>> + vscale = drm_rect_calc_vscale(&src, &dst, >>> + pdpu->pipe_sblk->maxupscale, >>> + pdpu->pipe_sblk->maxdwnscale); >>> + >>> + clip.x2 = crtc->state->adjusted_mode.hdisplay; >>> + clip.y2 = crtc->state->adjusted_mode.vdisplay; >>> + drm_rect_clip_scaled(&src, &dst, &clip, hscale, vscale); >>> + >>> DPU_DEBUG_PLANE(pdpu, "FB[%u] " DRM_RECT_FMT "->crtc%u " >>> DRM_RECT_FMT >>> ", %4.4s ubwc %d\n", fb->base.id [1], >>> DRM_RECT_ARG(&src), >>> crtc->base.id [1], DRM_RECT_ARG(&dst), >> >> Don't you have to update pdpu->pipe_cfg.src_rect and >> pdpu->pipe_cfg.dst_rect with clip? > > No, clip is the active area, so it'll always be equal to the adjusted > mode. > > Sean > Got it! In that case, can drm_atomic_helper_check_plane_state helper be useful here? >> -- >> Jeykumar S > > > Links: > ------ > [1] http://base.id -- Jeykumar S _______________________________________________ Freedreno mailing list Freedreno@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/freedreno ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <2c924a940e02978b470e98ee4331f33a-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>]
* Re: [PATCH v2] drm/msm: dpu: Allow planes to extend past active display [not found] ` <2c924a940e02978b470e98ee4331f33a-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> @ 2018-08-29 12:32 ` Sean Paul 0 siblings, 0 replies; 6+ messages in thread From: Sean Paul @ 2018-08-29 12:32 UTC (permalink / raw) To: Jeykumar Sankaran Cc: Sean Paul, Rajesh Yadav, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA, Jordan Crouse, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Rob Clark, Sean Paul, freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Sravanthi Kollukuduru On Tue, Aug 28, 2018 at 05:01:13PM -0700, Jeykumar Sankaran wrote: > On 2018-08-28 15:52, Sean Paul wrote: > > On Tue, Aug 28, 2018, 6:04 PM Jeykumar Sankaran > > <jsanka@codeaurora.org> wrote: > > > > > On 2018-08-28 13:50, Sean Paul wrote: > > > > From: Sean Paul <seanpaul@chromium.org> > > > > > > > > The atomic_check is a bit too aggressive with respect to planes > > > which > > > > leave the active area. This caused a bunch of log spew when the > > > cursor > > > > got to the edge of the screen and stopped it from going all the > > > way. > > > > > > > > This patch removes the conservative bounds checks from atomic and > > > clips > > > > the dst rect such that we properly display planes which go off the > > > > screen. > > > > > > > > Changes in v2: > > > > - Apply the clip to src as well (taking into account scaling) > > > > > > > > Cc: Sravanthi Kollukuduru <skolluku@codeaurora.org> > > > > Cc: Jeykumar Sankaran <jsanka@codeaurora.org> > > > > Signed-off-by: Sean Paul <seanpaul@chromium.org> > > > > --- > > > > drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 3 +-- > > > > drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 14 +++++++++++++- > > > > 2 files changed, 14 insertions(+), 3 deletions(-) > > > > > > > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c > > > > b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c > > > > index 07c2d15b45f2..f0a5e776ba32 100644 > > > > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c > > > > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c > > > > @@ -1551,8 +1551,7 @@ static int dpu_crtc_atomic_check(struct > > > drm_crtc > > > > *crtc, > > > > cnt++; > > > > > > > > dst = drm_plane_state_dest(pstate); > > > > - if (!drm_rect_intersect(&clip, &dst) || > > > > - !drm_rect_equals(&clip, &dst)) { > > > > + if (!drm_rect_intersect(&clip, &dst)) { > > > > DPU_ERROR("invalid vertical/horizontal > > > > destination\n"); > > > > DPU_ERROR("display: " DRM_RECT_FMT " plane: > > > " > > > > DRM_RECT_FMT "\n", > > > > DRM_RECT_ARG(&crtc_rect), > > > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > > > > b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > > > > index efdf9b200dd9..adfd16625188 100644 > > > > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > > > > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > > > > @@ -1254,7 +1254,8 @@ static int > > > dpu_plane_sspp_atomic_update(struct > > > > drm_plane *plane, > > > > const struct dpu_format *fmt; > > > > struct drm_crtc *crtc; > > > > struct drm_framebuffer *fb; > > > > - struct drm_rect src, dst; > > > > + struct drm_rect clip = { 0 }, src, dst; > > > > + int hscale, vscale; > > > > > > > > if (!plane) { > > > > DPU_ERROR("invalid plane\n"); > > > > @@ -1300,6 +1301,17 @@ static int > > > dpu_plane_sspp_atomic_update(struct > > > > drm_plane *plane, > > > > > > > > dst = drm_plane_state_dest(state); > > > > > > > > + hscale = drm_rect_calc_hscale(&src, &dst, > > > > + pdpu->pipe_sblk->maxupscale, > > > > + pdpu->pipe_sblk->maxdwnscale); > > > > + vscale = drm_rect_calc_vscale(&src, &dst, > > > > + pdpu->pipe_sblk->maxupscale, > > > > + pdpu->pipe_sblk->maxdwnscale); > > > > + > > > > + clip.x2 = crtc->state->adjusted_mode.hdisplay; > > > > + clip.y2 = crtc->state->adjusted_mode.vdisplay; > > > > + drm_rect_clip_scaled(&src, &dst, &clip, hscale, vscale); > > > > + > > > > DPU_DEBUG_PLANE(pdpu, "FB[%u] " DRM_RECT_FMT "->crtc%u " > > > > DRM_RECT_FMT > > > > ", %4.4s ubwc %d\n", fb->base.id [1], > > > > DRM_RECT_ARG(&src), > > > > crtc->base.id [1], DRM_RECT_ARG(&dst), > > > > > > Don't you have to update pdpu->pipe_cfg.src_rect and > > > pdpu->pipe_cfg.dst_rect with clip? > > > > No, clip is the active area, so it'll always be equal to the adjusted > > mode. > > > > Sean > > > > Got it! In that case, can drm_atomic_helper_check_plane_state helper be > useful here? Yeah, good call, I'll switch over to that. Thanks, Sean > > > > -- > > > Jeykumar S > > > > > > Links: > > ------ > > [1] http://base.id > > -- > Jeykumar S -- Sean Paul, Software Engineer, Google / Chromium OS _______________________________________________ Freedreno mailing list Freedreno@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/freedreno ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <20180828205106.15168-1-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>]
* Re: [PATCH v2] drm/msm: dpu: Allow planes to extend past active display [not found] ` <20180828205106.15168-1-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org> @ 2018-08-29 11:52 ` Ville Syrjälä 0 siblings, 0 replies; 6+ messages in thread From: Ville Syrjälä @ 2018-08-29 11:52 UTC (permalink / raw) To: Sean Paul Cc: Rajesh Yadav, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Sean Paul, freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Sravanthi Kollukuduru On Tue, Aug 28, 2018 at 04:50:37PM -0400, Sean Paul wrote: > From: Sean Paul <seanpaul@chromium.org> > > The atomic_check is a bit too aggressive with respect to planes which > leave the active area. This caused a bunch of log spew when the cursor > got to the edge of the screen and stopped it from going all the way. > > This patch removes the conservative bounds checks from atomic and clips > the dst rect such that we properly display planes which go off the > screen. > > Changes in v2: > - Apply the clip to src as well (taking into account scaling) > > Cc: Sravanthi Kollukuduru <skolluku@codeaurora.org> > Cc: Jeykumar Sankaran <jsanka@codeaurora.org> > Signed-off-by: Sean Paul <seanpaul@chromium.org> > --- > drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 3 +-- > drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 14 +++++++++++++- > 2 files changed, 14 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c > index 07c2d15b45f2..f0a5e776ba32 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c > @@ -1551,8 +1551,7 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc, > cnt++; > > dst = drm_plane_state_dest(pstate); > - if (!drm_rect_intersect(&clip, &dst) || > - !drm_rect_equals(&clip, &dst)) { > + if (!drm_rect_intersect(&clip, &dst)) { > DPU_ERROR("invalid vertical/horizontal destination\n"); > DPU_ERROR("display: " DRM_RECT_FMT " plane: " > DRM_RECT_FMT "\n", DRM_RECT_ARG(&crtc_rect), > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > index efdf9b200dd9..adfd16625188 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > @@ -1254,7 +1254,8 @@ static int dpu_plane_sspp_atomic_update(struct drm_plane *plane, > const struct dpu_format *fmt; > struct drm_crtc *crtc; > struct drm_framebuffer *fb; > - struct drm_rect src, dst; > + struct drm_rect clip = { 0 }, src, dst; > + int hscale, vscale; > > if (!plane) { > DPU_ERROR("invalid plane\n"); > @@ -1300,6 +1301,17 @@ static int dpu_plane_sspp_atomic_update(struct drm_plane *plane, > > dst = drm_plane_state_dest(state); > > + hscale = drm_rect_calc_hscale(&src, &dst, > + pdpu->pipe_sblk->maxupscale, > + pdpu->pipe_sblk->maxdwnscale); > + vscale = drm_rect_calc_vscale(&src, &dst, > + pdpu->pipe_sblk->maxupscale, > + pdpu->pipe_sblk->maxdwnscale); > + > + clip.x2 = crtc->state->adjusted_mode.hdisplay; > + clip.y2 = crtc->state->adjusted_mode.vdisplay; > + drm_rect_clip_scaled(&src, &dst, &clip, hscale, vscale); Can't use drm_atomic_helper_check_plane_state() ? > + > DPU_DEBUG_PLANE(pdpu, "FB[%u] " DRM_RECT_FMT "->crtc%u " DRM_RECT_FMT > ", %4.4s ubwc %d\n", fb->base.id, DRM_RECT_ARG(&src), > crtc->base.id, DRM_RECT_ARG(&dst), > -- > Sean Paul, Software Engineer, Google / Chromium OS > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Ville Syrjälä Intel _______________________________________________ Freedreno mailing list Freedreno@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/freedreno ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-08-29 12:32 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2018-08-28 20:50 [PATCH v2] drm/msm: dpu: Allow planes to extend past active display Sean Paul 2018-08-28 22:04 ` Jeykumar Sankaran [not found] ` <8e057e8759588455e8a1816dd8336c33-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> 2018-08-28 22:52 ` Sean Paul [not found] ` <CAMavQKLERkicusw3d4FPuxrZSzHs+-dfkUuCyhij6=-CMGfUMw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2018-08-29 0:01 ` Jeykumar Sankaran [not found] ` <2c924a940e02978b470e98ee4331f33a-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> 2018-08-29 12:32 ` Sean Paul [not found] ` <20180828205106.15168-1-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org> 2018-08-29 11:52 ` Ville Syrjälä
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.