Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934452AbeAKP7F (ORCPT + 1 other); Thu, 11 Jan 2018 10:59:05 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:54812 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933117AbeAKP67 (ORCPT ); Thu, 11 Jan 2018 10:58:59 -0500 Date: Thu, 11 Jan 2018 16:58:57 +0100 From: Maxime Ripard To: Chen-Yu Tsai , Daniel Vetter , Jani Nikula , Sean Paul , Thomas Petazzoni , Boris Brezillon , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Laurent Pinchart , linux-arm-kernel@lists.infradead.org, thomas@vitsch.nl Subject: Re: [PATCH 06/19] drm/blend: Add a generic alpha property Message-ID: <20180111155857.bbfp4772fx56s5k3@flea.lan> References: <5c765fc730d75cb362dc37bcdb3b3aeacc7bdb30.1515494838.git-series.maxime.ripard@free-electrons.com> <20180109123241.GU26573@phenom.ffwll.local> <20180109135322.7lb3snbxfcezobhz@flea> <20180109142834.GZ26573@phenom.ffwll.local> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ld3xcpg2uxvlxzvj" Content-Disposition: inline In-Reply-To: <20180109142834.GZ26573@phenom.ffwll.local> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: --ld3xcpg2uxvlxzvj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 09, 2018 at 03:28:34PM +0100, Daniel Vetter wrote: > On Tue, Jan 09, 2018 at 02:53:22PM +0100, Maxime Ripard wrote: > > On Tue, Jan 09, 2018 at 01:32:41PM +0100, Daniel Vetter wrote: > > > On Tue, Jan 09, 2018 at 11:56:25AM +0100, Maxime Ripard wrote: > > > > Some drivers duplicate the logic to create a property to store a pe= r-plane > > > > alpha. > > > >=20 > > > > Let's create a helper in order to move that to the core. > > > >=20 > > > > Cc: Boris Brezillon > > > > Cc: Laurent Pinchart > > > > Signed-off-by: Maxime Ripard > > >=20 > > > Do we have userspace for this? > >=20 > > Wayland seems to be on its way to implement this, with ChromeOS using > > it: > > https://lists.freedesktop.org/archives/wayland-devel/2017-August/034741= =2Ehtml > >=20 > > and more specifically: > > https://chromium.googlesource.com/chromium/src/+/master/third_party/way= land-protocols/unstable/alpha-compositing/alpha-compositing-unstable-v1.xml= #118 >=20 > Yay, would be good to include these links in the patch description. Really > happy we're having a real standard now used by multiple people. I will. > > > Is encoding a fixed 0-255 range really the best idea? > >=20 > > I don't really know, is there hardware or formats where there is more > > than 255? Or did you mean less than that? >=20 > 30bit I'd assume wants more alpha. In the past we've done some fixed-point > stuff (e.g. for LUT), using the 0.0-1.0 float range. Using that for the > blend equation docs is also what I recommend (and that we map from 0-255 > to 0.0-1.0 logically). Ofc the hw might not do any of that ... I think > 0.16 fixed point, stored in a u16 is probably best. That's what we're > doing for gamma tables already, and that way drivers can simply throw away > the lower bits. But that would also break the two users of that property that won't be able to move to the generic property (with the same name) without breaking userspace. The point of that patch was to allow some code consolidation, and that would mean failing to do so here :/ > > > I know other drivers have skimped on the rules here a bit ... But at = least > > > internally (i.e. within the drm_plane_state) we probably should restr= ict > > > ourselves to u8. And this needs real docs (i.e. the full blend equati= on > > > drivers are supposed to implement). > >=20 > > You mean straight vs premultiplied? Maybe we should implement this as > > an additional property in read only depending on how the hardware > > behaves? >=20 > No need for an additional property right now, but definitely document > whether you mean straight or pre-multiplied. Just writing down the blend > equation is probably best. Ack. Thanks! Maxime --=20 Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com --ld3xcpg2uxvlxzvj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEE0VqZU19dR2zEVaqr0rTAlCFNr3QFAlpXicAACgkQ0rTAlCFN r3Ql8Q//cc1WJpAy2XgjIw9PSl/c3O2Xg2+PVPAjnWGazcorkENq2oddmYPyAt5g Sz9PNW6WZ7UbVzA5y1Lj0PohlgywrtK/b6uRSHyNS9/Kj8OC9T1tXhNM7R8MY8dB EEVpj01O33ujeA127hP+qOlH+OrO6brr6tWqLV/W97h3iqqoa7MIlV4ilVHvSWkk vLX2oYej85KpwpGtEu20Q4c3X+UCkCQUkPvK2M5nRaq3nipV2OmZy7bVW5bqs5Uk 5SZ/uHaQm05VpT38fhQfi/GAhFIY/aMsBN/YGD+ByeTZcZTFGD+R0yOtRmjTE8oO Nxv1LCsOee5w/moAIKIUwIr3qhdI7fquWg0nelOKgTJXoW6/lbW+hGEt/O92fkTd ymCjinSdRS1nJK9sjuHMDASRBEWk4cpVJFkbtwWBw7PNHJWcYn8Vk7aVfqFql3hx nkGRB66jozrkkzl+k6cdiRfrOiqQXODGj0ST8Not7r6PnP41LLg/Z4/msf4R6bb5 IkWJXxZv2mMf8bFoQ+6UhrODd09KWDDh396LdJO1QoucVrUW9AJvAJ8LyW66s4ij Kzh+ogU7zUandHhfxJC/jy6YVOfQdYfya0J5BNvAjbgBf3Y5ZlMTiU5wVE2seELb EXnrVPtYgF0nbC+rls1BBwKeKk3xRFGdzbpaYKkOuaryaRn0BFM= =Rb68 -----END PGP SIGNATURE----- --ld3xcpg2uxvlxzvj--