[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200406103758.1be49f78@eldfell.localdomain>
Date: Mon, 6 Apr 2020 10:37:58 +0300
From: Pekka Paalanen <ppaalanen@...il.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Hans Verkuil <hverkuil@...all.nl>, Petr Mladek <pmladek@...e.com>,
Dave Stevenson <dave.stevenson@...pberrypi.com>,
linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Steven Rostedt <rostedt@...dmis.org>,
laurent.pinchart@...asonboard.com,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
mchehab@...nel.org, linux-media@...r.kernel.org
Subject: Re: [PATCH 1/1] lib/vsprintf: Add support for printing V4L2 and DRM
fourccs
On Wed, 1 Apr 2020 18:13:32 +0300
Andy Shevchenko <andriy.shevchenko@...ux.intel.com> wrote:
> On Wed, Apr 01, 2020 at 04:13:51PM +0200, Hans Verkuil wrote:
> > On 4/1/20 4:05 PM, Sakari Ailus wrote:
> > > Add a printk modifier %ppf (for pixel format) for printing V4L2 and DRM
> > > pixel formats denoted by 4ccs. The 4cc encoding is the same for both so
> > > the same implementation can be used.
>
> %p4cc ?
>
> Another possibility
>
> u8 ch[8];
>
> if (*fourcc & BIT(31)) {
> put_unaligned_be32(tmp, &ch[0]);
> strcpy(&ch[4], "-BE");
> } else {
> put_unaligned_le32(tmp, &ch[0]);
> strcpy(&ch[4], "-LE");
> }
> return string(buf, end, &ch[0], spec);
>
Hi,
mind, if I guess right what that code does, I think this would confuse
the fourcc code endianness and the pixel data endianness. I think fourcc
codes are always crafted machine-endian, regardless of how the pixel
data is. At least, that is what drm_fourcc.h seems to be doing with
fourcc_code(). That has nothing to do with DRM_FORMAT_BIG_ENDIAN which
refers to the pixel data.
Thanks,
pq
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists