From patchwork Tue Mar 5 09:07:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13581896 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 39F4FC54E41 for ; Tue, 5 Mar 2024 09:08:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5E505112968; Tue, 5 Mar 2024 09:08:15 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="bPDpcUJQ"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by gabe.freedesktop.org (Postfix) with ESMTPS id E4265112963; Tue, 5 Mar 2024 09:08:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709629694; x=1741165694; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KA9vD+r+E9Oc8gfQpJD2ZyTu+UVAs9Ky7G88GUHLteo=; b=bPDpcUJQz23dbQ6e1CxSbnCRhkZVRX4+8ySuhos41AWIL5Y9goVmivWj Lg0mV3mimzOVbu/o8sL8XI7J3YDKXPy+WhkpgeXCCaJ91jiCpAYiLpYSM vsQ638FFpQBt41yXoJhauQKaW1uKrcWrOQsOQGMRVfvkqDj4+e9UE6agC 3XroNgVE5ovCSgxzqgd7xuZGkWjomVehmhfqO8auXIKDuik49lPjDCdNW DM2LEo+mmXAVkzq58XE5NV3Nq3xc3M8cKFtOj/K19pVwL3PUjxHXv6tNi kCIqTCRfOXI1dT8KLoSavlk9iSgm50EdRpF/872oiEbq/v3NUzlXpBkkA w==; X-IronPort-AV: E=McAfee;i="6600,9927,11003"; a="4027088" X-IronPort-AV: E=Sophos;i="6.06,205,1705392000"; d="scan'208";a="4027088" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Mar 2024 01:08:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,205,1705392000"; d="scan'208";a="9427406" Received: from omakhlou-mobl4.amr.corp.intel.com (HELO localhost) ([10.252.51.143]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Mar 2024 01:08:04 -0800 From: Jani Nikula To: dri-devel@lists.freedesktop.org Cc: Jani Nikula , intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org, David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , "Pan, Xinhui" , Karol Herbst , Lyude Paul , Danilo Krummrich , Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , Marijn Suijten , Hamza Mahfooz , Javier Martinez Canillas , Sui Jingfeng Subject: [RESEND v3 2/2] drm: Add CONFIG_DRM_WERROR Date: Tue, 5 Mar 2024 11:07:36 +0200 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Add kconfig to enable -Werror subsystem wide. This is useful for development and CI to keep the subsystem warning free, while avoiding issues outside of the subsystem that kernel wide CONFIG_WERROR=y might hit. v2: Don't depend on COMPILE_TEST Reviewed-by: Hamza Mahfooz # v1 Signed-off-by: Jani Nikula Reviewed-by: Javier Martinez Canillas --- drivers/gpu/drm/Kconfig | 13 +++++++++++++ drivers/gpu/drm/Makefile | 3 +++ 2 files changed, 16 insertions(+) diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index 6e853acf15da..c08e18108c2a 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -416,3 +416,16 @@ config DRM_LIB_RANDOM config DRM_PRIVACY_SCREEN bool default n + +config DRM_WERROR + bool "Compile the drm subsystem with warnings as errors" + depends on EXPERT + default n + help + A kernel build should not cause any compiler warnings, and this + enables the '-Werror' flag to enforce that rule in the drm subsystem. + + The drm subsystem enables more warnings than the kernel default, so + this config option is disabled by default. + + If in doubt, say N. diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index ea456f057e8a..a73c04d2d7a3 100644 --- a/drivers/gpu/drm/Makefile +++ b/drivers/gpu/drm/Makefile @@ -30,6 +30,9 @@ subdir-ccflags-y += -Wno-sign-compare endif # --- end copy-paste +# Enable -Werror in CI and development +subdir-ccflags-$(CONFIG_DRM_WERROR) += -Werror + drm-y := \ drm_aperture.o \ drm_atomic.o \