[lkml]   [2021]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[PATCH v6 0/3] Add %p4cc printk modifier for V4L2 and DRM fourcc codes
Hi all,

This set adds support for %p4cc printk modifier for printing V4L2 and DRM
fourcc codes. The codes are cumbersome to print manually and by adding the
modifier, this task is saved from the V4L2 and DRM frameworks as well as
related drivers. DRM actually had it handled in a way (see 3rd patch) but
the printk modifier makes printing the format easier even there. On V4L2
side it saves quite a few lines of repeating different implementations of
printing the 4cc codes.

Further work will include converting the V4L2 drivers doing the same, as
well as converting DRM drivers from drm_get_format_name() to plain %p4cc.
I left these out from this version since individual drivers are easier
changed without dealing with multiple trees.

If DRM folks would prefer to convert drivers to %p4cc directly instead I
have no problem dropping the 3rd patch. Nearly all uses in DRM are in
printk family of functions that can readily use %p4cc instead of the
current arrangement that relies on caller-allocated temporary buffer.

Since v5:

- Added V4L2 core conversion to %p4cc, as well as change the DRM
fourcc printing function to use %p4cc.

- Add missing checks for %p4cc modifier.

Sakari Ailus (3):
lib/vsprintf: Add support for printing V4L2 and DRM fourccs
v4l: ioctl: Use %p4cc printk modifier to print FourCC codes
drm/fourcc: Switch to %p4cc format modifier

Documentation/core-api/printk-formats.rst | 16 +++++
drivers/gpu/drm/drm_fourcc.c | 16 +----
drivers/media/v4l2-core/v4l2-ioctl.c | 85 ++++++-----------------
lib/test_printf.c | 17 +++++
lib/vsprintf.c | 51 ++++++++++++++
scripts/ | 6 +-
6 files changed, 112 insertions(+), 79 deletions(-)


 \ /
  Last update: 2021-02-08 22:18    [W:0.229 / U:0.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site