From: Maxime Ripard Subject: Re: [PATCH] drm: add drm_format_alpha_bits Date: Fri, 12 Jan 2018 16:51:16 +0100 Message-ID: <20180112155116.bqpyreloi6dkmqv3@flea.lan> References: <1515766876-14231-1-git-send-email-ayan.halder@arm.com> <20180112142834.GB10981@intel.com> <20180112154349.GE16548@arm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1141270040==" Return-path: Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by gabe.freedesktop.org (Postfix) with ESMTP id 2B83A6E532 for ; Fri, 12 Jan 2018 15:51:17 +0000 (UTC) In-Reply-To: <20180112154349.GE16548@arm.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Ayan Halder Cc: airlied@linux.ie, liviu.dudau@arm.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, daniel.vetter@intel.com, nd@arm.com List-Id: dri-devel@lists.freedesktop.org --===============1141270040== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mez6l76mbiyjxwez" Content-Disposition: inline --mez6l76mbiyjxwez Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Fri, Jan 12, 2018 at 03:43:49PM +0000, Ayan Halder wrote: > On Fri, Jan 12, 2018 at 04:28:34PM +0200, Ville Syrj?l? wrote: > > On Fri, Jan 12, 2018 at 02:21:16PM +0000, Ayan Halder wrote: > > > drm_format_info does not describe the number of bits used for the alp= ha > > > channel. That information is useful in a central place like drm_fourc= c.c > > > where it can be queried by the drivers that want to determine if 'alp= ha > > > blending' is to be enabled or not. > > >=20 > > > Signed-off-by: Ayan Kumar Halder > > > Reviewed-by: Liviu Dudau > > > --- > > > drivers/gpu/drm/drm_fourcc.c | 154 ++++++++++++++++++++++++---------= ---------- > > > include/drm/drm_fourcc.h | 3 + > > > 2 files changed, 89 insertions(+), 68 deletions(-) > > >=20 > > > diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourc= c.c > > > index 9c0152d..073001b 100644 > > > --- a/drivers/gpu/drm/drm_fourcc.c > > > +++ b/drivers/gpu/drm/drm_fourcc.c > > > > > @@ -348,3 +348,21 @@ int drm_format_plane_height(int height, uint32_t= format, int plane) > > > return height / info->vsub; > > > } > > > EXPORT_SYMBOL(drm_format_plane_height); > > > + > > > +/** > > > + * drm_format_alpha_bits - get the number of bits per pixel > > > + * representing alpha for format > > > + * @format: pixel format (DRM_FORMAT_*) > > > + * > > > + * Returns: > > > + * The number of bits per pixel representing alpha used by the > > > + * specified pixel format. > > > + */ > > > +int drm_format_alpha_bits(uint32_t format) > > > +{ > > > + const struct drm_format_info *info; > > > + > > > + info =3D drm_format_info(format); > > > + return info ? info->alpha : 0; > > > +} > > > +EXPORT_SYMBOL(drm_format_alpha_bits); > >=20 > > Do you have an actual use for this function somewhere? > > Currently, we do not have a usage for this function. We need 'alpha' > field for each entry in 'drm_format_info' so as to determine whether > to enable/disable alpha blending in Mali display processor for the > particular color format. Do you need only the info that a particular channel has an alpha component, or do you also need the number of bits? In the former case, then my serie sent earlier this week would help I guess. Maxime --=20 Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com --mez6l76mbiyjxwez Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEE0VqZU19dR2zEVaqr0rTAlCFNr3QFAlpY2XEACgkQ0rTAlCFN r3SSeg/9GRd65Bi1Qnsoc0LGR1+my8sQrADlVtvbau9HF122r9QcJndiAos1qrXM 7ZHgaSdRp1PKryf/p86hBb7BfcFNKPQXy9+tTD2OzOjXhDbswcVXZZFFNxf4v8om BrHSWgvUDthLWDy8/PasK6vMnU8+USJrBSOP17hQcoPToO13iwaFARVdrouvGGuz 3/yYiArxUPtreTIG6K0AJBNmb0eJyKHrwFRf8DpL5hwGzC5UbJfbpNkENQfzNuw/ 5D4ziKiUfT6h3OrjqjAF2uGIL43XfY270TWZgYiwSxZdRWUAJ3f055QKgtZomU08 LM9wVK565CavpOiVOz9+rNP81ZbOLiJNPJkqBnu1LwuJ3Co/j2nKiRk/SGty5TMG /PaRgbswRTY9TOMF6fRVVD96HZPJpZzyhplrynqlxnCpoRI1FTAcHhnHb8rBp7QF iGf5aRUijFaiD0iuXYFF/nem+qNcKB7Ccyg/G+5JfuCZBGpox/EatqkDXPEp+noJ NQtpXV0VKnzsKIa41H5MCviYjyzNEmO/5KubIOOHF95qJrSw/naFMS1HZQ/+P1Pb nPMYZ+gtZv7BniR2gM5wxUOc89iRNDpkP1grq55nWJtg8jjmz8ux0uBrmhRL/obB M0SwaBnBdtgwfMON9MG3Rkk63Pef8kGoYE1TCPy/YsyOsCL7kxY= =QYu3 -----END PGP SIGNATURE----- --mez6l76mbiyjxwez-- --===============1141270040== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============1141270040==--