From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/omap: check plane size
Date: Wed, 27 Apr 2016 18:30:19 +0300 [thread overview]
Message-ID: <2928499.eguzpSNvCy@avalon> (raw)
In-Reply-To: <1461665802-13149-1-git-send-email-tomi.valkeinen@ti.com>
Hi Tomi,
(CC'ing Daniel)
Thank you for the patch.
On Tuesday 26 Apr 2016 13:16:42 Tomi Valkeinen wrote:
> At the moment we don't check the plane input/output sizes, which can
> lead to DSS HW errors when invalid values are given from the userspace.
>
> Add a check so that the sizes are > 0.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
I don't think it makes sense to have an empty source or destination rectangle
for any driver, not just omapdrm. Shouldn't this check be added to
drm_atomic_plane_check() instead ?
> ---
> drivers/gpu/drm/omapdrm/omap_plane.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c
> b/drivers/gpu/drm/omapdrm/omap_plane.c index 93ee538a99f5..fa9e5086eb65
> 100644
> --- a/drivers/gpu/drm/omapdrm/omap_plane.c
> +++ b/drivers/gpu/drm/omapdrm/omap_plane.c
> @@ -168,6 +168,12 @@ static int omap_plane_atomic_check(struct drm_plane
> *plane, if (IS_ERR(crtc_state))
> return PTR_ERR(crtc_state);
>
> + if (state->src_w == 0 || state->src_h == 0)
> + return -EINVAL;
> +
> + if (state->crtc_w == 0 || state->crtc_h == 0)
> + return -EINVAL;
> +
> if (state->crtc_x < 0 || state->crtc_y < 0)
> return -EINVAL;
--
Regards,
Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2016-04-27 16:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-26 10:16 [PATCH] drm/omap: check plane size Tomi Valkeinen
2016-04-27 15:30 ` Laurent Pinchart [this message]
2016-04-27 17:29 ` Ville Syrjälä
2016-04-27 20:02 ` Laurent Pinchart
2016-04-28 18:30 ` Ville Syrjälä
2016-04-28 21:52 ` Laurent Pinchart
2016-04-29 7:03 ` Daniel Vetter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2928499.eguzpSNvCy@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=tomi.valkeinen@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox