From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0FED4C433FE for ; Thu, 10 Dec 2020 14:08:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B79F422BF5 for ; Thu, 10 Dec 2020 14:08:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390022AbgLJOIQ (ORCPT ); Thu, 10 Dec 2020 09:08:16 -0500 Received: from mga01.intel.com ([192.55.52.88]:29475 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733261AbgLJOIP (ORCPT ); Thu, 10 Dec 2020 09:08:15 -0500 IronPort-SDR: Aklkd2ouG1w1YKPIky2mX0d4GaeXzcPfZ/p5Z6fenn0Zowc8u8X6QfJRBwvH2jKQmp6I/r08xe DD4fPKCfWGBw== X-IronPort-AV: E=McAfee;i="6000,8403,9830"; a="192578543" X-IronPort-AV: E=Sophos;i="5.78,408,1599548400"; d="scan'208";a="192578543" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2020 06:07:07 -0800 IronPort-SDR: EoDdnLpI+SqnpnRvYnVV7QWUxkweGYOsEBD78Q4+q9L3qi7LLueBvmqYxBZEz3AzFl+ps4cJza lVT8w83o2SFA== X-IronPort-AV: E=Sophos;i="5.78,408,1599548400"; d="scan'208";a="348822288" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2020 06:07:04 -0800 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1knMc1-00DR1Y-Ma; Thu, 10 Dec 2020 16:08:05 +0200 Date: Thu, 10 Dec 2020 16:08:05 +0200 From: Andy Shevchenko To: Sakari Ailus Cc: Petr Mladek , Linux Kernel Mailing List , Linux Media Mailing List , Dave Stevenson , dri-devel , Hans Verkuil , Laurent Pinchart , Mauro Carvalho Chehab , Sergey Senozhatsky , Steven Rostedt , Joe Perches , Jani Nikula , Rasmus Villemoes Subject: Re: [PATCH v5 1/1] lib/vsprintf: Add support for printing V4L2 and DRM fourccs Message-ID: <20201210140805.GI4077@smile.fi.intel.com> References: <20201113105441.1427-1-sakari.ailus@linux.intel.com> <20201210135526.GH25763@paasikivi.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201210135526.GH25763@paasikivi.fi.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 10, 2020 at 03:55:27PM +0200, Sakari Ailus wrote: > On Thu, Dec 10, 2020 at 03:05:02PM +0200, Andy Shevchenko wrote: > > On Thu, Dec 10, 2020 at 2:16 PM Petr Mladek wrote: > > > On Fri 2020-11-13 12:54:41, Sakari Ailus wrote: > > > > Add a printk modifier %p4cc (for pixel format) for printing V4L2 and DRM > > > > pixel formats denoted by fourccs. The fourcc encoding is the same for both > > > > so the same implementation can be used. > > > > > > > > Suggested-by: Mauro Carvalho Chehab > > > > Signed-off-by: Sakari Ailus > > > > > > Andy, Rasmus, > > > > > > the last version looks fine to me. I am going to push it. > > > Please, speak up if you are against it. > > > > My concerns are: > > - not so standard format of representation (why not to use > > string_escape_mem() helper?) or is it? > > The format string may contain spaces that are not meant to be printed. > Other unprintable chacaters should not be present (at least not in V4L2 > pixelformats). The hexadecimal representation is there to convey the > numerical value and that originally came from DRM, not V4L2. Yes, but I mean that we usually anticipate the escaped characters in a form of '\xNN' (hex) or '\NNN' (octal). The format '(NN)' is quite unusual to me. > > - no compatibility with generic 4cc > > (I would rather have an additional specifier here for v4l2 cases. > > What do you mean by "generic 4cc"? There are two users of 4cc codes in the > kernel that I know of: V4L2 and DRM. Something that does not refer to > in-memory pixel formats? Of course. Everything else. 4cc is a generic term to describe something which is of 4 characters long [1]. It's not limited by media file formats. And moreover some (chip) vendors are using it as well (Synopsys). Microsoft uses 4cc in CSRT ACPI table for vendor field and so on... [1]: https://en.wikipedia.org/wiki/FourCC -- With Best Regards, Andy Shevchenko