From patchwork Tue Feb 16 10:19:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 12089739 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C93C5C433DB for ; Tue, 16 Feb 2021 10:19:35 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 662AB64D99 for ; Tue, 16 Feb 2021 10:19:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 662AB64D99 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ACA0D6E2C7; Tue, 16 Feb 2021 10:19:34 +0000 (UTC) Received: from hillosipuli.retiisi.eu (hillosipuli.retiisi.eu [IPv6:2a01:4f9:c010:4572::81:2]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8A4E76E2C7 for ; Tue, 16 Feb 2021 10:19:33 +0000 (UTC) Received: from lanttu.localdomain (lanttu-e.localdomain [192.168.1.64]) by hillosipuli.retiisi.eu (Postfix) with ESMTP id 84FCE634C8E; Tue, 16 Feb 2021 12:18:29 +0200 (EET) From: Sakari Ailus To: dri-devel@lists.freedesktop.org Subject: [PATCH v8 0/4] Add %p4cc printk modifier for V4L2 and DRM fourcc codes Date: Tue, 16 Feb 2021 12:19:27 +0200 Message-Id: <20210216101931.2110-1-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Petr Mladek , mchehab@kernel.org, Thomas Zimmermann , Dave Stevenson , Rasmus Villemoes , linux-kernel@vger.kernel.org, Steven Rostedt , hverkuil@xs4all.nl, Sergey Senozhatsky , laurent.pinchart@ideasonboard.com, Joe Perches , Andy Shevchenko , linux-media@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi all, On merging --- it would seem everyone is happy with merging this through the drm-misc tree. The last patch should wait until all users are gone for sure, probably to the next kernel release. There are no users of drm_get_format_name() in linux-next currently after the 3rd patch. 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. I left these out from this version since individual drivers are easier changed without dealing with multiple trees. Since v7: - Add more examples, one with big endian and another with a space. - Add Y10 test format. - Use "0123" in the size string for temporary buffer. - Added acks. - Split the 3rd patch into two: driver changes and removal of drm_get_format_name(). 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 (4): 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 drm: Remove drm_get_format_name() Documentation/core-api/printk-formats.rst | 18 ++++ 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 | 18 ++++ lib/vsprintf.c | 39 +++++++++ scripts/checkpatch.pl | 6 +- 32 files changed, 164 insertions(+), 223 deletions(-)