From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Kocialkowski Subject: Re: [PATCH v4 1/5] drm/blend: Add a generic alpha property Date: Wed, 04 Apr 2018 11:15:04 +0200 Message-ID: References: <402e596049beb3429faf5981682d902c70325274.1520974361.git-series.maxime.ripard@bootlin.com> <87vadd5mgf.fsf@anholt.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1862593844==" Return-path: Received: from mail.bootlin.com (mail.bootlin.com [62.4.15.54]) by gabe.freedesktop.org (Postfix) with ESMTP id 49F686E1CF for ; Wed, 4 Apr 2018 09:16:22 +0000 (UTC) In-Reply-To: <87vadd5mgf.fsf@anholt.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Eric Anholt , Maxime Ripard , Gustavo Padovan , Daniel Vetter , Maarten Lankhorst , Sean Paul Cc: dri-devel@lists.freedesktop.org, Stefan Schake , Boris Brezillon , Chen-Yu Tsai , Laurent Pinchart , linux-arm-kernel@lists.infradead.org List-Id: dri-devel@lists.freedesktop.org --===============1862593844== Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-EAXNzUP6DfNa5S4E7QNl" --=-EAXNzUP6DfNa5S4E7QNl Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, On Fri, 2018-03-30 at 13:37 -0700, Eric Anholt wrote: > Maxime Ripard writes: >=20 > > Some drivers duplicate the logic to create a property to store a > > per-plane > > alpha. > >=20 > > This is especially useful if we ever want to support extra protocols > > for > > Wayland like: > > https://lists.freedesktop.org/archives/wayland-devel/2017-August/034 > > 741.html > >=20 > > Let's create a helper in order to move that to the core. > > diff --git a/drivers/gpu/drm/drm_blend.c > > b/drivers/gpu/drm/drm_blend.c > > index 5a81e1b4c076..05eda2d57c77 100644 > > --- a/drivers/gpu/drm/drm_blend.c > > +++ b/drivers/gpu/drm/drm_blend.c > > @@ -88,6 +88,12 @@ > > * On top of this basic transformation additional properties can be > > exposed by > > * the driver: > > * > > + * alpha: > > + * Alpha is setup with drm_plane_create_alpha_property(). > > It controls the >=20 > s/setup/set up/ >=20 > > + * plane-wide opacity, from transparent (0) to opaque > > (0xffff). It can be > > + * combined with pixel alpha. > > + * The alpha value is represented as premultiplied alpha. >=20 > I don't think this premultiplied comment makes any sense. What are > you saying it's premultiplied with? Maybe you mean that the output > pixels will have both their color and alpha channels multiplied by > this alpha? > I'd just drop it. I disagree here: since there are multiple ways to blend the pixel alpha value and the plane-wide alpha value, I think it's important to clearly specify which blending equation DRM expects here. Otherwise, the plane- wide alpha value just doesn't have a specified meaning and driver implementations can't figure whether the hardware uses the same equation or not and whether adaptation to this coefficient is needed. The equations for premultiplied alpha blending are at: https://en.wikipedia.org/wiki/Alpha_compositing#Alpha_blending What do you think? > Reviewed-by: Eric Anholt >=20 > We should probably do this property for vc4 at some point, too. --=20 Paul Kocialkowski, Bootlin (formerly Free Electrons) Embedded Linux and kernel engineering https://bootlin.com --=-EAXNzUP6DfNa5S4E7QNl Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEJZpWjZeIetVBefti3cLmz3+fv9EFAlrEl5gACgkQ3cLmz3+f v9GrNwf+I7k5fmMGlksHQDN+iDdprgX/HcCXbRsALUhQiTxwlfT4TwaU/1C3Bv3N N33u27o5/uN77rpGGxrPafEyxRiHmvNkJLTuwiG8NQBlCKhVZFCm6z57wR1+L8UM BUB+mf4/YOsFoRvTthp9sFeAacoA5GRiqkvPDg9v9syEfP/ojXQOw6pXwcGt37Cv Hcd0nSQxCqIwiZzyy7FAMZ3oaMBe56Sd5grvPbQCdE3OJcfBpS8NCDa2jizkrOVk dN1Tv9ERY/BPaBc78Huzivfujzm2p/0r3ZNW3OZumZnbHKQRfKXco46nHIJ7opfA cNDbiQQLyjUnAlswQz6QYtxQqBLojQ== =WQzG -----END PGP SIGNATURE----- --=-EAXNzUP6DfNa5S4E7QNl-- --===============1862593844== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============1862593844==--