1 ########################################################################### ###
3 #@Title Root build configuration.
4 #@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
5 #@License Dual MIT/GPLv2
7 # The contents of this file are subject to the MIT license as set out below.
9 # Permission is hereby granted, free of charge, to any person obtaining a copy
10 # of this software and associated documentation files (the "Software"), to deal
11 # in the Software without restriction, including without limitation the rights
12 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 # copies of the Software, and to permit persons to whom the Software is
14 # furnished to do so, subject to the following conditions:
16 # The above copyright notice and this permission notice shall be included in
17 # all copies or substantial portions of the Software.
19 # Alternatively, the contents of this file may be used under the terms of
20 # the GNU General Public License Version 2 ("GPL") in which case the provisions
21 # of GPL are applicable instead of those above.
23 # If you wish to allow use of your version of this file only under the terms of
24 # GPL, and not to allow others to use your version of this file under the terms
25 # of the MIT license, indicate your decision by deleting the provisions above
26 # and replace them with the notice and other provisions required by GPL as set
27 # out in the file called "GPL-COPYING" included in this distribution. If you do
28 # not delete the provisions above, a recipient may use your version of this file
29 # under the terms of either the MIT license or GPL.
31 # This License is also included in this distribution in the file called
34 # EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
35 # PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
36 # BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
37 # PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
38 # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
39 # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
40 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
41 ### ###########################################################################
43 # Configuration wrapper for new build system. This file deals with
44 # configuration of the build. Add to this file anything that deals
45 # with switching driver options on/off and altering the defines or
46 # objects the build uses.
48 # At the end of this file is an exhaustive list of all variables
49 # that are passed between the platform/config stage and the generic
50 # build. PLEASE refrain from adding more variables than necessary
51 # to this stage -- almost all options can go through config.h.
54 # Sanity check: Make sure preconfig has been included
56 $(error TOP not defined: Was preconfig.mk included in root makefile?)
59 ################################# MACROS ####################################
61 ALL_TUNABLE_OPTIONS :=
63 # This records the config option's help text and default value. Note that
64 # the help text can't contain a literal comma. Use $(comma) instead.
65 define RegisterOptionHelp
66 ALL_TUNABLE_OPTIONS += $(1)
67 ifeq ($(INTERNAL_DESCRIPTION_FOR_$(1)),)
68 INTERNAL_DESCRIPTION_FOR_$(1) := $(3)
70 INTERNAL_CONFIG_DEFAULT_FOR_$(1) := $(2)
72 $(error Too many arguments in config option '$(1)' (stray comma in help text?)))
75 # Write out a kernel GNU make option.
77 define KernelConfigMake
78 $$(shell echo "override $(1) := $(2)" >>$(CONFIG_KERNEL_MK).new)
79 $(if $(filter config,$(D)),$(info KernelConfigMake $(1) := $(2) # $(if $($(1)),$(origin $(1)),default)))
82 # Write out a GNU make option for both user & kernel
85 $$(eval $$(call KernelConfigMake,$(1),$(2)))
86 $$(eval $$(call UserConfigMake,$(1),$(2)))
89 # Conditionally write out a kernel GNU make option
91 define _TunableKernelConfigMake
94 $$(eval $$(call KernelConfigMake,$(1),$$($(1))))
98 $$(eval $$(call KernelConfigMake,$(1),$(2)))
103 define TunableKernelConfigMake
104 $$(eval $$(call _TunableKernelConfigMake,$(1),$(2)))
105 $(call RegisterOptionHelp,$(1),$(2),$(3),$(4))
108 # Conditionally write out a GNU make option for both user & kernel
110 define TunableBothConfigMake
111 $$(eval $$(call _TunableKernelConfigMake,$(1),$(2)))
112 $$(eval $$(call _TunableUserConfigMake,$(1),$(2)))
113 $(call RegisterOptionHelp,$(1),$(2),$(3),$(4))
116 # Write out a kernel-only option
119 $$(shell echo "#define $(1) $(2)" >>$(CONFIG_KERNEL_H).new)
120 $(if $(filter config,$(D)),$(info KernelConfigC #define $(1) $(2) /* $(if $($(1)),$(origin $(1)),default) */),)
123 # Write out an option for both user & kernel
126 $$(eval $$(call KernelConfigC,$(1),$(2)))
127 $$(eval $$(call UserConfigC,$(1),$(2)))
130 # Conditionally write out a kernel-only option
132 define _TunableKernelConfigC
136 $$(eval $$(call KernelConfigC,$(1),))
138 $$(eval $$(call KernelConfigC,$(1),$$($(1))))
144 $$(eval $$(call KernelConfigC,$(1),))
146 $$(eval $$(call KernelConfigC,$(1),$(2)))
152 define TunableKernelConfigC
153 $$(eval $$(call _TunableKernelConfigC,$(1),$(2)))
154 ALL_TUNABLE_OPTIONS += $(1)
155 ifeq ($(INTERNAL_DESCRIPTION_FOR_$(1)),)
156 INTERNAL_DESCRIPTION_FOR_$(1) := $(3)
158 INTERNAL_CONFIG_DEFAULT_FOR_$(1) := $(2)
161 # Conditionally write out an option for both user & kernel
163 define TunableBothConfigC
164 $$(eval $$(call _TunableKernelConfigC,$(1),$(2)))
165 $$(eval $$(call _TunableUserConfigC,$(1),$(2)))
166 $(call RegisterOptionHelp,$(1),$(2),$(3),$(4))
169 # Use this to mark config options which have to exist, but aren't
170 # user-tunable. Warn if an attempt is made to change it.
172 define NonTunableOption
173 $(if $(filter command line environment,$(origin $(1))),\
174 $(error Changing '$(1)' is not supported))
177 ############################### END MACROS ##################################
179 # Check we have a new enough version of GNU make.
182 ifeq ($(filter $(need),$(firstword $(sort $(MAKE_VERSION) $(need)))),)
183 $(error A version of GNU make >= $(need) is required - this is version $(MAKE_VERSION))
186 # Decide whether we need a BVNC
187 ifneq ($(COMPILER_BVNC_LIST),)
188 DONT_NEED_RGX_BVNC := 1
193 # Infer PVR_BUILD_DIR from the directory configuration is launched from.
194 # Check anyway that such a directory exists.
196 PVR_BUILD_DIR := $(notdir $(abspath .))
197 $(call directory-must-exist,$(TOP)/build/linux/$(PVR_BUILD_DIR))
199 # Output directory for configuration, object code,
200 # final programs/libraries, and install/rc scripts.
203 ifneq ($(filter $(WINDOW_SYSTEM),xorg wayland nullws nulldrmws ews_drm nulladfws ews_adf),)
204 OUT ?= $(TOP)/binary_$(PVR_BUILD_DIR)_$(WINDOW_SYSTEM)_$(BUILD)
206 OUT ?= $(TOP)/binary_$(PVR_BUILD_DIR)_$(BUILD)
208 override OUT := $(if $(filter /%,$(OUT)),$(OUT),$(TOP)/$(OUT))
210 CONFIG_MK := $(OUT)/config.mk
211 CONFIG_H := $(OUT)/config.h
212 CONFIG_KERNEL_MK := $(OUT)/config_kernel.mk
213 CONFIG_KERNEL_H := $(OUT)/config_kernel.h
215 # Convert commas to spaces in $(D). This is so you can say "make
216 # D=config-changes,freeze-config" and have $(filter config-changes,$(D))
218 override D := $(subst $(comma),$(space),$(D))
220 # Create the OUT directory
222 $(shell mkdir -p $(OUT))
224 # Some targets don't need information about any modules. If we only specify
225 # these targets on the make command line, set INTERNAL_CLOBBER_ONLY to
226 # indicate that toplevel.mk shouldn't read any makefiles
227 CLOBBER_ONLY_TARGETS := clean clobber help install
228 INTERNAL_CLOBBER_ONLY :=
229 ifneq ($(strip $(MAKECMDGOALS)),)
230 INTERNAL_CLOBBER_ONLY := \
232 $(strip $(foreach _cmdgoal,$(MAKECMDGOALS),\
233 $(if $(filter $(_cmdgoal),$(CLOBBER_ONLY_TARGETS)),,x))),,true)
236 # For a clobber-only build, we shouldn't regenerate any config files
237 ifneq ($(INTERNAL_CLOBBER_ONLY),true)
239 -include ../config/user-defs.mk
245 # delete any previous intermediary files
247 for file in $(CONFIG_KERNEL_H).new $(CONFIG_KERNEL_MK).new ; do \
251 ifeq ($(DONT_NEED_RGX_BVNC),)
252 # Extract the BNC config name
253 RGX_BNC_SPLIT := $(subst .,$(space) ,$(RGX_BVNC))
254 RGX_BNC := $(word 1,$(RGX_BNC_SPLIT)).V.$(word 3,$(RGX_BNC_SPLIT)).$(word 4,$(RGX_BNC_SPLIT))
256 # Check BVNC core version
258 $(patsubst rgxcore_km_%.h,%,\
259 $(notdir $(shell ls $(TOP)/hwdefs/km/cores/rgxcore_km_*.h)))
260 ifeq ($(filter $(RGX_BVNC),$(ALL_KM_BVNCS)),)
261 $(error Error: Invalid Kernel core RGX_BVNC=$(RGX_BVNC). \
262 Valid Kernel core BVNCs: $(subst $(space),$(comma)$(space),$(ALL_KM_BVNCS)))
265 # Check if BVNC core file exist
266 RGX_BVNC_CORE_KM := $(TOP)/hwdefs/km/cores/rgxcore_km_$(RGX_BVNC).h
267 RGX_BVNC_CORE_KM_HEADER := \"cores/rgxcore_km_$(RGX_BVNC).h\"
268 # "rgxcore_km_$(RGX_BVNC).h"
269 ifeq ($(wildcard $(RGX_BVNC_CORE_KM)),)
270 $(error The file $(RGX_BVNC_CORE_KM) does not exist. \
271 Valid BVNCs: $(ALL_KM_BVNCS))
274 # Check BNC config version
276 $(patsubst rgxconfig_km_%.h,%,\
277 $(notdir $(shell ls $(TOP)/hwdefs/km/configs/rgxconfig_km_*.h)))
278 ifeq ($(filter $(RGX_BNC),$(ALL_KM_BNCS)),)
279 $(error Error: Invalid Kernel config RGX_BNC=$(RGX_BNC). \
280 Valid Kernel config BNCs: $(subst $(space),$(comma)$(space),$(ALL_KM_BNCS)))
283 # Check if BNC config file exist
284 RGX_BNC_CONFIG_KM := $(TOP)/hwdefs/km/configs/rgxconfig_km_$(RGX_BNC).h
285 RGX_BNC_CONFIG_KM_HEADER := \"configs/rgxconfig_km_$(RGX_BNC).h\"
286 #"rgxcore_km_$(RGX_BNC).h"
287 ifeq ($(wildcard $(RGX_BNC_CONFIG_KM)),)
288 $(error The file $(RGX_BNC_CONFIG_KM) does not exist. \
289 Valid BNCs: $(ALL_KM_BNCS))
293 # Enforced dependencies. Move this to an include.
295 SUPPORT_LINUX_USING_WORKQUEUES ?= 1
296 ifeq ($(SUPPORT_LINUX_USING_WORKQUEUES),1)
297 override PVR_LINUX_USING_WORKQUEUES := 1
298 override PVR_LINUX_MISR_USING_PRIVATE_WORKQUEUE := 1
299 override PVR_LINUX_TIMERS_USING_WORKQUEUES := 1
300 else ifeq ($(SUPPORT_LINUX_USING_SHARED_WORKQUEUES),1)
301 override PVR_LINUX_USING_WORKQUEUES := 1
302 override PVR_LINUX_MISR_USING_WORKQUEUE := 1
303 override PVR_LINUX_TIMERS_USING_SHARED_WORKQUEUE := 1
306 ifeq ($(NO_HARDWARE),1)
307 override SYS_USING_INTERRUPTS := 0
310 # Rather than requiring the user to have to define two variables (one quoted,
311 # one not), make PVRSRV_MODNAME a non-tunable and give it an overridable
314 PVRSRV_MODNAME ?= pvrsrvkm
316 MAX_POOL_PAGES ?= 10240
318 # Normally builds don't touch these, but we use them to influence the
319 # components list. Make sure these are defined early enough to make this
322 ifeq ($(SUPPORT_DRM),1)
323 SUPPORT_DISPLAY_CLASS := 0
325 ifeq ($(SUPPORT_ADF),1)
326 SUPPORT_DISPLAY_CLASS := 0
328 ifeq ($(SUPPORT_DC),1)
329 SUPPORT_DISPLAY_CLASS ?= 1
335 ifeq ($(DONT_NEED_RGX_BVNC),)
336 # we can only do this stuff if we have a BVNC
338 SUPPORT_RAY_TRACING := \
339 $(shell grep -qw RGX_FEATURE_RAY_TRACING $(RGX_BNC_CONFIG_KM) && echo 1)
342 $(shell grep -qw RGX_FEATURE_META_DMA_CHANNEL_COUNT $(RGX_BNC_CONFIG_KM) && echo 1)
345 # Default place for shared libraries
346 SHLIB_DESTDIR ?= /usr/lib
348 # Build's selected list of components.
349 # - components.mk is a per-build file that specifies the components that are
351 -include components.mk
353 # Set up the host and target compiler.
354 include ../config/compiler.mk
356 # PDUMP needs extra components
359 ifneq ($(COMPONENTS),)
362 ifeq ($(SUPPORT_DRM),1)
363 EXTRA_PVRSRVKM_COMPONENTS += dbgdrv
365 KERNEL_COMPONENTS += dbgdrv
369 # HWPerf KM Interface example
371 ifeq ($(SUPPORT_KERNEL_HWPERF_TEST),1)
372 KERNEL_COMPONENTS += rgxhwpdrv
375 # PVRGDB needs extra components
378 ifneq ($(COMPONENTS),)
379 COMPONENTS += pvrdebugger pvrgdb pvrdebugipc
381 override SUPPORT_EXPORTING_MEMORY_CONTEXT := 1
384 $(if $(filter config,$(D)),$(info Build configuration:))
386 ################################# CONFIG ####################################
388 ifneq ($(SUPPORT_NEUTRINO_PLATFORM), 1)
390 # If KERNELDIR is set, write it out to the config.mk, with
391 # KERNEL_COMPONENTS and KERNEL_ID
393 ifneq ($(strip $(KERNELDIR)),)
394 PVRSRV_MODULE_BASEDIR ?= /lib/modules/$(KERNEL_ID)/extra/
395 $(eval $(call BothConfigMake,KERNELDIR,$(KERNELDIR)))
396 $(eval $(call BothConfigMake,KERNEL_ID,$(KERNEL_ID)))
397 $(eval $(call KernelConfigMake,KERNEL_COMPONENTS,$(KERNEL_COMPONENTS)))
398 $(eval $(call TunableKernelConfigMake,EXTRA_PVRSRVKM_COMPONENTS,,\
399 List of components that should be built in to pvrsrvkm.ko$(comma) rather than_\
400 forming separate kernel modules._\
403 # If KERNEL_CROSS_COMPILE is set to "undef", this is magically
404 # equivalent to being unset. If it is unset, we use CROSS_COMPILE
405 # (which might also be unset). If it is set, use it directly.
406 ifneq ($(KERNEL_CROSS_COMPILE),undef)
407 KERNEL_CROSS_COMPILE ?= $(CROSS_COMPILE)
408 $(eval $(call TunableBothConfigMake,KERNEL_CROSS_COMPILE,))
411 # Check the KERNELDIR has a kernel built and also check that it is
412 # not 64-bit, which we do not support.
414 $(strip $(wildcard $(KERNELDIR)/include/linux/autoconf.h) \
415 $(wildcard $(KERNELDIR)/include/generated/autoconf.h))
416 ifeq ($(KERNEL_AUTOCONF),)
417 $(warning autoconf.h not found in $$(KERNELDIR)/include/linux \
418 or $$(KERNELDIR)/include/generated. Check your $$(KERNELDIR) variable \
419 and kernel configuration.)
422 $(if $(KERNEL_COMPONENTS),$(warning KERNELDIR is not set. Kernel components cannot be built))
427 # Normally this is off for Linux, and only used by Android, but if customers
428 # are testing their display engines using NULLADFWS, they need to enable it
429 # for dmabuf support under Linux. The sync header is needed by adf_pdp.
432 ifneq ($(SUPPORT_ION),0)
433 # Support kernels built out-of-tree with O=/other/path
434 # In those cases, KERNELDIR will be O, not the source tree.
435 ifneq ($(wildcard $(KERNELDIR)/source),)
436 KSRCDIR := $(KERNELDIR)/source
438 KSRCDIR := $(KERNELDIR)
440 ifneq ($(wildcard $(KSRCDIR)/drivers/staging/android/ion/ion.h),)
441 # The kernel has a more recent version of ion, located in drivers/staging.
442 # Change the default header paths and the behaviour wrt sg_dma_len.
443 PVR_ANDROID_ION_HEADER := \"../drivers/staging/android/ion/ion.h\"
444 PVR_ANDROID_ION_PRIV_HEADER := \"../drivers/staging/android/ion/ion_priv.h\"
445 PVR_ANDROID_ION_USE_SG_LENGTH := 1
447 ifneq ($(wildcard $(KSRCDIR)/drivers/staging/android/sync.h),)
448 # The kernel has a more recent version of the sync driver, located in
449 # drivers/staging. Change the default header path.
450 PVR_ANDROID_SYNC_HEADER := \"../drivers/staging/android/sync.h\"
452 $(eval $(call BothConfigMake,SUPPORT_ION,1))
453 $(eval $(call BothConfigC,SUPPORT_ION,))
454 $(eval $(call TunableKernelConfigC,PVR_ANDROID_ION_HEADER,\"linux/ion.h\"))
455 $(eval $(call TunableKernelConfigC,PVR_ANDROID_ION_PRIV_HEADER,\"../drivers/gpu/ion/ion_priv.h\"))
456 $(eval $(call TunableKernelConfigC,PVR_ANDROID_ION_USE_SG_LENGTH,))
457 $(eval $(call TunableKernelConfigC,PVR_ANDROID_SYNC_HEADER,\"linux/sync.h\"))
460 $(eval $(call UserConfigC,PVRSRV_MODULE_BASEDIR,\"$(PVRSRV_MODULE_BASEDIR)\"))
462 # Ideally configured by platform Makefiles, as necessary
465 $(if $(USE_CCACHE),$(if $(USE_DISTCC),$(error\
466 Enabling both USE_CCACHE and USE_DISTCC at the same time is not supported)))
468 # Invariant options for Linux
470 $(eval $(call BothConfigC,LINUX,))
472 $(eval $(call BothConfigC,PVR_BUILD_DIR,"\"$(PVR_BUILD_DIR)\""))
473 $(eval $(call BothConfigC,PVR_BUILD_TYPE,"\"$(BUILD)\""))
474 $(eval $(call BothConfigC,PVRSRV_MODNAME,"\"$(PVRSRV_MODNAME)\""))
475 $(eval $(call BothConfigMake,PVRSRV_MODNAME,$(PVRSRV_MODNAME)))
476 $(eval $(call BothConfigMake,PVR_BUILD_DIR,$(PVR_BUILD_DIR)))
477 $(eval $(call BothConfigMake,PVR_BUILD_TYPE,$(BUILD)))
479 $(eval $(call BothConfigC,SUPPORT_RGX,1))
480 $(eval $(call UserConfigMake,SUPPORT_RGX,1))
482 $(eval $(call BothConfigC,PVR_SECURE_HANDLES,))
483 $(eval $(call UserConfigC,PVR_TLS_USE_GCC__thread_KEYWORD,))
485 ifneq ($(DISPLAY_CONTROLLER),)
486 $(eval $(call BothConfigC,DISPLAY_CONTROLLER,$(DISPLAY_CONTROLLER)))
487 $(eval $(call BothConfigMake,DISPLAY_CONTROLLER,$(DISPLAY_CONTROLLER)))
490 $(eval $(call UserConfigC,OPK_DEFAULT,"\"$(OPK_DEFAULT)\""))
491 $(eval $(call UserConfigC,OPK_FALLBACK,"\"$(OPK_FALLBACK)\""))
493 $(eval $(call BothConfigMake,PVR_SYSTEM,$(PVR_SYSTEM)))
496 $(eval $(call UserConfigMake,LIB_IMG_EGL,pvr_dri_if))
498 $(eval $(call UserConfigMake,LIB_IMG_EGL,IMGegl))
501 # Build-type dependent options
503 $(eval $(call BothConfigMake,BUILD,$(BUILD)))
505 ifeq ($(BUILD),debug)
507 $(eval $(call BothConfigC,DEBUG,))
508 $(eval $(call KernelConfigC,DEBUG_LINUX_MEMORY_ALLOCATIONS,))
509 $(eval $(call KernelConfigC,DEBUG_LINUX_MEM_AREAS,))
510 $(eval $(call KernelConfigC,DEBUG_LINUX_MMAP_AREAS,))
511 $(eval $(call KernelConfigC,DEBUG_BRIDGE_KM,))
512 $(eval $(call KernelConfigC,DEBUG_HANDLEALLOC_KM,))
513 $(eval $(call UserConfigC,DLL_METRIC,1))
514 $(eval $(call TunableBothConfigC,RGXFW_ALIGNCHECKS,1))
515 $(eval $(call TunableBothConfigC,PVRSRV_DEBUG_CCB_MAX,))
516 else ifeq ($(BUILD),release)
517 $(eval $(call BothConfigC,RELEASE,))
518 $(eval $(call TunableBothConfigMake,DEBUGLINK,1))
519 $(eval $(call TunableBothConfigC,RGXFW_ALIGNCHECKS,))
520 else ifeq ($(BUILD),timing)
521 $(eval $(call BothConfigC,TIMING,))
522 $(eval $(call UserConfigC,DLL_METRIC,1))
523 $(eval $(call TunableBothConfigMake,DEBUGLINK,1))
525 $(error BUILD= must be either debug, release or timing)
530 # User-configurable options
532 ifeq ($(DONT_NEED_RGX_BVNC),)
533 $(eval $(call TunableBothConfigC,RGX_BVNC_CORE_KM_HEADER,))
534 $(eval $(call TunableBothConfigC,RGX_BNC_CONFIG_KM_HEADER,))
537 $(eval $(call TunableBothConfigC,SUPPORT_DBGDRV_EVENT_OBJECTS,1))
538 $(eval $(call TunableBothConfigC,PVR_DBG_BREAK_ASSERT_FAIL,,\
539 Enable this to treat PVR_DBG_BREAK as PVR_ASSERT(0)._\
540 Otherwise it is ignored._\
542 $(eval $(call TunableBothConfigC,PDUMP,,\
543 Enable parameter dumping in the driver._\
544 This adds code to record the parameters being sent to the hardware for_\
547 $(eval $(call TunableBothConfigC,NO_HARDWARE,,\
548 Disable hardware interactions (e.g. register writes) that the driver would_\
549 normally perform. A driver built with this option can$(apos)t drive hardware$(comma)_\
550 but with PDUMP enabled$(comma) it can capture parameters to be played back later._\
552 $(eval $(call TunableBothConfigC,PDUMP_DEBUG_OUTFILES,))
553 $(eval $(call TunableBothConfigC,SYS_USING_INTERRUPTS,1))
554 $(eval $(call TunableBothConfigC,PVRSRV_NEED_PVR_DPF,,\
555 Enable this to turn on PVR_DPF in release builds._\
557 $(eval $(call TunableBothConfigC,PVRSRV_NEED_PVR_ASSERT,,\
558 Enable this to turn on PVR_ASSERT in release builds._\
560 $(eval $(call TunableBothConfigC,PVRSRV_NEED_PVR_TRACE,,\
561 Enable this to turn on PVR_TRACE in release builds._\
563 $(eval $(call TunableBothConfigC,REFCOUNT_DEBUG,))
564 $(eval $(call TunableBothConfigC,DC_DEBUG,))
565 $(eval $(call TunableBothConfigC,SCP_DEBUG,))
566 $(eval $(call TunableBothConfigC,CACHEFLUSH_TYPE,CACHEFLUSH_GENERIC))
567 $(eval $(call TunableBothConfigC,SUPPORT_INSECURE_EXPORT,1))
568 $(eval $(call TunableBothConfigC,SUPPORT_SECURE_EXPORT,1,\
569 Enable support for secure device memory and sync export._\
570 This replaces export handles with file descriptors$(comma) which can be passed_\
571 between processes to share memory._\
573 $(eval $(call TunableBothConfigC,SUPPORT_PMMIF,))
574 $(eval $(call TunableBothConfigC,SUPPORT_GPUTRACE_EVENTS,))
575 $(eval $(call TunableBothConfigC,SUPPORT_KERNEL_HWPERF,))
576 $(eval $(call TunableBothConfigC,SUPPORT_DISPLAY_CLASS,))
577 $(eval $(call TunableBothConfigC,PVRSRV_DEBUG_CCB_MAX,))
578 $(eval $(call TunableBothConfigC,SUPPORT_TRUSTED_DEVICE,))
579 $(eval $(call TunableBothConfigC,TRUSTED_DEVICE_DEFAULT_ENABLED,))
580 $(eval $(call TunableBothConfigC,SUPPORT_EXPORTING_MEMORY_CONTEXT,))
581 $(eval $(call TunableBothConfigC,SUPPORT_USER_REGISTER_CONFIGURATION,))
582 $(eval $(call TunableBothConfigC,FIX_DUSTS_POW_ON_INIT,))
584 $(eval $(call TunableKernelConfigC,DEBUG_HANDLEALLOC_INFO_KM,))
585 $(eval $(call TunableKernelConfigC,SUPPORT_LINUX_X86_WRITECOMBINE,1))
586 $(eval $(call TunableKernelConfigC,SUPPORT_LINUX_X86_PAT,1))
587 $(eval $(call TunableKernelConfigC,PVRSRV_RESET_ON_HWTIMEOUT,))
588 $(eval $(call TunableKernelConfigC,PVR_LINUX_USING_WORKQUEUES,))
589 $(eval $(call TunableKernelConfigC,PVR_LINUX_MISR_USING_WORKQUEUE,))
590 $(eval $(call TunableKernelConfigC,PVR_LINUX_MISR_USING_PRIVATE_WORKQUEUE,))
591 $(eval $(call TunableKernelConfigC,PVR_LINUX_TIMERS_USING_WORKQUEUES,))
592 $(eval $(call TunableKernelConfigC,PVR_LINUX_TIMERS_USING_SHARED_WORKQUEUE,))
593 $(eval $(call TunableKernelConfigC,PVR_LDM_PLATFORM_PRE_REGISTERED,))
594 $(eval $(call TunableKernelConfigC,PVR_LDM_DRIVER_REGISTRATION_NAME,"\"$(PVRSRV_MODNAME)\""))
595 $(eval $(call TunableBothConfigC,LDM_PLATFORM,))
596 $(eval $(call TunableBothConfigC,LDM_PCI,))
597 $(eval $(call TunableBothConfigC,PVRSRV_ENABLE_FULL_SYNC_TRACKING,))
598 $(eval $(call TunableKernelConfigC,SYNC_DEBUG,))
599 $(eval $(call TunableKernelConfigC,SUPPORT_DUMP_CLIENT_CCB_COMMANDS,))
600 $(eval $(call TunableKernelConfigC,PVR_LINUX_DONT_USE_RANGE_BASED_INVALIDATE,))
601 $(eval $(call TunableKernelConfigC,PVR_MMAP_USE_VM_INSERT,))
602 $(eval $(call TunableKernelConfigC,SUPPORT_MMU_PxE_MAP_ON_DEMAND,))
603 $(eval $(call TunableKernelConfigC,SUPPORT_MMU_MODIFICATION_LOGGING,,\
604 Enable support for logging of page table modifications. This is as debug_\
605 feature for use when debugging page-faults which are showing what look to_\
606 be unexpected values. It keeps a history of the last few modifications types_\
607 (map/unmap) and the value written during as a result of that operation._\
609 $(eval $(call TunableKernelConfigC,SUPPORT_DC_COMPLETE_TIMEOUT_DEBUG,))
610 $(eval $(call TunableKernelConfigC,SUPPORT_SYSTEM_INTERRUPT_HANDLING,,\
611 Enable support for system level interrupt handling. This is intended_\
612 for use on systems that have two or more levels of interrupt registers_\
613 which require the top level register to be cleared by the system layer_\
614 because it is not specific to one single device._\
617 $(eval $(call TunableBothConfigC,SUPPORT_PVR_VALGRIND,))
623 ifneq ($(SUPPORT_ANDROID_PLATFORM),1)
627 $(eval $(call TunableBothConfigMake,CACHEFLUSH_TYPE,CACHEFLUSH_GENERIC))
628 $(eval $(call TunableBothConfigMake,PDUMP,))
629 $(eval $(call TunableBothConfigMake,SUPPORT_INSECURE_EXPORT,1))
630 $(eval $(call TunableBothConfigMake,SUPPORT_SECURE_EXPORT,1))
631 $(eval $(call TunableBothConfigMake,SUPPORT_PMMIF,))
632 $(eval $(call TunableBothConfigMake,SUPPORT_DISPLAY_CLASS,))
633 $(eval $(call TunableBothConfigMake,SUPPORT_RAY_TRACING,))
635 $(eval $(call TunableBothConfigMake,SUPPORT_GPUTRACE_EVENTS,))
636 $(eval $(call TunableBothConfigMake,SUPPORT_KERNEL_HWPERF,))
638 $(eval $(call TunableBothConfigMake,OPTIM,,\
639 Specify the optimisation flags passed to the compiler. Normally this_\
640 is autoconfigured based on the build type._\
642 $(eval $(call TunableBothConfigC,SUPPORT_MMU_FREELIST,))
643 $(eval $(call TunableBothConfigC,SUPPORT_VFP,))
645 $(eval $(call TunableBothConfigC,SUPPORT_META_SLAVE_BOOT,))
647 $(eval $(call UserConfigC,EGL_BASENAME_SUFFIX,\"$(EGL_BASENAME_SUFFIX)\"))
653 $(eval $(call TunableBothConfigC,PVR_TESTING_UTILS,,\
654 Enable this to build in support for testing the PVR Transport Layer API._\
658 TQ_CAPTURE_PARAMS ?= 1
660 $(eval $(call TunableBothConfigC,TDMETACODE,))
661 $(eval $(call TunableBothConfigC,PVR_DPF_ADHOC_DEBUG_ON,))
662 $(eval $(call TunableBothConfigC,RGXFW_DEBUG_LOG_GROUP,))
663 $(eval $(call TunableBothConfigC,SUPPORT_POWMON_WO_GPIO_PIN,))
666 $(eval $(call TunableKernelConfigMake,PVR_HANDLE_BACKEND,generic,\
667 Specifies the back-end that should be used$(comma) by the Services kernel handle_\
668 interface$(comma) to allocate handles. The available backends are:_\
669 * generic (OS agnostic)_\
670 * idr (Uses the Linux IDR interface)_\
674 $(eval $(call TunableBothConfigC,PVRSRV_ENABLE_PROCESS_STATS,1,\
675 Enable Process Statistics via DebugFS._\
678 $(eval $(call TunableKernelConfigC,SUPPORT_SHARED_SLC,,))
680 # PVR_RI_DEBUG is set to enable RI annotation of devmem allocations
681 # This is enabled by default for debug builds.
683 $(eval $(call TunableBothConfigMake,PVR_RI_DEBUG,))
684 $(eval $(call TunableBothConfigC,PVR_RI_DEBUG,,\
685 Enable Resource Information (RI) debug. This logs details of_\
686 resource allocations with annotation to help indicate their use._\
689 $(eval $(call TunableKernelConfigC,PVRSRV_ENABLE_MEMORY_STATS,,\
690 Enable Memory allocations to be recorded and published via Process Statistics._\
693 $(eval $(call TunableKernelConfigC,PVRSRV_ENABLE_FW_TRACE_DEBUGFS,,\
694 Enable automatic decoding of Firmware Trace via DebugFS._\
697 $(eval $(call TunableKernelConfigC,PVR_LINUX_PYSMEM_MAX_POOL_PAGES,"$(MAX_POOL_PAGES)"))
699 # ARM-Linux specific:
700 # When allocating uncached or write-combine memory we need to invalidate the
701 # CPU cache before we can use the acquired pages.
702 # The threshhold defines at which number of pages we want to do a full
703 # cache flush instead of invalidating pages one by one.
704 $(eval $(call TunableKernelConfigC,PVR_LINUX_ARM_PAGEALLOC_FLUSH_THRESHOLD, 256))
706 $(eval $(call TunableKernelConfigC,PVR_LINUX_VMALLOC_ALLOCATION_THRESHOLD, 16384 ))
708 # Tunable RGX_MAX_TA_SYNCS / RGX_MAX_3D_SYNCS to increase the size of sync array in the DDK
709 # If defined, these macros take up the values as defined in the environment,
710 # Else, the default value is taken up as defined in include/rgxapi.h
713 endif # INTERNAL_CLOBBER_ONLY
715 export INTERNAL_CLOBBER_ONLY
719 MAKE_ETC := -Rr --no-print-directory -C $(TOP) TOP=$(TOP) OUT=$(OUT) \
720 -f build/linux/toplevel.mk
722 # This must match the default value of MAKECMDGOALS below, and the default
723 # goal in toplevel.mk
724 .DEFAULT_GOAL := build
726 ifeq ($(MAKECMDGOALS),)
727 MAKECMDGOALS := build
729 # We can't pass autogen to toplevel.mk
730 MAKECMDGOALS := $(filter-out autogen,$(MAKECMDGOALS))
735 ifeq ($(INTERNAL_CLOBBER_ONLY),)
736 @$(MAKE) -s --no-print-directory -C $(TOP) \
737 -f build/linux/prepare_tree.mk \
739 LDM_PLATFORM=$(LDM_PLATFORM)
744 include ../config/help.mk
746 # This deletes built-in suffix rules. Otherwise the submake isn't run when
747 # saying e.g. "make thingy.a"
750 # Because we have a match-anything rule below, we'll run the main build when
751 # we're actually trying to remake various makefiles after they're read in.
752 # These rules try to prevent that
757 .PHONY: build kbuild install
758 build kbuild install: autogen
759 @$(if $(MAKECMDGOALS),$(MAKE) $(MAKE_ETC) $(MAKECMDGOALS) $(eval MAKECMDGOALS :=),:)
762 @$(if $(MAKECMDGOALS),$(MAKE) $(MAKE_ETC) $(MAKECMDGOALS) $(eval MAKECMDGOALS :=),:)