On Wed, 1 Apr 2020 18:13:32 +0300
Andy Shevchenko <andriy.shevche...@linux.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

Attachment: pgp9nfeVG1EwJ.pgp
Description: OpenPGP digital signature

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to