Am Dienstag, den 24.05.2016, 18:10 +0800 schrieb Liu Ying:
> The IPUv3 primary plane doesn't support partial off screen.
> So, this patch separates plane check logics for primary plane and overlay
> plane and adds more limitations on the primary plane.
> 
> Signed-off-by: Liu Ying <gnuiyl at gmail.com>
> ---
>  drivers/gpu/drm/imx/ipuv3-plane.c | 72 
> ++++++++++++++++++++++-----------------
>  1 file changed, 41 insertions(+), 31 deletions(-)
> 
> diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c 
> b/drivers/gpu/drm/imx/ipuv3-plane.c
> index e6ec8eb..8f91b2e 100644
> --- a/drivers/gpu/drm/imx/ipuv3-plane.c
> +++ b/drivers/gpu/drm/imx/ipuv3-plane.c
> @@ -190,44 +190,54 @@ int ipu_plane_mode_set(struct ipu_plane *ipu_plane, 
> struct drm_crtc *crtc,
>                      uint32_t src_x, uint32_t src_y,
>                      uint32_t src_w, uint32_t src_h, bool interlaced)
>  {
> -     struct device *dev = ipu_plane->base.dev->dev;
> +     struct drm_plane plane = ipu_plane->base;

Why make a copy of the drm_plane here?

> +     struct device *dev = plane.dev->dev;
>       int ret;
>  
>       /* no scaling */
>       if (src_w != crtc_w || src_h != crtc_h)
>               return -EINVAL;
>  
> -     /* clip to crtc bounds */
> -     if (crtc_x < 0) {
> -             if (-crtc_x > crtc_w)
> +     if (plane.type == DRM_PLANE_TYPE_PRIMARY) {
> +             /* full plane doesn't support partial off screen */
> +             if (crtc_x || crtc_y || crtc_w != mode->hdisplay ||
> +                     crtc_h != mode->vdisplay)

As long as the requested plane is large enough to cover the whole base
plane, we can fix the crtc_x/y/w/h up by clipping to the base plane
boundaries. There is no need to return -EINVAL here as long as the IDMAC
is capable to start reading at src_x/y = -crtc_x/y.

regards
Philipp

Reply via email to