From patchwork Fri Aug 23 14:11:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13775274 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 3C4E2C52D7C for ; Fri, 23 Aug 2024 14:11:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9221210EB1B; Fri, 23 Aug 2024 14:11:22 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="FXehU8uO"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) by gabe.freedesktop.org (Postfix) with ESMTPS id DDCB210EB1B; Fri, 23 Aug 2024 14:11:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724422282; x=1755958282; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=uSuKvU0/LddDnKxIMqNqH4pZWn7SxQ9SX8UXF6+Z6Lg=; b=FXehU8uOZedcTQS54kYUn7vpvJI/ybY5bqACB4DzEP8BSDDE6TuClCHY JtKvTRmuQ9IwlidCE9g2djxtrVbXL8DAkLjpcSWmNN4JD1j8xDUol6+3I btd982Fn/ALKO2bM+7/JLTgl3EG2mdPKjOX55WB7/C9DvGYRvW3t61nv2 3UH66nPart8xg7r+rPA9Sg3Im/2C+MDzSM18djvMW87g2Ew1OPpDhLybN ePoLWdVvjnyoejyCyXQNW4qtQZr6n7Lm6ewkmewFV9eiVP4/AxDNmMO93 ZoSWxiF3mL3EfufzVTLquvppQuxHaunQ6xVXsUyUcnSd0jhfE+JqdDxnF g==; X-CSE-ConnectionGUID: QByqYHItQ5q95wJvg5XzUQ== X-CSE-MsgGUID: +Hf39VYARFGXG1KZfEK0pg== X-IronPort-AV: E=McAfee;i="6700,10204,11172"; a="23017808" X-IronPort-AV: E=Sophos;i="6.10,170,1719903600"; d="scan'208";a="23017808" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Aug 2024 07:11:21 -0700 X-CSE-ConnectionGUID: NpnNuRCiRl6eiBaZwJPRZA== X-CSE-MsgGUID: 7Da7QiSCRJCum4up6pW+jQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,170,1719903600"; d="scan'208";a="66129026" Received: from mklonows-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.246.223]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Aug 2024 07:11:18 -0700 From: Jani Nikula To: dri-devel@lists.freedesktop.org Cc: intel-gfx@lists.freedesktop.org, jani.nikula@intel.com, =?utf-8?q?Thomas?= =?utf-8?q?_Hellstr=C3=B6m?= , =?utf-8?q?C?= =?utf-8?q?hristian_K=C3=B6nig?= Subject: [PATCH 1/2] drm/ttm: fix kernel-doc typo for @trylock_only Date: Fri, 23 Aug 2024 17:11:09 +0300 Message-Id: <20240823141110.3431423-1-jani.nikula@intel.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" s/tryock_only/trylock_only/ Fixes: da966b82bf3d ("drm/ttm: Provide a generic LRU walker helper") Cc: Thomas Hellström Cc: Christian König Signed-off-by: Jani Nikula Reviewed-by: Christian König --- include/drm/ttm/ttm_bo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/drm/ttm/ttm_bo.h b/include/drm/ttm/ttm_bo.h index d1a732d56259..7294dde240fb 100644 --- a/include/drm/ttm/ttm_bo.h +++ b/include/drm/ttm/ttm_bo.h @@ -222,7 +222,7 @@ struct ttm_lru_walk { struct ttm_operation_ctx *ctx; /** @ticket: The struct ww_acquire_ctx if any. */ struct ww_acquire_ctx *ticket; - /** @tryock_only: Only use trylock for locking. */ + /** @trylock_only: Only use trylock for locking. */ bool trylock_only; }; From patchwork Fri Aug 23 14:11:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13775275 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 5EBDEC531DC for ; Fri, 23 Aug 2024 14:11:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B599310EB3B; Fri, 23 Aug 2024 14:11:29 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="QEjV4CLg"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8669110EB36; Fri, 23 Aug 2024 14:11:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724422288; x=1755958288; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dBCKBWB+6vMVwtko5k54ZMgS5GMzX97umFRcK5WfJSY=; b=QEjV4CLguxJE/SHU5wIVWQsAkNA7p8/zcSEMIbL/rby6Bme2rPXgHMsw H3jOWgBfI+zybydvsrD/4sRVBW1ExLnq+kjCb/RcVepha7Yr0oNn6G8pT sjOUwIkypXpl5HywPDh8caJ8aPUgBLJhcK66K+/0SlqEQPNGdtv9NLR4u P2J/XMO0ZUgEL1j0ae/u9PHUo7i9BjwQ0USIFMCbXpl8RGchfm3KqOyMO toMVqdP1eQOqcZHkh3NpYNRnHvX6YvwttCcTNi3tUrZWapykBmYlv6vCD rdf4MxQ/s9pQEpl+F5JZzjY1IgUpngbmCa6ClnCoLKN3QDe3TQNJrPfbB A==; X-CSE-ConnectionGUID: eXijaPmITyy0+zAlCabLCw== X-CSE-MsgGUID: A95FwssRRiyDQh/GXo6vLw== X-IronPort-AV: E=McAfee;i="6700,10204,11172"; a="23017835" X-IronPort-AV: E=Sophos;i="6.10,170,1719903600"; d="scan'208";a="23017835" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Aug 2024 07:11:27 -0700 X-CSE-ConnectionGUID: OouSVMJnTiunbv6/Txy4bw== X-CSE-MsgGUID: DL8SJxjERF6JyFHn22Jn7g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,170,1719903600"; d="scan'208";a="66129059" Received: from mklonows-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.246.223]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Aug 2024 07:11:23 -0700 From: Jani Nikula To: dri-devel@lists.freedesktop.org Cc: intel-gfx@lists.freedesktop.org, jani.nikula@intel.com, Daniel Vetter , David Airlie , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Masahiro Yamada Subject: [PATCH 2/2] drm: ensure drm headers are self-contained and pass kernel-doc Date: Fri, 23 Aug 2024 17:11:10 +0300 Message-Id: <20240823141110.3431423-2-jani.nikula@intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240823141110.3431423-1-jani.nikula@intel.com> References: <20240823141110.3431423-1-jani.nikula@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Ensure drm headers build, are self-contained, have header guards, and have no kernel-doc warnings, when CONFIG_DRM_HEADER_TEST=y. The mechanism follows similar patters used in i915, xe, and usr/include. To cover include/drm, we need to recurse there using the top level Kbuild and the new include/Kbuild files. v4: check for CONFIG_WERROR in addition to CONFIG_DRM_WERROR v3: adapt to upstream build changes v2: make DRM_HEADER_TEST depend on DRM Suggested-by: Daniel Vetter Cc: David Airlie Cc: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: Masahiro Yamada Acked-by: Thomas Zimmermann Signed-off-by: Jani Nikula --- Kbuild | 1 + drivers/gpu/drm/Kconfig | 11 +++++++++++ drivers/gpu/drm/Makefile | 18 ++++++++++++++++++ include/Kbuild | 1 + include/drm/Makefile | 18 ++++++++++++++++++ 5 files changed, 49 insertions(+) create mode 100644 include/Kbuild create mode 100644 include/drm/Makefile diff --git a/Kbuild b/Kbuild index 464b34a08f51..f327ca86990c 100644 --- a/Kbuild +++ b/Kbuild @@ -97,3 +97,4 @@ obj-$(CONFIG_SAMPLES) += samples/ obj-$(CONFIG_NET) += net/ obj-y += virt/ obj-y += $(ARCH_DRIVERS) +obj-$(CONFIG_DRM_HEADER_TEST) += include/ diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index 0387143bbb39..1f3a22df9309 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -476,6 +476,17 @@ config DRM_WERROR If in doubt, say N. +config DRM_HEADER_TEST + bool "Ensure DRM headers are self-contained and pass kernel-doc" + depends on DRM && EXPERT + default n + help + Ensure the DRM subsystem headers both under drivers/gpu/drm and + include/drm compile, are self-contained, have header guards, and have + no kernel-doc warnings. + + If in doubt, say N. + endif # Separate option because drm_panel_orientation_quirks.c is shared with fbdev diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index 68cc9258ffc4..c199075c87a4 100644 --- a/drivers/gpu/drm/Makefile +++ b/drivers/gpu/drm/Makefile @@ -219,3 +219,21 @@ obj-y += solomon/ obj-$(CONFIG_DRM_SPRD) += sprd/ obj-$(CONFIG_DRM_LOONGSON) += loongson/ obj-$(CONFIG_DRM_POWERVR) += imagination/ + +# Ensure drm headers are self-contained and pass kernel-doc +hdrtest-files := \ + $(shell cd $(src) && find . -maxdepth 1 -name 'drm_*.h') \ + $(shell cd $(src) && find display lib -name '*.h') + +always-$(CONFIG_DRM_HEADER_TEST) += \ + $(patsubst %.h,%.hdrtest, $(hdrtest-files)) + +# Include the header twice to detect missing include guard. +quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@) + cmd_hdrtest = \ + $(CC) $(c_flags) -fsyntax-only -x c /dev/null -include $< -include $<; \ + $(srctree)/scripts/kernel-doc -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \ + touch $@ + +$(obj)/%.hdrtest: $(src)/%.h FORCE + $(call if_changed_dep,hdrtest) diff --git a/include/Kbuild b/include/Kbuild new file mode 100644 index 000000000000..5e76a599e2dd --- /dev/null +++ b/include/Kbuild @@ -0,0 +1 @@ +obj-$(CONFIG_DRM_HEADER_TEST) += drm/ diff --git a/include/drm/Makefile b/include/drm/Makefile new file mode 100644 index 000000000000..a7bd15d2803e --- /dev/null +++ b/include/drm/Makefile @@ -0,0 +1,18 @@ +# SPDX-License-Identifier: GPL-2.0 + +# Ensure drm headers are self-contained and pass kernel-doc +hdrtest-files := \ + $(shell cd $(src) && find * -name '*.h' 2>/dev/null) + +always-$(CONFIG_DRM_HEADER_TEST) += \ + $(patsubst %.h,%.hdrtest, $(hdrtest-files)) + +# Include the header twice to detect missing include guard. +quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@) + cmd_hdrtest = \ + $(CC) $(c_flags) -fsyntax-only -x c /dev/null -include $< -include $<; \ + $(srctree)/scripts/kernel-doc -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \ + touch $@ + +$(obj)/%.hdrtest: $(src)/%.h FORCE + $(call if_changed_dep,hdrtest)