[Nouveau] [PATCH 5/5] drm: Don't pass clip to drm_atomic_helper_check_plane_state()
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Wed Jan 24 00:12:41 UTC 2018
Hi Ville,
Thank you for the patch.
On Tuesday, 23 January 2018 19:08:57 EET Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala at 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.dudau at arm.com>
> Cc: Brian Starkey <brian.starkey at arm.com>
> Cc: Mali DP Maintainers <malidp at foss.arm.com>
> Cc: Daniel Vetter <daniel.vetter at intel.com>
> Cc: Gustavo Padovan <gustavo at padovan.org>
> Cc: Sean Paul <seanpaul at chromium.org>
> Cc: Philipp Zabel <p.zabel at pengutronix.de>
> Cc: CK Hu <ck.hu at mediatek.com>
> Cc: Neil Armstrong <narmstrong at baylibre.com>
> Cc: Rob Clark <robdclark at gmail.com>
> Cc: Ben Skeggs <bskeggs at redhat.com>
> Cc: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> Cc: Sandy Huang <hjc at rock-chips.com>
> Cc: "Heiko Stübner" <heiko at sntech.de>
> Cc: Maxime Ripard <maxime.ripard at free-electrons.com>
> Cc: Thierry Reding <thierry.reding at gmail.com>
> Cc: VMware Graphics <linux-graphics-maintainer at vmware.com>
> Cc: Sinclair Yeh <syeh at vmware.com>
> Cc: Thomas Hellstrom <thellstrom at vmware.com>
> Cc: Shawn Guo <shawnguo at kernel.org>
> Cc: Archit Taneja <architt at codeaurora.org>
> Cc: linux-amlogic at lists.infradead.org
> Cc: linux-arm-msm at vger.kernel.org
> Cc: freedreno at lists.freedesktop.org
> Cc: nouveau at lists.freedesktop.org
> Cc: linux-renesas-soc at vger.kernel.org
> Cc: linux-tegra at vger.kernel.org
> Cc: Russell King <rmk+kernel at armlinux.org.uk>
> Suggested-by: Daniel Vetter <daniel at ffwll.ch>
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>
> Reviewed-by: Thierry Reding <treding at nvidia.com>
> Reviewed-by: Archit Taneja <architt at 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.pinchart at 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
More information about the Nouveau
mailing list