Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934175AbeALQSz (ORCPT + 1 other); Fri, 12 Jan 2018 11:18:55 -0500 Received: from mail-ve1eur01on0059.outbound.protection.outlook.com ([104.47.1.59]:36000 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934004AbeALQSx (ORCPT ); Fri, 12 Jan 2018 11:18:53 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ayan.Halder@arm.com; Date: Fri, 12 Jan 2018 16:18:47 +0000 From: Ayan Halder To: Maxime Ripard Cc: Ville Syrj?l? , nd@arm.com, airlied@linux.ie, liviu.dudau@arm.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, daniel.vetter@intel.com Subject: Re: [PATCH] drm: add drm_format_alpha_bits Message-ID: <20180112161847.GB18191@arm.com> References: <1515766876-14231-1-git-send-email-ayan.halder@arm.com> <20180112142834.GB10981@intel.com> <20180112154349.GE16548@arm.com> <20180112155116.bqpyreloi6dkmqv3@flea.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180112155116.bqpyreloi6dkmqv3@flea.lan> User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [217.140.96.140] X-ClientProxiedBy: AM4P190CA0016.EURP190.PROD.OUTLOOK.COM (2603:10a6:200:56::26) To HE1PR0802MB2411.eurprd08.prod.outlook.com (2603:10a6:3:dd::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8adbf929-b9e6-49a4-03f6-08d559d82a35 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020084)(4652020)(5600026)(4604075)(48565401081)(2017052603307)(7153060)(7193020);SRVR:HE1PR0802MB2411; X-Microsoft-Exchange-Diagnostics: 1;HE1PR0802MB2411;3:u0G10C5n4EzrSrT9RaXZfPiF/CNxiHwF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68Wrvj49MyCi2g+NTgLZtuIECo0APJwD+rEjlaOGCvOC5C/Ibku5d6N+nu0TApqA8imEvQewSssP4qdYzA2JVJr4xu1H2VhnKq2Nu9x1PeqR2f31HlprtwC6kSq4qcfUsXRdUqPVXnekEPAeQkKNDD2QgM/VoFjH1Zx/X4V+NtDGKei7vDW5eBe3czlVCAdxE1EZTBfJdRsF2AOZ5twE9l/VCrSQ7VM50PoTWohnPMEzUoFYKMg47PSy/LB/HzqGBEraMzPY6hm9tOBgxilgAETC27ikfIfrF0yAo+iQXiqqO13c7DDce4V6rSQAS+V/sbetWIBVj1NvjjB0WF8TGd5R9EkL9SJzep5o= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(58145275503218); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040470)(2401047)(8121501046)(5005006)(3002001)(10201501046)(3231023)(944501145)(93006095)(93001095)(6055026)(6041268)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(6072148)(201708071742011);SRVR:HE1PR0802MB2411;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:HE1PR0802MB2411; X-Forefront-PRVS: 0550778858 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6069001)(39380400002)(39860400002)(396003)(346002)(366004)(376002)(24454002)(189003)(199004)(50466002)(93886005)(6306002)(305945005)(25786009)(7736002)(16586007)(8676002)(58126008)(8936002)(16526018)(53936002)(6486002)(68736007)(52116002)(47776003)(83506002)(86362001)(81166006)(81156014)(6246003)(97736004)(316002)(4326008)(229853002)(66066001)(72206003)(966005)(2906002)(6496006)(106356001)(105586002)(36756003)(2950100002)(6916009)(33656002)(76506005)(478600001)(76176011)(386003)(23726003)(3846002)(6116002)(1076002)(5660300001)(18370500001)(18886065003);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR0802MB2411;H:localhost;FPR:;SPF:None;PTR:In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yPp2gFq?= =?us-ascii?Q?ff2iGAWbtHbe3pmhFeM1vMp/SyKqJQhvm7YmxPLj23N60IMM016Pec5qSl1n?= =?us-ascii?Q?Das/93dFbyWvCxsrcnH6jxPMY3Y3QNvq2K9OqVwOR09vFbCGAb18nHQOF7kN?= =?us-ascii?Q?QjdNtf5CG38KSxkp4QoQSjL3/ItGDqC5zIaUmEhbsQaPyipEY7+BQPaRg6VT?= =?us-ascii?Q?0qWy7anc7/7d29Gw6KH8oevfQXh/s1AFcpSoCbytuDbTtfzN3doUganif/+D?= =?us-ascii?Q?d4nYUQlpK5jrFyb3hRgR8RGlppDYkzCkcBofA5XG2YR6cZvloXgKQS7YYCSi?= =?us-ascii?Q?GyCUtXfyg69EVGQRB9Le9fLkNBisbfQMN+TJmo/F60XA6d/y1IEBIxs3e73Y?= =?us-ascii?Q?TH+sTQarMtAyPootf6/159qQrI8GlN6nYioCTfeIT7O0ONC3UalX+kA43b+v?= =?us-ascii?Q?VML4COTQs3Cj0bcyQe1daBT0+2YGi6g4fnR1HCi8r6HYq4WZQiNcMcQTojYP?= =?us-ascii?Q?ebA5EcxHThyuEn5OyoBEBseQ=3D?= X-Microsoft-Exchange-Diagnostics: 1;HE1PR0802MB2411;6:zSWZfOFRNzs/4nIR7JBEid44ABbw26YR0wA3lyqqUeKU0483lZ6mvgCWowkqrZvA8PpReztt0FWZqXKck5nTC2eMQ0Toakj+TrHIWUZCNq5Kgasjavbnh6m57geAbO2qWXwZVBpiUvCEGARp6DPc/z2iMyySotv2c9dudM836D4bbxXoBJnUBUGAFLAZu9nlUh30qTbb08S66409SItv2Vno7UcPRJy06ydzYgykx4ERxqYH8JX1PbWtPitmYlzBP3WCIAykmJ6PeIQNOtbLJBdK7rsJk0BBpDnHkmwo+F/39nNgFvgt9w1g++016awtq0jQMw9dU8PCfwuir4ei7BtQ+RExyLwIngvd5DEvPbM=;5:Ri7d6njs4tic+HHbayj1Af0fg9Ltj5asw7UED60XqgWmJ1Hh5oqbwGPnaUbmUE/QpW7L40NCfzYubisoOjsBuTw5aHbXgoXVIjOzLEqqqvP2N2iO0mQBWzoEtNLefGJT2uWB76fUvMBeU5fVM2TaCbXfUX9lwxy4WKbW2uKNHSo=;24:jCwQSMxZXVtHUUK2x678px2rZwqp8GrBHaUsyUnuKm6JSyRZtQZYpsHeIY5HiH8M42F68SlCoSWJ3WQRZ4ak/NKPM+h+O8NBi7VyyC92t5Q=;7:JbZNJPRwGlX01nUogRvMA4FqJ5lQY+2oOLpyUtvyy8i7QJT39oatXcT83kEwNZ5HPhjsI/yXk1FiYlmXYUjpXUnNBMNFfA/eD/pe4xa1v3VDaUiJgNHrlgm3fTdHprZBkJt+6PA50QbMYGVnj+6pEmwD7EZzcNA9/aUqsJkyk22ocuyAYT2Ea5riH899TF1UhxH5yY+e/145wwewU8GssQVlh4Ig/7DG0ANLUrP9WlxwBmKZ0XGiG9nsL/7n4UAM SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2018 16:18:49.6999 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8adbf929-b9e6-49a4-03f6-08d559d82a35 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0802MB2411 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 04:51:16PM +0100, Maxime Ripard wrote: > 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 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. 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? Currently, only the info whether alpha component is present in a particular channel. I saw your patch and thought that instead of returning true/false, it might be useful to capture the number of alpha bits for each format. > In the former case, then my serie sent earlier this week would help I > guess. > > Maxime > > -- > Maxime Ripard, Free Electrons > Embedded Linux and Kernel engineering > http://free-electrons.com