Hi Ville,

Thank you for the patch.

On Tuesday, 23 January 2018 19:08:57 EET Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrj...@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.
> 
> v2: Convert armada, rcar, and sun4i as well
> 
> Cc: Liviu Dudau <liviu.du...@arm.com>
> Cc: Brian Starkey <brian.star...@arm.com>
> Cc: Mali DP Maintainers <mal...@foss.arm.com>
> Cc: Daniel Vetter <daniel.vet...@intel.com>
> Cc: Gustavo Padovan <gust...@padovan.org>
> Cc: Sean Paul <seanp...@chromium.org>
> Cc: Philipp Zabel <p.za...@pengutronix.de>
> Cc: CK Hu <ck...@mediatek.com>
> Cc: Neil Armstrong <narmstr...@baylibre.com>
> Cc: Rob Clark <robdcl...@gmail.com>
> Cc: Ben Skeggs <bske...@redhat.com>
> Cc: Laurent Pinchart <laurent.pinch...@ideasonboard.com>
> Cc: Sandy Huang <h...@rock-chips.com>
> Cc: "Heiko Stübner" <he...@sntech.de>
> Cc: Maxime Ripard <maxime.rip...@free-electrons.com>
> Cc: Thierry Reding <thierry.red...@gmail.com>
> Cc: VMware Graphics <linux-graphics-maintai...@vmware.com>
> Cc: Sinclair Yeh <s...@vmware.com>
> Cc: Thomas Hellstrom <thellst...@vmware.com>
> Cc: Shawn Guo <shawn...@kernel.org>
> Cc: Archit Taneja <arch...@codeaurora.org>
> Cc: linux-amlo...@lists.infradead.org
> Cc: linux-arm-...@vger.kernel.org
> Cc: freedreno@lists.freedesktop.org
> Cc: nouv...@lists.freedesktop.org
> Cc: linux-renesas-...@vger.kernel.org
> Cc: linux-te...@vger.kernel.org
> Cc: Russell King <rmk+ker...@armlinux.org.uk>
> Suggested-by: Daniel Vetter <dan...@ffwll.ch>
> Signed-off-by: Ville Syrjälä <ville.syrj...@linux.intel.com>
> Reviewed-by: Daniel Vetter <daniel.vet...@ffwll.ch>
> Reviewed-by: Thierry Reding <tred...@nvidia.com>
> Reviewed-by: Archit Taneja <arch...@codeaurora.org> #msm
> ---
>  drivers/gpu/drm/arm/hdlcd_crtc.c            |  7 +------
>  drivers/gpu/drm/arm/malidp_planes.c         |  7 +------
>  drivers/gpu/drm/armada/armada_crtc.c        |  8 ++------
>  drivers/gpu/drm/armada/armada_overlay.c     |  8 ++------
>  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/rcar-du/rcar_du_plane.c     |  7 +------
>  drivers/gpu/drm/rockchip/rockchip_drm_vop.c |  7 +------
>  drivers/gpu/drm/sun4i/sun8i_ui_layer.c      |  7 +------
>  drivers/gpu/drm/sun4i/sun8i_vi_layer.c      |  7 +------
>  drivers/gpu/drm/tegra/plane.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 -
>  22 files changed, 28 insertions(+), 147 deletions(-)

[snip]

> diff --git a/drivers/gpu/drm/drm_atomic_helper.c
> b/drivers/gpu/drm/drm_atomic_helper.c index ab4032167094..9fb96f9cc36e
> 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 = {};

Isn't the correct C99 zero initializer { 0, } ?

Apart from that,

Reviewed-by: Laurent Pinchart <laurent.pinch...@ideasonboard.com>

>       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;
>       }
> 

[snip]

-- 
Regards,

Laurent Pinchart

_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

Reply via email to