From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pekka Paalanen Subject: Re: [PATCH 01/14] drm: add new plane property FB_DAMAGE_CLIPS to send damage during plane update Date: Fri, 7 Sep 2018 12:27:04 +0300 Message-ID: <20180907122642.38588540@eldfell> References: <20180905233901.2321-1-drawat@vmware.com> <20180905233901.2321-2-drawat@vmware.com> <20180906074249.GM4929@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0598589714==" Return-path: Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0F0036E8A4 for ; Fri, 7 Sep 2018 09:27:16 +0000 (UTC) Received: by mail-lj1-x241.google.com with SMTP id j19-v6so11723182ljc.7 for ; Fri, 07 Sep 2018 02:27:15 -0700 (PDT) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Deepak Singh Rawat Cc: "lukasz.spintzyk@displaylink.com" , Thomas Hellstrom , linux-graphics-maintainer , "dri-devel@lists.freedesktop.org" List-Id: dri-devel@lists.freedesktop.org --===============0598589714== Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/z=JvV=E2Ynjg3sY6=gL4tQ+"; protocol="application/pgp-signature" --Sig_/z=JvV=E2Ynjg3sY6=gL4tQ+ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Thu, 6 Sep 2018 21:36:51 +0000 Deepak Singh Rawat wrote: > >=20 > > - Why no input validation on the damage clips against the framebuffer > > size? Ime not validating just leads to funny driver bugs down the roa= d, > > so what's the use-case you have in mind here? =20 >=20 > My motivation behind not informing user-space if damage is outside plane > src, sent during modeset(where it should be provided) or damage is outside > framebuffer coordinate (simply put damage clips are invalid) is that it's= a > hint. The contract between kernel and user-space is simple, if damage > clips are valid, kernel might use them (but not always) otherwise they > will be ignored. Damage can be ignored deep in the stack (like network), > so all the input validation for nothing. >=20 > Also, what all to consider in input validation ? > * clips are outside plane src > * damage clips sent during modeset should error ? > * any other properties. >=20 > This will lead to a complex input validation during modeset check like > if some drivers are OK with damage while scaling whereas others > cannot support, should this error? >=20 > However I am alright doing input validation if this becomes clear what > kind of validation to actually do. My understanding of drm core is limite= d. Hi, I think validating that the area of any clip rectangle does not extend beyond the framebuffer size would be good. A userspace violating that is arguably broken, so it would help catch userspace bugs. I also would not assume that damage is irrelevant on modeset. Userspace does not always know if an update will be a modeset or not: drivers vary there, and userspace that just wants the update through will allow modesets always while still providing damage. Userspace could also change video mode timings or pixel format while keeping the resolution the same, and in that case damage could be meaningful to a driver. Thanks, pq --Sig_/z=JvV=E2Ynjg3sY6=gL4tQ+ Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEJQjwWQChkWOYOIONI1/ltBGqqqcFAluSRGgACgkQI1/ltBGq qqcOnQ/+J5ZC3EtFy5f/8Y5ZWf7L2uzutEGJaZeapq0SBH/BYyRjTHZTjDWQI/m2 d3MSXBAF1I2R/nsY/iPgxYeKt539w9/fTznv6drt/WuuCC0ti9+gbZqulRdUDEg+ o2d8amCk2kfI+spY/mxUf+NmuwoO77ZEmAWg8W0/ebJOPrX5KwGQfvnq9IIavcfZ uifk2FdbOG2yrpqVyrq3PIFo6fGo5azq9uFUcV00QPoNoXsi7/XQB46Yw2VQXXQU 24NqdIHLzBiLinB97o4i3PI5i/ZoT6cs2yyrmI/4l7KCIEsYztsQFF9BrVOqQubk eZjEd00CjgDRNySRlRvgqKbOavGRHS24ocjCNklM2I675JEXJbzPXDhHP+q00Yxh DqouHRkAuVW0R6DEs7bw2zOhdxADftuYVpFCXlGbjastVJq22lZUD04SGunNYpFU n7dqa2CelJayS7iVbPIZ3uxTb/CW+iL6BfO+htMB55FqGKiHuKsxPUnBP/1OOEmX ddYMSyv7wcUWDoX9oUvhabFQwPJjtPba6/qoZNqwrAcunAk8Co+hHCHkLiG+h0GA pdFtu+ViYB3Wp/SuZ6TwlHZe+xaK2XUeL0b0oGyM64PxpajnIo54tdhtuDB3++QZ qif8eDIjI3tiIVUcki4xwon2dAlXsYNdQCFwl73YC/7N/mGXFrU= =1Xb/ -----END PGP SIGNATURE----- --Sig_/z=JvV=E2Ynjg3sY6=gL4tQ+-- --===============0598589714== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============0598589714==--