Re: [PATCH 5/5] drm: Don't pass clip to drm_atomic_helper_check_plane_state()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx>
> 
> 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@xxxxxxx>
> Cc: Brian Starkey <brian.starkey@xxxxxxx>
> Cc: Mali DP Maintainers <malidp@xxxxxxxxxxxx>
> Cc: Daniel Vetter <daniel.vetter@xxxxxxxxx>
> Cc: Gustavo Padovan <gustavo@xxxxxxxxxxx>
> Cc: Sean Paul <seanpaul@xxxxxxxxxxxx>
> Cc: Philipp Zabel <p.zabel@xxxxxxxxxxxxxx>
> Cc: CK Hu <ck.hu@xxxxxxxxxxxx>
> Cc: Neil Armstrong <narmstrong@xxxxxxxxxxxx>
> Cc: Rob Clark <robdclark@xxxxxxxxx>
> Cc: Ben Skeggs <bskeggs@xxxxxxxxxx>
> Cc: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
> Cc: Sandy Huang <hjc@xxxxxxxxxxxxxx>
> Cc: "Heiko Stübner" <heiko@xxxxxxxxx>
> Cc: Maxime Ripard <maxime.ripard@xxxxxxxxxxxxxxxxxx>
> Cc: Thierry Reding <thierry.reding@xxxxxxxxx>
> Cc: VMware Graphics <linux-graphics-maintainer@xxxxxxxxxx>
> Cc: Sinclair Yeh <syeh@xxxxxxxxxx>
> Cc: Thomas Hellstrom <thellstrom@xxxxxxxxxx>
> Cc: Shawn Guo <shawnguo@xxxxxxxxxx>
> Cc: Archit Taneja <architt@xxxxxxxxxxxxxx>
> Cc: linux-amlogic@xxxxxxxxxxxxxxxxxxx
> Cc: linux-arm-msm@xxxxxxxxxxxxxxx
> Cc: freedreno@xxxxxxxxxxxxxxxxxxxxx
> Cc: nouveau@xxxxxxxxxxxxxxxxxxxxx
> Cc: linux-renesas-soc@xxxxxxxxxxxxxxx
> Cc: linux-tegra@xxxxxxxxxxxxxxx
> Cc: Russell King <rmk+kernel@xxxxxxxxxxxxxxx>
> Suggested-by: Daniel Vetter <daniel@xxxxxxxx>
> Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
> Reviewed-by: Daniel Vetter <daniel.vetter@xxxxxxxx>
> Reviewed-by: Thierry Reding <treding@xxxxxxxxxx>
> Reviewed-by: Archit Taneja <architt@xxxxxxxxxxxxxx> #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@xxxxxxxxxxxxxxxx>

>  	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

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux