[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6CB20172-906F-4D13-B5E4-100A9CF74F02@live.com>
Date: Sat, 22 Feb 2025 15:46:03 +0000
From: Aditya Garg <gargaditya08@...e.com>
To: "pmladek@...e.com" <pmladek@...e.com>, "rostedt@...dmis.org"
<rostedt@...dmis.org>, "andriy.shevchenko@...ux.intel.com"
<andriy.shevchenko@...ux.intel.com>, "linux@...musvillemoes.dk"
<linux@...musvillemoes.dk>, "senozhatsky@...omium.org"
<senozhatsky@...omium.org>, "corbet@....net" <corbet@....net>,
"maarten.lankhorst@...ux.intel.com" <maarten.lankhorst@...ux.intel.com>,
"mripard@...nel.org" <mripard@...nel.org>, "tzimmermann@...e.de"
<tzimmermann@...e.de>, "airlied@...il.com" <airlied@...il.com>,
"simona@...ll.ch" <simona@...ll.ch>, "akpm@...ux-foundation.org"
<akpm@...ux-foundation.org>, "apw@...onical.com" <apw@...onical.com>,
"joe@...ches.com" <joe@...ches.com>, "dwaipayanray1@...il.com"
<dwaipayanray1@...il.com>, "lukas.bulwahn@...il.com"
<lukas.bulwahn@...il.com>, "sumit.semwal@...aro.org"
<sumit.semwal@...aro.org>, "christian.koenig@....com"
<christian.koenig@....com>
CC: "kekrby@...il.com" <kekrby@...il.com>, "admin@...eit.net"
<admin@...eit.net>, Orlando Chamberlain <orlandoch.dev@...il.com>,
"evepolonium@...il.com" <evepolonium@...il.com>, "linux-doc@...r.kernel.org"
<linux-doc@...r.kernel.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "dri-devel@...ts.freedesktop.org"
<dri-devel@...ts.freedesktop.org>, "linux-media@...r.kernel.org"
<linux-media@...r.kernel.org>, "linaro-mm-sig@...ts.linaro.org"
<linaro-mm-sig@...ts.linaro.org>, Hector Martin <marcan@...can.st>,
"linux@...linux.org.uk" <linux@...linux.org.uk>, "asahi@...ts.linux.dev"
<asahi@...ts.linux.dev>, Sven Peter <sven@...npeter.dev>, Janne Grunau
<j@...nau.net>
Subject: Re: [PATCH v2 2/3] lib/vsprintf: Add support for generic FOURCCs by
extending %p4cc
> On 20 Feb 2025, at 10:09 PM, Aditya Garg <gargaditya08@...e.com> wrote:
>
> From: Hector Martin <marcan@...can.st>
>
> %p4cc is designed for DRM/V4L2 FOURCCs with their specific quirks, but
> it's useful to be able to print generic 4-character codes formatted as
> an integer. Extend it to add format specifiers for printing generic
> 32-bit FOURCCs with various endian semantics:
>
> %p4ch Host-endian
> %p4cl Little-endian
> %p4cb Big-endian
> %p4cr Reverse-endian
>
> The endianness determines how bytes are interpreted as a u32, and the
> FOURCC is then always printed MSByte-first (this is the opposite of
> V4L/DRM FOURCCs). This covers most practical cases, e.g. %p4cr would
> allow printing LSByte-first FOURCCs stored in host endian order
> (other than the hex form being in character order, not the integer
> value).
>
> Signed-off-by: Hector Martin <marcan@...can.st>
> Signed-off-by: Aditya Garg <gargaditya08@...e.com>
BTW, after looking at the comments by Martin [1], its actually better to use existing specifiers for the appletbdrm driver.
The driver needs the host endian as proposed by this patch, so instead of that, we can use %.4s
[1]: https://lore.kernel.org/asahi/E753B391-D2CB-4213-AF82-678ADD5A7644@cutebit.org/
Alternatively we could add a host endian only. Other endians are not really used by any driver AFAIK. The host endian is being used by appletbdrm and Asahi Linux’ SMC driver only.
>
>
> ---
> - *p++ = ' ';
> - strcpy(p, orig & BIT(31) ? "big-endian" : "little-endian");
> - p += strlen(p);
> + if (pixel_fmt) {
> + *p++ = ' ';
> + strcpy(p, orig & BIT(31) ? "big-endian" : "little-endian");
> + p += strlen(p);
> + }
Powered by blists - more mailing lists