From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Ripard Subject: Re: [PATCH] drm/sun4i: Check that the plane coordinates are not negative Date: Mon, 3 Oct 2016 14:58:11 +0200 Message-ID: <20161003125811.GH5228@lukather> References: <20160930143320.26241-1-maxime.ripard@free-electrons.com> <20160930180826.169e3daf@bbrezillon> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1363038800==" Return-path: Received: from mail.free-electrons.com (down.free-electrons.com [37.187.137.238]) by gabe.freedesktop.org (Postfix) with ESMTP id 742DC6E3F1 for ; Mon, 3 Oct 2016 12:58:13 +0000 (UTC) In-Reply-To: <20160930180826.169e3daf@bbrezillon> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Boris Brezillon Cc: Daniel Vetter , Chen-Yu Tsai , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org List-Id: dri-devel@lists.freedesktop.org --===============1363038800== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+Hr//EUsa8//ouuB" Content-Disposition: inline --+Hr//EUsa8//ouuB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Boris, On Fri, Sep 30, 2016 at 06:08:26PM +0200, Boris Brezillon wrote: > On Fri, 30 Sep 2016 16:33:20 +0200 > Maxime Ripard wrote: >=20 > > Our planes cannot be set at negative coordinates. Make sure we reject s= uch > > configuration. > >=20 > > Reported-by: Boris Brezillon > > Signed-off-by: Maxime Ripard > > --- > > drivers/gpu/drm/sun4i/sun4i_layer.c | 3 +++ > > 1 file changed, 3 insertions(+) > >=20 > > diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.c b/drivers/gpu/drm/sun4= i/sun4i_layer.c > > index f0035bf5efea..f5463c4c2cde 100644 > > --- a/drivers/gpu/drm/sun4i/sun4i_layer.c > > +++ b/drivers/gpu/drm/sun4i/sun4i_layer.c > > @@ -29,6 +29,9 @@ struct sun4i_plane_desc { > > static int sun4i_backend_layer_atomic_check(struct drm_plane *plane, > > struct drm_plane_state *state) > > { > > + if ((state->crtc_x < 0) || (state->crtc_y < 0)) > > + return -EINVAL; > > + >=20 > Hm, I think it's a perfectly valid use case from the DRM framework and > DRM user PoV: you may want to place your plane at a negative CRTC > offset (which means part of the plane will be hidden). >=20 > Maybe I'm wrong, but it seems you can support that by adapting the > start address of your framebuffer pointer and the layer size. Indeed, that would probably work. This is even somewhat what we've been using to implement the VGA hack we use on the CHIP. Can you send that patch? Thanks, Maxime --=20 Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com --+Hr//EUsa8//ouuB Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJX8lXjAAoJEBx+YmzsjxAgP9gQAJeOChPlRGi7+Q5JGO6XdiD4 5DwNlOaW119AOfPBlhW/zkgzBNMc02YtL/pSbT9sMe+7m7n15j1CIDONvDJGvi0v WJcSjJlARLG477AqiV8E63f0SiHGu+MuTzYaoYJA8WAycAzfmHjjUxB8UCGiHUen kY3u9NvIxAKrcevLrU+wkuGtAXJpnlOe/wnNLXRTI7k7rcl7Dw6/WqDP3L4ebTeU k7+HqDmz9FOVBc0aIApMyhCDwoDl8sgw9AofwZqAZDpqFua9N7YHgz8a3wLGmL6w sPUShQI2HWv3qRr8klv/ojRiAoUEew6qitj2iweUbpAuTZpqNl37UItrlPb+kbHC UDXBwQw3jZs6kSvYQ/Gmj734kEpbIVHg+r/Y78dvdQDgtMWPLjBHnfOwaXLl/gly 7ew7SHDaHtUXUJEtSfk61NkG1iRQ+ZYCsFMMzvsPfhTNU/Ppp51vGUC5ucgghBGW 1tJ9UkxIkBgzneNMLHpOUYh3gaXdRNZai49D78yqSY32DSdO/F7ZL6iGYzK1m/ft ktdDI4gjFiDW9hGRLlWiDSqvutepsfaqeE6Sqml1RNfEh1Z97Qpiz1ZKBED/Vqls Ip75Mmutm/6lqlHVfLE+hPWX7wICUrlnp7go9i+MCKGIh5g+9NHbfk/BggLXDrvw 1cGFIRwuGG34n47alSvi =sOnm -----END PGP SIGNATURE----- --+Hr//EUsa8//ouuB-- --===============1363038800== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============1363038800==--