* [PATCH 00/15] drm: More plane clipping polish @ 2017-11-23 19:04 ` Ville Syrjala 0 siblings, 0 replies; 39+ messages in thread From: Ville Syrjala @ 2017-11-23 19:04 UTC (permalink / raw) To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW Cc: intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Archit Taneja, Ben Skeggs, Brian Starkey, CK Hu, Daniel Vetter, freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Laurent Pinchart, linux-amlogic-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA, linux-tegra-u79uwXL29TY76Z2rM5mHXA, Liviu Dudau, Mali DP Maintainers, Mark Yao, Neil Armstrong, Noralf Trønnes, nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Philipp Zabel, Rob Clark, Shawn Guo, Sinclair Yeh From: Ville Syrjälä <ville.syrjala-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> This series first unifies all users of drm_atomic_helper_check_plane_state() to populate the clip rectangle with drm_mode_get_hv_timing(), and once everything is unified the clip rectangle handling is sucked into drm_atomic_helper_check_plane_state() away from driver code. Entire series available here: git://github.com/vsyrjala/linux.git atomic_plane_helper_clip Cc: Archit Taneja <architt-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> Cc: Ben Skeggs <bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> Cc: Brian Starkey <brian.starkey-5wv7dgnIgG8@public.gmane.org> Cc: CK Hu <ck.hu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org> Cc: Daniel Vetter <daniel-/w4YWyX8dFk@public.gmane.org> Cc: freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Cc: Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org> Cc: linux-amlogic-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: Liviu Dudau <liviu.dudau-5wv7dgnIgG8@public.gmane.org> Cc: Mali DP Maintainers <malidp-VeJGdqYn5oNWk0Htik3J/w@public.gmane.org> Cc: Mark Yao <mark.yao-TNX95d0MmH7DzftRWevZcw@public.gmane.org> Cc: Neil Armstrong <narmstrong-rdvid1DuHRBWk0Htik3J/w@public.gmane.org> Cc: Noralf Trønnes <noralf-L59+Z2yzLopAfugRpC6u6w@public.gmane.org> Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Cc: Philipp Zabel <p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> Cc: Rob Clark <robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Cc: Shawn Guo <shawnguo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> Cc: Sinclair Yeh <syeh-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org> Cc: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Cc: Thomas Hellstrom <thellstrom-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org> Cc: VMware Graphics <linux-graphics-maintainer-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org> Ville Syrjälä (15): drm/i915: Reject odd pipe source width with double wide/dual link drm/i915: Use drm_mode_get_hv_timing() to populate plane clip rectangle drm/arm/hdlcd: Use drm_mode_get_hv_timing() to populate plane clip rectangle drm/arm/mali-dp: Use drm_mode_get_hv_timing() to populate plane clip rectangle drm/simple_kms_helper: Use drm_mode_get_hv_timing() to populate plane clip rectangle drm/imx: Use drm_mode_get_hv_timing() to populate plane clip rectangle drm/mediatek: Use drm_mode_get_hv_timing() to populate plane clip rectangle drm/meson: Use drm_mode_get_hv_timing() to populate plane clip rectangle drm/msm/mdp5: Use drm_mode_get_hv_timing() to populate plane clip rectangle drm/nouveau/kms/nv50: Use drm_mode_get_hv_timing() to populate plane clip rectangle drm/rockchip: Use drm_mode_get_hv_timing() to populate plane clip rectangle drm/tegra/dc: Use drm_mode_get_hv_timing() to populate plane clip rectangle drm/vmwgfx: Use drm_mode_get_hv_timing() to populate plane clip rectangle drm/zte: Use drm_mode_get_hv_timing() to populate plane clip rectangle drm: Don't pass clip to drm_atomic_helper_check_plane_state() drivers/gpu/drm/arm/hdlcd_crtc.c | 6 +----- drivers/gpu/drm/arm/malidp_planes.c | 5 +---- drivers/gpu/drm/armada/armada_overlay.c | 2 +- drivers/gpu/drm/drm_atomic_helper.c | 12 +++++++----- drivers/gpu/drm/drm_plane_helper.c | 11 +++-------- drivers/gpu/drm/drm_simple_kms_helper.c | 5 ----- drivers/gpu/drm/i915/intel_atomic_plane.c | 8 -------- drivers/gpu/drm/i915/intel_display.c | 12 +++++++----- drivers/gpu/drm/i915/intel_drv.h | 1 - drivers/gpu/drm/i915/intel_sprite.c | 8 ++++++-- drivers/gpu/drm/imx/ipuv3-plane.c | 7 +------ drivers/gpu/drm/mediatek/mtk_drm_plane.c | 6 +----- drivers/gpu/drm/meson/meson_plane.c | 6 +----- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 14 ++------------ drivers/gpu/drm/nouveau/nv50_display.c | 8 -------- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 8 +------- drivers/gpu/drm/tegra/dc.c | 8 +------- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 8 +------- drivers/gpu/drm/zte/zx_plane.c | 15 +-------------- include/drm/drm_atomic_helper.h | 1 - include/drm/drm_plane_helper.h | 1 - 21 files changed, 35 insertions(+), 117 deletions(-) -- 2.13.6 ^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 00/15] drm: More plane clipping polish @ 2017-11-23 19:04 ` Ville Syrjala 0 siblings, 0 replies; 39+ messages in thread From: Ville Syrjala @ 2017-11-23 19:04 UTC (permalink / raw) To: linus-amlogic From: Ville Syrj?l? <ville.syrjala@linux.intel.com> This series first unifies all users of drm_atomic_helper_check_plane_state() to populate the clip rectangle with drm_mode_get_hv_timing(), and once everything is unified the clip rectangle handling is sucked into drm_atomic_helper_check_plane_state() away from driver code. Entire series available here: git://github.com/vsyrjala/linux.git atomic_plane_helper_clip Cc: Archit Taneja <architt@codeaurora.org> Cc: Ben Skeggs <bskeggs@redhat.com> Cc: Brian Starkey <brian.starkey@arm.com> Cc: CK Hu <ck.hu@mediatek.com> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: freedreno at lists.freedesktop.org Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: linux-amlogic at lists.infradead.org Cc: linux-arm-msm at vger.kernel.org Cc: linux-tegra at vger.kernel.org Cc: Liviu Dudau <liviu.dudau@arm.com> Cc: Mali DP Maintainers <malidp@foss.arm.com> Cc: Mark Yao <mark.yao@rock-chips.com> Cc: Neil Armstrong <narmstrong@baylibre.com> Cc: Noralf Tr?nnes <noralf@tronnes.org> Cc: nouveau at lists.freedesktop.org Cc: Philipp Zabel <p.zabel@pengutronix.de> Cc: Rob Clark <robdclark@gmail.com> Cc: Shawn Guo <shawnguo@kernel.org> Cc: Sinclair Yeh <syeh@vmware.com> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Thomas Hellstrom <thellstrom@vmware.com> Cc: VMware Graphics <linux-graphics-maintainer@vmware.com> Ville Syrj?l? (15): drm/i915: Reject odd pipe source width with double wide/dual link drm/i915: Use drm_mode_get_hv_timing() to populate plane clip rectangle drm/arm/hdlcd: Use drm_mode_get_hv_timing() to populate plane clip rectangle drm/arm/mali-dp: Use drm_mode_get_hv_timing() to populate plane clip rectangle drm/simple_kms_helper: Use drm_mode_get_hv_timing() to populate plane clip rectangle drm/imx: Use drm_mode_get_hv_timing() to populate plane clip rectangle drm/mediatek: Use drm_mode_get_hv_timing() to populate plane clip rectangle drm/meson: Use drm_mode_get_hv_timing() to populate plane clip rectangle drm/msm/mdp5: Use drm_mode_get_hv_timing() to populate plane clip rectangle drm/nouveau/kms/nv50: Use drm_mode_get_hv_timing() to populate plane clip rectangle drm/rockchip: Use drm_mode_get_hv_timing() to populate plane clip rectangle drm/tegra/dc: Use drm_mode_get_hv_timing() to populate plane clip rectangle drm/vmwgfx: Use drm_mode_get_hv_timing() to populate plane clip rectangle drm/zte: Use drm_mode_get_hv_timing() to populate plane clip rectangle drm: Don't pass clip to drm_atomic_helper_check_plane_state() drivers/gpu/drm/arm/hdlcd_crtc.c | 6 +----- drivers/gpu/drm/arm/malidp_planes.c | 5 +---- drivers/gpu/drm/armada/armada_overlay.c | 2 +- drivers/gpu/drm/drm_atomic_helper.c | 12 +++++++----- drivers/gpu/drm/drm_plane_helper.c | 11 +++-------- drivers/gpu/drm/drm_simple_kms_helper.c | 5 ----- drivers/gpu/drm/i915/intel_atomic_plane.c | 8 -------- drivers/gpu/drm/i915/intel_display.c | 12 +++++++----- drivers/gpu/drm/i915/intel_drv.h | 1 - drivers/gpu/drm/i915/intel_sprite.c | 8 ++++++-- drivers/gpu/drm/imx/ipuv3-plane.c | 7 +------ drivers/gpu/drm/mediatek/mtk_drm_plane.c | 6 +----- drivers/gpu/drm/meson/meson_plane.c | 6 +----- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 14 ++------------ drivers/gpu/drm/nouveau/nv50_display.c | 8 -------- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 8 +------- drivers/gpu/drm/tegra/dc.c | 8 +------- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 8 +------- drivers/gpu/drm/zte/zx_plane.c | 15 +-------------- include/drm/drm_atomic_helper.h | 1 - include/drm/drm_plane_helper.h | 1 - 21 files changed, 35 insertions(+), 117 deletions(-) -- 2.13.6 ^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 01/15] drm/i915: Reject odd pipe source width with double wide/dual link 2017-11-23 19:04 ` Ville Syrjala (?) @ 2017-11-23 19:04 ` Ville Syrjala 2017-11-24 17:04 ` [Intel-gfx] " Daniel Vetter -1 siblings, 1 reply; 39+ messages in thread From: Ville Syrjala @ 2017-11-23 19:04 UTC (permalink / raw) To: dri-devel; +Cc: intel-gfx, Laurent Pinchart From: Ville Syrjälä <ville.syrjala@linux.intel.com> In order to guarantee that pipe_src_w/h matches the user mode h/vdisplay we must not adjust pipe_src_w to accommodate double wide/dual link. Instead just reject the mode outright. This will allows us to rely on crtc_state->mode for plane clipping. Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> --- drivers/gpu/drm/i915/intel_display.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index d67c7c498b34..959d21157328 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -6332,9 +6332,18 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc, * - LVDS dual channel mode * - Double wide pipe */ - if ((intel_crtc_has_type(pipe_config, INTEL_OUTPUT_LVDS) && - intel_is_dual_link_lvds(dev)) || pipe_config->double_wide) - pipe_config->pipe_src_w &= ~1; + if (pipe_config->pipe_src_w & 1) { + if (pipe_config->double_wide) { + DRM_DEBUG_KMS("Odd pipe source width not supported with double wide pipe\n"); + return -EINVAL; + } + + if (intel_crtc_has_type(pipe_config, INTEL_OUTPUT_LVDS) && + intel_is_dual_link_lvds(dev)) { + DRM_DEBUG_KMS("Odd pipe source width not supported with dual link LVDS\n"); + return -EINVAL; + } + } /* Cantiga+ cannot handle modes with a hsync front porch of 0. * WaPruneModeWithIncorrectHsyncOffset:ctg,elk,ilk,snb,ivb,vlv,hsw. -- 2.13.6 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply related [flat|nested] 39+ messages in thread
* Re: [Intel-gfx] [PATCH 01/15] drm/i915: Reject odd pipe source width with double wide/dual link 2017-11-23 19:04 ` [PATCH 01/15] drm/i915: Reject odd pipe source width with double wide/dual link Ville Syrjala @ 2017-11-24 17:04 ` Daniel Vetter 0 siblings, 0 replies; 39+ messages in thread From: Daniel Vetter @ 2017-11-24 17:04 UTC (permalink / raw) To: Ville Syrjala; +Cc: intel-gfx, Laurent Pinchart, dri-devel On Thu, Nov 23, 2017 at 09:04:48PM +0200, Ville Syrjala wrote: > From: Ville Syrjälä <ville.syrjala@linux.intel.com> > > In order to guarantee that pipe_src_w/h matches the user mode h/vdisplay > we must not adjust pipe_src_w to accommodate double wide/dual link. > Instead just reject the mode outright. > > This will allows us to rely on crtc_state->mode for plane clipping. > > Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Might be real good if we have some igt that injects all these kinds of funny modes, just to check for bugs and stuff (i.e. not encoding any expectations that any of them work). Or maybe we need a smart fuzzer for the atomic ioctl for that. Musings aside, on patches 1&2: Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> > --- > drivers/gpu/drm/i915/intel_display.c | 15 ++++++++++++--- > 1 file changed, 12 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c > index d67c7c498b34..959d21157328 100644 > --- a/drivers/gpu/drm/i915/intel_display.c > +++ b/drivers/gpu/drm/i915/intel_display.c > @@ -6332,9 +6332,18 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc, > * - LVDS dual channel mode > * - Double wide pipe > */ > - if ((intel_crtc_has_type(pipe_config, INTEL_OUTPUT_LVDS) && > - intel_is_dual_link_lvds(dev)) || pipe_config->double_wide) > - pipe_config->pipe_src_w &= ~1; > + if (pipe_config->pipe_src_w & 1) { > + if (pipe_config->double_wide) { > + DRM_DEBUG_KMS("Odd pipe source width not supported with double wide pipe\n"); > + return -EINVAL; > + } > + > + if (intel_crtc_has_type(pipe_config, INTEL_OUTPUT_LVDS) && > + intel_is_dual_link_lvds(dev)) { > + DRM_DEBUG_KMS("Odd pipe source width not supported with dual link LVDS\n"); > + return -EINVAL; > + } > + } > > /* Cantiga+ cannot handle modes with a hsync front porch of 0. > * WaPruneModeWithIncorrectHsyncOffset:ctg,elk,ilk,snb,ivb,vlv,hsw. > -- > 2.13.6 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 02/15] drm/i915: Use drm_mode_get_hv_timing() to populate plane clip rectangle 2017-11-23 19:04 ` Ville Syrjala (?) (?) @ 2017-11-23 19:04 ` Ville Syrjala -1 siblings, 0 replies; 39+ messages in thread From: Ville Syrjala @ 2017-11-23 19:04 UTC (permalink / raw) To: dri-devel; +Cc: intel-gfx, Laurent Pinchart From: Ville Syrjälä <ville.syrjala@linux.intel.com> Use drm_mode_get_hv_timing() to fill out the plane clip rectangle. No functional changes since pipe_src_w/h are already filled via drm_mode_get_hv_timing(). Once everyone agrees on this we can move the clip handling into drm_atomic_helper_check_plane_state(). Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> --- drivers/gpu/drm/i915/intel_atomic_plane.c | 8 -------- drivers/gpu/drm/i915/intel_display.c | 14 ++++++++++++-- drivers/gpu/drm/i915/intel_drv.h | 1 - drivers/gpu/drm/i915/intel_sprite.c | 8 ++++++-- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_atomic_plane.c b/drivers/gpu/drm/i915/intel_atomic_plane.c index 8e6dc159f64d..c7984a80706e 100644 --- a/drivers/gpu/drm/i915/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/intel_atomic_plane.c @@ -129,14 +129,6 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_ if (!intel_state->base.crtc && !old_plane_state->base.crtc) return 0; - /* Clip all planes to CRTC size, or 0x0 if CRTC is disabled */ - intel_state->clip.x1 = 0; - intel_state->clip.y1 = 0; - intel_state->clip.x2 = - crtc_state->base.enable ? crtc_state->pipe_src_w : 0; - intel_state->clip.y2 = - crtc_state->base.enable ? crtc_state->pipe_src_h : 0; - if (state->fb && drm_rotation_90_or_270(state->rotation)) { struct drm_format_name_buf format_name; diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 959d21157328..4eeec590b722 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -9267,13 +9267,18 @@ static int intel_check_cursor(struct intel_crtc_state *crtc_state, struct intel_plane_state *plane_state) { const struct drm_framebuffer *fb = plane_state->base.fb; + struct drm_rect clip = {}; int src_x, src_y; u32 offset; int ret; + if (crtc_state->base.enable) + drm_mode_get_hv_timing(&crtc_state->base.mode, + &clip.x2, &clip.y2); + ret = drm_atomic_helper_check_plane_state(&plane_state->base, &crtc_state->base, - &plane_state->clip, + &clip, DRM_PLANE_HELPER_NO_SCALING, DRM_PLANE_HELPER_NO_SCALING, true, true); @@ -12832,6 +12837,7 @@ intel_check_primary_plane(struct intel_plane *plane, int min_scale = DRM_PLANE_HELPER_NO_SCALING; int max_scale = DRM_PLANE_HELPER_NO_SCALING; bool can_position = false; + struct drm_rect clip = {}; int ret; if (INTEL_GEN(dev_priv) >= 9) { @@ -12843,9 +12849,13 @@ intel_check_primary_plane(struct intel_plane *plane, can_position = true; } + if (crtc_state->base.enable) + drm_mode_get_hv_timing(&crtc_state->base.mode, + &clip.x2, &clip.y2); + ret = drm_atomic_helper_check_plane_state(&state->base, &crtc_state->base, - &state->clip, + &clip, min_scale, max_scale, can_position, true); if (ret) diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 635a96fcd788..06017de4a29c 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -403,7 +403,6 @@ struct intel_atomic_state { struct intel_plane_state { struct drm_plane_state base; - struct drm_rect clip; struct i915_vma *vma; struct { diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c index dd485f59eb1d..cffa7a8b0f9c 100644 --- a/drivers/gpu/drm/i915/intel_sprite.c +++ b/drivers/gpu/drm/i915/intel_sprite.c @@ -864,7 +864,7 @@ intel_check_sprite_plane(struct intel_plane *plane, uint32_t src_x, src_y, src_w, src_h; struct drm_rect *src = &state->base.src; struct drm_rect *dst = &state->base.dst; - const struct drm_rect *clip = &state->clip; + struct drm_rect clip = {}; int hscale, vscale; int max_scale, min_scale; bool can_scale; @@ -922,7 +922,11 @@ intel_check_sprite_plane(struct intel_plane *plane, vscale = drm_rect_calc_vscale_relaxed(src, dst, min_scale, max_scale); BUG_ON(vscale < 0); - state->base.visible = drm_rect_clip_scaled(src, dst, clip, hscale, vscale); + if (crtc_state->base.enable) + drm_mode_get_hv_timing(&crtc_state->base.mode, + &clip.x2, &clip.y2); + + state->base.visible = drm_rect_clip_scaled(src, dst, &clip, hscale, vscale); crtc_x = dst->x1; crtc_y = dst->y1; -- 2.13.6 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 03/15] drm/arm/hdlcd: Use drm_mode_get_hv_timing() to populate plane clip rectangle 2017-11-23 19:04 ` Ville Syrjala ` (2 preceding siblings ...) (?) @ 2017-11-23 19:04 ` Ville Syrjala 2017-11-24 11:03 ` Liviu Dudau -1 siblings, 1 reply; 39+ messages in thread From: Ville Syrjala @ 2017-11-23 19:04 UTC (permalink / raw) To: dri-devel; +Cc: Mali DP Maintainers, intel-gfx, Liviu Dudau, Laurent Pinchart From: Ville Syrjälä <ville.syrjala@linux.intel.com> Use drm_mode_get_hv_timing() to fill out the plane clip rectangle. Note that this replaces crtc_state->adjusted_mode usage with crtc_state->mode. The latter is the correct choice since that's the mode the user provided and it matches the plane crtc coordinates the user also provided. Once everyone agrees on this we can move the clip handling into drm_atomic_helper_check_plane_state(). Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Liviu Dudau <liviu.dudau@arm.com> Cc: Brian Starkey <brian.starkey@arm.com> Cc: Mali DP Maintainers <malidp@foss.arm.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> --- drivers/gpu/drm/arm/hdlcd_crtc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c index 63511a3bbf6c..fa852fc1c9e6 100644 --- a/drivers/gpu/drm/arm/hdlcd_crtc.c +++ b/drivers/gpu/drm/arm/hdlcd_crtc.c @@ -249,8 +249,9 @@ static int hdlcd_plane_atomic_check(struct drm_plane *plane, return -EINVAL; } - clip.x2 = crtc_state->adjusted_mode.hdisplay; - clip.y2 = crtc_state->adjusted_mode.vdisplay; + if (crtc_state->enable) + drm_mode_get_hv_timing(&crtc_state->mode, + &clip.x2, &clip.y2); return drm_atomic_helper_check_plane_state(state, crtc_state, &clip, DRM_PLANE_HELPER_NO_SCALING, -- 2.13.6 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply related [flat|nested] 39+ messages in thread
* Re: [PATCH 03/15] drm/arm/hdlcd: Use drm_mode_get_hv_timing() to populate plane clip rectangle 2017-11-23 19:04 ` [PATCH 03/15] drm/arm/hdlcd: " Ville Syrjala @ 2017-11-24 11:03 ` Liviu Dudau 0 siblings, 0 replies; 39+ messages in thread From: Liviu Dudau @ 2017-11-24 11:03 UTC (permalink / raw) To: Ville Syrjala; +Cc: intel-gfx, Mali DP Maintainers, Laurent Pinchart, dri-devel On Thu, Nov 23, 2017 at 09:04:50PM +0200, Ville Syrjala wrote: > From: Ville Syrjälä <ville.syrjala@linux.intel.com> > > Use drm_mode_get_hv_timing() to fill out the plane clip rectangle. > > Note that this replaces crtc_state->adjusted_mode usage with > crtc_state->mode. The latter is the correct choice since that's the > mode the user provided and it matches the plane crtc coordinates > the user also provided. > > Once everyone agrees on this we can move the clip handling into > drm_atomic_helper_check_plane_state(). > > Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > Cc: Liviu Dudau <liviu.dudau@arm.com> > Cc: Brian Starkey <brian.starkey@arm.com> > Cc: Mali DP Maintainers <malidp@foss.arm.com> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Acked-by: Liviu Dudau <liviu.dudau@arm.com> Please let me know if you need me to pull this patch into the HDLCD tree. Best regards, Liviu > --- > drivers/gpu/drm/arm/hdlcd_crtc.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c > index 63511a3bbf6c..fa852fc1c9e6 100644 > --- a/drivers/gpu/drm/arm/hdlcd_crtc.c > +++ b/drivers/gpu/drm/arm/hdlcd_crtc.c > @@ -249,8 +249,9 @@ static int hdlcd_plane_atomic_check(struct drm_plane *plane, > return -EINVAL; > } > > - clip.x2 = crtc_state->adjusted_mode.hdisplay; > - clip.y2 = crtc_state->adjusted_mode.vdisplay; > + if (crtc_state->enable) > + drm_mode_get_hv_timing(&crtc_state->mode, > + &clip.x2, &clip.y2); > > return drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > DRM_PLANE_HELPER_NO_SCALING, > -- > 2.13.6 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- ==================== | I would like to | | fix the world, | | but they're not | | giving me the | \ source code! / --------------- ¯\_(ツ)_/¯ _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 04/15] drm/arm/mali-dp: Use drm_mode_get_hv_timing() to populate plane clip rectangle 2017-11-23 19:04 ` Ville Syrjala ` (3 preceding siblings ...) (?) @ 2017-11-23 19:04 ` Ville Syrjala 2017-11-24 11:03 ` Liviu Dudau -1 siblings, 1 reply; 39+ messages in thread From: Ville Syrjala @ 2017-11-23 19:04 UTC (permalink / raw) To: dri-devel; +Cc: Mali DP Maintainers, intel-gfx, Laurent Pinchart From: Ville Syrjälä <ville.syrjala@linux.intel.com> Use drm_mode_get_hv_timing() to fill out the plane clip rectangle. Note that this replaces crtc_state->adjusted_mode usage with crtc_state->mode. The latter is the correct choice since that's the mode the user provided and it matches the plane crtc coordinates the user also provided. Once everyone agrees on this we can move the clip handling into drm_atomic_helper_check_plane_state(). Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Liviu Dudau <liviu.dudau@arm.com> Cc: Brian Starkey <brian.starkey@arm.com> Cc: Mali DP Maintainers <malidp@foss.arm.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> --- drivers/gpu/drm/arm/malidp_planes.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c index 72a07950167e..2f6d608d6eaf 100644 --- a/drivers/gpu/drm/arm/malidp_planes.c +++ b/drivers/gpu/drm/arm/malidp_planes.c @@ -148,8 +148,10 @@ static int malidp_se_check_scaling(struct malidp_plane *mp, if (!crtc_state) return -EINVAL; - clip.x2 = crtc_state->adjusted_mode.hdisplay; - clip.y2 = crtc_state->adjusted_mode.vdisplay; + if (crtc_state->enable) + drm_mode_get_hv_timing(&crtc_state->mode, + &clip.x2, &clip.y2); + ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, 0, INT_MAX, true, true); if (ret) -- 2.13.6 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply related [flat|nested] 39+ messages in thread
* Re: [PATCH 04/15] drm/arm/mali-dp: Use drm_mode_get_hv_timing() to populate plane clip rectangle 2017-11-23 19:04 ` [PATCH 04/15] drm/arm/mali-dp: " Ville Syrjala @ 2017-11-24 11:03 ` Liviu Dudau 0 siblings, 0 replies; 39+ messages in thread From: Liviu Dudau @ 2017-11-24 11:03 UTC (permalink / raw) To: Ville Syrjala; +Cc: intel-gfx, Mali DP Maintainers, Laurent Pinchart, dri-devel On Thu, Nov 23, 2017 at 09:04:51PM +0200, Ville Syrjala wrote: > From: Ville Syrjälä <ville.syrjala@linux.intel.com> > > Use drm_mode_get_hv_timing() to fill out the plane clip rectangle. > > Note that this replaces crtc_state->adjusted_mode usage with > crtc_state->mode. The latter is the correct choice since that's the > mode the user provided and it matches the plane crtc coordinates > the user also provided. > > Once everyone agrees on this we can move the clip handling into > drm_atomic_helper_check_plane_state(). > > Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > Cc: Liviu Dudau <liviu.dudau@arm.com> > Cc: Brian Starkey <brian.starkey@arm.com> > Cc: Mali DP Maintainers <malidp@foss.arm.com> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Acked-by: Liviu Dudau <liviu.dudau@arm.com> Please let me know if you need me to pull this patch into the mali-dp tree. Best regards, Liviu > --- > drivers/gpu/drm/arm/malidp_planes.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c > index 72a07950167e..2f6d608d6eaf 100644 > --- a/drivers/gpu/drm/arm/malidp_planes.c > +++ b/drivers/gpu/drm/arm/malidp_planes.c > @@ -148,8 +148,10 @@ static int malidp_se_check_scaling(struct malidp_plane *mp, > if (!crtc_state) > return -EINVAL; > > - clip.x2 = crtc_state->adjusted_mode.hdisplay; > - clip.y2 = crtc_state->adjusted_mode.vdisplay; > + if (crtc_state->enable) > + drm_mode_get_hv_timing(&crtc_state->mode, > + &clip.x2, &clip.y2); > + > ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > 0, INT_MAX, true, true); > if (ret) > -- > 2.13.6 > -- ==================== | I would like to | | fix the world, | | but they're not | | giving me the | \ source code! / --------------- ¯\_(ツ)_/¯ _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 05/15] drm/simple_kms_helper: Use drm_mode_get_hv_timing() to populate plane clip rectangle 2017-11-23 19:04 ` Ville Syrjala ` (4 preceding siblings ...) (?) @ 2017-11-23 19:04 ` Ville Syrjala -1 siblings, 0 replies; 39+ messages in thread From: Ville Syrjala @ 2017-11-23 19:04 UTC (permalink / raw) To: dri-devel; +Cc: intel-gfx, Laurent Pinchart From: Ville Syrjälä <ville.syrjala@linux.intel.com> Use drm_mode_get_hv_timing() to fill out the plane clip rectangle. Note that this replaces crtc_state->adjusted_mode usage with crtc_state->mode. The latter is the correct choice since that's the mode the user provided and it matches the plane crtc coordinates the user also provided. Once everyone agrees on this we can move the clip handling into drm_atomic_helper_check_plane_state(). Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Noralf Trønnes <noralf@tronnes.org> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> --- drivers/gpu/drm/drm_simple_kms_helper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_simple_kms_helper.c b/drivers/gpu/drm/drm_simple_kms_helper.c index 9f3b1c94802b..9d3f6b70812c 100644 --- a/drivers/gpu/drm/drm_simple_kms_helper.c +++ b/drivers/gpu/drm/drm_simple_kms_helper.c @@ -100,8 +100,9 @@ static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane, if (!crtc_state->enable) return 0; /* nothing to check when disabling or disabled */ - clip.x2 = crtc_state->adjusted_mode.hdisplay; - clip.y2 = crtc_state->adjusted_mode.vdisplay; + if (crtc_state->enable) + drm_mode_get_hv_timing(&crtc_state->mode, + &clip.x2, &clip.y2); ret = drm_atomic_helper_check_plane_state(plane_state, crtc_state, &clip, -- 2.13.6 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 06/15] drm/imx: Use drm_mode_get_hv_timing() to populate plane clip rectangle 2017-11-23 19:04 ` Ville Syrjala ` (5 preceding siblings ...) (?) @ 2017-11-23 19:04 ` Ville Syrjala 2017-11-24 14:32 ` Philipp Zabel -1 siblings, 1 reply; 39+ messages in thread From: Ville Syrjala @ 2017-11-23 19:04 UTC (permalink / raw) To: dri-devel; +Cc: intel-gfx, Laurent Pinchart From: Ville Syrjälä <ville.syrjala@linux.intel.com> Use drm_mode_get_hv_timing() to fill out the plane clip rectangle. Note that this replaces crtc_state->adjusted_mode usage with crtc_state->mode. The latter is the correct choice since that's the mode the user provided and it matches the plane crtc coordinates the user also provided. Once everyone agrees on this we can move the clip handling into drm_atomic_helper_check_plane_state(). Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> --- drivers/gpu/drm/imx/ipuv3-plane.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3-plane.c index 5a67daedcf4d..c0662503571b 100644 --- a/drivers/gpu/drm/imx/ipuv3-plane.c +++ b/drivers/gpu/drm/imx/ipuv3-plane.c @@ -322,7 +322,7 @@ static int ipu_plane_atomic_check(struct drm_plane *plane, struct drm_framebuffer *old_fb = old_state->fb; unsigned long eba, ubo, vbo, old_ubo, old_vbo, alpha_eba; bool can_position = (plane->type == DRM_PLANE_TYPE_OVERLAY); - struct drm_rect clip; + struct drm_rect clip = {}; int hsub, vsub; int ret; @@ -338,10 +338,10 @@ static int ipu_plane_atomic_check(struct drm_plane *plane, if (WARN_ON(!crtc_state)) return -EINVAL; - clip.x1 = 0; - clip.y1 = 0; - clip.x2 = crtc_state->adjusted_mode.hdisplay; - clip.y2 = crtc_state->adjusted_mode.vdisplay; + if (crtc_state->enable) + drm_mode_get_hv_timing(&crtc_state->mode, + &clip.x2, &clip.y2); + ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, DRM_PLANE_HELPER_NO_SCALING, DRM_PLANE_HELPER_NO_SCALING, -- 2.13.6 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply related [flat|nested] 39+ messages in thread
* Re: [PATCH 06/15] drm/imx: Use drm_mode_get_hv_timing() to populate plane clip rectangle 2017-11-23 19:04 ` [PATCH 06/15] drm/imx: " Ville Syrjala @ 2017-11-24 14:32 ` Philipp Zabel 0 siblings, 0 replies; 39+ messages in thread From: Philipp Zabel @ 2017-11-24 14:32 UTC (permalink / raw) To: Ville Syrjala, dri-devel; +Cc: intel-gfx, Laurent Pinchart On Thu, 2017-11-23 at 21:04 +0200, Ville Syrjala wrote: > From: Ville Syrjälä <ville.syrjala@linux.intel.com> > > Use drm_mode_get_hv_timing() to fill out the plane clip rectangle. > > Note that this replaces crtc_state->adjusted_mode usage with > crtc_state->mode. The latter is the correct choice since that's the > mode the user provided and it matches the plane crtc coordinates > the user also provided. I am not aware of any adjustments that change hdisplay/vdisplay anyway, Acked-by: Philipp Zabel <p.zabel@pengutronix.de> regards Philipp _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 07/15] drm/mediatek: Use drm_mode_get_hv_timing() to populate plane clip rectangle 2017-11-23 19:04 ` Ville Syrjala ` (6 preceding siblings ...) (?) @ 2017-11-23 19:04 ` Ville Syrjala 2017-11-24 14:32 ` Philipp Zabel -1 siblings, 1 reply; 39+ messages in thread From: Ville Syrjala @ 2017-11-23 19:04 UTC (permalink / raw) To: dri-devel; +Cc: intel-gfx, Laurent Pinchart From: Ville Syrjälä <ville.syrjala@linux.intel.com> Use drm_mode_get_hv_timing() to fill out the plane clip rectangle. No functional changes as the code already uses crtc_state->mode to populate the clip, which is also what drm_mode_get_hv_timing() uses. Once everyone agrees on this we can move the clip handling into drm_atomic_helper_check_plane_state(). Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: CK Hu <ck.hu@mediatek.com> Cc: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> --- drivers/gpu/drm/mediatek/mtk_drm_plane.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c index 5ef898b93d8d..b5c6eec9a584 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c @@ -108,8 +108,9 @@ static int mtk_plane_atomic_check(struct drm_plane *plane, if (IS_ERR(crtc_state)) return PTR_ERR(crtc_state); - clip.x2 = crtc_state->mode.hdisplay; - clip.y2 = crtc_state->mode.vdisplay; + if (crtc_state->enable) + drm_mode_get_hv_timing(&crtc_state->mode, + &clip.x2, &clip.y2); return drm_atomic_helper_check_plane_state(state, crtc_state, &clip, DRM_PLANE_HELPER_NO_SCALING, -- 2.13.6 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply related [flat|nested] 39+ messages in thread
* Re: [PATCH 07/15] drm/mediatek: Use drm_mode_get_hv_timing() to populate plane clip rectangle 2017-11-23 19:04 ` [PATCH 07/15] drm/mediatek: " Ville Syrjala @ 2017-11-24 14:32 ` Philipp Zabel 2017-11-24 14:49 ` Ville Syrjälä 0 siblings, 1 reply; 39+ messages in thread From: Philipp Zabel @ 2017-11-24 14:32 UTC (permalink / raw) To: Ville Syrjala, dri-devel; +Cc: intel-gfx, Laurent Pinchart On Thu, 2017-11-23 at 21:04 +0200, Ville Syrjala wrote: > From: Ville Syrjälä <ville.syrjala@linux.intel.com> > > Use drm_mode_get_hv_timing() to fill out the plane clip rectangle. > > No functional changes as the code already uses crtc_state->mode > to populate the clip, which is also what drm_mode_get_hv_timing() > uses. I don't understand this explanation, drm_mode_get_hv_timing uses whichever mode is passed to it? > Once everyone agrees on this we can move the clip handling into > drm_atomic_helper_check_plane_state(). I can see that there are no functional changes though, Acked-by: Philipp Zabel <p.zabel@pengutronix.de> regards Philipp _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 07/15] drm/mediatek: Use drm_mode_get_hv_timing() to populate plane clip rectangle 2017-11-24 14:32 ` Philipp Zabel @ 2017-11-24 14:49 ` Ville Syrjälä 0 siblings, 0 replies; 39+ messages in thread From: Ville Syrjälä @ 2017-11-24 14:49 UTC (permalink / raw) To: Philipp Zabel; +Cc: CK Hu, intel-gfx, Laurent Pinchart, dri-devel On Fri, Nov 24, 2017 at 03:32:22PM +0100, Philipp Zabel wrote: > On Thu, 2017-11-23 at 21:04 +0200, Ville Syrjala wrote: > > From: Ville Syrjälä <ville.syrjala@linux.intel.com> > > > > Use drm_mode_get_hv_timing() to fill out the plane clip rectangle. > > > > No functional changes as the code already uses crtc_state->mode > > to populate the clip, which is also what drm_mode_get_hv_timing() > > uses. > > I don't understand this explanation, drm_mode_get_hv_timing uses > whichever mode is passed to it? Hmm. I worded that badly it seems. The point is that we pass the user mode everywhere else where we want to know the dimensions of the crtc coordinate space. > > > Once everyone agrees on this we can move the clip handling into > > drm_atomic_helper_check_plane_state(). > > I can see that there are no functional changes though, > > Acked-by: Philipp Zabel <p.zabel@pengutronix.de> > > regards > Philipp -- Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 08/15] drm/meson: Use drm_mode_get_hv_timing() to populate plane clip rectangle 2017-11-23 19:04 ` Ville Syrjala @ 2017-11-23 19:04 ` Ville Syrjala -1 siblings, 0 replies; 39+ messages in thread From: Ville Syrjala @ 2017-11-23 19:04 UTC (permalink / raw) To: dri-devel; +Cc: linux-amlogic, intel-gfx, Laurent Pinchart, Neil Armstrong From: Ville Syrjälä <ville.syrjala@linux.intel.com> Use drm_mode_get_hv_timing() to fill out the plane clip rectangle. No functional changes as the code already uses crtc_state->mode to populate the clip, which is also what drm_mode_get_hv_timing() uses. Once everyone agrees on this we can move the clip handling into drm_atomic_helper_check_plane_state(). Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Neil Armstrong <narmstrong@baylibre.com> Cc: linux-amlogic@lists.infradead.org Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> --- drivers/gpu/drm/meson/meson_plane.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/meson/meson_plane.c b/drivers/gpu/drm/meson/meson_plane.c index d0a6ac8390f3..3801bee1f9e6 100644 --- a/drivers/gpu/drm/meson/meson_plane.c +++ b/drivers/gpu/drm/meson/meson_plane.c @@ -58,8 +58,9 @@ static int meson_plane_atomic_check(struct drm_plane *plane, if (IS_ERR(crtc_state)) return PTR_ERR(crtc_state); - clip.x2 = crtc_state->mode.hdisplay; - clip.y2 = crtc_state->mode.vdisplay; + if (crtc_state->enable) + drm_mode_get_hv_timing(&crtc_state->mode, + &clip.x2, &clip.y2); return drm_atomic_helper_check_plane_state(state, crtc_state, &clip, DRM_PLANE_HELPER_NO_SCALING, -- 2.13.6 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 08/15] drm/meson: Use drm_mode_get_hv_timing() to populate plane clip rectangle @ 2017-11-23 19:04 ` Ville Syrjala 0 siblings, 0 replies; 39+ messages in thread From: Ville Syrjala @ 2017-11-23 19:04 UTC (permalink / raw) To: linus-amlogic From: Ville Syrj?l? <ville.syrjala@linux.intel.com> Use drm_mode_get_hv_timing() to fill out the plane clip rectangle. No functional changes as the code already uses crtc_state->mode to populate the clip, which is also what drm_mode_get_hv_timing() uses. Once everyone agrees on this we can move the clip handling into drm_atomic_helper_check_plane_state(). Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Neil Armstrong <narmstrong@baylibre.com> Cc: linux-amlogic at lists.infradead.org Signed-off-by: Ville Syrj?l? <ville.syrjala@linux.intel.com> --- drivers/gpu/drm/meson/meson_plane.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/meson/meson_plane.c b/drivers/gpu/drm/meson/meson_plane.c index d0a6ac8390f3..3801bee1f9e6 100644 --- a/drivers/gpu/drm/meson/meson_plane.c +++ b/drivers/gpu/drm/meson/meson_plane.c @@ -58,8 +58,9 @@ static int meson_plane_atomic_check(struct drm_plane *plane, if (IS_ERR(crtc_state)) return PTR_ERR(crtc_state); - clip.x2 = crtc_state->mode.hdisplay; - clip.y2 = crtc_state->mode.vdisplay; + if (crtc_state->enable) + drm_mode_get_hv_timing(&crtc_state->mode, + &clip.x2, &clip.y2); return drm_atomic_helper_check_plane_state(state, crtc_state, &clip, DRM_PLANE_HELPER_NO_SCALING, -- 2.13.6 ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 09/15] drm/msm/mdp5: Use drm_mode_get_hv_timing() to populate plane clip rectangle 2017-11-23 19:04 ` Ville Syrjala ` (8 preceding siblings ...) (?) @ 2017-11-23 19:04 ` Ville Syrjala 2017-11-26 13:11 ` Archit Taneja -1 siblings, 1 reply; 39+ messages in thread From: Ville Syrjala @ 2017-11-23 19:04 UTC (permalink / raw) To: dri-devel Cc: intel-gfx, Laurent Pinchart, Rob Clark, Archit Taneja, linux-arm-msm, freedreno From: Ville Syrjälä <ville.syrjala@linux.intel.com> Use drm_mode_get_hv_timing() to fill out the plane clip rectangle. Note that this replaces crtc_state->adjusted_mode usage with crtc_state->mode. The latter is the correct choice since that's the mode the user provided and it matches the plane crtc coordinates the user also provided. Once everyone agrees on this we can move the clip handling into drm_atomic_helper_check_plane_state(). Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Rob Clark <robdclark@gmail.com> Cc: Archit Taneja <architt@codeaurora.org> Cc: linux-arm-msm@vger.kernel.org Cc: freedreno@lists.freedesktop.org Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> --- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c index ee41423baeb7..09f758e7bb1b 100644 --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c @@ -286,7 +286,7 @@ static int mdp5_plane_atomic_check_with_state(struct drm_crtc_state *crtc_state, uint32_t max_width, max_height; bool out_of_bounds = false; uint32_t caps = 0; - struct drm_rect clip; + struct drm_rect clip = {}; int min_scale, max_scale; int ret; @@ -320,13 +320,13 @@ static int mdp5_plane_atomic_check_with_state(struct drm_crtc_state *crtc_state, return -ERANGE; } - clip.x1 = 0; - clip.y1 = 0; - clip.x2 = crtc_state->adjusted_mode.hdisplay; - clip.y2 = crtc_state->adjusted_mode.vdisplay; min_scale = FRAC_16_16(1, 8); max_scale = FRAC_16_16(8, 1); + if (crtc_state->enable) + drm_mode_get_hv_timing(&crtc_state->mode, + &clip.x2, &clip.y2); + ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, min_scale, max_scale, true, true); @@ -471,7 +471,7 @@ static int mdp5_plane_atomic_async_check(struct drm_plane *plane, { struct mdp5_plane_state *mdp5_state = to_mdp5_plane_state(state); struct drm_crtc_state *crtc_state; - struct drm_rect clip; + struct drm_rect clip = {}; int min_scale, max_scale; int ret; @@ -499,13 +499,13 @@ static int mdp5_plane_atomic_async_check(struct drm_plane *plane, plane->state->fb != state->fb) return -EINVAL; - clip.x1 = 0; - clip.y1 = 0; - clip.x2 = crtc_state->adjusted_mode.hdisplay; - clip.y2 = crtc_state->adjusted_mode.vdisplay; min_scale = FRAC_16_16(1, 8); max_scale = FRAC_16_16(8, 1); + if (crtc_state->enable) + drm_mode_get_hv_timing(&crtc_state->mode, + &clip.x2, &clip.y2); + ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, min_scale, max_scale, true, true); -- 2.13.6 ^ permalink raw reply related [flat|nested] 39+ messages in thread
* Re: [PATCH 09/15] drm/msm/mdp5: Use drm_mode_get_hv_timing() to populate plane clip rectangle 2017-11-23 19:04 ` [PATCH 09/15] drm/msm/mdp5: " Ville Syrjala @ 2017-11-26 13:11 ` Archit Taneja 0 siblings, 0 replies; 39+ messages in thread From: Archit Taneja @ 2017-11-26 13:11 UTC (permalink / raw) To: Ville Syrjala, dri-devel Cc: intel-gfx, freedreno, Laurent Pinchart, linux-arm-msm On 11/24/2017 12:34 AM, Ville Syrjala wrote: > From: Ville Syrjälä <ville.syrjala@linux.intel.com> > > Use drm_mode_get_hv_timing() to fill out the plane clip rectangle. > > Note that this replaces crtc_state->adjusted_mode usage with > crtc_state->mode. The latter is the correct choice since that's the > mode the user provided and it matches the plane crtc coordinates > the user also provided. > > Once everyone agrees on this we can move the clip handling into > drm_atomic_helper_check_plane_state(). For this and the msm change in patch # 15/15: Reviewed-by: Archit Taneja <architt@codeaurora.org> Thanks, Archit > > Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > Cc: Rob Clark <robdclark@gmail.com> > Cc: Archit Taneja <architt@codeaurora.org> > Cc: linux-arm-msm@vger.kernel.org > Cc: freedreno@lists.freedesktop.org > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> > --- > drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 20 ++++++++++---------- > 1 file changed, 10 insertions(+), 10 deletions(-) > > diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c > index ee41423baeb7..09f758e7bb1b 100644 > --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c > +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c > @@ -286,7 +286,7 @@ static int mdp5_plane_atomic_check_with_state(struct drm_crtc_state *crtc_state, > uint32_t max_width, max_height; > bool out_of_bounds = false; > uint32_t caps = 0; > - struct drm_rect clip; > + struct drm_rect clip = {}; > int min_scale, max_scale; > int ret; > > @@ -320,13 +320,13 @@ static int mdp5_plane_atomic_check_with_state(struct drm_crtc_state *crtc_state, > return -ERANGE; > } > > - clip.x1 = 0; > - clip.y1 = 0; > - clip.x2 = crtc_state->adjusted_mode.hdisplay; > - clip.y2 = crtc_state->adjusted_mode.vdisplay; > min_scale = FRAC_16_16(1, 8); > max_scale = FRAC_16_16(8, 1); > > + if (crtc_state->enable) > + drm_mode_get_hv_timing(&crtc_state->mode, > + &clip.x2, &clip.y2); > + > ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > min_scale, max_scale, > true, true); > @@ -471,7 +471,7 @@ static int mdp5_plane_atomic_async_check(struct drm_plane *plane, > { > struct mdp5_plane_state *mdp5_state = to_mdp5_plane_state(state); > struct drm_crtc_state *crtc_state; > - struct drm_rect clip; > + struct drm_rect clip = {}; > int min_scale, max_scale; > int ret; > > @@ -499,13 +499,13 @@ static int mdp5_plane_atomic_async_check(struct drm_plane *plane, > plane->state->fb != state->fb) > return -EINVAL; > > - clip.x1 = 0; > - clip.y1 = 0; > - clip.x2 = crtc_state->adjusted_mode.hdisplay; > - clip.y2 = crtc_state->adjusted_mode.vdisplay; > min_scale = FRAC_16_16(1, 8); > max_scale = FRAC_16_16(8, 1); > > + if (crtc_state->enable) > + drm_mode_get_hv_timing(&crtc_state->mode, > + &clip.x2, &clip.y2); > + > ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > min_scale, max_scale, > true, true); > -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 11/15] drm/rockchip: Use drm_mode_get_hv_timing() to populate plane clip rectangle 2017-11-23 19:04 ` Ville Syrjala ` (9 preceding siblings ...) (?) @ 2017-11-23 19:04 ` Ville Syrjala -1 siblings, 0 replies; 39+ messages in thread From: Ville Syrjala @ 2017-11-23 19:04 UTC (permalink / raw) To: dri-devel; +Cc: intel-gfx, Laurent Pinchart From: Ville Syrjälä <ville.syrjala@linux.intel.com> Use drm_mode_get_hv_timing() to fill out the plane clip rectangle. Note that this replaces crtc_state->adjusted_mode usage with crtc_state->mode. The latter is the correct choice since that's the mode the user provided and it matches the plane crtc coordinates the user also provided. Once everyone agrees on this we can move the clip handling into drm_atomic_helper_check_plane_state(). Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Mark Yao <mark.yao@rock-chips.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index ba7505292b78..cd2c72389629 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -641,7 +641,7 @@ static int vop_plane_atomic_check(struct drm_plane *plane, struct vop_win *vop_win = to_vop_win(plane); const struct vop_win_data *win = vop_win->data; int ret; - struct drm_rect clip; + struct drm_rect clip = {}; int min_scale = win->phy->scl ? FRAC_16_16(1, 8) : DRM_PLANE_HELPER_NO_SCALING; int max_scale = win->phy->scl ? FRAC_16_16(8, 1) : @@ -654,10 +654,9 @@ static int vop_plane_atomic_check(struct drm_plane *plane, if (WARN_ON(!crtc_state)) return -EINVAL; - clip.x1 = 0; - clip.y1 = 0; - clip.x2 = crtc_state->adjusted_mode.hdisplay; - clip.y2 = crtc_state->adjusted_mode.vdisplay; + if (crtc_state->enable) + drm_mode_get_hv_timing(&crtc_state->mode, + &clip.x2, &clip.y2); ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, min_scale, max_scale, -- 2.13.6 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply related [flat|nested] 39+ messages in thread
[parent not found: <20171123190502.28449-1-ville.syrjala-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>]
* [PATCH 10/15] drm/nouveau/kms/nv50: Use drm_mode_get_hv_timing() to populate plane clip rectangle [not found] ` <20171123190502.28449-1-ville.syrjala-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> @ 2017-11-23 19:04 ` Ville Syrjala 2017-11-23 19:04 ` [PATCH 12/15] drm/tegra/dc: " Ville Syrjala 2017-11-24 13:41 ` Thierry Reding 2 siblings, 0 replies; 39+ messages in thread From: Ville Syrjala @ 2017-11-23 19:04 UTC (permalink / raw) To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Laurent Pinchart, Ben Skeggs From: Ville Syrjälä <ville.syrjala@linux.intel.com> Use drm_mode_get_hv_timing() to fill out the plane clip rectangle. No functional changes as the code already uses crtc_state->mode to populate the clip, which is also what drm_mode_get_hv_timing() uses. Once everyone agrees on this we can move the clip handling into drm_atomic_helper_check_plane_state(). Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Ben Skeggs <bskeggs@redhat.com> Cc: nouveau@lists.freedesktop.org Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> --- drivers/gpu/drm/nouveau/nv50_display.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c index 65336948e807..7d8307ec442c 100644 --- a/drivers/gpu/drm/nouveau/nv50_display.c +++ b/drivers/gpu/drm/nouveau/nv50_display.c @@ -228,8 +228,6 @@ struct nv50_wndw_atom { struct drm_plane_state state; u8 interval; - struct drm_rect clip; - struct { u32 handle; u16 offset:12; @@ -840,10 +838,6 @@ nv50_wndw_atomic_check_acquire(struct nv50_wndw *wndw, int ret; NV_ATOMIC(drm, "%s acquire\n", wndw->plane.name); - asyw->clip.x1 = 0; - asyw->clip.y1 = 0; - asyw->clip.x2 = asyh->state.mode.hdisplay; - asyw->clip.y2 = asyh->state.mode.vdisplay; asyw->image.w = fb->base.width; asyw->image.h = fb->base.height; @@ -1141,10 +1135,15 @@ static int nv50_curs_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, struct nv50_head_atom *asyh) { + struct drm_rect clip = {}; int ret; + if (asyh->state.enable) + drm_mode_get_hv_timing(&asyh->state.mode, + &clip.x2, &clip.y2); + ret = drm_atomic_helper_check_plane_state(&asyw->state, &asyh->state, - &asyw->clip, + &clip, DRM_PLANE_HELPER_NO_SCALING, DRM_PLANE_HELPER_NO_SCALING, true, true); @@ -1428,13 +1427,18 @@ nv50_base_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, struct nv50_head_atom *asyh) { const struct drm_framebuffer *fb = asyw->state.fb; + struct drm_rect clip = {}; int ret; if (!fb->format->depth) return -EINVAL; + if (asyh->state.enable) + drm_mode_get_hv_timing(&asyh->state.mode, + &clip.x2, &clip.y2); + ret = drm_atomic_helper_check_plane_state(&asyw->state, &asyh->state, - &asyw->clip, + &clip, DRM_PLANE_HELPER_NO_SCALING, DRM_PLANE_HELPER_NO_SCALING, false, true); -- 2.13.6 _______________________________________________ Nouveau mailing list Nouveau@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/nouveau ^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 12/15] drm/tegra/dc: Use drm_mode_get_hv_timing() to populate plane clip rectangle [not found] ` <20171123190502.28449-1-ville.syrjala-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> 2017-11-23 19:04 ` [PATCH 10/15] drm/nouveau/kms/nv50: " Ville Syrjala @ 2017-11-23 19:04 ` Ville Syrjala [not found] ` <20171123190502.28449-13-ville.syrjala-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> 2017-11-24 13:41 ` Thierry Reding 2 siblings, 1 reply; 39+ messages in thread From: Ville Syrjala @ 2017-11-23 19:04 UTC (permalink / raw) To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW Cc: intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Laurent Pinchart, Thierry Reding, linux-tegra-u79uwXL29TY76Z2rM5mHXA From: Ville Syrjälä <ville.syrjala-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> Use drm_mode_get_hv_timing() to fill out the plane clip rectangle. No functional changes as the code already uses crtc_state->mode to populate the clip, which is also what drm_mode_get_hv_timing() uses. Once everyone agrees on this we can move the clip handling into drm_atomic_helper_check_plane_state(). Cc: Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org> Cc: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Signed-off-by: Ville Syrjälä <ville.syrjala-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> --- drivers/gpu/drm/tegra/dc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index fc70351b9017..93b47e0e038b 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -477,7 +477,7 @@ static int tegra_plane_state_add(struct tegra_plane *plane, { struct drm_crtc_state *crtc_state; struct tegra_dc_state *tegra; - struct drm_rect clip; + struct drm_rect clip = {}; int err; /* Propagate errors from allocation or locking failures. */ @@ -485,10 +485,9 @@ static int tegra_plane_state_add(struct tegra_plane *plane, if (IS_ERR(crtc_state)) return PTR_ERR(crtc_state); - clip.x1 = 0; - clip.y1 = 0; - clip.x2 = crtc_state->mode.hdisplay; - clip.y2 = crtc_state->mode.vdisplay; + if (crtc_state->enable) + drm_mode_get_hv_timing(&crtc_state->mode, + &clip.x2, &clip.y2); /* Check plane state for visibility and calculate clipping bounds */ err = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, -- 2.13.6 ^ permalink raw reply related [flat|nested] 39+ messages in thread
[parent not found: <20171123190502.28449-13-ville.syrjala-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>]
* Re: [PATCH 12/15] drm/tegra/dc: Use drm_mode_get_hv_timing() to populate plane clip rectangle [not found] ` <20171123190502.28449-13-ville.syrjala-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> @ 2017-11-24 13:42 ` Thierry Reding 0 siblings, 0 replies; 39+ messages in thread From: Thierry Reding @ 2017-11-24 13:42 UTC (permalink / raw) To: Ville Syrjala Cc: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Laurent Pinchart, linux-tegra-u79uwXL29TY76Z2rM5mHXA [-- Attachment #1: Type: text/plain, Size: 1034 bytes --] On Thu, Nov 23, 2017 at 09:04:59PM +0200, Ville Syrjala wrote: > From: Ville Syrjälä <ville.syrjala-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> > > Use drm_mode_get_hv_timing() to fill out the plane clip rectangle. > > No functional changes as the code already uses crtc_state->mode > to populate the clip, which is also what drm_mode_get_hv_timing() > uses. > > Once everyone agrees on this we can move the clip handling into > drm_atomic_helper_check_plane_state(). > > Cc: Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org> > Cc: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > Signed-off-by: Ville Syrjälä <ville.syrjala-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> > --- > drivers/gpu/drm/tegra/dc.c | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) I assume you want to take this through drm-misc, so: Acked-by: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 00/15] drm: More plane clipping polish 2017-11-23 19:04 ` Ville Syrjala @ 2017-11-24 13:41 ` Thierry Reding -1 siblings, 0 replies; 39+ messages in thread From: Thierry Reding @ 2017-11-24 13:41 UTC (permalink / raw) To: Ville Syrjala Cc: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Archit Taneja, Ben Skeggs, Brian Starkey, CK Hu, Daniel Vetter, freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Laurent Pinchart, linux-amlogic-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA, linux-tegra-u79uwXL29TY76Z2rM5mHXA, Liviu Dudau, Mali DP Maintainers, Mark Yao, Neil Armstrong, Noralf Trønnes, nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Philipp Zabel, Rob Clark, Shawn Guo [-- Attachment #1: Type: text/plain, Size: 4887 bytes --] On Thu, Nov 23, 2017 at 09:04:47PM +0200, Ville Syrjala wrote: > From: Ville Syrjälä <ville.syrjala-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> > > This series first unifies all users of drm_atomic_helper_check_plane_state() > to populate the clip rectangle with drm_mode_get_hv_timing(), and once > everything is unified the clip rectangle handling is sucked into > drm_atomic_helper_check_plane_state() away from driver code. > > Entire series available here: > git://github.com/vsyrjala/linux.git atomic_plane_helper_clip > > Cc: Archit Taneja <architt-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> > Cc: Ben Skeggs <bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> > Cc: Brian Starkey <brian.starkey-5wv7dgnIgG8@public.gmane.org> > Cc: CK Hu <ck.hu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org> > Cc: Daniel Vetter <daniel-/w4YWyX8dFk@public.gmane.org> > Cc: freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org > Cc: Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org> > Cc: linux-amlogic-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org > Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > Cc: Liviu Dudau <liviu.dudau-5wv7dgnIgG8@public.gmane.org> > Cc: Mali DP Maintainers <malidp-VeJGdqYn5oNWk0Htik3J/w@public.gmane.org> > Cc: Mark Yao <mark.yao-TNX95d0MmH7DzftRWevZcw@public.gmane.org> > Cc: Neil Armstrong <narmstrong-rdvid1DuHRBWk0Htik3J/w@public.gmane.org> > Cc: Noralf Trønnes <noralf-L59+Z2yzLopAfugRpC6u6w@public.gmane.org> > Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org > Cc: Philipp Zabel <p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> > Cc: Rob Clark <robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > Cc: Shawn Guo <shawnguo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> > Cc: Sinclair Yeh <syeh-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org> > Cc: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > Cc: Thomas Hellstrom <thellstrom-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org> > Cc: VMware Graphics <linux-graphics-maintainer-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org> > > Ville Syrjälä (15): > drm/i915: Reject odd pipe source width with double wide/dual link > drm/i915: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/arm/hdlcd: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/arm/mali-dp: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/simple_kms_helper: Use drm_mode_get_hv_timing() to populate plane > clip rectangle > drm/imx: Use drm_mode_get_hv_timing() to populate plane clip rectangle > drm/mediatek: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/meson: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/msm/mdp5: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/nouveau/kms/nv50: Use drm_mode_get_hv_timing() to populate plane > clip rectangle > drm/rockchip: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/tegra/dc: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/vmwgfx: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/zte: Use drm_mode_get_hv_timing() to populate plane clip rectangle > drm: Don't pass clip to drm_atomic_helper_check_plane_state() > > drivers/gpu/drm/arm/hdlcd_crtc.c | 6 +----- > drivers/gpu/drm/arm/malidp_planes.c | 5 +---- > drivers/gpu/drm/armada/armada_overlay.c | 2 +- > drivers/gpu/drm/drm_atomic_helper.c | 12 +++++++----- > drivers/gpu/drm/drm_plane_helper.c | 11 +++-------- > drivers/gpu/drm/drm_simple_kms_helper.c | 5 ----- > drivers/gpu/drm/i915/intel_atomic_plane.c | 8 -------- > drivers/gpu/drm/i915/intel_display.c | 12 +++++++----- > drivers/gpu/drm/i915/intel_drv.h | 1 - > drivers/gpu/drm/i915/intel_sprite.c | 8 ++++++-- > drivers/gpu/drm/imx/ipuv3-plane.c | 7 +------ > drivers/gpu/drm/mediatek/mtk_drm_plane.c | 6 +----- > drivers/gpu/drm/meson/meson_plane.c | 6 +----- > drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 14 ++------------ > drivers/gpu/drm/nouveau/nv50_display.c | 8 -------- > drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 8 +------- > drivers/gpu/drm/tegra/dc.c | 8 +------- > drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 8 +------- > drivers/gpu/drm/zte/zx_plane.c | 15 +-------------- > include/drm/drm_atomic_helper.h | 1 - > include/drm/drm_plane_helper.h | 1 - > 21 files changed, 35 insertions(+), 117 deletions(-) The series: Reviewed-by: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 00/15] drm: More plane clipping polish @ 2017-11-24 13:41 ` Thierry Reding 0 siblings, 0 replies; 39+ messages in thread From: Thierry Reding @ 2017-11-24 13:41 UTC (permalink / raw) To: linus-amlogic On Thu, Nov 23, 2017 at 09:04:47PM +0200, Ville Syrjala wrote: > From: Ville Syrj?l? <ville.syrjala@linux.intel.com> > > This series first unifies all users of drm_atomic_helper_check_plane_state() > to populate the clip rectangle with drm_mode_get_hv_timing(), and once > everything is unified the clip rectangle handling is sucked into > drm_atomic_helper_check_plane_state() away from driver code. > > Entire series available here: > git://github.com/vsyrjala/linux.git atomic_plane_helper_clip > > Cc: Archit Taneja <architt@codeaurora.org> > Cc: Ben Skeggs <bskeggs@redhat.com> > Cc: Brian Starkey <brian.starkey@arm.com> > Cc: CK Hu <ck.hu@mediatek.com> > Cc: Daniel Vetter <daniel@ffwll.ch> > Cc: freedreno at lists.freedesktop.org > Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > Cc: linux-amlogic at lists.infradead.org > Cc: linux-arm-msm at vger.kernel.org > Cc: linux-tegra at vger.kernel.org > Cc: Liviu Dudau <liviu.dudau@arm.com> > Cc: Mali DP Maintainers <malidp@foss.arm.com> > Cc: Mark Yao <mark.yao@rock-chips.com> > Cc: Neil Armstrong <narmstrong@baylibre.com> > Cc: Noralf Tr?nnes <noralf@tronnes.org> > Cc: nouveau at lists.freedesktop.org > Cc: Philipp Zabel <p.zabel@pengutronix.de> > Cc: Rob Clark <robdclark@gmail.com> > Cc: Shawn Guo <shawnguo@kernel.org> > Cc: Sinclair Yeh <syeh@vmware.com> > Cc: Thierry Reding <thierry.reding@gmail.com> > Cc: Thomas Hellstrom <thellstrom@vmware.com> > Cc: VMware Graphics <linux-graphics-maintainer@vmware.com> > > Ville Syrj?l? (15): > drm/i915: Reject odd pipe source width with double wide/dual link > drm/i915: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/arm/hdlcd: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/arm/mali-dp: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/simple_kms_helper: Use drm_mode_get_hv_timing() to populate plane > clip rectangle > drm/imx: Use drm_mode_get_hv_timing() to populate plane clip rectangle > drm/mediatek: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/meson: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/msm/mdp5: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/nouveau/kms/nv50: Use drm_mode_get_hv_timing() to populate plane > clip rectangle > drm/rockchip: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/tegra/dc: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/vmwgfx: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/zte: Use drm_mode_get_hv_timing() to populate plane clip rectangle > drm: Don't pass clip to drm_atomic_helper_check_plane_state() > > drivers/gpu/drm/arm/hdlcd_crtc.c | 6 +----- > drivers/gpu/drm/arm/malidp_planes.c | 5 +---- > drivers/gpu/drm/armada/armada_overlay.c | 2 +- > drivers/gpu/drm/drm_atomic_helper.c | 12 +++++++----- > drivers/gpu/drm/drm_plane_helper.c | 11 +++-------- > drivers/gpu/drm/drm_simple_kms_helper.c | 5 ----- > drivers/gpu/drm/i915/intel_atomic_plane.c | 8 -------- > drivers/gpu/drm/i915/intel_display.c | 12 +++++++----- > drivers/gpu/drm/i915/intel_drv.h | 1 - > drivers/gpu/drm/i915/intel_sprite.c | 8 ++++++-- > drivers/gpu/drm/imx/ipuv3-plane.c | 7 +------ > drivers/gpu/drm/mediatek/mtk_drm_plane.c | 6 +----- > drivers/gpu/drm/meson/meson_plane.c | 6 +----- > drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 14 ++------------ > drivers/gpu/drm/nouveau/nv50_display.c | 8 -------- > drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 8 +------- > drivers/gpu/drm/tegra/dc.c | 8 +------- > drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 8 +------- > drivers/gpu/drm/zte/zx_plane.c | 15 +-------------- > include/drm/drm_atomic_helper.h | 1 - > include/drm/drm_plane_helper.h | 1 - > 21 files changed, 35 insertions(+), 117 deletions(-) The series: Reviewed-by: Thierry Reding <treding@nvidia.com> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: <http://lists.infradead.org/pipermail/linux-amlogic/attachments/20171124/16bb87d7/attachment.sig> ^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 13/15] drm/vmwgfx: Use drm_mode_get_hv_timing() to populate plane clip rectangle 2017-11-23 19:04 ` Ville Syrjala ` (11 preceding siblings ...) (?) @ 2017-11-23 19:05 ` Ville Syrjala 2017-11-28 5:11 ` Sinclair Yeh -1 siblings, 1 reply; 39+ messages in thread From: Ville Syrjala @ 2017-11-23 19:05 UTC (permalink / raw) To: dri-devel; +Cc: intel-gfx, Thomas Hellstrom, VMware Graphics, Laurent Pinchart From: Ville Syrjälä <ville.syrjala@linux.intel.com> Use drm_mode_get_hv_timing() to fill out the plane clip rectangle. Note that this replaces crtc_state->adjusted_mode usage with crtc_state->mode. The latter is the correct choice since that's the mode the user provided and it matches the plane crtc coordinates the user also provided. Once everyone agrees on this we can move the clip handling into drm_atomic_helper_check_plane_state(). Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: VMware Graphics <linux-graphics-maintainer@vmware.com> Cc: Sinclair Yeh <syeh@vmware.com> Cc: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> --- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index a2a93d7e2a04..25d96560180b 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c @@ -449,10 +449,9 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane, if (state->crtc) crtc_state = drm_atomic_get_new_crtc_state(state->state, state->crtc); - if (crtc_state && crtc_state->enable) { - clip.x2 = crtc_state->adjusted_mode.hdisplay; - clip.y2 = crtc_state->adjusted_mode.vdisplay; - } + if (crtc_state && crtc_state->enable) + drm_mode_get_hv_timing(&crtc_state->mode, + &clip.x2, &clip.y2); ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, DRM_PLANE_HELPER_NO_SCALING, -- 2.13.6 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply related [flat|nested] 39+ messages in thread
* Re: [PATCH 13/15] drm/vmwgfx: Use drm_mode_get_hv_timing() to populate plane clip rectangle 2017-11-23 19:05 ` [PATCH 13/15] drm/vmwgfx: Use drm_mode_get_hv_timing() to populate plane clip rectangle Ville Syrjala @ 2017-11-28 5:11 ` Sinclair Yeh 0 siblings, 0 replies; 39+ messages in thread From: Sinclair Yeh @ 2017-11-28 5:11 UTC (permalink / raw) To: Ville Syrjala Cc: intel-gfx, VMware Graphics, Laurent Pinchart, dri-devel, Thomas Hellstrom This looks okay to me. Reviewed-by: Sinclair Yeh <syeh@vmware.com> On Thu, Nov 23, 2017 at 09:05:00PM +0200, Ville Syrjala wrote: > From: Ville Syrjälä <ville.syrjala@linux.intel.com> > > Use drm_mode_get_hv_timing() to fill out the plane clip rectangle. > > Note that this replaces crtc_state->adjusted_mode usage with > crtc_state->mode. The latter is the correct choice since that's the > mode the user provided and it matches the plane crtc coordinates > the user also provided. > > Once everyone agrees on this we can move the clip handling into > drm_atomic_helper_check_plane_state(). > > Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > Cc: VMware Graphics <linux-graphics-maintainer@vmware.com> > Cc: Sinclair Yeh <syeh@vmware.com> > Cc: Thomas Hellstrom <thellstrom@vmware.com> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> > --- > drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c > index a2a93d7e2a04..25d96560180b 100644 > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c > @@ -449,10 +449,9 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane, > if (state->crtc) > crtc_state = drm_atomic_get_new_crtc_state(state->state, state->crtc); > > - if (crtc_state && crtc_state->enable) { > - clip.x2 = crtc_state->adjusted_mode.hdisplay; > - clip.y2 = crtc_state->adjusted_mode.vdisplay; > - } > + if (crtc_state && crtc_state->enable) > + drm_mode_get_hv_timing(&crtc_state->mode, > + &clip.x2, &clip.y2); > > ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > DRM_PLANE_HELPER_NO_SCALING, > -- > 2.13.6 > _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 14/15] drm/zte: Use drm_mode_get_hv_timing() to populate plane clip rectangle 2017-11-23 19:04 ` Ville Syrjala ` (12 preceding siblings ...) (?) @ 2017-11-23 19:05 ` Ville Syrjala 2017-11-29 6:41 ` Shawn Guo -1 siblings, 1 reply; 39+ messages in thread From: Ville Syrjala @ 2017-11-23 19:05 UTC (permalink / raw) To: dri-devel; +Cc: intel-gfx, Shawn Guo, Laurent Pinchart From: Ville Syrjälä <ville.syrjala@linux.intel.com> Use drm_mode_get_hv_timing() to fill out the plane clip rectangle. Note that this replaces crtc_state->adjusted_mode usage with crtc_state->mode. The latter is the correct choice since that's the mode the user provided and it matches the plane crtc coordinates the user also provided. Once everyone agrees on this we can move the clip handling into drm_atomic_helper_check_plane_state(). Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Shawn Guo <shawnguo@kernel.org> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> --- drivers/gpu/drm/zte/zx_plane.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/zte/zx_plane.c b/drivers/gpu/drm/zte/zx_plane.c index 68fd2e2dc78a..8e1f34274e24 100644 --- a/drivers/gpu/drm/zte/zx_plane.c +++ b/drivers/gpu/drm/zte/zx_plane.c @@ -55,7 +55,7 @@ static int zx_vl_plane_atomic_check(struct drm_plane *plane, struct drm_framebuffer *fb = plane_state->fb; struct drm_crtc *crtc = plane_state->crtc; struct drm_crtc_state *crtc_state; - struct drm_rect clip; + struct drm_rect clip = {}; int min_scale = FRAC_16_16(1, 8); int max_scale = FRAC_16_16(8, 1); @@ -75,10 +75,9 @@ static int zx_vl_plane_atomic_check(struct drm_plane *plane, if (!plane_state->crtc) return -EINVAL; - clip.x1 = 0; - clip.y1 = 0; - clip.x2 = crtc_state->adjusted_mode.hdisplay; - clip.y2 = crtc_state->adjusted_mode.vdisplay; + if (crtc_state->enable) + drm_mode_get_hv_timing(&crtc_state->mode, + &clip.x2, &clip.y2); return drm_atomic_helper_check_plane_state(plane_state, crtc_state, &clip, min_scale, max_scale, @@ -292,7 +291,7 @@ static int zx_gl_plane_atomic_check(struct drm_plane *plane, struct drm_framebuffer *fb = plane_state->fb; struct drm_crtc *crtc = plane_state->crtc; struct drm_crtc_state *crtc_state; - struct drm_rect clip; + struct drm_rect clip = {}; if (!crtc || !fb) return 0; @@ -310,10 +309,9 @@ static int zx_gl_plane_atomic_check(struct drm_plane *plane, if (!plane_state->crtc) return -EINVAL; - clip.x1 = 0; - clip.y1 = 0; - clip.x2 = crtc_state->adjusted_mode.hdisplay; - clip.y2 = crtc_state->adjusted_mode.vdisplay; + if (crtc_state->enable) + drm_mode_get_hv_timing(&crtc_state->mode, + &clip.x2, &clip.y2); return drm_atomic_helper_check_plane_state(plane_state, crtc_state, &clip, -- 2.13.6 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply related [flat|nested] 39+ messages in thread
* Re: [PATCH 14/15] drm/zte: Use drm_mode_get_hv_timing() to populate plane clip rectangle 2017-11-23 19:05 ` [PATCH 14/15] drm/zte: " Ville Syrjala @ 2017-11-29 6:41 ` Shawn Guo 0 siblings, 0 replies; 39+ messages in thread From: Shawn Guo @ 2017-11-29 6:41 UTC (permalink / raw) To: Ville Syrjala; +Cc: intel-gfx, Laurent Pinchart, dri-devel On Thu, Nov 23, 2017 at 09:05:01PM +0200, Ville Syrjala wrote: > From: Ville Syrjälä <ville.syrjala@linux.intel.com> > > Use drm_mode_get_hv_timing() to fill out the plane clip rectangle. > > Note that this replaces crtc_state->adjusted_mode usage with > crtc_state->mode. The latter is the correct choice since that's the > mode the user provided and it matches the plane crtc coordinates > the user also provided. > > Once everyone agrees on this we can move the clip handling into > drm_atomic_helper_check_plane_state(). > > Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > Cc: Shawn Guo <shawnguo@kernel.org> Acked-by: Shawn Guo <shawnguo@kernel.org> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 15/15] drm: Don't pass clip to drm_atomic_helper_check_plane_state() 2017-11-23 19:04 ` Ville Syrjala ` (13 preceding siblings ...) (?) @ 2017-11-23 19:05 ` Ville Syrjala 2017-11-24 11:59 ` Liviu Dudau ` (2 more replies) -1 siblings, 3 replies; 39+ messages in thread From: Ville Syrjala @ 2017-11-23 19:05 UTC (permalink / raw) To: dri-devel; +Cc: intel-gfx, Laurent Pinchart From: Ville Syrjälä <ville.syrjala@linux.intel.com> Move the plane clip rectangle handling into drm_atomic_helper_check_plane_state(). Drivers no longer have to worry about such mundane details. Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Daniel Vetter <daniel@ffwll.ch> Suggested-by: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> --- drivers/gpu/drm/arm/hdlcd_crtc.c | 7 +------ drivers/gpu/drm/arm/malidp_planes.c | 7 +------ drivers/gpu/drm/armada/armada_overlay.c | 6 +----- drivers/gpu/drm/drm_atomic_helper.c | 12 +++++++----- drivers/gpu/drm/drm_plane_helper.c | 11 +++-------- drivers/gpu/drm/drm_simple_kms_helper.c | 6 ------ drivers/gpu/drm/i915/intel_display.c | 12 ------------ drivers/gpu/drm/imx/ipuv3-plane.c | 7 +------ drivers/gpu/drm/mediatek/mtk_drm_plane.c | 7 +------ drivers/gpu/drm/meson/meson_plane.c | 7 +------ drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 14 ++------------ drivers/gpu/drm/nouveau/nv50_display.c | 12 ------------ drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 7 +------ drivers/gpu/drm/tegra/dc.c | 7 +------ drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 7 +------ drivers/gpu/drm/zte/zx_plane.c | 13 +------------ include/drm/drm_atomic_helper.h | 1 - include/drm/drm_plane_helper.h | 1 - 18 files changed, 22 insertions(+), 122 deletions(-) diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c index fa852fc1c9e6..93c503b754ba 100644 --- a/drivers/gpu/drm/arm/hdlcd_crtc.c +++ b/drivers/gpu/drm/arm/hdlcd_crtc.c @@ -229,7 +229,6 @@ static const struct drm_crtc_helper_funcs hdlcd_crtc_helper_funcs = { static int hdlcd_plane_atomic_check(struct drm_plane *plane, struct drm_plane_state *state) { - struct drm_rect clip = { 0 }; struct drm_crtc_state *crtc_state; u32 src_h = state->src_h >> 16; @@ -249,11 +248,7 @@ static int hdlcd_plane_atomic_check(struct drm_plane *plane, return -EINVAL; } - if (crtc_state->enable) - drm_mode_get_hv_timing(&crtc_state->mode, - &clip.x2, &clip.y2); - - return drm_atomic_helper_check_plane_state(state, crtc_state, &clip, + return drm_atomic_helper_check_plane_state(state, crtc_state, DRM_PLANE_HELPER_NO_SCALING, DRM_PLANE_HELPER_NO_SCALING, false, true); diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c index 2f6d608d6eaf..e630c0218aaf 100644 --- a/drivers/gpu/drm/arm/malidp_planes.c +++ b/drivers/gpu/drm/arm/malidp_planes.c @@ -141,18 +141,13 @@ static int malidp_se_check_scaling(struct malidp_plane *mp, struct drm_crtc_state *crtc_state = drm_atomic_get_existing_crtc_state(state->state, state->crtc); struct malidp_crtc_state *mc; - struct drm_rect clip = { 0 }; u32 src_w, src_h; int ret; if (!crtc_state) return -EINVAL; - if (crtc_state->enable) - drm_mode_get_hv_timing(&crtc_state->mode, - &clip.x2, &clip.y2); - - ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, + ret = drm_atomic_helper_check_plane_state(state, crtc_state, 0, INT_MAX, true, true); if (ret) return ret; diff --git a/drivers/gpu/drm/armada/armada_overlay.c b/drivers/gpu/drm/armada/armada_overlay.c index b411b608821a..564bd63a5f6a 100644 --- a/drivers/gpu/drm/armada/armada_overlay.c +++ b/drivers/gpu/drm/armada/armada_overlay.c @@ -111,10 +111,6 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, .x2 = crtc_x + crtc_w, .y2 = crtc_y + crtc_h, }; - const struct drm_rect clip = { - .x2 = crtc->mode.hdisplay, - .y2 = crtc->mode.vdisplay, - }; uint32_t val, ctrl0; unsigned idx = 0; bool visible; @@ -124,7 +120,7 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, crtc_x, crtc_y, crtc_w, crtc_h, src_x, src_y, src_w, src_h); - ret = drm_plane_helper_check_update(plane, crtc, fb, &src, &dest, &clip, + ret = drm_plane_helper_check_update(plane, crtc, fb, &src, &dest, DRM_MODE_ROTATE_0, 0, INT_MAX, true, false, &visible); if (ret) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 2f80377101a1..d25eaf6f62a9 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -699,7 +699,6 @@ EXPORT_SYMBOL(drm_atomic_helper_check_modeset); * drm_atomic_helper_check_plane_state() - Check plane state for validity * @plane_state: plane state to check * @crtc_state: crtc state to check - * @clip: integer clipping coordinates * @min_scale: minimum @src:@dest scaling factor in 16.16 fixed point * @max_scale: maximum @src:@dest scaling factor in 16.16 fixed point * @can_position: is it legal to position the plane such that it @@ -719,7 +718,6 @@ EXPORT_SYMBOL(drm_atomic_helper_check_modeset); */ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, const struct drm_crtc_state *crtc_state, - const struct drm_rect *clip, int min_scale, int max_scale, bool can_position, @@ -729,6 +727,7 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, struct drm_rect *src = &plane_state->src; struct drm_rect *dst = &plane_state->dst; unsigned int rotation = plane_state->rotation; + struct drm_rect clip = {}; int hscale, vscale; WARN_ON(plane_state->crtc && plane_state->crtc != crtc_state->crtc); @@ -764,7 +763,10 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, return -ERANGE; } - plane_state->visible = drm_rect_clip_scaled(src, dst, clip, hscale, vscale); + if (crtc_state->enable) + drm_mode_get_hv_timing(&crtc_state->mode, &clip.x2, &clip.y2); + + plane_state->visible = drm_rect_clip_scaled(src, dst, &clip, hscale, vscale); drm_rect_rotate_inv(src, fb->width << 16, fb->height << 16, rotation); @@ -778,10 +780,10 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, */ return 0; - if (!can_position && !drm_rect_equals(dst, clip)) { + if (!can_position && !drm_rect_equals(dst, &clip)) { DRM_DEBUG_KMS("Plane must cover entire CRTC\n"); drm_rect_debug_print("dst: ", dst, false); - drm_rect_debug_print("clip: ", clip, false); + drm_rect_debug_print("clip: ", &clip, false); return -EINVAL; } diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c index f1be8cd4e387..f88f68161519 100644 --- a/drivers/gpu/drm/drm_plane_helper.c +++ b/drivers/gpu/drm/drm_plane_helper.c @@ -106,7 +106,6 @@ static int get_connectors_for_crtc(struct drm_crtc *crtc, * @fb: framebuffer to flip onto plane * @src: source coordinates in 16.16 fixed point * @dst: integer destination coordinates - * @clip: integer clipping coordinates * @rotation: plane rotation * @min_scale: minimum @src:@dest scaling factor in 16.16 fixed point * @max_scale: maximum @src:@dest scaling factor in 16.16 fixed point @@ -131,7 +130,6 @@ int drm_plane_helper_check_update(struct drm_plane *plane, struct drm_framebuffer *fb, struct drm_rect *src, struct drm_rect *dst, - const struct drm_rect *clip, unsigned int rotation, int min_scale, int max_scale, @@ -157,11 +155,12 @@ int drm_plane_helper_check_update(struct drm_plane *plane, struct drm_crtc_state crtc_state = { .crtc = crtc, .enable = crtc->enabled, + .mode = crtc->mode, }; int ret; ret = drm_atomic_helper_check_plane_state(&plane_state, &crtc_state, - clip, min_scale, max_scale, + min_scale, max_scale, can_position, can_update_disabled); if (ret) @@ -239,16 +238,12 @@ int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *crtc, .x2 = crtc_x + crtc_w, .y2 = crtc_y + crtc_h, }; - const struct drm_rect clip = { - .x2 = crtc->mode.hdisplay, - .y2 = crtc->mode.vdisplay, - }; struct drm_connector **connector_list; int num_connectors, ret; bool visible; ret = drm_plane_helper_check_update(plane, crtc, fb, - &src, &dest, &clip, + &src, &dest, DRM_MODE_ROTATE_0, DRM_PLANE_HELPER_NO_SCALING, DRM_PLANE_HELPER_NO_SCALING, diff --git a/drivers/gpu/drm/drm_simple_kms_helper.c b/drivers/gpu/drm/drm_simple_kms_helper.c index 9d3f6b70812c..165bc756af96 100644 --- a/drivers/gpu/drm/drm_simple_kms_helper.c +++ b/drivers/gpu/drm/drm_simple_kms_helper.c @@ -89,7 +89,6 @@ static const struct drm_crtc_funcs drm_simple_kms_crtc_funcs = { static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane, struct drm_plane_state *plane_state) { - struct drm_rect clip = { 0 }; struct drm_simple_display_pipe *pipe; struct drm_crtc_state *crtc_state; int ret; @@ -100,12 +99,7 @@ static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane, if (!crtc_state->enable) return 0; /* nothing to check when disabling or disabled */ - if (crtc_state->enable) - drm_mode_get_hv_timing(&crtc_state->mode, - &clip.x2, &clip.y2); - ret = drm_atomic_helper_check_plane_state(plane_state, crtc_state, - &clip, DRM_PLANE_HELPER_NO_SCALING, DRM_PLANE_HELPER_NO_SCALING, false, true); diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 4eeec590b722..200d8989f7b5 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -9267,18 +9267,12 @@ static int intel_check_cursor(struct intel_crtc_state *crtc_state, struct intel_plane_state *plane_state) { const struct drm_framebuffer *fb = plane_state->base.fb; - struct drm_rect clip = {}; int src_x, src_y; u32 offset; int ret; - if (crtc_state->base.enable) - drm_mode_get_hv_timing(&crtc_state->base.mode, - &clip.x2, &clip.y2); - ret = drm_atomic_helper_check_plane_state(&plane_state->base, &crtc_state->base, - &clip, DRM_PLANE_HELPER_NO_SCALING, DRM_PLANE_HELPER_NO_SCALING, true, true); @@ -12837,7 +12831,6 @@ intel_check_primary_plane(struct intel_plane *plane, int min_scale = DRM_PLANE_HELPER_NO_SCALING; int max_scale = DRM_PLANE_HELPER_NO_SCALING; bool can_position = false; - struct drm_rect clip = {}; int ret; if (INTEL_GEN(dev_priv) >= 9) { @@ -12849,13 +12842,8 @@ intel_check_primary_plane(struct intel_plane *plane, can_position = true; } - if (crtc_state->base.enable) - drm_mode_get_hv_timing(&crtc_state->base.mode, - &clip.x2, &clip.y2); - ret = drm_atomic_helper_check_plane_state(&state->base, &crtc_state->base, - &clip, min_scale, max_scale, can_position, true); if (ret) diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3-plane.c index c0662503571b..35be3759e08e 100644 --- a/drivers/gpu/drm/imx/ipuv3-plane.c +++ b/drivers/gpu/drm/imx/ipuv3-plane.c @@ -322,7 +322,6 @@ static int ipu_plane_atomic_check(struct drm_plane *plane, struct drm_framebuffer *old_fb = old_state->fb; unsigned long eba, ubo, vbo, old_ubo, old_vbo, alpha_eba; bool can_position = (plane->type == DRM_PLANE_TYPE_OVERLAY); - struct drm_rect clip = {}; int hsub, vsub; int ret; @@ -338,11 +337,7 @@ static int ipu_plane_atomic_check(struct drm_plane *plane, if (WARN_ON(!crtc_state)) return -EINVAL; - if (crtc_state->enable) - drm_mode_get_hv_timing(&crtc_state->mode, - &clip.x2, &clip.y2); - - ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, + ret = drm_atomic_helper_check_plane_state(state, crtc_state, DRM_PLANE_HELPER_NO_SCALING, DRM_PLANE_HELPER_NO_SCALING, can_position, true); diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c index b5c6eec9a584..2f4b0ffee598 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c @@ -91,7 +91,6 @@ static int mtk_plane_atomic_check(struct drm_plane *plane, { struct drm_framebuffer *fb = state->fb; struct drm_crtc_state *crtc_state; - struct drm_rect clip = { 0, }; if (!fb) return 0; @@ -108,11 +107,7 @@ static int mtk_plane_atomic_check(struct drm_plane *plane, if (IS_ERR(crtc_state)) return PTR_ERR(crtc_state); - if (crtc_state->enable) - drm_mode_get_hv_timing(&crtc_state->mode, - &clip.x2, &clip.y2); - - return drm_atomic_helper_check_plane_state(state, crtc_state, &clip, + return drm_atomic_helper_check_plane_state(state, crtc_state, DRM_PLANE_HELPER_NO_SCALING, DRM_PLANE_HELPER_NO_SCALING, true, true); diff --git a/drivers/gpu/drm/meson/meson_plane.c b/drivers/gpu/drm/meson/meson_plane.c index 3801bee1f9e6..c78a3a59f58c 100644 --- a/drivers/gpu/drm/meson/meson_plane.c +++ b/drivers/gpu/drm/meson/meson_plane.c @@ -49,7 +49,6 @@ static int meson_plane_atomic_check(struct drm_plane *plane, struct drm_plane_state *state) { struct drm_crtc_state *crtc_state; - struct drm_rect clip = { 0, }; if (!state->crtc) return 0; @@ -58,11 +57,7 @@ static int meson_plane_atomic_check(struct drm_plane *plane, if (IS_ERR(crtc_state)) return PTR_ERR(crtc_state); - if (crtc_state->enable) - drm_mode_get_hv_timing(&crtc_state->mode, - &clip.x2, &clip.y2); - - return drm_atomic_helper_check_plane_state(state, crtc_state, &clip, + return drm_atomic_helper_check_plane_state(state, crtc_state, DRM_PLANE_HELPER_NO_SCALING, DRM_PLANE_HELPER_NO_SCALING, true, true); diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c index 09f758e7bb1b..087d6973e804 100644 --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c @@ -286,7 +286,6 @@ static int mdp5_plane_atomic_check_with_state(struct drm_crtc_state *crtc_state, uint32_t max_width, max_height; bool out_of_bounds = false; uint32_t caps = 0; - struct drm_rect clip = {}; int min_scale, max_scale; int ret; @@ -323,11 +322,7 @@ static int mdp5_plane_atomic_check_with_state(struct drm_crtc_state *crtc_state, min_scale = FRAC_16_16(1, 8); max_scale = FRAC_16_16(8, 1); - if (crtc_state->enable) - drm_mode_get_hv_timing(&crtc_state->mode, - &clip.x2, &clip.y2); - - ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, + ret = drm_atomic_helper_check_plane_state(state, crtc_state, min_scale, max_scale, true, true); if (ret) @@ -471,7 +466,6 @@ static int mdp5_plane_atomic_async_check(struct drm_plane *plane, { struct mdp5_plane_state *mdp5_state = to_mdp5_plane_state(state); struct drm_crtc_state *crtc_state; - struct drm_rect clip = {}; int min_scale, max_scale; int ret; @@ -502,11 +496,7 @@ static int mdp5_plane_atomic_async_check(struct drm_plane *plane, min_scale = FRAC_16_16(1, 8); max_scale = FRAC_16_16(8, 1); - if (crtc_state->enable) - drm_mode_get_hv_timing(&crtc_state->mode, - &clip.x2, &clip.y2); - - ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, + ret = drm_atomic_helper_check_plane_state(state, crtc_state, min_scale, max_scale, true, true); if (ret) diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c index 7d8307ec442c..9aad769bcdf0 100644 --- a/drivers/gpu/drm/nouveau/nv50_display.c +++ b/drivers/gpu/drm/nouveau/nv50_display.c @@ -1135,15 +1135,9 @@ static int nv50_curs_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, struct nv50_head_atom *asyh) { - struct drm_rect clip = {}; int ret; - if (asyh->state.enable) - drm_mode_get_hv_timing(&asyh->state.mode, - &clip.x2, &clip.y2); - ret = drm_atomic_helper_check_plane_state(&asyw->state, &asyh->state, - &clip, DRM_PLANE_HELPER_NO_SCALING, DRM_PLANE_HELPER_NO_SCALING, true, true); @@ -1427,18 +1421,12 @@ nv50_base_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, struct nv50_head_atom *asyh) { const struct drm_framebuffer *fb = asyw->state.fb; - struct drm_rect clip = {}; int ret; if (!fb->format->depth) return -EINVAL; - if (asyh->state.enable) - drm_mode_get_hv_timing(&asyh->state.mode, - &clip.x2, &clip.y2); - ret = drm_atomic_helper_check_plane_state(&asyw->state, &asyh->state, - &clip, DRM_PLANE_HELPER_NO_SCALING, DRM_PLANE_HELPER_NO_SCALING, false, true); diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index cd2c72389629..b95e9d45a435 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -641,7 +641,6 @@ static int vop_plane_atomic_check(struct drm_plane *plane, struct vop_win *vop_win = to_vop_win(plane); const struct vop_win_data *win = vop_win->data; int ret; - struct drm_rect clip = {}; int min_scale = win->phy->scl ? FRAC_16_16(1, 8) : DRM_PLANE_HELPER_NO_SCALING; int max_scale = win->phy->scl ? FRAC_16_16(8, 1) : @@ -654,11 +653,7 @@ static int vop_plane_atomic_check(struct drm_plane *plane, if (WARN_ON(!crtc_state)) return -EINVAL; - if (crtc_state->enable) - drm_mode_get_hv_timing(&crtc_state->mode, - &clip.x2, &clip.y2); - - ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, + ret = drm_atomic_helper_check_plane_state(state, crtc_state, min_scale, max_scale, true, true); if (ret) diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index 93b47e0e038b..45c9cecd7111 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -477,7 +477,6 @@ static int tegra_plane_state_add(struct tegra_plane *plane, { struct drm_crtc_state *crtc_state; struct tegra_dc_state *tegra; - struct drm_rect clip = {}; int err; /* Propagate errors from allocation or locking failures. */ @@ -485,12 +484,8 @@ static int tegra_plane_state_add(struct tegra_plane *plane, if (IS_ERR(crtc_state)) return PTR_ERR(crtc_state); - if (crtc_state->enable) - drm_mode_get_hv_timing(&crtc_state->mode, - &clip.x2, &clip.y2); - /* Check plane state for visibility and calculate clipping bounds */ - err = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, + err = drm_atomic_helper_check_plane_state(state, crtc_state, 0, INT_MAX, true, true); if (err < 0) return err; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index 25d96560180b..e3e2e9b1ead8 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c @@ -443,17 +443,12 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane, { struct drm_crtc_state *crtc_state = NULL; struct drm_framebuffer *new_fb = state->fb; - struct drm_rect clip = {}; int ret; if (state->crtc) crtc_state = drm_atomic_get_new_crtc_state(state->state, state->crtc); - if (crtc_state && crtc_state->enable) - drm_mode_get_hv_timing(&crtc_state->mode, - &clip.x2, &clip.y2); - - ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, + ret = drm_atomic_helper_check_plane_state(state, crtc_state, DRM_PLANE_HELPER_NO_SCALING, DRM_PLANE_HELPER_NO_SCALING, false, true); diff --git a/drivers/gpu/drm/zte/zx_plane.c b/drivers/gpu/drm/zte/zx_plane.c index 8e1f34274e24..94545adac50d 100644 --- a/drivers/gpu/drm/zte/zx_plane.c +++ b/drivers/gpu/drm/zte/zx_plane.c @@ -55,7 +55,6 @@ static int zx_vl_plane_atomic_check(struct drm_plane *plane, struct drm_framebuffer *fb = plane_state->fb; struct drm_crtc *crtc = plane_state->crtc; struct drm_crtc_state *crtc_state; - struct drm_rect clip = {}; int min_scale = FRAC_16_16(1, 8); int max_scale = FRAC_16_16(8, 1); @@ -75,12 +74,8 @@ static int zx_vl_plane_atomic_check(struct drm_plane *plane, if (!plane_state->crtc) return -EINVAL; - if (crtc_state->enable) - drm_mode_get_hv_timing(&crtc_state->mode, - &clip.x2, &clip.y2); - return drm_atomic_helper_check_plane_state(plane_state, crtc_state, - &clip, min_scale, max_scale, + min_scale, max_scale, true, true); } @@ -291,7 +286,6 @@ static int zx_gl_plane_atomic_check(struct drm_plane *plane, struct drm_framebuffer *fb = plane_state->fb; struct drm_crtc *crtc = plane_state->crtc; struct drm_crtc_state *crtc_state; - struct drm_rect clip = {}; if (!crtc || !fb) return 0; @@ -309,12 +303,7 @@ static int zx_gl_plane_atomic_check(struct drm_plane *plane, if (!plane_state->crtc) return -EINVAL; - if (crtc_state->enable) - drm_mode_get_hv_timing(&crtc_state->mode, - &clip.x2, &clip.y2); - return drm_atomic_helper_check_plane_state(plane_state, crtc_state, - &clip, DRM_PLANE_HELPER_NO_SCALING, DRM_PLANE_HELPER_NO_SCALING, false, true); diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h index 4842ee9485ce..26aaba58d6ce 100644 --- a/include/drm/drm_atomic_helper.h +++ b/include/drm/drm_atomic_helper.h @@ -40,7 +40,6 @@ int drm_atomic_helper_check_modeset(struct drm_device *dev, struct drm_atomic_state *state); int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, const struct drm_crtc_state *crtc_state, - const struct drm_rect *clip, int min_scale, int max_scale, bool can_position, diff --git a/include/drm/drm_plane_helper.h b/include/drm/drm_plane_helper.h index 8aa49c0ecd4d..28d7ce620729 100644 --- a/include/drm/drm_plane_helper.h +++ b/include/drm/drm_plane_helper.h @@ -43,7 +43,6 @@ int drm_plane_helper_check_update(struct drm_plane *plane, struct drm_framebuffer *fb, struct drm_rect *src, struct drm_rect *dest, - const struct drm_rect *clip, unsigned int rotation, int min_scale, int max_scale, -- 2.13.6 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply related [flat|nested] 39+ messages in thread
* Re: [PATCH 15/15] drm: Don't pass clip to drm_atomic_helper_check_plane_state() 2017-11-23 19:05 ` [PATCH 15/15] drm: Don't pass clip to drm_atomic_helper_check_plane_state() Ville Syrjala @ 2017-11-24 11:59 ` Liviu Dudau 2017-11-24 14:08 ` Ville Syrjälä 2017-11-24 12:01 ` Liviu Dudau 2017-11-24 17:00 ` Daniel Vetter 2 siblings, 1 reply; 39+ messages in thread From: Liviu Dudau @ 2017-11-24 11:59 UTC (permalink / raw) To: Ville Syrjala; +Cc: intel-gfx, Laurent Pinchart, dri-devel On Thu, Nov 23, 2017 at 09:05:02PM +0200, Ville Syrjala wrote: > From: Ville Syrjälä <ville.syrjala@linux.intel.com> Hi Ville, > > Move the plane clip rectangle handling into > drm_atomic_helper_check_plane_state(). Drivers no longer > have to worry about such mundane details. This is quite an important patch and I dare say the essence of your series, right? Yet very few people got Cc-ed on it (1 AFAICT) and it touches quite a few drivers. May I respectfully suggest that you review your patch sending process? You have Cc-ed me only on patches 3 and 4 and I could easy asssume that those were all the changes you have made to the driver, which is obviously not the case here. I tend to err on the side of verbosity and include everyone touched by a patch in a series into all the patches of that series. Is by no mean the best approach, but is one way I avoid situations like this. Best regards, Liviu > > Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > Cc: Daniel Vetter <daniel@ffwll.ch> > Suggested-by: Daniel Vetter <daniel@ffwll.ch> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> > --- > drivers/gpu/drm/arm/hdlcd_crtc.c | 7 +------ > drivers/gpu/drm/arm/malidp_planes.c | 7 +------ > drivers/gpu/drm/armada/armada_overlay.c | 6 +----- > drivers/gpu/drm/drm_atomic_helper.c | 12 +++++++----- > drivers/gpu/drm/drm_plane_helper.c | 11 +++-------- > drivers/gpu/drm/drm_simple_kms_helper.c | 6 ------ > drivers/gpu/drm/i915/intel_display.c | 12 ------------ > drivers/gpu/drm/imx/ipuv3-plane.c | 7 +------ > drivers/gpu/drm/mediatek/mtk_drm_plane.c | 7 +------ > drivers/gpu/drm/meson/meson_plane.c | 7 +------ > drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 14 ++------------ > drivers/gpu/drm/nouveau/nv50_display.c | 12 ------------ > drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 7 +------ > drivers/gpu/drm/tegra/dc.c | 7 +------ > drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 7 +------ > drivers/gpu/drm/zte/zx_plane.c | 13 +------------ > include/drm/drm_atomic_helper.h | 1 - > include/drm/drm_plane_helper.h | 1 - > 18 files changed, 22 insertions(+), 122 deletions(-) > > diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c > index fa852fc1c9e6..93c503b754ba 100644 > --- a/drivers/gpu/drm/arm/hdlcd_crtc.c > +++ b/drivers/gpu/drm/arm/hdlcd_crtc.c > @@ -229,7 +229,6 @@ static const struct drm_crtc_helper_funcs hdlcd_crtc_helper_funcs = { > static int hdlcd_plane_atomic_check(struct drm_plane *plane, > struct drm_plane_state *state) > { > - struct drm_rect clip = { 0 }; > struct drm_crtc_state *crtc_state; > u32 src_h = state->src_h >> 16; > > @@ -249,11 +248,7 @@ static int hdlcd_plane_atomic_check(struct drm_plane *plane, > return -EINVAL; > } > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > - return drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > + return drm_atomic_helper_check_plane_state(state, crtc_state, > DRM_PLANE_HELPER_NO_SCALING, > DRM_PLANE_HELPER_NO_SCALING, > false, true); > diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c > index 2f6d608d6eaf..e630c0218aaf 100644 > --- a/drivers/gpu/drm/arm/malidp_planes.c > +++ b/drivers/gpu/drm/arm/malidp_planes.c > @@ -141,18 +141,13 @@ static int malidp_se_check_scaling(struct malidp_plane *mp, > struct drm_crtc_state *crtc_state = > drm_atomic_get_existing_crtc_state(state->state, state->crtc); > struct malidp_crtc_state *mc; > - struct drm_rect clip = { 0 }; > u32 src_w, src_h; > int ret; > > if (!crtc_state) > return -EINVAL; > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > - ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > + ret = drm_atomic_helper_check_plane_state(state, crtc_state, > 0, INT_MAX, true, true); > if (ret) > return ret; > diff --git a/drivers/gpu/drm/armada/armada_overlay.c b/drivers/gpu/drm/armada/armada_overlay.c > index b411b608821a..564bd63a5f6a 100644 > --- a/drivers/gpu/drm/armada/armada_overlay.c > +++ b/drivers/gpu/drm/armada/armada_overlay.c > @@ -111,10 +111,6 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, > .x2 = crtc_x + crtc_w, > .y2 = crtc_y + crtc_h, > }; > - const struct drm_rect clip = { > - .x2 = crtc->mode.hdisplay, > - .y2 = crtc->mode.vdisplay, > - }; > uint32_t val, ctrl0; > unsigned idx = 0; > bool visible; > @@ -124,7 +120,7 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, > crtc_x, crtc_y, crtc_w, crtc_h, > src_x, src_y, src_w, src_h); > > - ret = drm_plane_helper_check_update(plane, crtc, fb, &src, &dest, &clip, > + ret = drm_plane_helper_check_update(plane, crtc, fb, &src, &dest, > DRM_MODE_ROTATE_0, > 0, INT_MAX, true, false, &visible); > if (ret) > diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c > index 2f80377101a1..d25eaf6f62a9 100644 > --- a/drivers/gpu/drm/drm_atomic_helper.c > +++ b/drivers/gpu/drm/drm_atomic_helper.c > @@ -699,7 +699,6 @@ EXPORT_SYMBOL(drm_atomic_helper_check_modeset); > * drm_atomic_helper_check_plane_state() - Check plane state for validity > * @plane_state: plane state to check > * @crtc_state: crtc state to check > - * @clip: integer clipping coordinates > * @min_scale: minimum @src:@dest scaling factor in 16.16 fixed point > * @max_scale: maximum @src:@dest scaling factor in 16.16 fixed point > * @can_position: is it legal to position the plane such that it > @@ -719,7 +718,6 @@ EXPORT_SYMBOL(drm_atomic_helper_check_modeset); > */ > int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, > const struct drm_crtc_state *crtc_state, > - const struct drm_rect *clip, > int min_scale, > int max_scale, > bool can_position, > @@ -729,6 +727,7 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, > struct drm_rect *src = &plane_state->src; > struct drm_rect *dst = &plane_state->dst; > unsigned int rotation = plane_state->rotation; > + struct drm_rect clip = {}; > int hscale, vscale; > > WARN_ON(plane_state->crtc && plane_state->crtc != crtc_state->crtc); > @@ -764,7 +763,10 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, > return -ERANGE; > } > > - plane_state->visible = drm_rect_clip_scaled(src, dst, clip, hscale, vscale); > + if (crtc_state->enable) > + drm_mode_get_hv_timing(&crtc_state->mode, &clip.x2, &clip.y2); > + > + plane_state->visible = drm_rect_clip_scaled(src, dst, &clip, hscale, vscale); > > drm_rect_rotate_inv(src, fb->width << 16, fb->height << 16, rotation); > > @@ -778,10 +780,10 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, > */ > return 0; > > - if (!can_position && !drm_rect_equals(dst, clip)) { > + if (!can_position && !drm_rect_equals(dst, &clip)) { > DRM_DEBUG_KMS("Plane must cover entire CRTC\n"); > drm_rect_debug_print("dst: ", dst, false); > - drm_rect_debug_print("clip: ", clip, false); > + drm_rect_debug_print("clip: ", &clip, false); > return -EINVAL; > } > > diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c > index f1be8cd4e387..f88f68161519 100644 > --- a/drivers/gpu/drm/drm_plane_helper.c > +++ b/drivers/gpu/drm/drm_plane_helper.c > @@ -106,7 +106,6 @@ static int get_connectors_for_crtc(struct drm_crtc *crtc, > * @fb: framebuffer to flip onto plane > * @src: source coordinates in 16.16 fixed point > * @dst: integer destination coordinates > - * @clip: integer clipping coordinates > * @rotation: plane rotation > * @min_scale: minimum @src:@dest scaling factor in 16.16 fixed point > * @max_scale: maximum @src:@dest scaling factor in 16.16 fixed point > @@ -131,7 +130,6 @@ int drm_plane_helper_check_update(struct drm_plane *plane, > struct drm_framebuffer *fb, > struct drm_rect *src, > struct drm_rect *dst, > - const struct drm_rect *clip, > unsigned int rotation, > int min_scale, > int max_scale, > @@ -157,11 +155,12 @@ int drm_plane_helper_check_update(struct drm_plane *plane, > struct drm_crtc_state crtc_state = { > .crtc = crtc, > .enable = crtc->enabled, > + .mode = crtc->mode, > }; > int ret; > > ret = drm_atomic_helper_check_plane_state(&plane_state, &crtc_state, > - clip, min_scale, max_scale, > + min_scale, max_scale, > can_position, > can_update_disabled); > if (ret) > @@ -239,16 +238,12 @@ int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *crtc, > .x2 = crtc_x + crtc_w, > .y2 = crtc_y + crtc_h, > }; > - const struct drm_rect clip = { > - .x2 = crtc->mode.hdisplay, > - .y2 = crtc->mode.vdisplay, > - }; > struct drm_connector **connector_list; > int num_connectors, ret; > bool visible; > > ret = drm_plane_helper_check_update(plane, crtc, fb, > - &src, &dest, &clip, > + &src, &dest, > DRM_MODE_ROTATE_0, > DRM_PLANE_HELPER_NO_SCALING, > DRM_PLANE_HELPER_NO_SCALING, > diff --git a/drivers/gpu/drm/drm_simple_kms_helper.c b/drivers/gpu/drm/drm_simple_kms_helper.c > index 9d3f6b70812c..165bc756af96 100644 > --- a/drivers/gpu/drm/drm_simple_kms_helper.c > +++ b/drivers/gpu/drm/drm_simple_kms_helper.c > @@ -89,7 +89,6 @@ static const struct drm_crtc_funcs drm_simple_kms_crtc_funcs = { > static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane, > struct drm_plane_state *plane_state) > { > - struct drm_rect clip = { 0 }; > struct drm_simple_display_pipe *pipe; > struct drm_crtc_state *crtc_state; > int ret; > @@ -100,12 +99,7 @@ static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane, > if (!crtc_state->enable) > return 0; /* nothing to check when disabling or disabled */ > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > ret = drm_atomic_helper_check_plane_state(plane_state, crtc_state, > - &clip, > DRM_PLANE_HELPER_NO_SCALING, > DRM_PLANE_HELPER_NO_SCALING, > false, true); > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c > index 4eeec590b722..200d8989f7b5 100644 > --- a/drivers/gpu/drm/i915/intel_display.c > +++ b/drivers/gpu/drm/i915/intel_display.c > @@ -9267,18 +9267,12 @@ static int intel_check_cursor(struct intel_crtc_state *crtc_state, > struct intel_plane_state *plane_state) > { > const struct drm_framebuffer *fb = plane_state->base.fb; > - struct drm_rect clip = {}; > int src_x, src_y; > u32 offset; > int ret; > > - if (crtc_state->base.enable) > - drm_mode_get_hv_timing(&crtc_state->base.mode, > - &clip.x2, &clip.y2); > - > ret = drm_atomic_helper_check_plane_state(&plane_state->base, > &crtc_state->base, > - &clip, > DRM_PLANE_HELPER_NO_SCALING, > DRM_PLANE_HELPER_NO_SCALING, > true, true); > @@ -12837,7 +12831,6 @@ intel_check_primary_plane(struct intel_plane *plane, > int min_scale = DRM_PLANE_HELPER_NO_SCALING; > int max_scale = DRM_PLANE_HELPER_NO_SCALING; > bool can_position = false; > - struct drm_rect clip = {}; > int ret; > > if (INTEL_GEN(dev_priv) >= 9) { > @@ -12849,13 +12842,8 @@ intel_check_primary_plane(struct intel_plane *plane, > can_position = true; > } > > - if (crtc_state->base.enable) > - drm_mode_get_hv_timing(&crtc_state->base.mode, > - &clip.x2, &clip.y2); > - > ret = drm_atomic_helper_check_plane_state(&state->base, > &crtc_state->base, > - &clip, > min_scale, max_scale, > can_position, true); > if (ret) > diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3-plane.c > index c0662503571b..35be3759e08e 100644 > --- a/drivers/gpu/drm/imx/ipuv3-plane.c > +++ b/drivers/gpu/drm/imx/ipuv3-plane.c > @@ -322,7 +322,6 @@ static int ipu_plane_atomic_check(struct drm_plane *plane, > struct drm_framebuffer *old_fb = old_state->fb; > unsigned long eba, ubo, vbo, old_ubo, old_vbo, alpha_eba; > bool can_position = (plane->type == DRM_PLANE_TYPE_OVERLAY); > - struct drm_rect clip = {}; > int hsub, vsub; > int ret; > > @@ -338,11 +337,7 @@ static int ipu_plane_atomic_check(struct drm_plane *plane, > if (WARN_ON(!crtc_state)) > return -EINVAL; > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > - ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > + ret = drm_atomic_helper_check_plane_state(state, crtc_state, > DRM_PLANE_HELPER_NO_SCALING, > DRM_PLANE_HELPER_NO_SCALING, > can_position, true); > diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c > index b5c6eec9a584..2f4b0ffee598 100644 > --- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c > +++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c > @@ -91,7 +91,6 @@ static int mtk_plane_atomic_check(struct drm_plane *plane, > { > struct drm_framebuffer *fb = state->fb; > struct drm_crtc_state *crtc_state; > - struct drm_rect clip = { 0, }; > > if (!fb) > return 0; > @@ -108,11 +107,7 @@ static int mtk_plane_atomic_check(struct drm_plane *plane, > if (IS_ERR(crtc_state)) > return PTR_ERR(crtc_state); > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > - return drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > + return drm_atomic_helper_check_plane_state(state, crtc_state, > DRM_PLANE_HELPER_NO_SCALING, > DRM_PLANE_HELPER_NO_SCALING, > true, true); > diff --git a/drivers/gpu/drm/meson/meson_plane.c b/drivers/gpu/drm/meson/meson_plane.c > index 3801bee1f9e6..c78a3a59f58c 100644 > --- a/drivers/gpu/drm/meson/meson_plane.c > +++ b/drivers/gpu/drm/meson/meson_plane.c > @@ -49,7 +49,6 @@ static int meson_plane_atomic_check(struct drm_plane *plane, > struct drm_plane_state *state) > { > struct drm_crtc_state *crtc_state; > - struct drm_rect clip = { 0, }; > > if (!state->crtc) > return 0; > @@ -58,11 +57,7 @@ static int meson_plane_atomic_check(struct drm_plane *plane, > if (IS_ERR(crtc_state)) > return PTR_ERR(crtc_state); > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > - return drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > + return drm_atomic_helper_check_plane_state(state, crtc_state, > DRM_PLANE_HELPER_NO_SCALING, > DRM_PLANE_HELPER_NO_SCALING, > true, true); > diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c > index 09f758e7bb1b..087d6973e804 100644 > --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c > +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c > @@ -286,7 +286,6 @@ static int mdp5_plane_atomic_check_with_state(struct drm_crtc_state *crtc_state, > uint32_t max_width, max_height; > bool out_of_bounds = false; > uint32_t caps = 0; > - struct drm_rect clip = {}; > int min_scale, max_scale; > int ret; > > @@ -323,11 +322,7 @@ static int mdp5_plane_atomic_check_with_state(struct drm_crtc_state *crtc_state, > min_scale = FRAC_16_16(1, 8); > max_scale = FRAC_16_16(8, 1); > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > - ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > + ret = drm_atomic_helper_check_plane_state(state, crtc_state, > min_scale, max_scale, > true, true); > if (ret) > @@ -471,7 +466,6 @@ static int mdp5_plane_atomic_async_check(struct drm_plane *plane, > { > struct mdp5_plane_state *mdp5_state = to_mdp5_plane_state(state); > struct drm_crtc_state *crtc_state; > - struct drm_rect clip = {}; > int min_scale, max_scale; > int ret; > > @@ -502,11 +496,7 @@ static int mdp5_plane_atomic_async_check(struct drm_plane *plane, > min_scale = FRAC_16_16(1, 8); > max_scale = FRAC_16_16(8, 1); > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > - ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > + ret = drm_atomic_helper_check_plane_state(state, crtc_state, > min_scale, max_scale, > true, true); > if (ret) > diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c > index 7d8307ec442c..9aad769bcdf0 100644 > --- a/drivers/gpu/drm/nouveau/nv50_display.c > +++ b/drivers/gpu/drm/nouveau/nv50_display.c > @@ -1135,15 +1135,9 @@ static int > nv50_curs_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, > struct nv50_head_atom *asyh) > { > - struct drm_rect clip = {}; > int ret; > > - if (asyh->state.enable) > - drm_mode_get_hv_timing(&asyh->state.mode, > - &clip.x2, &clip.y2); > - > ret = drm_atomic_helper_check_plane_state(&asyw->state, &asyh->state, > - &clip, > DRM_PLANE_HELPER_NO_SCALING, > DRM_PLANE_HELPER_NO_SCALING, > true, true); > @@ -1427,18 +1421,12 @@ nv50_base_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, > struct nv50_head_atom *asyh) > { > const struct drm_framebuffer *fb = asyw->state.fb; > - struct drm_rect clip = {}; > int ret; > > if (!fb->format->depth) > return -EINVAL; > > - if (asyh->state.enable) > - drm_mode_get_hv_timing(&asyh->state.mode, > - &clip.x2, &clip.y2); > - > ret = drm_atomic_helper_check_plane_state(&asyw->state, &asyh->state, > - &clip, > DRM_PLANE_HELPER_NO_SCALING, > DRM_PLANE_HELPER_NO_SCALING, > false, true); > diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c > index cd2c72389629..b95e9d45a435 100644 > --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c > +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c > @@ -641,7 +641,6 @@ static int vop_plane_atomic_check(struct drm_plane *plane, > struct vop_win *vop_win = to_vop_win(plane); > const struct vop_win_data *win = vop_win->data; > int ret; > - struct drm_rect clip = {}; > int min_scale = win->phy->scl ? FRAC_16_16(1, 8) : > DRM_PLANE_HELPER_NO_SCALING; > int max_scale = win->phy->scl ? FRAC_16_16(8, 1) : > @@ -654,11 +653,7 @@ static int vop_plane_atomic_check(struct drm_plane *plane, > if (WARN_ON(!crtc_state)) > return -EINVAL; > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > - ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > + ret = drm_atomic_helper_check_plane_state(state, crtc_state, > min_scale, max_scale, > true, true); > if (ret) > diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c > index 93b47e0e038b..45c9cecd7111 100644 > --- a/drivers/gpu/drm/tegra/dc.c > +++ b/drivers/gpu/drm/tegra/dc.c > @@ -477,7 +477,6 @@ static int tegra_plane_state_add(struct tegra_plane *plane, > { > struct drm_crtc_state *crtc_state; > struct tegra_dc_state *tegra; > - struct drm_rect clip = {}; > int err; > > /* Propagate errors from allocation or locking failures. */ > @@ -485,12 +484,8 @@ static int tegra_plane_state_add(struct tegra_plane *plane, > if (IS_ERR(crtc_state)) > return PTR_ERR(crtc_state); > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > /* Check plane state for visibility and calculate clipping bounds */ > - err = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > + err = drm_atomic_helper_check_plane_state(state, crtc_state, > 0, INT_MAX, true, true); > if (err < 0) > return err; > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c > index 25d96560180b..e3e2e9b1ead8 100644 > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c > @@ -443,17 +443,12 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane, > { > struct drm_crtc_state *crtc_state = NULL; > struct drm_framebuffer *new_fb = state->fb; > - struct drm_rect clip = {}; > int ret; > > if (state->crtc) > crtc_state = drm_atomic_get_new_crtc_state(state->state, state->crtc); > > - if (crtc_state && crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > - ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > + ret = drm_atomic_helper_check_plane_state(state, crtc_state, > DRM_PLANE_HELPER_NO_SCALING, > DRM_PLANE_HELPER_NO_SCALING, > false, true); > diff --git a/drivers/gpu/drm/zte/zx_plane.c b/drivers/gpu/drm/zte/zx_plane.c > index 8e1f34274e24..94545adac50d 100644 > --- a/drivers/gpu/drm/zte/zx_plane.c > +++ b/drivers/gpu/drm/zte/zx_plane.c > @@ -55,7 +55,6 @@ static int zx_vl_plane_atomic_check(struct drm_plane *plane, > struct drm_framebuffer *fb = plane_state->fb; > struct drm_crtc *crtc = plane_state->crtc; > struct drm_crtc_state *crtc_state; > - struct drm_rect clip = {}; > int min_scale = FRAC_16_16(1, 8); > int max_scale = FRAC_16_16(8, 1); > > @@ -75,12 +74,8 @@ static int zx_vl_plane_atomic_check(struct drm_plane *plane, > if (!plane_state->crtc) > return -EINVAL; > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > return drm_atomic_helper_check_plane_state(plane_state, crtc_state, > - &clip, min_scale, max_scale, > + min_scale, max_scale, > true, true); > } > > @@ -291,7 +286,6 @@ static int zx_gl_plane_atomic_check(struct drm_plane *plane, > struct drm_framebuffer *fb = plane_state->fb; > struct drm_crtc *crtc = plane_state->crtc; > struct drm_crtc_state *crtc_state; > - struct drm_rect clip = {}; > > if (!crtc || !fb) > return 0; > @@ -309,12 +303,7 @@ static int zx_gl_plane_atomic_check(struct drm_plane *plane, > if (!plane_state->crtc) > return -EINVAL; > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > return drm_atomic_helper_check_plane_state(plane_state, crtc_state, > - &clip, > DRM_PLANE_HELPER_NO_SCALING, > DRM_PLANE_HELPER_NO_SCALING, > false, true); > diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h > index 4842ee9485ce..26aaba58d6ce 100644 > --- a/include/drm/drm_atomic_helper.h > +++ b/include/drm/drm_atomic_helper.h > @@ -40,7 +40,6 @@ int drm_atomic_helper_check_modeset(struct drm_device *dev, > struct drm_atomic_state *state); > int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, > const struct drm_crtc_state *crtc_state, > - const struct drm_rect *clip, > int min_scale, > int max_scale, > bool can_position, > diff --git a/include/drm/drm_plane_helper.h b/include/drm/drm_plane_helper.h > index 8aa49c0ecd4d..28d7ce620729 100644 > --- a/include/drm/drm_plane_helper.h > +++ b/include/drm/drm_plane_helper.h > @@ -43,7 +43,6 @@ int drm_plane_helper_check_update(struct drm_plane *plane, > struct drm_framebuffer *fb, > struct drm_rect *src, > struct drm_rect *dest, > - const struct drm_rect *clip, > unsigned int rotation, > int min_scale, > int max_scale, > -- > 2.13.6 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- ==================== | I would like to | | fix the world, | | but they're not | | giving me the | \ source code! / --------------- ¯\_(ツ)_/¯ _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 15/15] drm: Don't pass clip to drm_atomic_helper_check_plane_state() 2017-11-24 11:59 ` Liviu Dudau @ 2017-11-24 14:08 ` Ville Syrjälä 2017-11-24 15:24 ` Liviu Dudau 0 siblings, 1 reply; 39+ messages in thread From: Ville Syrjälä @ 2017-11-24 14:08 UTC (permalink / raw) To: Liviu Dudau; +Cc: intel-gfx, Laurent Pinchart, dri-devel On Fri, Nov 24, 2017 at 11:59:45AM +0000, Liviu Dudau wrote: > On Thu, Nov 23, 2017 at 09:05:02PM +0200, Ville Syrjala wrote: > > From: Ville Syrjälä <ville.syrjala@linux.intel.com> > > Hi Ville, > > > > > Move the plane clip rectangle handling into > > drm_atomic_helper_check_plane_state(). Drivers no longer > > have to worry about such mundane details. > > This is quite an important patch and I dare say the essence of your > series, right? Yet very few people got Cc-ed on it (1 AFAICT) and it > touches quite a few drivers. It has no functional changes, so forgetting to plaster it with Ccs doesn't seem all that dangerous. All the (potentially) functional changes were in the prep patches which had Ccs, as did the cover letter. And maintainers should read the ml anyway ;) -- Ville Syrjälä Intel OTC _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 15/15] drm: Don't pass clip to drm_atomic_helper_check_plane_state() 2017-11-24 14:08 ` Ville Syrjälä @ 2017-11-24 15:24 ` Liviu Dudau 0 siblings, 0 replies; 39+ messages in thread From: Liviu Dudau @ 2017-11-24 15:24 UTC (permalink / raw) To: Ville Syrjälä; +Cc: intel-gfx, Laurent Pinchart, dri-devel On Fri, Nov 24, 2017 at 04:08:28PM +0200, Ville Syrjälä wrote: > On Fri, Nov 24, 2017 at 11:59:45AM +0000, Liviu Dudau wrote: > > On Thu, Nov 23, 2017 at 09:05:02PM +0200, Ville Syrjala wrote: > > > From: Ville Syrjälä <ville.syrjala@linux.intel.com> > > > > Hi Ville, > > > > > > > > Move the plane clip rectangle handling into > > > drm_atomic_helper_check_plane_state(). Drivers no longer > > > have to worry about such mundane details. > > > > This is quite an important patch and I dare say the essence of your > > series, right? Yet very few people got Cc-ed on it (1 AFAICT) and it > > touches quite a few drivers. > > It has no functional changes, so forgetting to plaster it with Ccs > doesn't seem all that dangerous. All the (potentially) functional > changes were in the prep patches which had Ccs, as did the cover > letter. And maintainers should read the ml anyway ;) Maintainers don't maintain the functionality, they maintain the source code. They fix conflicts and order patches. On that line, not Cc-ing maintainers when you change the code of the drivers they maintain makes their lives all more ... "entertaining". And I would argue that the patch does introduce functional changes, as it removes the clip rectangle from drm_atomic_helper_check_plane_state()'s list of parameters. It does change all the users of it, too, I agree, but not for people that have drivers not yet upstreamed (and they start to wonder how one driver compiles and other fails when they were supposed to have the same code inside :) ) Regards, Liviu > > -- > Ville Syrjälä > Intel OTC -- ==================== | I would like to | | fix the world, | | but they're not | | giving me the | \ source code! / --------------- ¯\_(ツ)_/¯ _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 15/15] drm: Don't pass clip to drm_atomic_helper_check_plane_state() 2017-11-23 19:05 ` [PATCH 15/15] drm: Don't pass clip to drm_atomic_helper_check_plane_state() Ville Syrjala 2017-11-24 11:59 ` Liviu Dudau @ 2017-11-24 12:01 ` Liviu Dudau 2017-11-24 17:00 ` Daniel Vetter 2 siblings, 0 replies; 39+ messages in thread From: Liviu Dudau @ 2017-11-24 12:01 UTC (permalink / raw) To: Ville Syrjala; +Cc: intel-gfx, Laurent Pinchart, dri-devel On Thu, Nov 23, 2017 at 09:05:02PM +0200, Ville Syrjala wrote: > From: Ville Syrjälä <ville.syrjala@linux.intel.com> > > Move the plane clip rectangle handling into > drm_atomic_helper_check_plane_state(). Drivers no longer > have to worry about such mundane details. > > Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > Cc: Daniel Vetter <daniel@ffwll.ch> > Suggested-by: Daniel Vetter <daniel@ffwll.ch> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> > --- > drivers/gpu/drm/arm/hdlcd_crtc.c | 7 +------ > drivers/gpu/drm/arm/malidp_planes.c | 7 +------ > drivers/gpu/drm/armada/armada_overlay.c | 6 +----- > drivers/gpu/drm/drm_atomic_helper.c | 12 +++++++----- > drivers/gpu/drm/drm_plane_helper.c | 11 +++-------- > drivers/gpu/drm/drm_simple_kms_helper.c | 6 ------ > drivers/gpu/drm/i915/intel_display.c | 12 ------------ > drivers/gpu/drm/imx/ipuv3-plane.c | 7 +------ > drivers/gpu/drm/mediatek/mtk_drm_plane.c | 7 +------ > drivers/gpu/drm/meson/meson_plane.c | 7 +------ > drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 14 ++------------ > drivers/gpu/drm/nouveau/nv50_display.c | 12 ------------ > drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 7 +------ > drivers/gpu/drm/tegra/dc.c | 7 +------ > drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 7 +------ > drivers/gpu/drm/zte/zx_plane.c | 13 +------------ > include/drm/drm_atomic_helper.h | 1 - > include/drm/drm_plane_helper.h | 1 - > 18 files changed, 22 insertions(+), 122 deletions(-) > > diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c > index fa852fc1c9e6..93c503b754ba 100644 > --- a/drivers/gpu/drm/arm/hdlcd_crtc.c > +++ b/drivers/gpu/drm/arm/hdlcd_crtc.c > @@ -229,7 +229,6 @@ static const struct drm_crtc_helper_funcs hdlcd_crtc_helper_funcs = { > static int hdlcd_plane_atomic_check(struct drm_plane *plane, > struct drm_plane_state *state) > { > - struct drm_rect clip = { 0 }; > struct drm_crtc_state *crtc_state; > u32 src_h = state->src_h >> 16; > > @@ -249,11 +248,7 @@ static int hdlcd_plane_atomic_check(struct drm_plane *plane, > return -EINVAL; > } > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > - return drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > + return drm_atomic_helper_check_plane_state(state, crtc_state, > DRM_PLANE_HELPER_NO_SCALING, > DRM_PLANE_HELPER_NO_SCALING, > false, true); > diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c > index 2f6d608d6eaf..e630c0218aaf 100644 > --- a/drivers/gpu/drm/arm/malidp_planes.c > +++ b/drivers/gpu/drm/arm/malidp_planes.c > @@ -141,18 +141,13 @@ static int malidp_se_check_scaling(struct malidp_plane *mp, > struct drm_crtc_state *crtc_state = > drm_atomic_get_existing_crtc_state(state->state, state->crtc); > struct malidp_crtc_state *mc; > - struct drm_rect clip = { 0 }; > u32 src_w, src_h; > int ret; > > if (!crtc_state) > return -EINVAL; > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > - ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > + ret = drm_atomic_helper_check_plane_state(state, crtc_state, > 0, INT_MAX, true, true); > if (ret) > return ret; For the hdlcd and malidp changes above: Acked-by: Liviu Dudau <liviu.dudau@arm.com> Best regards, Liviu > diff --git a/drivers/gpu/drm/armada/armada_overlay.c b/drivers/gpu/drm/armada/armada_overlay.c > index b411b608821a..564bd63a5f6a 100644 > --- a/drivers/gpu/drm/armada/armada_overlay.c > +++ b/drivers/gpu/drm/armada/armada_overlay.c > @@ -111,10 +111,6 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, > .x2 = crtc_x + crtc_w, > .y2 = crtc_y + crtc_h, > }; > - const struct drm_rect clip = { > - .x2 = crtc->mode.hdisplay, > - .y2 = crtc->mode.vdisplay, > - }; > uint32_t val, ctrl0; > unsigned idx = 0; > bool visible; > @@ -124,7 +120,7 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, > crtc_x, crtc_y, crtc_w, crtc_h, > src_x, src_y, src_w, src_h); > > - ret = drm_plane_helper_check_update(plane, crtc, fb, &src, &dest, &clip, > + ret = drm_plane_helper_check_update(plane, crtc, fb, &src, &dest, > DRM_MODE_ROTATE_0, > 0, INT_MAX, true, false, &visible); > if (ret) > diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c > index 2f80377101a1..d25eaf6f62a9 100644 > --- a/drivers/gpu/drm/drm_atomic_helper.c > +++ b/drivers/gpu/drm/drm_atomic_helper.c > @@ -699,7 +699,6 @@ EXPORT_SYMBOL(drm_atomic_helper_check_modeset); > * drm_atomic_helper_check_plane_state() - Check plane state for validity > * @plane_state: plane state to check > * @crtc_state: crtc state to check > - * @clip: integer clipping coordinates > * @min_scale: minimum @src:@dest scaling factor in 16.16 fixed point > * @max_scale: maximum @src:@dest scaling factor in 16.16 fixed point > * @can_position: is it legal to position the plane such that it > @@ -719,7 +718,6 @@ EXPORT_SYMBOL(drm_atomic_helper_check_modeset); > */ > int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, > const struct drm_crtc_state *crtc_state, > - const struct drm_rect *clip, > int min_scale, > int max_scale, > bool can_position, > @@ -729,6 +727,7 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, > struct drm_rect *src = &plane_state->src; > struct drm_rect *dst = &plane_state->dst; > unsigned int rotation = plane_state->rotation; > + struct drm_rect clip = {}; > int hscale, vscale; > > WARN_ON(plane_state->crtc && plane_state->crtc != crtc_state->crtc); > @@ -764,7 +763,10 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, > return -ERANGE; > } > > - plane_state->visible = drm_rect_clip_scaled(src, dst, clip, hscale, vscale); > + if (crtc_state->enable) > + drm_mode_get_hv_timing(&crtc_state->mode, &clip.x2, &clip.y2); > + > + plane_state->visible = drm_rect_clip_scaled(src, dst, &clip, hscale, vscale); > > drm_rect_rotate_inv(src, fb->width << 16, fb->height << 16, rotation); > > @@ -778,10 +780,10 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, > */ > return 0; > > - if (!can_position && !drm_rect_equals(dst, clip)) { > + if (!can_position && !drm_rect_equals(dst, &clip)) { > DRM_DEBUG_KMS("Plane must cover entire CRTC\n"); > drm_rect_debug_print("dst: ", dst, false); > - drm_rect_debug_print("clip: ", clip, false); > + drm_rect_debug_print("clip: ", &clip, false); > return -EINVAL; > } > > diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c > index f1be8cd4e387..f88f68161519 100644 > --- a/drivers/gpu/drm/drm_plane_helper.c > +++ b/drivers/gpu/drm/drm_plane_helper.c > @@ -106,7 +106,6 @@ static int get_connectors_for_crtc(struct drm_crtc *crtc, > * @fb: framebuffer to flip onto plane > * @src: source coordinates in 16.16 fixed point > * @dst: integer destination coordinates > - * @clip: integer clipping coordinates > * @rotation: plane rotation > * @min_scale: minimum @src:@dest scaling factor in 16.16 fixed point > * @max_scale: maximum @src:@dest scaling factor in 16.16 fixed point > @@ -131,7 +130,6 @@ int drm_plane_helper_check_update(struct drm_plane *plane, > struct drm_framebuffer *fb, > struct drm_rect *src, > struct drm_rect *dst, > - const struct drm_rect *clip, > unsigned int rotation, > int min_scale, > int max_scale, > @@ -157,11 +155,12 @@ int drm_plane_helper_check_update(struct drm_plane *plane, > struct drm_crtc_state crtc_state = { > .crtc = crtc, > .enable = crtc->enabled, > + .mode = crtc->mode, > }; > int ret; > > ret = drm_atomic_helper_check_plane_state(&plane_state, &crtc_state, > - clip, min_scale, max_scale, > + min_scale, max_scale, > can_position, > can_update_disabled); > if (ret) > @@ -239,16 +238,12 @@ int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *crtc, > .x2 = crtc_x + crtc_w, > .y2 = crtc_y + crtc_h, > }; > - const struct drm_rect clip = { > - .x2 = crtc->mode.hdisplay, > - .y2 = crtc->mode.vdisplay, > - }; > struct drm_connector **connector_list; > int num_connectors, ret; > bool visible; > > ret = drm_plane_helper_check_update(plane, crtc, fb, > - &src, &dest, &clip, > + &src, &dest, > DRM_MODE_ROTATE_0, > DRM_PLANE_HELPER_NO_SCALING, > DRM_PLANE_HELPER_NO_SCALING, > diff --git a/drivers/gpu/drm/drm_simple_kms_helper.c b/drivers/gpu/drm/drm_simple_kms_helper.c > index 9d3f6b70812c..165bc756af96 100644 > --- a/drivers/gpu/drm/drm_simple_kms_helper.c > +++ b/drivers/gpu/drm/drm_simple_kms_helper.c > @@ -89,7 +89,6 @@ static const struct drm_crtc_funcs drm_simple_kms_crtc_funcs = { > static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane, > struct drm_plane_state *plane_state) > { > - struct drm_rect clip = { 0 }; > struct drm_simple_display_pipe *pipe; > struct drm_crtc_state *crtc_state; > int ret; > @@ -100,12 +99,7 @@ static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane, > if (!crtc_state->enable) > return 0; /* nothing to check when disabling or disabled */ > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > ret = drm_atomic_helper_check_plane_state(plane_state, crtc_state, > - &clip, > DRM_PLANE_HELPER_NO_SCALING, > DRM_PLANE_HELPER_NO_SCALING, > false, true); > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c > index 4eeec590b722..200d8989f7b5 100644 > --- a/drivers/gpu/drm/i915/intel_display.c > +++ b/drivers/gpu/drm/i915/intel_display.c > @@ -9267,18 +9267,12 @@ static int intel_check_cursor(struct intel_crtc_state *crtc_state, > struct intel_plane_state *plane_state) > { > const struct drm_framebuffer *fb = plane_state->base.fb; > - struct drm_rect clip = {}; > int src_x, src_y; > u32 offset; > int ret; > > - if (crtc_state->base.enable) > - drm_mode_get_hv_timing(&crtc_state->base.mode, > - &clip.x2, &clip.y2); > - > ret = drm_atomic_helper_check_plane_state(&plane_state->base, > &crtc_state->base, > - &clip, > DRM_PLANE_HELPER_NO_SCALING, > DRM_PLANE_HELPER_NO_SCALING, > true, true); > @@ -12837,7 +12831,6 @@ intel_check_primary_plane(struct intel_plane *plane, > int min_scale = DRM_PLANE_HELPER_NO_SCALING; > int max_scale = DRM_PLANE_HELPER_NO_SCALING; > bool can_position = false; > - struct drm_rect clip = {}; > int ret; > > if (INTEL_GEN(dev_priv) >= 9) { > @@ -12849,13 +12842,8 @@ intel_check_primary_plane(struct intel_plane *plane, > can_position = true; > } > > - if (crtc_state->base.enable) > - drm_mode_get_hv_timing(&crtc_state->base.mode, > - &clip.x2, &clip.y2); > - > ret = drm_atomic_helper_check_plane_state(&state->base, > &crtc_state->base, > - &clip, > min_scale, max_scale, > can_position, true); > if (ret) > diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3-plane.c > index c0662503571b..35be3759e08e 100644 > --- a/drivers/gpu/drm/imx/ipuv3-plane.c > +++ b/drivers/gpu/drm/imx/ipuv3-plane.c > @@ -322,7 +322,6 @@ static int ipu_plane_atomic_check(struct drm_plane *plane, > struct drm_framebuffer *old_fb = old_state->fb; > unsigned long eba, ubo, vbo, old_ubo, old_vbo, alpha_eba; > bool can_position = (plane->type == DRM_PLANE_TYPE_OVERLAY); > - struct drm_rect clip = {}; > int hsub, vsub; > int ret; > > @@ -338,11 +337,7 @@ static int ipu_plane_atomic_check(struct drm_plane *plane, > if (WARN_ON(!crtc_state)) > return -EINVAL; > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > - ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > + ret = drm_atomic_helper_check_plane_state(state, crtc_state, > DRM_PLANE_HELPER_NO_SCALING, > DRM_PLANE_HELPER_NO_SCALING, > can_position, true); > diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c > index b5c6eec9a584..2f4b0ffee598 100644 > --- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c > +++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c > @@ -91,7 +91,6 @@ static int mtk_plane_atomic_check(struct drm_plane *plane, > { > struct drm_framebuffer *fb = state->fb; > struct drm_crtc_state *crtc_state; > - struct drm_rect clip = { 0, }; > > if (!fb) > return 0; > @@ -108,11 +107,7 @@ static int mtk_plane_atomic_check(struct drm_plane *plane, > if (IS_ERR(crtc_state)) > return PTR_ERR(crtc_state); > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > - return drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > + return drm_atomic_helper_check_plane_state(state, crtc_state, > DRM_PLANE_HELPER_NO_SCALING, > DRM_PLANE_HELPER_NO_SCALING, > true, true); > diff --git a/drivers/gpu/drm/meson/meson_plane.c b/drivers/gpu/drm/meson/meson_plane.c > index 3801bee1f9e6..c78a3a59f58c 100644 > --- a/drivers/gpu/drm/meson/meson_plane.c > +++ b/drivers/gpu/drm/meson/meson_plane.c > @@ -49,7 +49,6 @@ static int meson_plane_atomic_check(struct drm_plane *plane, > struct drm_plane_state *state) > { > struct drm_crtc_state *crtc_state; > - struct drm_rect clip = { 0, }; > > if (!state->crtc) > return 0; > @@ -58,11 +57,7 @@ static int meson_plane_atomic_check(struct drm_plane *plane, > if (IS_ERR(crtc_state)) > return PTR_ERR(crtc_state); > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > - return drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > + return drm_atomic_helper_check_plane_state(state, crtc_state, > DRM_PLANE_HELPER_NO_SCALING, > DRM_PLANE_HELPER_NO_SCALING, > true, true); > diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c > index 09f758e7bb1b..087d6973e804 100644 > --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c > +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c > @@ -286,7 +286,6 @@ static int mdp5_plane_atomic_check_with_state(struct drm_crtc_state *crtc_state, > uint32_t max_width, max_height; > bool out_of_bounds = false; > uint32_t caps = 0; > - struct drm_rect clip = {}; > int min_scale, max_scale; > int ret; > > @@ -323,11 +322,7 @@ static int mdp5_plane_atomic_check_with_state(struct drm_crtc_state *crtc_state, > min_scale = FRAC_16_16(1, 8); > max_scale = FRAC_16_16(8, 1); > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > - ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > + ret = drm_atomic_helper_check_plane_state(state, crtc_state, > min_scale, max_scale, > true, true); > if (ret) > @@ -471,7 +466,6 @@ static int mdp5_plane_atomic_async_check(struct drm_plane *plane, > { > struct mdp5_plane_state *mdp5_state = to_mdp5_plane_state(state); > struct drm_crtc_state *crtc_state; > - struct drm_rect clip = {}; > int min_scale, max_scale; > int ret; > > @@ -502,11 +496,7 @@ static int mdp5_plane_atomic_async_check(struct drm_plane *plane, > min_scale = FRAC_16_16(1, 8); > max_scale = FRAC_16_16(8, 1); > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > - ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > + ret = drm_atomic_helper_check_plane_state(state, crtc_state, > min_scale, max_scale, > true, true); > if (ret) > diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c > index 7d8307ec442c..9aad769bcdf0 100644 > --- a/drivers/gpu/drm/nouveau/nv50_display.c > +++ b/drivers/gpu/drm/nouveau/nv50_display.c > @@ -1135,15 +1135,9 @@ static int > nv50_curs_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, > struct nv50_head_atom *asyh) > { > - struct drm_rect clip = {}; > int ret; > > - if (asyh->state.enable) > - drm_mode_get_hv_timing(&asyh->state.mode, > - &clip.x2, &clip.y2); > - > ret = drm_atomic_helper_check_plane_state(&asyw->state, &asyh->state, > - &clip, > DRM_PLANE_HELPER_NO_SCALING, > DRM_PLANE_HELPER_NO_SCALING, > true, true); > @@ -1427,18 +1421,12 @@ nv50_base_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, > struct nv50_head_atom *asyh) > { > const struct drm_framebuffer *fb = asyw->state.fb; > - struct drm_rect clip = {}; > int ret; > > if (!fb->format->depth) > return -EINVAL; > > - if (asyh->state.enable) > - drm_mode_get_hv_timing(&asyh->state.mode, > - &clip.x2, &clip.y2); > - > ret = drm_atomic_helper_check_plane_state(&asyw->state, &asyh->state, > - &clip, > DRM_PLANE_HELPER_NO_SCALING, > DRM_PLANE_HELPER_NO_SCALING, > false, true); > diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c > index cd2c72389629..b95e9d45a435 100644 > --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c > +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c > @@ -641,7 +641,6 @@ static int vop_plane_atomic_check(struct drm_plane *plane, > struct vop_win *vop_win = to_vop_win(plane); > const struct vop_win_data *win = vop_win->data; > int ret; > - struct drm_rect clip = {}; > int min_scale = win->phy->scl ? FRAC_16_16(1, 8) : > DRM_PLANE_HELPER_NO_SCALING; > int max_scale = win->phy->scl ? FRAC_16_16(8, 1) : > @@ -654,11 +653,7 @@ static int vop_plane_atomic_check(struct drm_plane *plane, > if (WARN_ON(!crtc_state)) > return -EINVAL; > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > - ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > + ret = drm_atomic_helper_check_plane_state(state, crtc_state, > min_scale, max_scale, > true, true); > if (ret) > diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c > index 93b47e0e038b..45c9cecd7111 100644 > --- a/drivers/gpu/drm/tegra/dc.c > +++ b/drivers/gpu/drm/tegra/dc.c > @@ -477,7 +477,6 @@ static int tegra_plane_state_add(struct tegra_plane *plane, > { > struct drm_crtc_state *crtc_state; > struct tegra_dc_state *tegra; > - struct drm_rect clip = {}; > int err; > > /* Propagate errors from allocation or locking failures. */ > @@ -485,12 +484,8 @@ static int tegra_plane_state_add(struct tegra_plane *plane, > if (IS_ERR(crtc_state)) > return PTR_ERR(crtc_state); > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > /* Check plane state for visibility and calculate clipping bounds */ > - err = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > + err = drm_atomic_helper_check_plane_state(state, crtc_state, > 0, INT_MAX, true, true); > if (err < 0) > return err; > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c > index 25d96560180b..e3e2e9b1ead8 100644 > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c > @@ -443,17 +443,12 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane, > { > struct drm_crtc_state *crtc_state = NULL; > struct drm_framebuffer *new_fb = state->fb; > - struct drm_rect clip = {}; > int ret; > > if (state->crtc) > crtc_state = drm_atomic_get_new_crtc_state(state->state, state->crtc); > > - if (crtc_state && crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > - ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > + ret = drm_atomic_helper_check_plane_state(state, crtc_state, > DRM_PLANE_HELPER_NO_SCALING, > DRM_PLANE_HELPER_NO_SCALING, > false, true); > diff --git a/drivers/gpu/drm/zte/zx_plane.c b/drivers/gpu/drm/zte/zx_plane.c > index 8e1f34274e24..94545adac50d 100644 > --- a/drivers/gpu/drm/zte/zx_plane.c > +++ b/drivers/gpu/drm/zte/zx_plane.c > @@ -55,7 +55,6 @@ static int zx_vl_plane_atomic_check(struct drm_plane *plane, > struct drm_framebuffer *fb = plane_state->fb; > struct drm_crtc *crtc = plane_state->crtc; > struct drm_crtc_state *crtc_state; > - struct drm_rect clip = {}; > int min_scale = FRAC_16_16(1, 8); > int max_scale = FRAC_16_16(8, 1); > > @@ -75,12 +74,8 @@ static int zx_vl_plane_atomic_check(struct drm_plane *plane, > if (!plane_state->crtc) > return -EINVAL; > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > return drm_atomic_helper_check_plane_state(plane_state, crtc_state, > - &clip, min_scale, max_scale, > + min_scale, max_scale, > true, true); > } > > @@ -291,7 +286,6 @@ static int zx_gl_plane_atomic_check(struct drm_plane *plane, > struct drm_framebuffer *fb = plane_state->fb; > struct drm_crtc *crtc = plane_state->crtc; > struct drm_crtc_state *crtc_state; > - struct drm_rect clip = {}; > > if (!crtc || !fb) > return 0; > @@ -309,12 +303,7 @@ static int zx_gl_plane_atomic_check(struct drm_plane *plane, > if (!plane_state->crtc) > return -EINVAL; > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > return drm_atomic_helper_check_plane_state(plane_state, crtc_state, > - &clip, > DRM_PLANE_HELPER_NO_SCALING, > DRM_PLANE_HELPER_NO_SCALING, > false, true); > diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h > index 4842ee9485ce..26aaba58d6ce 100644 > --- a/include/drm/drm_atomic_helper.h > +++ b/include/drm/drm_atomic_helper.h > @@ -40,7 +40,6 @@ int drm_atomic_helper_check_modeset(struct drm_device *dev, > struct drm_atomic_state *state); > int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, > const struct drm_crtc_state *crtc_state, > - const struct drm_rect *clip, > int min_scale, > int max_scale, > bool can_position, > diff --git a/include/drm/drm_plane_helper.h b/include/drm/drm_plane_helper.h > index 8aa49c0ecd4d..28d7ce620729 100644 > --- a/include/drm/drm_plane_helper.h > +++ b/include/drm/drm_plane_helper.h > @@ -43,7 +43,6 @@ int drm_plane_helper_check_update(struct drm_plane *plane, > struct drm_framebuffer *fb, > struct drm_rect *src, > struct drm_rect *dest, > - const struct drm_rect *clip, > unsigned int rotation, > int min_scale, > int max_scale, > -- > 2.13.6 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- ==================== | I would like to | | fix the world, | | but they're not | | giving me the | \ source code! / --------------- ¯\_(ツ)_/¯ _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 15/15] drm: Don't pass clip to drm_atomic_helper_check_plane_state() 2017-11-23 19:05 ` [PATCH 15/15] drm: Don't pass clip to drm_atomic_helper_check_plane_state() Ville Syrjala 2017-11-24 11:59 ` Liviu Dudau 2017-11-24 12:01 ` Liviu Dudau @ 2017-11-24 17:00 ` Daniel Vetter 2 siblings, 0 replies; 39+ messages in thread From: Daniel Vetter @ 2017-11-24 17:00 UTC (permalink / raw) To: Ville Syrjala; +Cc: intel-gfx, Laurent Pinchart, dri-devel On Thu, Nov 23, 2017 at 09:05:02PM +0200, Ville Syrjala wrote: > From: Ville Syrjälä <ville.syrjala@linux.intel.com> > > Move the plane clip rectangle handling into > drm_atomic_helper_check_plane_state(). Drivers no longer > have to worry about such mundane details. > > Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > Cc: Daniel Vetter <daniel@ffwll.ch> > Suggested-by: Daniel Vetter <daniel@ffwll.ch> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> I guess the longer-term next step would be that we expose can_scale and can_position (and maybe the scaling limits?) as read-only properties, as hints to the compositor. And then move all the calls into the overall helpers (i.e. drm_atomic_helper_check_planes). But this here is real sweet already I think. Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> > --- > drivers/gpu/drm/arm/hdlcd_crtc.c | 7 +------ > drivers/gpu/drm/arm/malidp_planes.c | 7 +------ > drivers/gpu/drm/armada/armada_overlay.c | 6 +----- > drivers/gpu/drm/drm_atomic_helper.c | 12 +++++++----- > drivers/gpu/drm/drm_plane_helper.c | 11 +++-------- > drivers/gpu/drm/drm_simple_kms_helper.c | 6 ------ > drivers/gpu/drm/i915/intel_display.c | 12 ------------ > drivers/gpu/drm/imx/ipuv3-plane.c | 7 +------ > drivers/gpu/drm/mediatek/mtk_drm_plane.c | 7 +------ > drivers/gpu/drm/meson/meson_plane.c | 7 +------ > drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 14 ++------------ > drivers/gpu/drm/nouveau/nv50_display.c | 12 ------------ > drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 7 +------ > drivers/gpu/drm/tegra/dc.c | 7 +------ > drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 7 +------ > drivers/gpu/drm/zte/zx_plane.c | 13 +------------ > include/drm/drm_atomic_helper.h | 1 - > include/drm/drm_plane_helper.h | 1 - > 18 files changed, 22 insertions(+), 122 deletions(-) > > diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c > index fa852fc1c9e6..93c503b754ba 100644 > --- a/drivers/gpu/drm/arm/hdlcd_crtc.c > +++ b/drivers/gpu/drm/arm/hdlcd_crtc.c > @@ -229,7 +229,6 @@ static const struct drm_crtc_helper_funcs hdlcd_crtc_helper_funcs = { > static int hdlcd_plane_atomic_check(struct drm_plane *plane, > struct drm_plane_state *state) > { > - struct drm_rect clip = { 0 }; > struct drm_crtc_state *crtc_state; > u32 src_h = state->src_h >> 16; > > @@ -249,11 +248,7 @@ static int hdlcd_plane_atomic_check(struct drm_plane *plane, > return -EINVAL; > } > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > - return drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > + return drm_atomic_helper_check_plane_state(state, crtc_state, > DRM_PLANE_HELPER_NO_SCALING, > DRM_PLANE_HELPER_NO_SCALING, > false, true); > diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c > index 2f6d608d6eaf..e630c0218aaf 100644 > --- a/drivers/gpu/drm/arm/malidp_planes.c > +++ b/drivers/gpu/drm/arm/malidp_planes.c > @@ -141,18 +141,13 @@ static int malidp_se_check_scaling(struct malidp_plane *mp, > struct drm_crtc_state *crtc_state = > drm_atomic_get_existing_crtc_state(state->state, state->crtc); > struct malidp_crtc_state *mc; > - struct drm_rect clip = { 0 }; > u32 src_w, src_h; > int ret; > > if (!crtc_state) > return -EINVAL; > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > - ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > + ret = drm_atomic_helper_check_plane_state(state, crtc_state, > 0, INT_MAX, true, true); > if (ret) > return ret; > diff --git a/drivers/gpu/drm/armada/armada_overlay.c b/drivers/gpu/drm/armada/armada_overlay.c > index b411b608821a..564bd63a5f6a 100644 > --- a/drivers/gpu/drm/armada/armada_overlay.c > +++ b/drivers/gpu/drm/armada/armada_overlay.c > @@ -111,10 +111,6 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, > .x2 = crtc_x + crtc_w, > .y2 = crtc_y + crtc_h, > }; > - const struct drm_rect clip = { > - .x2 = crtc->mode.hdisplay, > - .y2 = crtc->mode.vdisplay, > - }; > uint32_t val, ctrl0; > unsigned idx = 0; > bool visible; > @@ -124,7 +120,7 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, > crtc_x, crtc_y, crtc_w, crtc_h, > src_x, src_y, src_w, src_h); > > - ret = drm_plane_helper_check_update(plane, crtc, fb, &src, &dest, &clip, > + ret = drm_plane_helper_check_update(plane, crtc, fb, &src, &dest, > DRM_MODE_ROTATE_0, > 0, INT_MAX, true, false, &visible); > if (ret) > diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c > index 2f80377101a1..d25eaf6f62a9 100644 > --- a/drivers/gpu/drm/drm_atomic_helper.c > +++ b/drivers/gpu/drm/drm_atomic_helper.c > @@ -699,7 +699,6 @@ EXPORT_SYMBOL(drm_atomic_helper_check_modeset); > * drm_atomic_helper_check_plane_state() - Check plane state for validity > * @plane_state: plane state to check > * @crtc_state: crtc state to check > - * @clip: integer clipping coordinates > * @min_scale: minimum @src:@dest scaling factor in 16.16 fixed point > * @max_scale: maximum @src:@dest scaling factor in 16.16 fixed point > * @can_position: is it legal to position the plane such that it > @@ -719,7 +718,6 @@ EXPORT_SYMBOL(drm_atomic_helper_check_modeset); > */ > int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, > const struct drm_crtc_state *crtc_state, > - const struct drm_rect *clip, > int min_scale, > int max_scale, > bool can_position, > @@ -729,6 +727,7 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, > struct drm_rect *src = &plane_state->src; > struct drm_rect *dst = &plane_state->dst; > unsigned int rotation = plane_state->rotation; > + struct drm_rect clip = {}; > int hscale, vscale; > > WARN_ON(plane_state->crtc && plane_state->crtc != crtc_state->crtc); > @@ -764,7 +763,10 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, > return -ERANGE; > } > > - plane_state->visible = drm_rect_clip_scaled(src, dst, clip, hscale, vscale); > + if (crtc_state->enable) > + drm_mode_get_hv_timing(&crtc_state->mode, &clip.x2, &clip.y2); > + > + plane_state->visible = drm_rect_clip_scaled(src, dst, &clip, hscale, vscale); > > drm_rect_rotate_inv(src, fb->width << 16, fb->height << 16, rotation); > > @@ -778,10 +780,10 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, > */ > return 0; > > - if (!can_position && !drm_rect_equals(dst, clip)) { > + if (!can_position && !drm_rect_equals(dst, &clip)) { > DRM_DEBUG_KMS("Plane must cover entire CRTC\n"); > drm_rect_debug_print("dst: ", dst, false); > - drm_rect_debug_print("clip: ", clip, false); > + drm_rect_debug_print("clip: ", &clip, false); > return -EINVAL; > } > > diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c > index f1be8cd4e387..f88f68161519 100644 > --- a/drivers/gpu/drm/drm_plane_helper.c > +++ b/drivers/gpu/drm/drm_plane_helper.c > @@ -106,7 +106,6 @@ static int get_connectors_for_crtc(struct drm_crtc *crtc, > * @fb: framebuffer to flip onto plane > * @src: source coordinates in 16.16 fixed point > * @dst: integer destination coordinates > - * @clip: integer clipping coordinates > * @rotation: plane rotation > * @min_scale: minimum @src:@dest scaling factor in 16.16 fixed point > * @max_scale: maximum @src:@dest scaling factor in 16.16 fixed point > @@ -131,7 +130,6 @@ int drm_plane_helper_check_update(struct drm_plane *plane, > struct drm_framebuffer *fb, > struct drm_rect *src, > struct drm_rect *dst, > - const struct drm_rect *clip, > unsigned int rotation, > int min_scale, > int max_scale, > @@ -157,11 +155,12 @@ int drm_plane_helper_check_update(struct drm_plane *plane, > struct drm_crtc_state crtc_state = { > .crtc = crtc, > .enable = crtc->enabled, > + .mode = crtc->mode, > }; > int ret; > > ret = drm_atomic_helper_check_plane_state(&plane_state, &crtc_state, > - clip, min_scale, max_scale, > + min_scale, max_scale, > can_position, > can_update_disabled); > if (ret) > @@ -239,16 +238,12 @@ int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *crtc, > .x2 = crtc_x + crtc_w, > .y2 = crtc_y + crtc_h, > }; > - const struct drm_rect clip = { > - .x2 = crtc->mode.hdisplay, > - .y2 = crtc->mode.vdisplay, > - }; > struct drm_connector **connector_list; > int num_connectors, ret; > bool visible; > > ret = drm_plane_helper_check_update(plane, crtc, fb, > - &src, &dest, &clip, > + &src, &dest, > DRM_MODE_ROTATE_0, > DRM_PLANE_HELPER_NO_SCALING, > DRM_PLANE_HELPER_NO_SCALING, > diff --git a/drivers/gpu/drm/drm_simple_kms_helper.c b/drivers/gpu/drm/drm_simple_kms_helper.c > index 9d3f6b70812c..165bc756af96 100644 > --- a/drivers/gpu/drm/drm_simple_kms_helper.c > +++ b/drivers/gpu/drm/drm_simple_kms_helper.c > @@ -89,7 +89,6 @@ static const struct drm_crtc_funcs drm_simple_kms_crtc_funcs = { > static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane, > struct drm_plane_state *plane_state) > { > - struct drm_rect clip = { 0 }; > struct drm_simple_display_pipe *pipe; > struct drm_crtc_state *crtc_state; > int ret; > @@ -100,12 +99,7 @@ static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane, > if (!crtc_state->enable) > return 0; /* nothing to check when disabling or disabled */ > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > ret = drm_atomic_helper_check_plane_state(plane_state, crtc_state, > - &clip, > DRM_PLANE_HELPER_NO_SCALING, > DRM_PLANE_HELPER_NO_SCALING, > false, true); > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c > index 4eeec590b722..200d8989f7b5 100644 > --- a/drivers/gpu/drm/i915/intel_display.c > +++ b/drivers/gpu/drm/i915/intel_display.c > @@ -9267,18 +9267,12 @@ static int intel_check_cursor(struct intel_crtc_state *crtc_state, > struct intel_plane_state *plane_state) > { > const struct drm_framebuffer *fb = plane_state->base.fb; > - struct drm_rect clip = {}; > int src_x, src_y; > u32 offset; > int ret; > > - if (crtc_state->base.enable) > - drm_mode_get_hv_timing(&crtc_state->base.mode, > - &clip.x2, &clip.y2); > - > ret = drm_atomic_helper_check_plane_state(&plane_state->base, > &crtc_state->base, > - &clip, > DRM_PLANE_HELPER_NO_SCALING, > DRM_PLANE_HELPER_NO_SCALING, > true, true); > @@ -12837,7 +12831,6 @@ intel_check_primary_plane(struct intel_plane *plane, > int min_scale = DRM_PLANE_HELPER_NO_SCALING; > int max_scale = DRM_PLANE_HELPER_NO_SCALING; > bool can_position = false; > - struct drm_rect clip = {}; > int ret; > > if (INTEL_GEN(dev_priv) >= 9) { > @@ -12849,13 +12842,8 @@ intel_check_primary_plane(struct intel_plane *plane, > can_position = true; > } > > - if (crtc_state->base.enable) > - drm_mode_get_hv_timing(&crtc_state->base.mode, > - &clip.x2, &clip.y2); > - > ret = drm_atomic_helper_check_plane_state(&state->base, > &crtc_state->base, > - &clip, > min_scale, max_scale, > can_position, true); > if (ret) > diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3-plane.c > index c0662503571b..35be3759e08e 100644 > --- a/drivers/gpu/drm/imx/ipuv3-plane.c > +++ b/drivers/gpu/drm/imx/ipuv3-plane.c > @@ -322,7 +322,6 @@ static int ipu_plane_atomic_check(struct drm_plane *plane, > struct drm_framebuffer *old_fb = old_state->fb; > unsigned long eba, ubo, vbo, old_ubo, old_vbo, alpha_eba; > bool can_position = (plane->type == DRM_PLANE_TYPE_OVERLAY); > - struct drm_rect clip = {}; > int hsub, vsub; > int ret; > > @@ -338,11 +337,7 @@ static int ipu_plane_atomic_check(struct drm_plane *plane, > if (WARN_ON(!crtc_state)) > return -EINVAL; > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > - ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > + ret = drm_atomic_helper_check_plane_state(state, crtc_state, > DRM_PLANE_HELPER_NO_SCALING, > DRM_PLANE_HELPER_NO_SCALING, > can_position, true); > diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c > index b5c6eec9a584..2f4b0ffee598 100644 > --- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c > +++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c > @@ -91,7 +91,6 @@ static int mtk_plane_atomic_check(struct drm_plane *plane, > { > struct drm_framebuffer *fb = state->fb; > struct drm_crtc_state *crtc_state; > - struct drm_rect clip = { 0, }; > > if (!fb) > return 0; > @@ -108,11 +107,7 @@ static int mtk_plane_atomic_check(struct drm_plane *plane, > if (IS_ERR(crtc_state)) > return PTR_ERR(crtc_state); > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > - return drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > + return drm_atomic_helper_check_plane_state(state, crtc_state, > DRM_PLANE_HELPER_NO_SCALING, > DRM_PLANE_HELPER_NO_SCALING, > true, true); > diff --git a/drivers/gpu/drm/meson/meson_plane.c b/drivers/gpu/drm/meson/meson_plane.c > index 3801bee1f9e6..c78a3a59f58c 100644 > --- a/drivers/gpu/drm/meson/meson_plane.c > +++ b/drivers/gpu/drm/meson/meson_plane.c > @@ -49,7 +49,6 @@ static int meson_plane_atomic_check(struct drm_plane *plane, > struct drm_plane_state *state) > { > struct drm_crtc_state *crtc_state; > - struct drm_rect clip = { 0, }; > > if (!state->crtc) > return 0; > @@ -58,11 +57,7 @@ static int meson_plane_atomic_check(struct drm_plane *plane, > if (IS_ERR(crtc_state)) > return PTR_ERR(crtc_state); > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > - return drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > + return drm_atomic_helper_check_plane_state(state, crtc_state, > DRM_PLANE_HELPER_NO_SCALING, > DRM_PLANE_HELPER_NO_SCALING, > true, true); > diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c > index 09f758e7bb1b..087d6973e804 100644 > --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c > +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c > @@ -286,7 +286,6 @@ static int mdp5_plane_atomic_check_with_state(struct drm_crtc_state *crtc_state, > uint32_t max_width, max_height; > bool out_of_bounds = false; > uint32_t caps = 0; > - struct drm_rect clip = {}; > int min_scale, max_scale; > int ret; > > @@ -323,11 +322,7 @@ static int mdp5_plane_atomic_check_with_state(struct drm_crtc_state *crtc_state, > min_scale = FRAC_16_16(1, 8); > max_scale = FRAC_16_16(8, 1); > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > - ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > + ret = drm_atomic_helper_check_plane_state(state, crtc_state, > min_scale, max_scale, > true, true); > if (ret) > @@ -471,7 +466,6 @@ static int mdp5_plane_atomic_async_check(struct drm_plane *plane, > { > struct mdp5_plane_state *mdp5_state = to_mdp5_plane_state(state); > struct drm_crtc_state *crtc_state; > - struct drm_rect clip = {}; > int min_scale, max_scale; > int ret; > > @@ -502,11 +496,7 @@ static int mdp5_plane_atomic_async_check(struct drm_plane *plane, > min_scale = FRAC_16_16(1, 8); > max_scale = FRAC_16_16(8, 1); > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > - ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > + ret = drm_atomic_helper_check_plane_state(state, crtc_state, > min_scale, max_scale, > true, true); > if (ret) > diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c > index 7d8307ec442c..9aad769bcdf0 100644 > --- a/drivers/gpu/drm/nouveau/nv50_display.c > +++ b/drivers/gpu/drm/nouveau/nv50_display.c > @@ -1135,15 +1135,9 @@ static int > nv50_curs_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, > struct nv50_head_atom *asyh) > { > - struct drm_rect clip = {}; > int ret; > > - if (asyh->state.enable) > - drm_mode_get_hv_timing(&asyh->state.mode, > - &clip.x2, &clip.y2); > - > ret = drm_atomic_helper_check_plane_state(&asyw->state, &asyh->state, > - &clip, > DRM_PLANE_HELPER_NO_SCALING, > DRM_PLANE_HELPER_NO_SCALING, > true, true); > @@ -1427,18 +1421,12 @@ nv50_base_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, > struct nv50_head_atom *asyh) > { > const struct drm_framebuffer *fb = asyw->state.fb; > - struct drm_rect clip = {}; > int ret; > > if (!fb->format->depth) > return -EINVAL; > > - if (asyh->state.enable) > - drm_mode_get_hv_timing(&asyh->state.mode, > - &clip.x2, &clip.y2); > - > ret = drm_atomic_helper_check_plane_state(&asyw->state, &asyh->state, > - &clip, > DRM_PLANE_HELPER_NO_SCALING, > DRM_PLANE_HELPER_NO_SCALING, > false, true); > diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c > index cd2c72389629..b95e9d45a435 100644 > --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c > +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c > @@ -641,7 +641,6 @@ static int vop_plane_atomic_check(struct drm_plane *plane, > struct vop_win *vop_win = to_vop_win(plane); > const struct vop_win_data *win = vop_win->data; > int ret; > - struct drm_rect clip = {}; > int min_scale = win->phy->scl ? FRAC_16_16(1, 8) : > DRM_PLANE_HELPER_NO_SCALING; > int max_scale = win->phy->scl ? FRAC_16_16(8, 1) : > @@ -654,11 +653,7 @@ static int vop_plane_atomic_check(struct drm_plane *plane, > if (WARN_ON(!crtc_state)) > return -EINVAL; > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > - ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > + ret = drm_atomic_helper_check_plane_state(state, crtc_state, > min_scale, max_scale, > true, true); > if (ret) > diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c > index 93b47e0e038b..45c9cecd7111 100644 > --- a/drivers/gpu/drm/tegra/dc.c > +++ b/drivers/gpu/drm/tegra/dc.c > @@ -477,7 +477,6 @@ static int tegra_plane_state_add(struct tegra_plane *plane, > { > struct drm_crtc_state *crtc_state; > struct tegra_dc_state *tegra; > - struct drm_rect clip = {}; > int err; > > /* Propagate errors from allocation or locking failures. */ > @@ -485,12 +484,8 @@ static int tegra_plane_state_add(struct tegra_plane *plane, > if (IS_ERR(crtc_state)) > return PTR_ERR(crtc_state); > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > /* Check plane state for visibility and calculate clipping bounds */ > - err = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > + err = drm_atomic_helper_check_plane_state(state, crtc_state, > 0, INT_MAX, true, true); > if (err < 0) > return err; > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c > index 25d96560180b..e3e2e9b1ead8 100644 > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c > @@ -443,17 +443,12 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane, > { > struct drm_crtc_state *crtc_state = NULL; > struct drm_framebuffer *new_fb = state->fb; > - struct drm_rect clip = {}; > int ret; > > if (state->crtc) > crtc_state = drm_atomic_get_new_crtc_state(state->state, state->crtc); > > - if (crtc_state && crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > - ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, > + ret = drm_atomic_helper_check_plane_state(state, crtc_state, > DRM_PLANE_HELPER_NO_SCALING, > DRM_PLANE_HELPER_NO_SCALING, > false, true); > diff --git a/drivers/gpu/drm/zte/zx_plane.c b/drivers/gpu/drm/zte/zx_plane.c > index 8e1f34274e24..94545adac50d 100644 > --- a/drivers/gpu/drm/zte/zx_plane.c > +++ b/drivers/gpu/drm/zte/zx_plane.c > @@ -55,7 +55,6 @@ static int zx_vl_plane_atomic_check(struct drm_plane *plane, > struct drm_framebuffer *fb = plane_state->fb; > struct drm_crtc *crtc = plane_state->crtc; > struct drm_crtc_state *crtc_state; > - struct drm_rect clip = {}; > int min_scale = FRAC_16_16(1, 8); > int max_scale = FRAC_16_16(8, 1); > > @@ -75,12 +74,8 @@ static int zx_vl_plane_atomic_check(struct drm_plane *plane, > if (!plane_state->crtc) > return -EINVAL; > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > return drm_atomic_helper_check_plane_state(plane_state, crtc_state, > - &clip, min_scale, max_scale, > + min_scale, max_scale, > true, true); > } > > @@ -291,7 +286,6 @@ static int zx_gl_plane_atomic_check(struct drm_plane *plane, > struct drm_framebuffer *fb = plane_state->fb; > struct drm_crtc *crtc = plane_state->crtc; > struct drm_crtc_state *crtc_state; > - struct drm_rect clip = {}; > > if (!crtc || !fb) > return 0; > @@ -309,12 +303,7 @@ static int zx_gl_plane_atomic_check(struct drm_plane *plane, > if (!plane_state->crtc) > return -EINVAL; > > - if (crtc_state->enable) > - drm_mode_get_hv_timing(&crtc_state->mode, > - &clip.x2, &clip.y2); > - > return drm_atomic_helper_check_plane_state(plane_state, crtc_state, > - &clip, > DRM_PLANE_HELPER_NO_SCALING, > DRM_PLANE_HELPER_NO_SCALING, > false, true); > diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h > index 4842ee9485ce..26aaba58d6ce 100644 > --- a/include/drm/drm_atomic_helper.h > +++ b/include/drm/drm_atomic_helper.h > @@ -40,7 +40,6 @@ int drm_atomic_helper_check_modeset(struct drm_device *dev, > struct drm_atomic_state *state); > int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, > const struct drm_crtc_state *crtc_state, > - const struct drm_rect *clip, > int min_scale, > int max_scale, > bool can_position, > diff --git a/include/drm/drm_plane_helper.h b/include/drm/drm_plane_helper.h > index 8aa49c0ecd4d..28d7ce620729 100644 > --- a/include/drm/drm_plane_helper.h > +++ b/include/drm/drm_plane_helper.h > @@ -43,7 +43,6 @@ int drm_plane_helper_check_update(struct drm_plane *plane, > struct drm_framebuffer *fb, > struct drm_rect *src, > struct drm_rect *dest, > - const struct drm_rect *clip, > unsigned int rotation, > int min_scale, > int max_scale, > -- > 2.13.6 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 39+ messages in thread
* ✓ Fi.CI.BAT: success for drm: More plane clipping polish 2017-11-23 19:04 ` Ville Syrjala ` (14 preceding siblings ...) (?) @ 2017-11-23 19:30 ` Patchwork -1 siblings, 0 replies; 39+ messages in thread From: Patchwork @ 2017-11-23 19:30 UTC (permalink / raw) To: Ville Syrjälä; +Cc: intel-gfx == Series Details == Series: drm: More plane clipping polish URL : https://patchwork.freedesktop.org/series/34323/ State : success == Summary == Series 34323v1 drm: More plane clipping polish https://patchwork.freedesktop.org/api/1.0/series/34323/revisions/1/mbox/ Test kms_pipe_crc_basic: Subgroup suspend-read-crc-pipe-c: incomplete -> PASS (fi-cfl-s2) fi-bdw-5557u total:289 pass:268 dwarn:0 dfail:0 fail:0 skip:21 time:452s fi-bdw-gvtdvm total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:465s fi-blb-e6850 total:289 pass:223 dwarn:1 dfail:0 fail:0 skip:65 time:382s fi-bsw-n3050 total:289 pass:243 dwarn:0 dfail:0 fail:0 skip:46 time:550s fi-bwr-2160 total:289 pass:183 dwarn:0 dfail:0 fail:0 skip:106 time:280s fi-bxt-dsi total:289 pass:259 dwarn:0 dfail:0 fail:0 skip:30 time:506s fi-bxt-j4205 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:512s fi-byt-j1900 total:289 pass:254 dwarn:0 dfail:0 fail:0 skip:35 time:504s fi-byt-n2820 total:289 pass:250 dwarn:0 dfail:0 fail:0 skip:39 time:503s fi-cfl-s2 total:289 pass:263 dwarn:0 dfail:0 fail:0 skip:26 time:605s fi-elk-e7500 total:289 pass:229 dwarn:0 dfail:0 fail:0 skip:60 time:431s fi-gdg-551 total:289 pass:178 dwarn:1 dfail:0 fail:1 skip:109 time:268s fi-glk-1 total:289 pass:261 dwarn:0 dfail:0 fail:0 skip:28 time:539s fi-hsw-4770 total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:432s fi-hsw-4770r total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:440s fi-ilk-650 total:289 pass:228 dwarn:0 dfail:0 fail:0 skip:61 time:431s fi-ivb-3520m total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:482s fi-ivb-3770 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:469s fi-pnv-d510 total:289 pass:222 dwarn:1 dfail:0 fail:0 skip:66 time:580s fi-skl-6260u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:458s fi-skl-6600u total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:547s fi-skl-6700hq total:289 pass:263 dwarn:0 dfail:0 fail:0 skip:26 time:570s fi-skl-6700k total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:521s fi-skl-6770hq total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:505s fi-skl-gvtdvm total:289 pass:266 dwarn:0 dfail:0 fail:0 skip:23 time:462s fi-snb-2520m total:289 pass:250 dwarn:0 dfail:0 fail:0 skip:39 time:560s fi-snb-2600 total:289 pass:249 dwarn:0 dfail:0 fail:0 skip:40 time:424s Blacklisted hosts: fi-cnl-y total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:542s fi-glk-dsi total:289 pass:259 dwarn:0 dfail:0 fail:0 skip:30 time:497s fi-kbl-7500u total:289 pass:264 dwarn:1 dfail:0 fail:0 skip:24 time:486s fi-kbl-7560u total:289 pass:270 dwarn:0 dfail:0 fail:0 skip:19 time:530s fi-kbl-7567u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:475s fi-kbl-r total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:534s b407e5f38397c0c22b5056a1664753287993b152 drm-tip: 2017y-11m-23d-16h-14m-59s UTC integration manifest 975cf9bae7a3 drm: Don't pass clip to drm_atomic_helper_check_plane_state() 51ebe51a3012 drm/zte: Use drm_mode_get_hv_timing() to populate plane clip rectangle c376ca060824 drm/vmwgfx: Use drm_mode_get_hv_timing() to populate plane clip rectangle ed50094cf87d drm/tegra/dc: Use drm_mode_get_hv_timing() to populate plane clip rectangle 2b017f50a0d2 drm/rockchip: Use drm_mode_get_hv_timing() to populate plane clip rectangle bf76698f2b25 drm/nouveau/kms/nv50: Use drm_mode_get_hv_timing() to populate plane clip rectangle da6a67b6450b drm/msm/mdp5: Use drm_mode_get_hv_timing() to populate plane clip rectangle 90523aff7c90 drm/meson: Use drm_mode_get_hv_timing() to populate plane clip rectangle baf88708e38f drm/mediatek: Use drm_mode_get_hv_timing() to populate plane clip rectangle 8d6797e79d3d drm/imx: Use drm_mode_get_hv_timing() to populate plane clip rectangle 4bd7ff6b606b drm/simple_kms_helper: Use drm_mode_get_hv_timing() to populate plane clip rectangle fc3bc8c17475 drm/arm/mali-dp: Use drm_mode_get_hv_timing() to populate plane clip rectangle 69ec08a135e9 drm/arm/hdlcd: Use drm_mode_get_hv_timing() to populate plane clip rectangle 91f70c943b8f drm/i915: Use drm_mode_get_hv_timing() to populate plane clip rectangle e666a96eb3a0 drm/i915: Reject odd pipe source width with double wide/dual link == Logs == For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7267/ _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 39+ messages in thread
* ✓ Fi.CI.IGT: success for drm: More plane clipping polish 2017-11-23 19:04 ` Ville Syrjala ` (15 preceding siblings ...) (?) @ 2017-11-23 22:54 ` Patchwork -1 siblings, 0 replies; 39+ messages in thread From: Patchwork @ 2017-11-23 22:54 UTC (permalink / raw) To: Ville Syrjala; +Cc: intel-gfx == Series Details == Series: drm: More plane clipping polish URL : https://patchwork.freedesktop.org/series/34323/ State : success == Summary == Test drv_module_reload: Subgroup basic-no-display: pass -> DMESG-WARN (shard-hsw) fdo#102707 Test kms_flip: Subgroup wf_vblank-vs-modeset-interruptible: pass -> DMESG-WARN (shard-hsw) fdo#102614 Test perf: Subgroup polling: fail -> PASS (shard-hsw) fdo#102252 Test kms_setmode: Subgroup basic: fail -> PASS (shard-hsw) fdo#99912 fdo#102707 https://bugs.freedesktop.org/show_bug.cgi?id=102707 fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614 fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252 fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912 shard-hsw total:2667 pass:1534 dwarn:3 dfail:0 fail:9 skip:1121 time:9483s shard-snb total:2649 pass:1294 dwarn:1 dfail:0 fail:12 skip:1341 time:7989s Blacklisted hosts: shard-apl total:2608 pass:1654 dwarn:1 dfail:0 fail:24 skip:928 time:13276s == Logs == For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7267/shards.html _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 00/15] drm: More plane clipping polish 2017-11-23 19:04 ` Ville Syrjala @ 2018-01-23 16:15 ` Ville Syrjälä -1 siblings, 0 replies; 39+ messages in thread From: Ville Syrjälä @ 2018-01-23 16:15 UTC (permalink / raw) To: dri-devel Cc: intel-gfx, Archit Taneja, Ben Skeggs, Brian Starkey, CK Hu, Daniel Vetter, freedreno, Laurent Pinchart, linux-amlogic, linux-arm-msm, linux-tegra, Liviu Dudau, Mali DP Maintainers, Mark Yao, Neil Armstrong, Noralf Trønnes, nouveau, Philipp Zabel, Rob Clark, Shawn Guo, Sinclair Yeh On Thu, Nov 23, 2017 at 09:04:47PM +0200, Ville Syrjala wrote: > From: Ville Syrjälä <ville.syrjala@linux.intel.com> > > This series first unifies all users of drm_atomic_helper_check_plane_state() > to populate the clip rectangle with drm_mode_get_hv_timing(), and once > everything is unified the clip rectangle handling is sucked into > drm_atomic_helper_check_plane_state() away from driver code. > > Entire series available here: > git://github.com/vsyrjala/linux.git atomic_plane_helper_clip > > Cc: Archit Taneja <architt@codeaurora.org> > Cc: Ben Skeggs <bskeggs@redhat.com> > Cc: Brian Starkey <brian.starkey@arm.com> > Cc: CK Hu <ck.hu@mediatek.com> > Cc: Daniel Vetter <daniel@ffwll.ch> > Cc: freedreno@lists.freedesktop.org > Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > Cc: linux-amlogic@lists.infradead.org > Cc: linux-arm-msm@vger.kernel.org > Cc: linux-tegra@vger.kernel.org > Cc: Liviu Dudau <liviu.dudau@arm.com> > Cc: Mali DP Maintainers <malidp@foss.arm.com> > Cc: Mark Yao <mark.yao@rock-chips.com> > Cc: Neil Armstrong <narmstrong@baylibre.com> > Cc: Noralf Trønnes <noralf@tronnes.org> > Cc: nouveau@lists.freedesktop.org > Cc: Philipp Zabel <p.zabel@pengutronix.de> > Cc: Rob Clark <robdclark@gmail.com> > Cc: Shawn Guo <shawnguo@kernel.org> > Cc: Sinclair Yeh <syeh@vmware.com> > Cc: Thierry Reding <thierry.reding@gmail.com> > Cc: Thomas Hellstrom <thellstrom@vmware.com> > Cc: VMware Graphics <linux-graphics-maintainer@vmware.com> > > Ville Syrjälä (15): > drm/i915: Reject odd pipe source width with double wide/dual link > drm/i915: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/arm/hdlcd: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/arm/mali-dp: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/simple_kms_helper: Use drm_mode_get_hv_timing() to populate plane > clip rectangle > drm/imx: Use drm_mode_get_hv_timing() to populate plane clip rectangle > drm/mediatek: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/meson: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/msm/mdp5: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/nouveau/kms/nv50: Use drm_mode_get_hv_timing() to populate plane > clip rectangle > drm/rockchip: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/tegra/dc: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/vmwgfx: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/zte: Use drm_mode_get_hv_timing() to populate plane clip rectangle Everything up to here pushed to drm-misc-next. Thanks for the reviews. There have been a few new users of the clip helper so I'll have to take care of those and respin the final patch. Also armada looks broken to me since it has started to use the atomic version of the helper without actually being an atomic driver. So I'll have to figure out what's going on there as well. > drm: Don't pass clip to drm_atomic_helper_check_plane_state() > > drivers/gpu/drm/arm/hdlcd_crtc.c | 6 +----- > drivers/gpu/drm/arm/malidp_planes.c | 5 +---- > drivers/gpu/drm/armada/armada_overlay.c | 2 +- > drivers/gpu/drm/drm_atomic_helper.c | 12 +++++++----- > drivers/gpu/drm/drm_plane_helper.c | 11 +++-------- > drivers/gpu/drm/drm_simple_kms_helper.c | 5 ----- > drivers/gpu/drm/i915/intel_atomic_plane.c | 8 -------- > drivers/gpu/drm/i915/intel_display.c | 12 +++++++----- > drivers/gpu/drm/i915/intel_drv.h | 1 - > drivers/gpu/drm/i915/intel_sprite.c | 8 ++++++-- > drivers/gpu/drm/imx/ipuv3-plane.c | 7 +------ > drivers/gpu/drm/mediatek/mtk_drm_plane.c | 6 +----- > drivers/gpu/drm/meson/meson_plane.c | 6 +----- > drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 14 ++------------ > drivers/gpu/drm/nouveau/nv50_display.c | 8 -------- > drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 8 +------- > drivers/gpu/drm/tegra/dc.c | 8 +------- > drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 8 +------- > drivers/gpu/drm/zte/zx_plane.c | 15 +-------------- > include/drm/drm_atomic_helper.h | 1 - > include/drm/drm_plane_helper.h | 1 - > 21 files changed, 35 insertions(+), 117 deletions(-) > > -- > 2.13.6 -- Ville Syrjälä Intel OTC ^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 00/15] drm: More plane clipping polish @ 2018-01-23 16:15 ` Ville Syrjälä 0 siblings, 0 replies; 39+ messages in thread From: Ville Syrjälä @ 2018-01-23 16:15 UTC (permalink / raw) To: linus-amlogic On Thu, Nov 23, 2017 at 09:04:47PM +0200, Ville Syrjala wrote: > From: Ville Syrj?l? <ville.syrjala@linux.intel.com> > > This series first unifies all users of drm_atomic_helper_check_plane_state() > to populate the clip rectangle with drm_mode_get_hv_timing(), and once > everything is unified the clip rectangle handling is sucked into > drm_atomic_helper_check_plane_state() away from driver code. > > Entire series available here: > git://github.com/vsyrjala/linux.git atomic_plane_helper_clip > > Cc: Archit Taneja <architt@codeaurora.org> > Cc: Ben Skeggs <bskeggs@redhat.com> > Cc: Brian Starkey <brian.starkey@arm.com> > Cc: CK Hu <ck.hu@mediatek.com> > Cc: Daniel Vetter <daniel@ffwll.ch> > Cc: freedreno at lists.freedesktop.org > Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > Cc: linux-amlogic at lists.infradead.org > Cc: linux-arm-msm at vger.kernel.org > Cc: linux-tegra at vger.kernel.org > Cc: Liviu Dudau <liviu.dudau@arm.com> > Cc: Mali DP Maintainers <malidp@foss.arm.com> > Cc: Mark Yao <mark.yao@rock-chips.com> > Cc: Neil Armstrong <narmstrong@baylibre.com> > Cc: Noralf Tr?nnes <noralf@tronnes.org> > Cc: nouveau at lists.freedesktop.org > Cc: Philipp Zabel <p.zabel@pengutronix.de> > Cc: Rob Clark <robdclark@gmail.com> > Cc: Shawn Guo <shawnguo@kernel.org> > Cc: Sinclair Yeh <syeh@vmware.com> > Cc: Thierry Reding <thierry.reding@gmail.com> > Cc: Thomas Hellstrom <thellstrom@vmware.com> > Cc: VMware Graphics <linux-graphics-maintainer@vmware.com> > > Ville Syrj?l? (15): > drm/i915: Reject odd pipe source width with double wide/dual link > drm/i915: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/arm/hdlcd: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/arm/mali-dp: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/simple_kms_helper: Use drm_mode_get_hv_timing() to populate plane > clip rectangle > drm/imx: Use drm_mode_get_hv_timing() to populate plane clip rectangle > drm/mediatek: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/meson: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/msm/mdp5: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/nouveau/kms/nv50: Use drm_mode_get_hv_timing() to populate plane > clip rectangle > drm/rockchip: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/tegra/dc: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/vmwgfx: Use drm_mode_get_hv_timing() to populate plane clip > rectangle > drm/zte: Use drm_mode_get_hv_timing() to populate plane clip rectangle Everything up to here pushed to drm-misc-next. Thanks for the reviews. There have been a few new users of the clip helper so I'll have to take care of those and respin the final patch. Also armada looks broken to me since it has started to use the atomic version of the helper without actually being an atomic driver. So I'll have to figure out what's going on there as well. > drm: Don't pass clip to drm_atomic_helper_check_plane_state() > > drivers/gpu/drm/arm/hdlcd_crtc.c | 6 +----- > drivers/gpu/drm/arm/malidp_planes.c | 5 +---- > drivers/gpu/drm/armada/armada_overlay.c | 2 +- > drivers/gpu/drm/drm_atomic_helper.c | 12 +++++++----- > drivers/gpu/drm/drm_plane_helper.c | 11 +++-------- > drivers/gpu/drm/drm_simple_kms_helper.c | 5 ----- > drivers/gpu/drm/i915/intel_atomic_plane.c | 8 -------- > drivers/gpu/drm/i915/intel_display.c | 12 +++++++----- > drivers/gpu/drm/i915/intel_drv.h | 1 - > drivers/gpu/drm/i915/intel_sprite.c | 8 ++++++-- > drivers/gpu/drm/imx/ipuv3-plane.c | 7 +------ > drivers/gpu/drm/mediatek/mtk_drm_plane.c | 6 +----- > drivers/gpu/drm/meson/meson_plane.c | 6 +----- > drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 14 ++------------ > drivers/gpu/drm/nouveau/nv50_display.c | 8 -------- > drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 8 +------- > drivers/gpu/drm/tegra/dc.c | 8 +------- > drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 8 +------- > drivers/gpu/drm/zte/zx_plane.c | 15 +-------------- > include/drm/drm_atomic_helper.h | 1 - > include/drm/drm_plane_helper.h | 1 - > 21 files changed, 35 insertions(+), 117 deletions(-) > > -- > 2.13.6 -- Ville Syrj?l? Intel OTC ^ permalink raw reply [flat|nested] 39+ messages in thread
end of thread, other threads:[~2018-01-23 16:15 UTC | newest] Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2017-11-23 19:04 [PATCH 00/15] drm: More plane clipping polish Ville Syrjala 2017-11-23 19:04 ` Ville Syrjala 2017-11-23 19:04 ` [PATCH 01/15] drm/i915: Reject odd pipe source width with double wide/dual link Ville Syrjala 2017-11-24 17:04 ` [Intel-gfx] " Daniel Vetter 2017-11-23 19:04 ` [PATCH 02/15] drm/i915: Use drm_mode_get_hv_timing() to populate plane clip rectangle Ville Syrjala 2017-11-23 19:04 ` [PATCH 03/15] drm/arm/hdlcd: " Ville Syrjala 2017-11-24 11:03 ` Liviu Dudau 2017-11-23 19:04 ` [PATCH 04/15] drm/arm/mali-dp: " Ville Syrjala 2017-11-24 11:03 ` Liviu Dudau 2017-11-23 19:04 ` [PATCH 05/15] drm/simple_kms_helper: " Ville Syrjala 2017-11-23 19:04 ` [PATCH 06/15] drm/imx: " Ville Syrjala 2017-11-24 14:32 ` Philipp Zabel 2017-11-23 19:04 ` [PATCH 07/15] drm/mediatek: " Ville Syrjala 2017-11-24 14:32 ` Philipp Zabel 2017-11-24 14:49 ` Ville Syrjälä 2017-11-23 19:04 ` [PATCH 08/15] drm/meson: " Ville Syrjala 2017-11-23 19:04 ` Ville Syrjala 2017-11-23 19:04 ` [PATCH 09/15] drm/msm/mdp5: " Ville Syrjala 2017-11-26 13:11 ` Archit Taneja 2017-11-23 19:04 ` [PATCH 11/15] drm/rockchip: " Ville Syrjala [not found] ` <20171123190502.28449-1-ville.syrjala-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> 2017-11-23 19:04 ` [PATCH 10/15] drm/nouveau/kms/nv50: " Ville Syrjala 2017-11-23 19:04 ` [PATCH 12/15] drm/tegra/dc: " Ville Syrjala [not found] ` <20171123190502.28449-13-ville.syrjala-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> 2017-11-24 13:42 ` Thierry Reding 2017-11-24 13:41 ` [PATCH 00/15] drm: More plane clipping polish Thierry Reding 2017-11-24 13:41 ` Thierry Reding 2017-11-23 19:05 ` [PATCH 13/15] drm/vmwgfx: Use drm_mode_get_hv_timing() to populate plane clip rectangle Ville Syrjala 2017-11-28 5:11 ` Sinclair Yeh 2017-11-23 19:05 ` [PATCH 14/15] drm/zte: " Ville Syrjala 2017-11-29 6:41 ` Shawn Guo 2017-11-23 19:05 ` [PATCH 15/15] drm: Don't pass clip to drm_atomic_helper_check_plane_state() Ville Syrjala 2017-11-24 11:59 ` Liviu Dudau 2017-11-24 14:08 ` Ville Syrjälä 2017-11-24 15:24 ` Liviu Dudau 2017-11-24 12:01 ` Liviu Dudau 2017-11-24 17:00 ` Daniel Vetter 2017-11-23 19:30 ` ✓ Fi.CI.BAT: success for drm: More plane clipping polish Patchwork 2017-11-23 22:54 ` ✓ Fi.CI.IGT: " Patchwork 2018-01-23 16:15 ` [PATCH 00/15] " Ville Syrjälä 2018-01-23 16:15 ` 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.