[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200406071712.GC5835@kekkonen.localdomain>
Date: Mon, 6 Apr 2020 10:17:12 +0300
From: Sakari Ailus <sakari.ailus@...ux.intel.com>
To: Laurent Pinchart <laurent.pinchart@...asonboard.com>
Cc: Andy Shevchenko <andy.shevchenko@...il.com>,
Joe Perches <joe@...ches.com>,
Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Petr Mladek <pmladek@...e.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Linux Media Mailing List <linux-media@...r.kernel.org>,
Dave Stevenson <dave.stevenson@...pberrypi.com>,
dri-devel <dri-devel@...ts.freedesktop.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Hans Verkuil <hverkuil@...all.nl>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Steven Rostedt <rostedt@...dmis.org>,
Jani Nikula <jani.nikula@...ux.intel.com>
Subject: Re: [PATCH v2 1/1] lib/vsprintf: Add support for printing V4L2 and
DRM fourccs
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 <joe@...ches.com> 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 <joe@...ches.com> 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
Powered by blists - more mailing lists