From patchwork Tue Aug 6 06:39:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 11078251 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 35C1E14E5 for ; Tue, 6 Aug 2019 06:40:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DE50277D9 for ; Tue, 6 Aug 2019 06:40:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0AF8C288FC; Tue, 6 Aug 2019 06:40:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2402A277D9 for ; Tue, 6 Aug 2019 06:40:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731752AbfHFGkW (ORCPT ); Tue, 6 Aug 2019 02:40:22 -0400 Received: from conuserg-12.nifty.com ([210.131.2.79]:39569 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731560AbfHFGkW (ORCPT ); Tue, 6 Aug 2019 02:40:22 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id x766dO7o002982; Tue, 6 Aug 2019 15:39:26 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com x766dO7o002982 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1565073566; bh=JlCMJ6teUrNcdw5nNAsjPH8LD60KsqUoMPPEo50W3xc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o38ZfvGh/J6sdmxHNVHbtsTBc2XwPxzojhdjO4Tpd5Jc6Kzy3Zyr1LlhLCxVY+2f9 uk76CsF2MDxirJh84AVmMmt6NOth+0HBQPu5zFCIvUBB9oIDLxBAVuAbmyjDh7EzI1 3DsBEU6VC8lh+rnT/JTp0odTWLocGhmPr6h+S4phlAxrKXp32wW51UWyJkZMsKfTUE IlFNSH6XyHBqMuOWmUMKRl7IVl3vH4lNHWSeNApCXuk5fda/N4ooUM9ZJ7jVazWlVq JHln5DDcHshnn+BrPkCbnohTiM/CkKCA1sdMz+B2qsu7/29jB2Ov327e/YC8obEZ3K JOX12HqWukreA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Jani Nikula , intel-gfx@lists.freedesktop.org, Sam Ravnborg , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 1/5] kbuild: treat an object as multi-used when $(foo-) is set Date: Tue, 6 Aug 2019 15:39:19 +0900 Message-Id: <20190806063923.1266-2-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190806063923.1266-1-yamada.masahiro@socionext.com> References: <20190806063923.1266-1-yamada.masahiro@socionext.com> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently, Kbuild treats an object as multi-used when any of $(foo-objs), $(foo-y), $(foo-m) is set. It makes more sense to check $(foo-) as well. In the context of foo-$(CONFIG_FOO_FEATURE1), CONFIG_FOO_FEATURE1 could be unset. Signed-off-by: Masahiro Yamada --- scripts/Makefile.lib | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 41c50f9461e5..0a540599823e 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -41,9 +41,9 @@ obj-m := $(filter-out %/, $(obj-m)) # Subdirectories we need to descend into subdir-ym := $(sort $(subdir-y) $(subdir-m)) -# if $(foo-objs), $(foo-y), or $(foo-m) exists, foo.o is a composite object -multi-used-y := $(sort $(foreach m,$(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m)))) -multi-used-m := $(sort $(foreach m,$(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m))), $(m)))) +# If $(foo-objs), $(foo-y), $(foo-m), or $(foo-) exists, foo.o is a composite object +multi-used-y := $(sort $(foreach m,$(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-))), $(m)))) +multi-used-m := $(sort $(foreach m,$(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)) $($(m:.o=-))), $(m)))) multi-used := $(multi-used-y) $(multi-used-m) # $(subdir-obj-y) is the list of objects in $(obj-y) which uses dir/ to @@ -52,8 +52,8 @@ subdir-obj-y := $(filter %/built-in.a, $(obj-y)) # Replace multi-part objects by their individual parts, # including built-in.a from subdirectories -real-obj-y := $(foreach m, $(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) -real-obj-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m))),$($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)),$(m))) +real-obj-y := $(foreach m, $(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) +real-obj-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)),$(m))) # DTB # If CONFIG_OF_ALL_DTBS is enabled, all DT blobs are built From patchwork Tue Aug 6 06:39:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 11078257 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DF45113A4 for ; Tue, 6 Aug 2019 06:40:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD9021FF66 for ; Tue, 6 Aug 2019 06:40:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C188E277D9; Tue, 6 Aug 2019 06:40:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 581D71FF66 for ; Tue, 6 Aug 2019 06:40:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731954AbfHFGkg (ORCPT ); Tue, 6 Aug 2019 02:40:36 -0400 Received: from conuserg-12.nifty.com ([210.131.2.79]:39570 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731731AbfHFGkW (ORCPT ); Tue, 6 Aug 2019 02:40:22 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id x766dO7p002982; Tue, 6 Aug 2019 15:39:27 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com x766dO7p002982 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1565073567; bh=WuuYZLz5z+C5ByPickHqXjcy+trxgXoTZfNCL4q0+ek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wZP3k/5mLGK/rx72rRKUp6Fflr4SFpT0/nbDK73dPtFRSCq+FIMJ6AFUdjAuYREoQ EAoB0nlX3+1RRxB0U/vlYlvpU95Uhe8+Msw90FPV9xLbEfeZHIWePv2+3Bn7jqRTQe Uh+mh36iRXvl6s62Jz/UaHL/Wojga/DMWusWL+o+vZo52M+vTCYI7lmFoWhQ9tR3D2 1rFNPX0nTg1KndQuNruLobq/a82uM/s6hzhb1Ws0DyCqENCPOiAG8ud3yRQvfi/Ste viHvqiBOcXazcEmxmzsheRHLk4djPhzzPUHdJK7FFJ6/M/DfcQipQieljKkQpp3Bdv RRKN76F/VEWJg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Jani Nikula , intel-gfx@lists.freedesktop.org, Sam Ravnborg , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 2/5] kbuild: clean up modname calculation Date: Tue, 6 Aug 2019 15:39:20 +0900 Message-Id: <20190806063923.1266-3-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190806063923.1266-1-yamada.masahiro@socionext.com> References: <20190806063923.1266-1-yamada.masahiro@socionext.com> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 'multi-used' is used for computing the modname. Improve the code readability by removing the .o suffix before the foreach loop. I renamed multi-used-m to modules-multi. No functional change intended. Signed-off-by: Masahiro Yamada --- scripts/Makefile.build | 6 +++--- scripts/Makefile.lib | 15 +++++++++------ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 0d434d0afc0b..b0ff60ac0c42 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -460,11 +460,11 @@ endif quiet_cmd_link_multi-m = LD [M] $@ cmd_link_multi-m = $(LD) $(ld_flags) -r -o $@ $(filter %.o,$^) -$(multi-used-m): FORCE +$(modules-multi): FORCE $(call if_changed,link_multi-m) -$(call multi_depend, $(multi-used-m), .o, -objs -y -m) +$(call multi_depend, $(modules-multi), .o, -objs -y -m) -targets += $(multi-used-m) +targets += $(modules-multi) targets := $(filter-out $(PHONY), $(targets)) # Add intermediate targets: diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 0a540599823e..e503f12e8e9c 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -41,10 +41,13 @@ obj-m := $(filter-out %/, $(obj-m)) # Subdirectories we need to descend into subdir-ym := $(sort $(subdir-y) $(subdir-m)) -# If $(foo-objs), $(foo-y), $(foo-m), or $(foo-) exists, foo.o is a composite object -multi-used-y := $(sort $(foreach m,$(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-))), $(m)))) -multi-used-m := $(sort $(foreach m,$(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)) $($(m:.o=-))), $(m)))) -multi-used := $(multi-used-y) $(multi-used-m) +# If $(foo-objs), $(foo-y), $(foo-m), or $(foo-) exists, foo is multi-used +multi-used-y := $(sort $(foreach m, $(patsubst %.o,%,$(obj-y)), $(if $(strip $($(m)-objs) $($(m)-y) $($(m)-)), $(m)))) +multi-used-m := $(sort $(foreach m, $(patsubst %.o,%,$(obj-m)), $(if $(strip $($(m)-objs) $($(m)-y) $($(m)-m) $($(m)-)), $(m)))) + +modules-multi := $(addsuffix .o, $(multi-used-m)) + +multi-used := $(multi-used-y) $(multi-used-m) # $(subdir-obj-y) is the list of objects in $(obj-y) which uses dir/ to # tell kbuild to descend @@ -90,14 +93,14 @@ lib-y := $(addprefix $(obj)/,$(lib-y)) subdir-obj-y := $(addprefix $(obj)/,$(subdir-obj-y)) real-obj-y := $(addprefix $(obj)/,$(real-obj-y)) real-obj-m := $(addprefix $(obj)/,$(real-obj-m)) -multi-used-m := $(addprefix $(obj)/,$(multi-used-m)) +modules-multi := $(addprefix $(obj)/,$(modules-multi)) subdir-ym := $(addprefix $(obj)/,$(subdir-ym)) # Finds the multi-part object the current object will be linked into. # If the object belongs to two or more multi-part objects, all of them are # concatenated with a colon separator. modname-multi = $(subst $(space),:,$(sort $(foreach m,$(multi-used),\ - $(if $(filter $*.o, $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m))),$(m:.o=))))) + $(if $(filter $*.o, $($(m)-objs) $($(m)-y) $($(m)-m)),$(m))))) modname = $(if $(modname-multi),$(modname-multi),$(basetarget)) From patchwork Tue Aug 6 06:39:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 11078253 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8A0E413A4 for ; Tue, 6 Aug 2019 06:40:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F23E1FF66 for ; Tue, 6 Aug 2019 06:40:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2F0CF26E82; Tue, 6 Aug 2019 06:40:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC098277D9 for ; Tue, 6 Aug 2019 06:40:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731916AbfHFGkY (ORCPT ); Tue, 6 Aug 2019 02:40:24 -0400 Received: from conuserg-12.nifty.com ([210.131.2.79]:39558 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731576AbfHFGkX (ORCPT ); Tue, 6 Aug 2019 02:40:23 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id x766dO7q002982; Tue, 6 Aug 2019 15:39:27 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com x766dO7q002982 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1565073568; bh=sw9gOrsRe1Xt1eVzCXiD4YS6wfm2vzRin5darkdpJ1A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xo7yNbFFf7vTcp5uurMMAUy6l1kcnjkSAIb7IRnyaHiiyAlAcXxZ3cyxMRIfAF3IA RJFKw5LdIswvKCFYjwKmz9RHp15n+CtAag32hNQlL5eiKbQKP59yVdqQefLpzLnsBF 7+WEC4FrwSP86RG8SrayMPhEWuED4gZLTGefyiXp+Blnnr6roMqkmKeufvt0/eZ5+/ IXrQ/CPghsEJrEJoVgp3IH3wNvtsG+cHXqxylzZyT6FP1jPzUfG/dVubZ37i/9KlhW pHXreWssCbxLY4DZEzBl/6Mg57IBK5JdSPtXlRzBRD4m6CZ02CkgdgA+qjNtiNZZTS sTT+Z9Yk9Drlg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Jani Nikula , intel-gfx@lists.freedesktop.org, Sam Ravnborg , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 3/5] kbuild: rename cmd_ar_builtin to cmd_ar_no_sym Date: Tue, 6 Aug 2019 15:39:21 +0900 Message-Id: <20190806063923.1266-4-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190806063923.1266-1-yamada.masahiro@socionext.com> References: <20190806063923.1266-1-yamada.masahiro@socionext.com> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In the next commit, I will re-use this for thin-archives of objects liked into modules. Rename cmd_ar_builtin to a more generic cmd_ar_no_sym. (cmd_ar is already defined in scripts/Makefile.lib) I removed unneeded ifdef builtin-target. No functional change intended. Signed-off-by: Masahiro Yamada --- scripts/Makefile.build | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/Makefile.build b/scripts/Makefile.build index b0ff60ac0c42..68622cbdfda5 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -404,16 +404,14 @@ $(sort $(subdir-obj-y)): $(subdir-ym) ; # # Rule to compile a set of .o files into one .a file (without symbol table) # -ifdef builtin-target -quiet_cmd_ar_builtin = AR $@ - cmd_ar_builtin = rm -f $@; $(AR) rcSTP$(KBUILD_ARFLAGS) $@ $(real-prereqs) +quiet_cmd_ar_no_sym = AR $@ + cmd_ar_no_sym = rm -f $@; $(AR) rcSTP$(KBUILD_ARFLAGS) $@ $(real-prereqs) $(builtin-target): $(real-obj-y) FORCE - $(call if_changed,ar_builtin) + $(call if_changed,ar_no_sym) targets += $(builtin-target) -endif # builtin-target # # Rule to create modules.order file From patchwork Tue Aug 6 06:39:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 11078255 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C227917E0 for ; Tue, 6 Aug 2019 06:40:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AEFD21FF66 for ; Tue, 6 Aug 2019 06:40:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A370A26E82; Tue, 6 Aug 2019 06:40:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB6A228837 for ; Tue, 6 Aug 2019 06:40:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731894AbfHFGkY (ORCPT ); Tue, 6 Aug 2019 02:40:24 -0400 Received: from conuserg-12.nifty.com ([210.131.2.79]:39559 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731644AbfHFGkX (ORCPT ); Tue, 6 Aug 2019 02:40:23 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id x766dO7r002982; Tue, 6 Aug 2019 15:39:28 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com x766dO7r002982 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1565073569; bh=5gUHgNcICorO6cqCrPrkJFv4onerI26ClAdRbUjrZRs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c8oYM8MZ1/hIlfUSZ+9uXKDDwIbePv/xndaZbSbK/gWGXDMbGWBPUYWFg2oENKDuN cyiGBzbpUhfPrO5l+yRb0JfLyPDUbTdgUJIT+X5yrKPjpuR7/IXKmBrXU8omiTSIPZ r++sKgPANrzeqCMhLSwzCo99ZK2a/Ibq2uuwmiFBONi4mdA92XdgShVN9ruBdK1RJf 5DcypP7JOgomtZ6NUreCLKEnYPbAzMU0Qp9nmEsGHQkmyyZLMTBqH6cTew4N9vTKNl KX8qrTzHDf2/eGfvHsjG4F/+3tHcjYHqe1nh7hC+U51lfiGIgoN1/Ubd9Oui57a/RK //H8yTyBEk3AQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Jani Nikula , intel-gfx@lists.freedesktop.org, Sam Ravnborg , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 4/5] kbuild: support composite objects spanning across multiple Makefiles Date: Tue, 6 Aug 2019 15:39:22 +0900 Message-Id: <20190806063923.1266-5-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190806063923.1266-1-yamada.masahiro@socionext.com> References: <20190806063923.1266-1-yamada.masahiro@socionext.com> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For a module that consists of multiple objects, the Makefile typically looks like this: obj-$(CONFIG_FOO) += foo.o foo-y += foo-main.o foo-$(CONFIG_FOO_FEATURE1) += foo-feature1.o foo-$(CONFIG_FOO_FEATURE2) += foo-feature2.o Since other Makefiles do not understand foo-y, all modules must have a flat structure. As Documentation/kbuild/modules.rst section 4.3 says, Kbuild can handle files that are spread over several sub-directories, but the top Makefile of a module must specify everything. Some modules (drm, fs, etc.) have grown quite big, and the current limitation is getting more and more painful. This commit allows modules to recurse into sub-directories. The child Makefiles inherit composite object names from the parent. TODO: Add documentation for this syntax. Signed-off-by: Masahiro Yamada --- scripts/Makefile.build | 27 ++++++++++++++++------ scripts/Makefile.lib | 51 +++++++++++++++++++++++++----------------- 2 files changed, 51 insertions(+), 27 deletions(-) diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 68622cbdfda5..cea2bb25787a 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -70,7 +70,7 @@ endif mod-targets := $(patsubst %.o, %.mod, $(obj-m)) __build: $(if $(KBUILD_BUILTIN),$(builtin-target) $(lib-target) $(extra-y)) \ - $(if $(KBUILD_MODULES),$(obj-m) $(mod-targets) $(modorder-target)) \ + $(if $(KBUILD_MODULES),$(obj-m) $(ar-m) $(mod-targets) $(modorder-target)) \ $(subdir-ym) $(always) @: @@ -274,7 +274,10 @@ $(obj)/%.o: $(src)/%.c $(recordmcount_source) $(objtool_dep) FORCE $(call if_changed_rule,cc_o_c) cmd_mod = { \ - echo $(if $($*-objs)$($*-y)$($*-m), $(addprefix $(obj)/, $($*-objs) $($*-y) $($*-m)), $(@:.mod=.o)); \ + echo $(if $($*-objs)$($*-y)$($*-m), \ + $(foreach m, $(addprefix $(obj)/, $($*-objs) $($*-y) $($*-m)), \ + $(if $(filter %.a, $(m)), $(shell $(AR) t $(m)), $(m))), \ + $(@:.mod=.o)); \ $(cmd_undef_syms); \ } > $@ @@ -399,19 +402,24 @@ $(obj)/%.asn1.c $(obj)/%.asn1.h: $(src)/%.asn1 $(objtree)/scripts/asn1_compiler # --------------------------------------------------------------------------- # To build objects in subdirs, we need to descend into the directories -$(sort $(subdir-obj-y)): $(subdir-ym) ; +$(sort $(subdir-obj-y) $(subdir-ar-m)): $(subdir-ym); # # Rule to compile a set of .o files into one .a file (without symbol table) # -quiet_cmd_ar_no_sym = AR $@ +quiet_cmd_ar_no_sym = AR $(quiet_modtag) $@ cmd_ar_no_sym = rm -f $@; $(AR) rcSTP$(KBUILD_ARFLAGS) $@ $(real-prereqs) $(builtin-target): $(real-obj-y) FORCE $(call if_changed,ar_no_sym) -targets += $(builtin-target) +$(ar-m): part-of-module := y +$(ar-m): FORCE + $(call if_changed,ar_no_sym) +$(call multi_depend, $(ar-m), .a, -objs -y -m) + +targets += $(builtin-target) $(ar-m) # # Rule to create modules.order file @@ -456,7 +464,7 @@ endif # module is turned into a multi object module, $^ will contain header file # dependencies recorded in the .*.cmd file. quiet_cmd_link_multi-m = LD [M] $@ - cmd_link_multi-m = $(LD) $(ld_flags) -r -o $@ $(filter %.o,$^) + cmd_link_multi-m = $(LD) $(ld_flags) -r -o $@ --whole-archive $(filter %.o %a,$^) --no-whole-archive $(modules-multi): FORCE $(call if_changed,link_multi-m) @@ -485,7 +493,12 @@ targets += $(call intermediate_targets, .asn1.o, .asn1.c .asn1.h) \ PHONY += $(subdir-ym) $(subdir-ym): - $(Q)$(MAKE) $(build)=$@ need-builtin=$(if $(findstring $@,$(subdir-obj-y)),1) + $(MAKE) $(build)=$@ \ + need-builtin=$(if $(filter $@/built-in.a,$(subdir-obj-y)),1) \ + multi-used2-y="$(sort $(foreach m, $(subdir-multi-used-y), \ + $(if $(filter $@/,$(dir $(m))), $(notdir $m))))" \ + multi-used2-m="$(sort $(foreach m, $(subdir-multi-used-m), \ + $(if $(filter $@/,$(dir $(m))), $(notdir $m))))" # Add FORCE to the prequisites of a target to force it to be always rebuilt. # --------------------------------------------------------------------------- diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index e503f12e8e9c..e4e4ed869cad 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -25,38 +25,44 @@ lib-y := $(filter-out $(obj-y), $(sort $(lib-y) $(lib-m))) # and -m subdirs. Just put -y's first. modorder := $(patsubst %/,%/modules.order, $(filter %/, $(obj-y)) $(obj-m:.o=.ko)) -# Handle objects in subdirs -# --------------------------------------------------------------------------- -# o if we encounter foo/ in $(obj-y), replace it by foo/built-in.a -# and add the directory to the list of dirs to descend into: $(subdir-y) -# o if we encounter foo/ in $(obj-m), remove it from $(obj-m) -# and add the directory to the list of dirs to descend into: $(subdir-m) -__subdir-y := $(patsubst %/,%,$(filter %/, $(obj-y))) -subdir-y += $(__subdir-y) -__subdir-m := $(patsubst %/,%,$(filter %/, $(obj-m))) -subdir-m += $(__subdir-m) -obj-y := $(patsubst %/, %/built-in.a, $(obj-y)) -obj-m := $(filter-out %/, $(obj-m)) + +# Replace multi-part objects by their individual parts, +# including built-in.a from subdirectories +real-obj-y := $(foreach m, $(obj-y),$(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-))), $($(m:.o=-objs)) $($(m:.o=-y)), $(m))) +real-obj-y += $(foreach m, $(multi-used2-y),$(if $(strip $($(m)-objs) $($(m)-y) $($(m)-)),$($(m)-objs) $($(m)-y))) +real-obj-m := $(foreach m, $(obj-m),$(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)), $(m))) +real-obj-m += $(foreach m, $(multi-used2-m),$(if $(strip $($(m)-objs) $($(m)-y) $($(m)-m) $($(m)-)), $($(m)-objs) $($(m)-y) $($(m)-m))) + +# all objects and thin archives combined into built-in.a in this directory # Subdirectories we need to descend into -subdir-ym := $(sort $(subdir-y) $(subdir-m)) +subdir-ym := $(sort $(subdir-y) $(subdir-m) \ + $(patsubst %/,%,$(filter %/,$(real-obj-y) $(real-obj-m)))) + +real-obj-y := $(patsubst %/, %/built-in.a, $(real-obj-y)) +subdir-obj-y := $(filter %/built-in.a, $(real-obj-y)) + +obj-m := $(filter-out %/, $(obj-m)) +real-obj-m := $(filter-out %/, $(real-obj-m)) # If $(foo-objs), $(foo-y), $(foo-m), or $(foo-) exists, foo is multi-used multi-used-y := $(sort $(foreach m, $(patsubst %.o,%,$(obj-y)), $(if $(strip $($(m)-objs) $($(m)-y) $($(m)-)), $(m)))) multi-used-m := $(sort $(foreach m, $(patsubst %.o,%,$(obj-m)), $(if $(strip $($(m)-objs) $($(m)-y) $($(m)-m) $($(m)-)), $(m)))) modules-multi := $(addsuffix .o, $(multi-used-m)) +ar-m := $(addsuffix .a, $(multi-used2-m)) + +multi-used-y += $(multi-used2-y) +multi-used-m += $(multi-used2-m) multi-used := $(multi-used-y) $(multi-used-m) -# $(subdir-obj-y) is the list of objects in $(obj-y) which uses dir/ to -# tell kbuild to descend -subdir-obj-y := $(filter %/built-in.a, $(obj-y)) +# multi-used (composite) objects propagated to sub-directories +subdir-multi-used-y := $(foreach m, $(multi-used-y), $(addsuffix $(m), $(filter %/, $($(m)-objs) $($(m)-y)))) +subdir-multi-used-m := $(foreach m, $(multi-used-m), $(addsuffix $(m), $(filter %/, $($(m)-objs) $($(m)-y) $($(m)-m)))) -# Replace multi-part objects by their individual parts, -# including built-in.a from subdirectories -real-obj-y := $(foreach m, $(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) -real-obj-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)),$(m))) +$(foreach m, $(patsubst %.o,%,$(multi-used-m) $(multi-used2-m)), $(foreach s, -objs -y -m, \ + $(eval $(m)$(s) := $(patsubst %/,%/$(m).a, $($(m)$(s)))))) # DTB # If CONFIG_OF_ALL_DTBS is enabled, all DT blobs are built @@ -95,6 +101,11 @@ real-obj-y := $(addprefix $(obj)/,$(real-obj-y)) real-obj-m := $(addprefix $(obj)/,$(real-obj-m)) modules-multi := $(addprefix $(obj)/,$(modules-multi)) subdir-ym := $(addprefix $(obj)/,$(subdir-ym)) +ar-m := $(addprefix $(obj)/,$(ar-m)) +subdir-multi-used-y := $(addprefix $(obj)/,$(subdir-multi-used-y)) +subdir-multi-used-m := $(addprefix $(obj)/,$(subdir-multi-used-m)) + +subdir-ar-m := $(addsuffix .a, $(subdir-multi-used-m)) # Finds the multi-part object the current object will be linked into. # If the object belongs to two or more multi-part objects, all of them are From patchwork Tue Aug 6 06:39:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 11078261 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 88E2313A4 for ; Tue, 6 Aug 2019 06:40:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7669E1FF66 for ; Tue, 6 Aug 2019 06:40:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6AB27277D9; Tue, 6 Aug 2019 06:40:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 93DD81FF66 for ; Tue, 6 Aug 2019 06:40:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731731AbfHFGkp (ORCPT ); Tue, 6 Aug 2019 02:40:45 -0400 Received: from conuserg-12.nifty.com ([210.131.2.79]:40143 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731976AbfHFGko (ORCPT ); Tue, 6 Aug 2019 02:40:44 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id x766dO7s002982; Tue, 6 Aug 2019 15:39:29 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com x766dO7s002982 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1565073570; bh=NHKB+RcwJX9tNIjEMmZ3uK4qIjZTelU5Onq9zKuQPU8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1czhhUjZIDKICC0g7fyRzg51PmtWgjB1i4MvtPqab9fEajQ0lRcfnksDCFerqRlph unCwjFQ775zT5+tV/VfY1ipMRAEYuRVi0pK4zKLDFQb07BGtD5Tva6Fs00h7l65Hzr FM9aw191ln8QtwH187M1/MTUVa19G55lWLnKx5fSuY3CT8yIQQ1585eCOAjfTpghyy 0hMngY9kEM8RhPHDOmMivWKUrpwtTFTpsCMLTRgtEiG3NioBL488ptfT157wmZMumX PVqpn6K/khWACOLaK8gXI2y61aX+YBlyY+4kCYlTIjavosYIwL900eBBTY7/JrbSSI fuOSvgLZu+Gxg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Jani Nikula , intel-gfx@lists.freedesktop.org, Sam Ravnborg , Masahiro Yamada , Daniel Vetter , David Airlie , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Zhenyu Wang , Zhi Wang , dri-devel@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/5] drm: i915: hierachize Makefiles Date: Tue, 6 Aug 2019 15:39:23 +0900 Message-Id: <20190806063923.1266-6-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190806063923.1266-1-yamada.masahiro@socionext.com> References: <20190806063923.1266-1-yamada.masahiro@socionext.com> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP You can use the -y syntax in sub-directory Makefiles of modules. Demonstrate how it works. PLEASE DO NOT APPLY FOR NOW: this is only for comments. Signed-off-by: Masahiro Yamada --- drivers/gpu/drm/i915/Makefile | 126 ++------------------ drivers/gpu/drm/i915/display/Makefile | 64 ++++++++++ drivers/gpu/drm/i915/gem/Makefile | 27 +++++ drivers/gpu/drm/i915/gem/selftests/Makefile | 3 + drivers/gpu/drm/i915/gt/Makefile | 16 +++ drivers/gpu/drm/i915/gvt/Makefile | 32 ++++- drivers/gpu/drm/i915/selftests/Makefile | 9 ++ 7 files changed, 153 insertions(+), 124 deletions(-) create mode 100644 drivers/gpu/drm/i915/gem/selftests/Makefile create mode 100644 drivers/gpu/drm/i915/selftests/Makefile diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile index 8cace65f50ce..6319c670bfb8 100644 --- a/drivers/gpu/drm/i915/Makefile +++ b/drivers/gpu/drm/i915/Makefile @@ -63,56 +63,16 @@ i915-y += \ i915_user_extensions.o i915-$(CONFIG_COMPAT) += i915_ioc32.o -i915-$(CONFIG_DEBUG_FS) += i915_debugfs.o display/intel_pipe_crc.o +i915-$(CONFIG_DEBUG_FS) += i915_debugfs.o i915-$(CONFIG_PERF_EVENTS) += i915_pmu.o # "Graphics Technology" (aka we talk to the gpu) -obj-y += gt/ -gt-y += \ - gt/intel_breadcrumbs.o \ - gt/intel_context.o \ - gt/intel_engine_cs.o \ - gt/intel_engine_pm.o \ - gt/intel_gt_pm.o \ - gt/intel_hangcheck.o \ - gt/intel_lrc.o \ - gt/intel_reset.o \ - gt/intel_ringbuffer.o \ - gt/intel_mocs.o \ - gt/intel_sseu.o \ - gt/intel_workarounds.o -gt-$(CONFIG_DRM_I915_SELFTEST) += \ - gt/mock_engine.o -i915-y += $(gt-y) +i915-y += gt/ # GEM (Graphics Execution Management) code -obj-y += gem/ -gem-y += \ - gem/i915_gem_busy.o \ - gem/i915_gem_clflush.o \ - gem/i915_gem_client_blt.o \ - gem/i915_gem_context.o \ - gem/i915_gem_dmabuf.o \ - gem/i915_gem_domain.o \ - gem/i915_gem_execbuffer.o \ - gem/i915_gem_fence.o \ - gem/i915_gem_internal.o \ - gem/i915_gem_object.o \ - gem/i915_gem_object_blt.o \ - gem/i915_gem_mman.o \ - gem/i915_gem_pages.o \ - gem/i915_gem_phys.o \ - gem/i915_gem_pm.o \ - gem/i915_gem_shmem.o \ - gem/i915_gem_shrinker.o \ - gem/i915_gem_stolen.o \ - gem/i915_gem_throttle.o \ - gem/i915_gem_tiling.o \ - gem/i915_gem_userptr.o \ - gem/i915_gem_wait.o \ - gem/i915_gemfs.o +i915-y += gem/ + i915-y += \ - $(gem-y) \ i915_active.o \ i915_cmd_parser.o \ i915_gem_batch_pool.o \ @@ -148,78 +108,11 @@ i915-y += intel_renderstate_gen6.o \ intel_renderstate_gen8.o \ intel_renderstate_gen9.o -# modesetting core code -obj-y += display/ -i915-y += \ - display/intel_atomic.o \ - display/intel_atomic_plane.o \ - display/intel_audio.o \ - display/intel_bios.o \ - display/intel_bw.o \ - display/intel_cdclk.o \ - display/intel_color.o \ - display/intel_combo_phy.o \ - display/intel_connector.o \ - display/intel_display.o \ - display/intel_display_power.o \ - display/intel_dpio_phy.o \ - display/intel_dpll_mgr.o \ - display/intel_fbc.o \ - display/intel_fifo_underrun.o \ - display/intel_frontbuffer.o \ - display/intel_hdcp.o \ - display/intel_hotplug.o \ - display/intel_lpe_audio.o \ - display/intel_overlay.o \ - display/intel_psr.o \ - display/intel_quirks.o \ - display/intel_sprite.o -i915-$(CONFIG_ACPI) += \ - display/intel_acpi.o \ - display/intel_opregion.o -i915-$(CONFIG_DRM_FBDEV_EMULATION) += \ - display/intel_fbdev.o - -# modesetting output/encoder code -i915-y += \ - display/dvo_ch7017.o \ - display/dvo_ch7xxx.o \ - display/dvo_ivch.o \ - display/dvo_ns2501.o \ - display/dvo_sil164.o \ - display/dvo_tfp410.o \ - display/icl_dsi.o \ - display/intel_crt.o \ - display/intel_ddi.o \ - display/intel_dp.o \ - display/intel_dp_aux_backlight.o \ - display/intel_dp_link_training.o \ - display/intel_dp_mst.o \ - display/intel_dsi.o \ - display/intel_dsi_dcs_backlight.o \ - display/intel_dsi_vbt.o \ - display/intel_dvo.o \ - display/intel_gmbus.o \ - display/intel_hdmi.o \ - display/intel_lspcon.o \ - display/intel_lvds.o \ - display/intel_panel.o \ - display/intel_sdvo.o \ - display/intel_tv.o \ - display/intel_vdsc.o \ - display/vlv_dsi.o \ - display/vlv_dsi_pll.o +i915-y += display/ # Post-mortem debug and GPU hang state capture i915-$(CONFIG_DRM_I915_CAPTURE_ERROR) += i915_gpu_error.o -i915-$(CONFIG_DRM_I915_SELFTEST) += \ - gem/selftests/igt_gem_utils.o \ - selftests/i915_random.o \ - selftests/i915_selftest.o \ - selftests/igt_flush_test.o \ - selftests/igt_live_test.o \ - selftests/igt_reset.o \ - selftests/igt_spinner.o +i915-$(CONFIG_DRM_I915_SELFTEST) += selftests/ # virtual gpu code i915-y += i915_vgpu.o @@ -241,10 +134,7 @@ i915-y += i915_perf.o \ i915_oa_cnl.o \ i915_oa_icl.o -ifeq ($(CONFIG_DRM_I915_GVT),y) -i915-y += intel_gvt.o -include $(src)/gvt/Makefile -endif +i915-$(CONFIG_DRM_I915_GVT) += intel_gvt.o gvt/ obj-$(CONFIG_DRM_I915) += i915.o -obj-$(CONFIG_DRM_I915_GVT_KVMGT) += gvt/kvmgt.o +obj-$(CONFIG_DRM_I915_GVT_KVMGT) += gvt/ diff --git a/drivers/gpu/drm/i915/display/Makefile b/drivers/gpu/drm/i915/display/Makefile index 1c75b5c9790c..1fd26c5e68b5 100644 --- a/drivers/gpu/drm/i915/display/Makefile +++ b/drivers/gpu/drm/i915/display/Makefile @@ -1,2 +1,66 @@ # Extra header tests include $(src)/Makefile.header-test + +i915-$(CONFIG_DEBUG_FS) += \ + intel_pipe_crc.o + +# modesetting core code +i915-y += \ + intel_atomic.o \ + intel_atomic_plane.o \ + intel_audio.o \ + intel_bios.o \ + intel_bw.o \ + intel_cdclk.o \ + intel_color.o \ + intel_combo_phy.o \ + intel_connector.o \ + intel_display.o \ + intel_display_power.o \ + intel_dpio_phy.o \ + intel_dpll_mgr.o \ + intel_fbc.o \ + intel_fifo_underrun.o \ + intel_frontbuffer.o \ + intel_hdcp.o \ + intel_hotplug.o \ + intel_lpe_audio.o \ + intel_overlay.o \ + intel_psr.o \ + intel_quirks.o \ + intel_sprite.o +i915-$(CONFIG_ACPI) += \ + intel_acpi.o \ + intel_opregion.o +i915-$(CONFIG_DRM_FBDEV_EMULATION) += \ + intel_fbdev.o + +# modesetting output/encoder code +i915-y += \ + dvo_ch7017.o \ + dvo_ch7xxx.o \ + dvo_ivch.o \ + dvo_ns2501.o \ + dvo_sil164.o \ + dvo_tfp410.o \ + icl_dsi.o \ + intel_crt.o \ + intel_ddi.o \ + intel_dp.o \ + intel_dp_aux_backlight.o \ + intel_dp_link_training.o \ + intel_dp_mst.o \ + intel_dsi.o \ + intel_dsi_dcs_backlight.o \ + intel_dsi_vbt.o \ + intel_dvo.o \ + intel_gmbus.o \ + intel_hdmi.o \ + intel_lspcon.o \ + intel_lvds.o \ + intel_panel.o \ + intel_sdvo.o \ + intel_tv.o \ + intel_vdsc.o \ + vlv_dsi.o \ + vlv_dsi_pll.o diff --git a/drivers/gpu/drm/i915/gem/Makefile b/drivers/gpu/drm/i915/gem/Makefile index 07e7b8b840ea..1d9da1287bef 100644 --- a/drivers/gpu/drm/i915/gem/Makefile +++ b/drivers/gpu/drm/i915/gem/Makefile @@ -1 +1,28 @@ include $(src)/Makefile.header-test # Extra header tests + +i915-y += \ + i915_gem_busy.o \ + i915_gem_clflush.o \ + i915_gem_client_blt.o \ + i915_gem_context.o \ + i915_gem_dmabuf.o \ + i915_gem_domain.o \ + i915_gem_execbuffer.o \ + i915_gem_fence.o \ + i915_gem_internal.o \ + i915_gem_object.o \ + i915_gem_object_blt.o \ + i915_gem_mman.o \ + i915_gem_pages.o \ + i915_gem_phys.o \ + i915_gem_pm.o \ + i915_gem_shmem.o \ + i915_gem_shrinker.o \ + i915_gem_stolen.o \ + i915_gem_throttle.o \ + i915_gem_tiling.o \ + i915_gem_userptr.o \ + i915_gem_wait.o \ + i915_gemfs.o + +i915-$(CONFIG_DRM_I915_SELFTEST) += selftests/ diff --git a/drivers/gpu/drm/i915/gem/selftests/Makefile b/drivers/gpu/drm/i915/gem/selftests/Makefile new file mode 100644 index 000000000000..80f96f51b623 --- /dev/null +++ b/drivers/gpu/drm/i915/gem/selftests/Makefile @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0-only + +i915-y += igt_gem_utils.o diff --git a/drivers/gpu/drm/i915/gt/Makefile b/drivers/gpu/drm/i915/gt/Makefile index 1c75b5c9790c..1a3401e7dde5 100644 --- a/drivers/gpu/drm/i915/gt/Makefile +++ b/drivers/gpu/drm/i915/gt/Makefile @@ -1,2 +1,18 @@ # Extra header tests include $(src)/Makefile.header-test + +i915-y += \ + intel_breadcrumbs.o \ + intel_context.o \ + intel_engine_cs.o \ + intel_engine_pm.o \ + intel_gt_pm.o \ + intel_hangcheck.o \ + intel_lrc.o \ + intel_reset.o \ + intel_ringbuffer.o \ + intel_mocs.o \ + intel_sseu.o \ + intel_workarounds.o +i915-$(CONFIG_DRM_I915_SELFTEST) += \ + mock_engine.o diff --git a/drivers/gpu/drm/i915/gvt/Makefile b/drivers/gpu/drm/i915/gvt/Makefile index ea8324abc784..2bd07b7935d3 100644 --- a/drivers/gpu/drm/i915/gvt/Makefile +++ b/drivers/gpu/drm/i915/gvt/Makefile @@ -1,9 +1,29 @@ # SPDX-License-Identifier: GPL-2.0 -GVT_DIR := gvt -GVT_SOURCE := gvt.o aperture_gm.o handlers.o vgpu.o trace_points.o firmware.o \ - interrupt.o gtt.o cfg_space.o opregion.o mmio.o display.o edid.o \ - execlist.o scheduler.o sched_policy.o mmio_context.o cmd_parser.o debugfs.o \ - fb_decoder.o dmabuf.o page_track.o ccflags-y += -I $(srctree)/$(src) -I $(srctree)/$(src)/$(GVT_DIR)/ -i915-y += $(addprefix $(GVT_DIR)/, $(GVT_SOURCE)) + +i915-y += \ + gvt.o \ + aperture_gm.o \ + handlers.o \ + vgpu.o \ + trace_points.o \ + firmware.o \ + interrupt.o \ + gtt.o \ + cfg_space.o \ + opregion.o \ + mmio.o \ + display.o \ + edid.o \ + execlist.o \ + scheduler.o \ + sched_policy.o \ + mmio_context.o \ + cmd_parser.o \ + debugfs.o \ + fb_decoder.o \ + dmabuf.o \ + page_track.o + +obj-$(CONFIG_DRM_I915_GVT_KVMGT) += kvmgt.o diff --git a/drivers/gpu/drm/i915/selftests/Makefile b/drivers/gpu/drm/i915/selftests/Makefile new file mode 100644 index 000000000000..19ca8e7b3b80 --- /dev/null +++ b/drivers/gpu/drm/i915/selftests/Makefile @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: GPL-2.0-only + +i915-y += \ + i915_random.o \ + i915_selftest.o \ + igt_flush_test.o \ + igt_live_test.o \ + igt_reset.o \ + igt_spinner.o