Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934133AbeALQLq (ORCPT + 1 other); Fri, 12 Jan 2018 11:11:46 -0500 Received: from mail-eopbgr60064.outbound.protection.outlook.com ([40.107.6.64]:2144 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934004AbeALQLo (ORCPT ); Fri, 12 Jan 2018 11:11:44 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ayan.Halder@arm.com; Date: Fri, 12 Jan 2018 16:11:38 +0000 From: Ayan Halder To: Ville Syrj?l? Cc: liviu.dudau@arm.com, brian.starkey@arm.com, daniel.vetter@intel.com, jani.nikula@linux.intel.com, seanpaul@chromium.org, airlied@linux.ie, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, maxime.ripard@free-electrons.com, nd@arm.com Subject: Re: [PATCH] drm: add drm_format_alpha_bits Message-ID: <20180112161138.GA18191@arm.com> References: <1515766876-14231-1-git-send-email-ayan.halder@arm.com> <20180112142834.GB10981@intel.com> <20180112154349.GE16548@arm.com> <20180112155333.GD10981@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180112155333.GD10981@intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [217.140.96.140] X-ClientProxiedBy: DB3PR0102CA0025.eurprd01.prod.exchangelabs.com (2603:10a6:8::38) To DB6PR0802MB2408.eurprd08.prod.outlook.com (2603:10a6:4:9f::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6788c9ef-4958-420a-c5b4-08d559d72a84 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020084)(4652020)(5600026)(4604075)(48565401081)(2017052603307)(7153060)(7193020);SRVR:DB6PR0802MB2408; X-Microsoft-Exchange-Diagnostics: 1;DB6PR0802MB2408;3:cLTbBk5MASUpru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zOv0131gQYIKUqyRNpL3ovM=;4:F0s9cdQWxaSHMNpUoV9EOOZjuOk+Fz+xXkdfO6fbzkVOepvmuNSHYRpPcAGBTHBLz9Xn9nwZ/pdEQ0mGtcP+HpGAcCmipcAS/J2RbrvW/UJLmT0UpRf8xhTcCxnceARkxNFk5evrcNIuafL9hIFnOA11ZrQOVgYwnMl5eaS3k4VErsiaFAueBhVCIpahNvLBn3hta6sUJLIt5bOtkg0+IwqCI84BrkKB3Etc15/wJS6mUgRGzhf3+xWv+uPjGtoq2duhAEgrvBS+Zt5SvWqAJ3mrrJI5IEcjMpGtezBLAoegFDgy7slBXIbLPLbHQUfbHYSdrxZ8hem7OIypDCUs6Yqxky6niVKpSDg5zI1FDc8= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(217544274631240); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040470)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231023)(944501145)(3002001)(10201501046)(6055026)(6041268)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(6072148)(201708071742011);SRVR:DB6PR0802MB2408;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:DB6PR0802MB2408; X-Forefront-PRVS: 0550778858 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6069001)(39380400002)(346002)(396003)(366004)(39860400002)(376002)(189003)(199004)(51444003)(24454002)(68736007)(8676002)(47776003)(66066001)(16526018)(8936002)(81156014)(1076002)(5660300001)(36756003)(52116002)(93886005)(76176011)(33656002)(97736004)(83506002)(2950100002)(6496006)(76506005)(229853002)(6916009)(25786009)(2906002)(4326008)(106356001)(23726003)(6246003)(58126008)(316002)(6306002)(86362001)(386003)(6116002)(81166006)(966005)(72206003)(53936002)(478600001)(16586007)(3846002)(50466002)(305945005)(105586002)(6486002)(7736002)(18370500001);DIR:OUT;SFP:1101;SCL:1;SRVR:DB6PR0802MB2408;H:localhost;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DB6PR0802MB2408;23:V7fRqNUQZxjz5uapqhdo/orgnnDqOpRETeDPz5V?= =?us-ascii?Q?FGS2Hq3ZWVpxAwmZyS/XySFgLLcUgmJhb5hNvEMC6c8g7MZ/T7mVZFsLp9b5?= =?us-ascii?Q?h+vZvmif7OhB4UvV5eMdCeC8TjCseJCG9e8NH0WWqMyiuKYy0PapyecLQqiR?= =?us-ascii?Q?8Rnhu0rT2yjyFRd7NyyhtpDf6Yziy5OfVoNwTvxkrCKZ5PF8ZGBBFHyRTSbm?= =?us-ascii?Q?Fe5pyG8U4P6krcvXpc5d/KqSGKYATpuqJ2PKvS227QS4dCnM53UN29a6sRwf?= =?us-ascii?Q?vJPGZRo6wfDZHprZf+tDBpRMiqfDlgvAJkQEjMywwmdPp0CI4DrfRdJJSiUv?= =?us-ascii?Q?7TfcUjXP1F15IqcU13Rv5hV42qbaZPgTb/A8YKYFpvdd+Ss75+Yw82sFKCmM?= =?us-ascii?Q?TsaY9i6hdWjeqQy6P2/KkX+8MyZuxh/TSqgq7+Q8ivpSdZLhzkepuUceOieq?= =?us-ascii?Q?3KoSFxJfDc79nRiiL764OWvUOciTm9kWdZ71fxaoLPVKRReTFbUcHUvUbZNI?= =?us-ascii?Q?by/z2hF2Iwqj7w7RuX5vMo3Cu0elhJDK1KW34agxi1NA/qRqA/t67PJ8yPli?= =?us-ascii?Q?lpuqsLvUBUdcpiih5FUXB2wYSl9Eios4v2IBrR5XUZclcmUqAYMoo30Lebx7?= =?us-ascii?Q?H3IZuPaja/H7snAvMoC7okBj6ODaPRIu44jmART52vP+2CjfP9KZDhWRJJGs?= =?us-ascii?Q?OVgUqBCCrO9/lYFKfEO7L4RrIthbEa/3/jZi8wRwVu57RChss8RcemdgGMIx?= =?us-ascii?Q?YN/DFn3Cdd5eMm1ij2WielM5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NwgR5qQBDX6F4yTaR9je1yXc3h9nOLanfA0QID9gfS5zo5bO4JFQP28OoFAgG/AzJLM4oD1FxdFIDKm6j6wU2QvrTBvGMLFNfv1tMpriWOZlKckJDzQdqgMp3AFnkf7Sgu8Svh7ATX0LPqM=;24:ILr2Pk6iLL0zIn/HbfAmbNjGwHwIr7gn/+GZqdkCQdy9xalR98Es1VNLikU0eIfsZ28AmxqUJ7TcBXyHP+rsC6YzV1mxRw13/cQ9pG2UT/Y=;7:FtwEEYFrjSgVpmvt38YG7tihcF1ROzE5ubmRoynH4lN3QKvFfmad8vRNsTrcLhq9CzywaHZqg6wSsxHJoq12WASRLunNs/Txt11uuINMp2LHM0QEnF4dtAKASchMRxW16WVPJAnMI3frKqu6By2ue+O1KZgm+QKHksfCD/4zWwiXRIK+qtGS1LzYCJrhnzxTqjWhJyARt507vq5dOLU18DFqRvJzAtdbqXeZWKRQUjp+YO5IgCZXzG2euI06fGtt SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2018 16:11:40.8040 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6788c9ef-4958-420a-c5b4-08d559d72a84 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2408 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Fri, Jan 12, 2018 at 05:53:33PM +0200, Ville Syrj?l? wrote: > 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 alpha > > > > channel. That information is useful in a central place like drm_fourcc.c > > > > where it can be queried by the drivers that want to determine if 'alpha > > > > blending' is to be enabled or not. > > > > > > > > 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(-) > > > > > > > > diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.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 = drm_format_info(format); > > > > + return info ? info->alpha : 0; > > > > +} > > > > +EXPORT_SYMBOL(drm_format_alpha_bits); > > > > > > Do you have an actual use for this function somewhere? > > Currently, we do not have a usage for this function. > > No point in adding the function then IMO. We have helper functions for the other fields so I followed the same and added the helper function for the new field ('alpha') too. > > > 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. > > I think that's OK. Not sure if it really helps much though since you > generally have to configure other things based on the format as well, so > I would expect almost everyone will end up with some kind of > swicth/table to configure the hardware based on the format. Based on a > quick look this doesn't really help i915 at least. My understanding was based on the fact that alpha blending could be a common feature for all the drivers (I might be wrong). So, if we keep the number of 'alpha' bits in 'drm_format_info', it would be useful to fetch this info similar to the existing fields. > > > > > > > diff --git a/include/drm/drm_fourcc.h b/include/drm/drm_fourcc.h > > > > index 6942e84..5513510 100644 > > > > --- a/include/drm/drm_fourcc.h > > > > +++ b/include/drm/drm_fourcc.h > > > > @@ -38,6 +38,7 @@ struct drm_mode_fb_cmd2; > > > > * @cpp: Number of bytes per pixel (per plane) > > > > * @hsub: Horizontal chroma subsampling factor > > > > * @vsub: Vertical chroma subsampling factor > > > > + * @alpha: Number of bits per pixel representing alpha > > > > */ > > > > struct drm_format_info { > > > > u32 format; > > > > @@ -46,6 +47,7 @@ struct drm_format_info { > > > > u8 cpp[3]; > > > > u8 hsub; > > > > u8 vsub; > > > > + u8 alpha; > > > > }; > > > > > > > > /** > > > > @@ -57,6 +59,7 @@ struct drm_format_name_buf { > > > > }; > > > > > > > > const struct drm_format_info *__drm_format_info(u32 format); > > > > +int drm_format_alpha_bits(u32 format); > > > > const struct drm_format_info *drm_format_info(u32 format); > > > > const struct drm_format_info * > > > > drm_get_format_info(struct drm_device *dev, > > > > -- > > > > 2.7.4 > > > > > > > > _______________________________________________ > > > > dri-devel mailing list > > > > dri-devel@lists.freedesktop.org > > > > https://lists.freedesktop.org/mailman/listinfo/dri-devel > > > > > > -- > > > Ville Syrj??l?? > > > Intel OTC > > > _______________________________________________ > > > dri-devel mailing list > > > dri-devel@lists.freedesktop.org > > > https://lists.freedesktop.org/mailman/listinfo/dri-devel > > -- > Ville Syrj?l? > Intel OTC