Re: [PATCH 30/33] drm/omap: verify that fb plane pitches are the same

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

 



Hi Tomi,

Thank you for the patch.

On Friday 19 February 2016 11:48:05 Tomi Valkeinen wrote:
> The DSS hardware uses the same ROW_INC value for both Y and UV planes
> for NV12 format. This means that the pitches of the Y and UV planes have
> to match. omapdrm doesn't check this at the moment, and this can lead
> into a broken NV12 fb on the screen.
> 
> This patch adds the check.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@xxxxxx>

Reviewed-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>

We can probably simplify the implementation further as most of the checks in 
the loop apply to the first place only. Would you like me to give it a go ?

> ---
>  drivers/gpu/drm/omapdrm/omap_fb.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c
> b/drivers/gpu/drm/omapdrm/omap_fb.c index ad202dfc1a49..481512db2656 100644
> --- a/drivers/gpu/drm/omapdrm/omap_fb.c
> +++ b/drivers/gpu/drm/omapdrm/omap_fb.c
> @@ -449,6 +449,14 @@ struct drm_framebuffer *omap_framebuffer_init(struct
> drm_device *dev, goto fail;
>  		}
> 
> +		if (i > 0 && pitch != mode_cmd->pitches[i - 1]) {
> +			dev_err(dev->dev,
> +				"pitches are not the same between framebuffer planes %d != 
%d\n",
> +				pitch, mode_cmd->pitches[i - 1]);
> +			ret = -EINVAL;
> +			goto fail;
> +		}
> +
>  		plane->bo     = bos[i];
>  		plane->offset = mode_cmd->offsets[i];
>  		plane->pitch  = pitch;

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