1# SPDX-License-Identifier: GPL-2.0
2ccflags-y := -I $(src)
3ccflags-y += -I $(obj)/generated
4ccflags-y += -I $(src)/disp/dpu1
5ccflags-$(CONFIG_DRM_MSM_DSI) += -I $(src)/dsi
6ccflags-$(CONFIG_DRM_MSM_DP) += -I $(src)/dp
7
8adreno-y := \
9	adreno/adreno_device.o \
10	adreno/adreno_gpu.o \
11	adreno/a2xx_catalog.o \
12	adreno/a2xx_gpu.o \
13	adreno/a2xx_gpummu.o \
14	adreno/a3xx_catalog.o \
15	adreno/a3xx_gpu.o \
16	adreno/a4xx_catalog.o \
17	adreno/a4xx_gpu.o \
18	adreno/a5xx_catalog.o \
19	adreno/a5xx_gpu.o \
20	adreno/a5xx_power.o \
21	adreno/a5xx_preempt.o \
22	adreno/a6xx_catalog.o \
23	adreno/a6xx_gpu.o \
24	adreno/a6xx_gmu.o \
25	adreno/a6xx_hfi.o \
26
27adreno-$(CONFIG_DEBUG_FS) += adreno/a5xx_debugfs.o \
28
29adreno-$(CONFIG_DRM_MSM_GPU_STATE)	+= adreno/a6xx_gpu_state.o
30
31msm-display-$(CONFIG_DRM_MSM_HDMI) += \
32	hdmi/hdmi.o \
33	hdmi/hdmi_audio.o \
34	hdmi/hdmi_bridge.o \
35	hdmi/hdmi_hpd.o \
36	hdmi/hdmi_i2c.o \
37	hdmi/hdmi_phy.o \
38	hdmi/hdmi_phy_8960.o \
39	hdmi/hdmi_phy_8996.o \
40	hdmi/hdmi_phy_8998.o \
41	hdmi/hdmi_phy_8x60.o \
42	hdmi/hdmi_phy_8x74.o \
43	hdmi/hdmi_pll_8960.o \
44
45msm-display-$(CONFIG_DRM_MSM_MDP4) += \
46	disp/mdp4/mdp4_crtc.o \
47	disp/mdp4/mdp4_dsi_encoder.o \
48	disp/mdp4/mdp4_dtv_encoder.o \
49	disp/mdp4/mdp4_lcdc_encoder.o \
50	disp/mdp4/mdp4_lvds_connector.o \
51	disp/mdp4/mdp4_lvds_pll.o \
52	disp/mdp4/mdp4_irq.o \
53	disp/mdp4/mdp4_kms.o \
54	disp/mdp4/mdp4_plane.o \
55
56msm-display-$(CONFIG_DRM_MSM_MDP5) += \
57	disp/mdp5/mdp5_cfg.o \
58	disp/mdp5/mdp5_cmd_encoder.o \
59	disp/mdp5/mdp5_ctl.o \
60	disp/mdp5/mdp5_crtc.o \
61	disp/mdp5/mdp5_encoder.o \
62	disp/mdp5/mdp5_irq.o \
63	disp/mdp5/mdp5_kms.o \
64	disp/mdp5/mdp5_pipe.o \
65	disp/mdp5/mdp5_mixer.o \
66	disp/mdp5/mdp5_plane.o \
67	disp/mdp5/mdp5_smp.o \
68
69msm-display-$(CONFIG_DRM_MSM_DPU) += \
70	disp/dpu1/dpu_core_perf.o \
71	disp/dpu1/dpu_crtc.o \
72	disp/dpu1/dpu_encoder.o \
73	disp/dpu1/dpu_encoder_phys_cmd.o \
74	disp/dpu1/dpu_encoder_phys_vid.o \
75	disp/dpu1/dpu_encoder_phys_wb.o \
76	disp/dpu1/dpu_formats.o \
77	disp/dpu1/dpu_hw_catalog.o \
78	disp/dpu1/dpu_hw_cdm.o \
79	disp/dpu1/dpu_hw_ctl.o \
80	disp/dpu1/dpu_hw_dsc.o \
81	disp/dpu1/dpu_hw_dsc_1_2.o \
82	disp/dpu1/dpu_hw_interrupts.o \
83	disp/dpu1/dpu_hw_intf.o \
84	disp/dpu1/dpu_hw_lm.o \
85	disp/dpu1/dpu_hw_pingpong.o \
86	disp/dpu1/dpu_hw_sspp.o \
87	disp/dpu1/dpu_hw_dspp.o \
88	disp/dpu1/dpu_hw_merge3d.o \
89	disp/dpu1/dpu_hw_top.o \
90	disp/dpu1/dpu_hw_util.o \
91	disp/dpu1/dpu_hw_vbif.o \
92	disp/dpu1/dpu_hw_wb.o \
93	disp/dpu1/dpu_kms.o \
94	disp/dpu1/dpu_plane.o \
95	disp/dpu1/dpu_rm.o \
96	disp/dpu1/dpu_vbif.o \
97	disp/dpu1/dpu_writeback.o
98
99msm-display-$(CONFIG_DRM_MSM_MDSS) += \
100	msm_mdss.o \
101
102msm-display-y += \
103	disp/mdp_format.o \
104	disp/mdp_kms.o \
105	disp/msm_disp_snapshot.o \
106	disp/msm_disp_snapshot_util.o \
107
108msm-y += \
109	msm_atomic.o \
110	msm_atomic_tracepoints.o \
111	msm_debugfs.o \
112	msm_drv.o \
113	msm_fb.o \
114	msm_fence.o \
115	msm_gem.o \
116	msm_gem_prime.o \
117	msm_gem_shrinker.o \
118	msm_gem_submit.o \
119	msm_gem_vma.o \
120	msm_gpu.o \
121	msm_gpu_devfreq.o \
122	msm_io_utils.o \
123	msm_iommu.o \
124	msm_kms.o \
125	msm_perf.o \
126	msm_rd.o \
127	msm_ringbuffer.o \
128	msm_submitqueue.o \
129	msm_gpu_tracepoints.o \
130
131msm-$(CONFIG_DRM_FBDEV_EMULATION) += msm_fbdev.o
132
133msm-display-$(CONFIG_DEBUG_FS) += \
134	dp/dp_debug.o
135
136msm-display-$(CONFIG_DRM_MSM_DP)+= dp/dp_aux.o \
137	dp/dp_catalog.o \
138	dp/dp_ctrl.o \
139	dp/dp_display.o \
140	dp/dp_drm.o \
141	dp/dp_link.o \
142	dp/dp_panel.o \
143	dp/dp_audio.o \
144	dp/dp_utils.o
145
146msm-display-$(CONFIG_DRM_MSM_HDMI_HDCP) += hdmi/hdmi_hdcp.o
147
148msm-display-$(CONFIG_DRM_MSM_DSI) += dsi/dsi.o \
149			dsi/dsi_cfg.o \
150			dsi/dsi_host.o \
151			dsi/dsi_manager.o \
152			dsi/phy/dsi_phy.o
153
154msm-display-$(CONFIG_DRM_MSM_DSI_28NM_PHY) += dsi/phy/dsi_phy_28nm.o
155msm-display-$(CONFIG_DRM_MSM_DSI_20NM_PHY) += dsi/phy/dsi_phy_20nm.o
156msm-display-$(CONFIG_DRM_MSM_DSI_28NM_8960_PHY) += dsi/phy/dsi_phy_28nm_8960.o
157msm-display-$(CONFIG_DRM_MSM_DSI_14NM_PHY) += dsi/phy/dsi_phy_14nm.o
158msm-display-$(CONFIG_DRM_MSM_DSI_10NM_PHY) += dsi/phy/dsi_phy_10nm.o
159msm-display-$(CONFIG_DRM_MSM_DSI_7NM_PHY) += dsi/phy/dsi_phy_7nm.o
160
161msm-y += $(adreno-y) $(msm-display-y)
162
163obj-$(CONFIG_DRM_MSM)	+= msm.o
164
165ifeq (y,$(CONFIG_DRM_MSM_VALIDATE_XML))
166	headergen-opts += --validate
167else
168	headergen-opts += --no-validate
169endif
170
171quiet_cmd_headergen = GENHDR  $@
172      cmd_headergen = mkdir -p $(obj)/generated && $(PYTHON3) $(src)/registers/gen_header.py \
173		      $(headergen-opts) --rnn $(src)/registers --xml $< c-defines > $@
174
175$(obj)/generated/%.xml.h: $(src)/registers/adreno/%.xml \
176		$(src)/registers/adreno/adreno_common.xml \
177		$(src)/registers/adreno/adreno_pm4.xml \
178		$(src)/registers/freedreno_copyright.xml \
179		$(src)/registers/gen_header.py \
180		$(src)/registers/rules-fd.xsd \
181		FORCE
182	$(call if_changed,headergen)
183
184$(obj)/generated/%.xml.h: $(src)/registers/display/%.xml \
185		$(src)/registers/freedreno_copyright.xml \
186		$(src)/registers/gen_header.py \
187		$(src)/registers/rules-fd.xsd \
188		FORCE
189	$(call if_changed,headergen)
190
191ADRENO_HEADERS = \
192	generated/a2xx.xml.h \
193	generated/a3xx.xml.h \
194	generated/a4xx.xml.h \
195	generated/a5xx.xml.h \
196	generated/a6xx.xml.h \
197	generated/a6xx_gmu.xml.h \
198	generated/adreno_common.xml.h \
199	generated/adreno_pm4.xml.h \
200
201DISPLAY_HEADERS = \
202	generated/dsi_phy_7nm.xml.h \
203	generated/dsi_phy_10nm.xml.h \
204	generated/dsi_phy_14nm.xml.h \
205	generated/dsi_phy_20nm.xml.h \
206	generated/dsi_phy_28nm_8960.xml.h \
207	generated/dsi_phy_28nm.xml.h \
208	generated/dsi.xml.h \
209	generated/hdmi.xml.h \
210	generated/mdp4.xml.h \
211	generated/mdp5.xml.h \
212	generated/mdp_common.xml.h \
213	generated/sfpb.xml.h
214
215$(addprefix $(obj)/,$(adreno-y)): $(addprefix $(obj)/,$(ADRENO_HEADERS))
216$(addprefix $(obj)/,$(msm-display-y)): $(addprefix $(obj)/,$(DISPLAY_HEADERS))
217
218targets += $(ADRENO_HEADERS) $(DISPLAY_HEADERS)
219