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=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 BB7ABC2BA18 for ; Mon, 6 Apr 2020 07:17:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9906C20719 for ; Mon, 6 Apr 2020 07:17:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726635AbgDFHRW (ORCPT ); Mon, 6 Apr 2020 03:17:22 -0400 Received: from mga12.intel.com ([192.55.52.136]:30835 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726491AbgDFHRW (ORCPT ); Mon, 6 Apr 2020 03:17:22 -0400 IronPort-SDR: VOQKv+GqkJHIGuG9jbgaoqJnFXrIi0K/aMC2X9ea6gsHNYD+k/4ziLSD7+GyYPoz54LWMkZio7 yQJtwIeLSuJg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Apr 2020 00:17:21 -0700 IronPort-SDR: FEJR2FRvCVFKSwmReGQsjKk0QKS6dLx8bmdH7ksbClhJxkKpCvimLHb1uWvWq7vUFHmXtFfgfv anum9QaXZ/fw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,350,1580803200"; d="scan'208";a="268991943" Received: from unknown (HELO kekkonen.fi.intel.com) ([10.252.48.155]) by orsmga002.jf.intel.com with ESMTP; 06 Apr 2020 00:17:17 -0700 Received: by kekkonen.fi.intel.com (Postfix, from userid 1000) id EE74421D18; Mon, 6 Apr 2020 10:17:12 +0300 (EEST) Date: Mon, 6 Apr 2020 10:17:12 +0300 From: Sakari Ailus To: Laurent Pinchart Cc: Andy Shevchenko , Joe Perches , Mauro Carvalho Chehab , Rasmus Villemoes , Petr Mladek , Andy Shevchenko , Linux Media Mailing List , Dave Stevenson , dri-devel , Linux Kernel Mailing List , Hans Verkuil , Sergey Senozhatsky , Steven Rostedt , Jani Nikula Subject: Re: [PATCH v2 1/1] lib/vsprintf: Add support for printing V4L2 and DRM fourccs Message-ID: <20200406071712.GC5835@kekkonen.localdomain> References: <20200403091156.7814-1-sakari.ailus@linux.intel.com> <1105bfe5-88f1-040e-db40-54d7761747d5@rasmusvillemoes.dk> <20200403193242.38611906@coco.lan> <2751400ae13b25d8259a8a9d7b36caf98ec2d367.camel@perches.com> <20200404001425.GC4394@kekkonen.localdomain> <20200404002147.GG9690@pendragon.ideasonboard.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200404002147.GG9690@pendragon.ideasonboard.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Laurent, On Sat, Apr 04, 2020 at 03:21:47AM +0300, Laurent Pinchart wrote: > Hi Sakari, > > On Sat, Apr 04, 2020 at 03:14:25AM +0300, Sakari Ailus wrote: > > On Fri, Apr 03, 2020 at 09:32:42PM +0300, Andy Shevchenko wrote: > > > On Fri, Apr 3, 2020 at 8:54 PM Joe Perches wrote: > > > > On Fri, 2020-04-03 at 19:32 +0200, Mauro Carvalho Chehab wrote: > > > > > Em Fri, 03 Apr 2020 09:56:42 -0700 > > > > > Joe Perches escreveu: > > > > > > > It _might_ be useful to use a CONFIG_MEDIA_SUPPORT guard > > > > in lib/vsprintf for this. > > > > > > No need. FourCC, if Sakari makes it more generic, can be used for > > > other purposes, e.g. printing component names from the chips (not > > > related to media at all). > > > > Could you elaborate? > > > > This could be already used on DRM, presumably, and that does not depend on > > CONFIG_MEDIA_SUPPORT. I don't know how much there would be a need for that, > > though, but this remains a possibility. > > /** > * drm_get_format_name - fill a string with a drm fourcc format's name > * @format: format to compute name of > * @buf: caller-supplied buffer > */ > const char *drm_get_format_name(uint32_t format, struct drm_format_name_buf *buf) > { > snprintf(buf->str, sizeof(buf->str), > "%c%c%c%c %s-endian (0x%08x)", > printable_char(format & 0xff), > printable_char((format >> 8) & 0xff), > printable_char((format >> 16) & 0xff), > printable_char((format >> 24) & 0x7f), > format & DRM_FORMAT_BIG_ENDIAN ? "big" : "little", > format); > > return buf->str; > } > EXPORT_SYMBOL(drm_get_format_name); > > I'm not advocating for one approach or the other in this case, but we > should standardize 4CC printing between the two subsystems. IMO this format (with spaces removed from 4cc) would be fine for V4L2 as well. -- Regards, Sakari Ailus