All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v7 0/3] Add %p4cc printk modifier for V4L2 and DRM fourcc codes
@ 2021-02-15 11:40 ` Sakari Ailus
  0 siblings, 0 replies; 44+ messages in thread
From: Sakari Ailus @ 2021-02-15 11:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-media, Andy Shevchenko, Petr Mladek, Dave Stevenson,
	dri-devel, hverkuil, laurent.pinchart, mchehab,
	Sergey Senozhatsky, Steven Rostedt, Joe Perches, Jani Nikula,
	Rasmus Villemoes

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 v6:

- Don't drop spaces in fourcc codes.

- Print unprintable characters as dot ('.') instead of hexadecimal number
  in parentheses.

- Convert DRM from drm_get_format_name() to %p4cc. I wonder if this should
  be merged through the DRM tree, albeit it's probably unlikely to
  conflict with other changes. Further use of the function could be a
  problem.

- Make tests more realistic.

Since v5:

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

- Add missing checkpatch.pl 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: Switch to %p4cc format modifier

 Documentation/core-api/printk-formats.rst     | 16 ++++
 drivers/gpu/drm/amd/amdgpu/dce_v10_0.c        |  5 +-
 drivers/gpu/drm/amd/amdgpu/dce_v11_0.c        |  5 +-
 drivers/gpu/drm/amd/amdgpu/dce_v6_0.c         |  5 +-
 drivers/gpu/drm/amd/amdgpu/dce_v8_0.c         |  5 +-
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  5 +-
 .../arm/display/komeda/komeda_format_caps.h   | 11 ---
 .../arm/display/komeda/komeda_framebuffer.c   |  4 +-
 .../gpu/drm/arm/display/komeda/komeda_plane.c |  6 +-
 drivers/gpu/drm/arm/malidp_mw.c               |  7 +-
 drivers/gpu/drm/drm_atomic.c                  |  8 +-
 drivers/gpu/drm/drm_crtc.c                    |  7 +-
 drivers/gpu/drm/drm_fourcc.c                  | 25 ------
 drivers/gpu/drm/drm_framebuffer.c             | 11 +--
 drivers/gpu/drm/drm_mipi_dbi.c                |  5 +-
 drivers/gpu/drm/drm_plane.c                   |  8 +-
 .../gpu/drm/hisilicon/kirin/kirin_drm_ade.c   |  5 +-
 drivers/gpu/drm/i915/display/intel_display.c  | 14 +--
 .../drm/i915/display/intel_display_debugfs.c  | 19 ++---
 drivers/gpu/drm/i915/display/intel_sprite.c   |  6 +-
 drivers/gpu/drm/mcde/mcde_display.c           |  6 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c      |  6 +-
 drivers/gpu/drm/nouveau/nouveau_display.c     |  9 +-
 drivers/gpu/drm/radeon/atombios_crtc.c        | 10 +--
 drivers/gpu/drm/sun4i/sun4i_backend.c         |  6 +-
 drivers/gpu/drm/vkms/vkms_writeback.c         |  7 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_kms.c           | 15 ++--
 drivers/media/v4l2-core/v4l2-ioctl.c          | 85 +++++--------------
 include/drm/drm_fourcc.h                      |  1 -
 lib/test_printf.c                             | 17 ++++
 lib/vsprintf.c                                | 39 +++++++++
 scripts/checkpatch.pl                         |  6 +-
 32 files changed, 161 insertions(+), 223 deletions(-)

-- 
2.29.2

^ permalink raw reply	[flat|nested] 44+ messages in thread

end of thread, other threads:[~2021-02-16  9:09 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-15 11:40 [PATCH v7 0/3] Add %p4cc printk modifier for V4L2 and DRM fourcc codes Sakari Ailus
2021-02-15 11:40 ` Sakari Ailus
2021-02-15 11:40 ` [PATCH v7 1/3] lib/vsprintf: Add support for printing V4L2 and DRM fourccs Sakari Ailus
2021-02-15 11:40   ` Sakari Ailus
2021-02-15 13:31   ` Andy Shevchenko
2021-02-15 13:31     ` Andy Shevchenko
2021-02-15 13:56     ` Sakari Ailus
2021-02-15 13:56       ` Sakari Ailus
2021-02-15 15:54       ` Andy Shevchenko
2021-02-15 15:54         ` Andy Shevchenko
2021-02-15 16:51         ` Petr Mladek
2021-02-15 16:51           ` Petr Mladek
2021-02-15 17:21           ` Sakari Ailus
2021-02-15 17:21             ` Sakari Ailus
2021-02-15 11:40 ` [PATCH v7 2/3] v4l: ioctl: Use %p4cc printk modifier to print FourCC codes Sakari Ailus
2021-02-15 11:40   ` Sakari Ailus
2021-02-15 13:34   ` Andy Shevchenko
2021-02-15 13:34     ` Andy Shevchenko
2021-02-15 13:50     ` Sakari Ailus
2021-02-15 13:50       ` Sakari Ailus
2021-02-15 16:56   ` Petr Mladek
2021-02-15 16:56     ` Petr Mladek
2021-02-15 17:05     ` Mauro Carvalho Chehab
2021-02-15 17:05       ` Mauro Carvalho Chehab
2021-02-15 17:22       ` Sakari Ailus
2021-02-15 17:22         ` Sakari Ailus
2021-02-15 11:40 ` [PATCH v7 3/3] drm: Switch to %p4cc format modifier Sakari Ailus
2021-02-15 11:40   ` Sakari Ailus
2021-02-15 13:41   ` Andy Shevchenko
2021-02-15 13:41     ` Andy Shevchenko
2021-02-15 13:48     ` Sakari Ailus
2021-02-15 13:48       ` Sakari Ailus
2021-02-15 17:26     ` Sakari Ailus
2021-02-15 17:26       ` Sakari Ailus
2021-02-15 17:36       ` Andy Shevchenko
2021-02-15 17:36         ` Andy Shevchenko
2021-02-15 16:58   ` Petr Mladek
2021-02-15 16:58     ` Petr Mladek
2021-02-16  8:37   ` Thomas Zimmermann
2021-02-16  8:37     ` Thomas Zimmermann
2021-02-16  9:01     ` Sakari Ailus
2021-02-16  9:01       ` Sakari Ailus
2021-02-16  9:08     ` Petr Mladek
2021-02-16  9:08       ` Petr Mladek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.