Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5806090pxb; Tue, 16 Feb 2021 08:04:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJwU5L4Oe51hz4rwR317M1gAnXDOBQIfgwJBWj5AJRtsU5AnMwLjT+mBlsYMkPl+IBAUskV0 X-Received: by 2002:a05:6402:1589:: with SMTP id c9mr22121170edv.282.1613491441157; Tue, 16 Feb 2021 08:04:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613491441; cv=none; d=google.com; s=arc-20160816; b=id4cSAJcLMWprd8Voy1KhvQf9N9SyL+ScvFtus+3gEIL1MSNMp3KHTMPH3tmdinsHX zbhLkOaj2HMrh04cypwhez1e8Y5AFJHrXWfineVVQx1JgdSVW08hU3e5ljIM439RG5Fo KvEI3yrW4D1Y/NQXirMBZSgT81hZiNDBRsJmBQSlFYr+K6bkqFuCWszBbXqPX0/cgeqj XEdWZaj3naHdcZlEycQNQxc+sCU02diKX44CI5wgYAqNDKyS68iexU7Cx9ZBbesoL/Ng A3gtmfWePVQonVK+3Gppla1Gv8rSIKSWqxD/xffkY+sy7uQbNdLWwqTaC7/vlagdLUzQ +eXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=YzpztgWYHQJy8cClbu+yIFTwvLLugvZ5ZdEXGzPwMes=; b=1KYPTj0U7wHayotp9ZLyBYA57wmByahdd3AixHeH6kxOu8M+EVwqlJXem3DzgPOksI dG74pwwLNGVzoQevlWkKis5D7kuODVR73qHWd9aB7UFMFxq7bfEY3mdJHcWVbJgNHQVx FfotekeQ0XpsMS5IjsNmuYgYftYb6WLARVEiXWrK+EgdYCSm30IEvVZSW8cT+xfUMwYj HxtMaNCVtyfeGizc8tKFrnhbWcvqu2GUhxzEo/1heIMb9ARgOXIPsquJ9Rtq3qMDz8If qUr9A2hL2HtJYY0UcvKeJ+/ed+DGGggHCFd0i/Jw4VOhfetGfU+8rHqYtYZBd6vyKKBo 3/zw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t22si13772585ejf.399.2021.02.16.08.03.21; Tue, 16 Feb 2021 08:04:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230221AbhBPP7Y (ORCPT + 99 others); Tue, 16 Feb 2021 10:59:24 -0500 Received: from retiisi.eu ([95.216.213.190]:57494 "EHLO hillosipuli.retiisi.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229699AbhBPP7N (ORCPT ); Tue, 16 Feb 2021 10:59:13 -0500 Received: from lanttu.localdomain (lanttu-e.localdomain [192.168.1.64]) by hillosipuli.retiisi.eu (Postfix) with ESMTP id 288D3634CBF; Tue, 16 Feb 2021 17:56:20 +0200 (EET) From: Sakari Ailus To: dri-devel@lists.freedesktop.org Cc: linux-media@vger.kernel.org, Andy Shevchenko , linux-kernel@vger.kernel.org, Petr Mladek , Dave Stevenson , hverkuil@xs4all.nl, laurent.pinchart@ideasonboard.com, mchehab@kernel.org, Sergey Senozhatsky , Steven Rostedt , Joe Perches , Jani Nikula , Rasmus Villemoes , Daniel Vetter , Thomas Zimmermann Subject: [PATCH v9 0/4] Add %p4cc printk modifier for V4L2 and DRM fourcc codes Date: Tue, 16 Feb 2021 17:57:19 +0200 Message-Id: <20210216155723.17109-1-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 v8: - Reduce ternary conditionals in intel_plane_uapi_info(). - Wrap a long line in intel_plane_hw_info(). 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(-) -- 2.29.2 *** BLURB HERE *** 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 | 30 +++---- 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, 169 insertions(+), 229 deletions(-) -- 2.29.2