aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/ice4100/sgx535/Makefile
blob: 9d28cf5fa21b36543973f4587911fa6278b15801 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
#
# Makefile for the graphics hardware.  This driver provides support for the
# Power VR accelerated 2D and 3D cores

BUILD ?= release


DATE ?= $(shell date "+%a %B %d %Z %Y")
PVRVERSION_H = drivers/staging/ice4100/sgx535/include/pvrversion.h
PVRVERSION = $(shell grep "PVRVERSION_STRING" < $(PVRVERSION_H) | \
			 sed "s,.*\"\([0-9.]*\)\".*,\1,";)

PVRVERSION_MAJ		= $(shell echo $(PVRVERSION) | cut -d '.' -f1)
PVRVERSION_MIN		= $(shell echo $(PVRVERSION) | cut -d '.' -f2)
PVRVERSION_BRANCH	= $(shell echo $(PVRVERSION) | cut -d '.' -f3)
PVRVERSION_BUILD	= $(shell echo $(PVRVERSION) | cut -d '.' -f4,5,6)

PVR_BUILD_DIR ?= $(PWD)

# Defaults for useful things.
#
INTEL_D3_CHANGES ?= 1
INTEL_D3_PAD ?= 1
INTEL_D3_FLUSH ?= 1
INTEL_D3_DISABLE_TEXTURE_STREAM ?= 1
INTEL_D3_GDL ?= 0
INTEL_D3_NO_PCI_ENUM ?= 0
INTEL_D3_P_CHANGES ?= 1
INTEL_D3_CACHED_CBUF ?= 1
INTEL_D3_MEEGO ?= 1

SUPPORT_SECURE_FD_EXPORT	?= 0
TRANSFER_QUEUE ?= 1
SUPPORT_SGX_EVENT_OBJECT ?=1
SUPPORT_SECURE_HANDLES		?= 1
SUPPORT_SRVINIT = 1
SUPPORT_PERCONTEXT_PB = 1
DC_NOHW_WIDTH ?= 640
DC_NOHW_HEIGHT ?= 480

#OPTIM contains the optimisation level in timing and release builds
OPTIM = -O2

PDUMP ?= 0
SUPPORT_SGX ?= 1
SUPPORT_HW_RECOVERY ?= 1

SYS_USING_INTERRUPTS ?= 1

# CE4100 device information
SGXCORE = 535
CORE = -DSGX535 -DSGX_CORE_REV=121 -DSUPPORT_SGX535
SUPPORT_DRI_DRM ?= 1
SUPPORT_LINUX_X86_WRITECOMBINE ?= 1
SUPPORT_SGX_LOW_LATENCY_SCHEDULING ?=1
SUPPORT_LINUX_X86_PAT ?= 1
PVR_PROC_USE_SEQ_FILE ?= 1

SUPPORT_SECURE_DRM_AUTH_EXPORT ?= 0
SUPPORT_LIBDRM_LITE ?= 0
SUPPORT_PDUMP_DELAYED_INITPHASE_TERMINATION = 0
SUPPORT_LINUX_USING_WORKQUEUES ?= 0

# Thread support
USE_PTHREADS ?= 1
USE_GCC__thread_KEYWORD ?= 0
OPTIMISE_NON_NPTL_SINGLE_THREAD_TLS_LOOKUP ?= 0
DISABLE_THREADS ?= 0

#  Don't support HW recovery on debug builds
ifeq ("$(BUILD)", "debug")
DEBUG_LINUX_MEMORY_ALLOCATIONS ?= 1
DEBUG_LINUX_MEM_AREAS ?= 1
DEBUG_LINUX_MMAP_AREAS ?= 1
DEBUG_LINUX_XML_PROC_FILES ?= 0
DEBUG_LINUX_SLAB_ALLOCATIONS ?= 0
DEBUG_BRIDGE_KM ?= 1
DEBUG_TRACE_BRIDGE_KM ?= 0
DEBUG_BRIDGE_KM_DISPATCH_TABLE ?= 0
SUPPORT_HW_RECOVERY = 0
PVRSRV_LOG_MEMORY_ALLOCS ?= 0
PVRSRV_DEBUG_OS_MEMORY ?= 0
endif

# The standard CFLAGS macro can be overridden on the 'make' command line.  We
# put CBUILD in a separate macro so its setting doesn't get lost when a user
# *does* override CFLAGS.
#

CBUILD			=	-DPVR_BUILD_DIR="\"$(PVR_BUILD_DIR)\"" \
					-DPVR_BUILD_DATE="\"$(DATE)\"" \
					-DPVR_BUILD_TYPE="\"$(BUILD)\""

CBUILD.debug	= -DDEBUG
CBUILD.timing	= -DTIMING
CBUILD.release	= -DRELEASE
CFLAGS.debug	= -g -O0 -DDLL_METRIC=1
CFLAGS.timing	= $(OPTIM) -g -DDLL_METRIC=1 -DTIMING
CFLAGS.release	= $(OPTIM) -g
EXTRA_CFLAGS    = $(CFLAGS.$(BUILD))

SYS_CFLAGS += -DSERVICES4 -D_XOPEN_SOURCE=600 -DPVR2D_VALIDATE_INPUT_PARAMS

# Services module name
PVRSRV_MODNAME = pvrsrvkm
SYS_CFLAGS += -DPVRSRV_MODNAME="\"$(PVRSRV_MODNAME)"\"

# Automatically define C compiler macros for features possible (or not) in use.

SYS_CFLAGS.$(SUPPORT_SRVINIT)				+= -DSUPPORT_SRVINIT
SYS_CFLAGS.$(SUPPORT_LINUX_X86_PAT)			+= -DSUPPORT_LINUX_X86_PAT

SYS_CFLAGS.$(SUPPORT_SGX)					+= -DSUPPORT_SGX
SYS_CFLAGS.$(SUPPORT_XWS)					+= -DSUPPORT_XWS
SYS_CFLAGS.$(PDUMP)							+= -DPDUMP
SYS_CFLAGS.$(SUPPORT_POWER_MANAGEMENT)		+= -DSUPPORT_POWER_MANAGEMENT
SYS_CFLAGS.$(SUPPORT_BUFFER_CLASS)			+= -DSUPPORT_BUFFER_CLASS

SYS_CFLAGS.$(SUPPORT_PERCONTEXT_PB)			+= -DSUPPORT_PERCONTEXT_PB
SYS_CFLAGS.$(SUPPORT_DYNAMIC_PBRESIZE)		+= -DSUPPORT_DYNAMIC_PBRESIZE

SYS_CFLAGS.$(USE_FBDEV)						+= -DUSE_FBDEV
SYS_CFLAGS.$(USE_FBDEV)						+= -DFBDEV_NAME="\"$(FBDEV_NAME)\""
SYS_CFLAGS.$(SUPPORT_DYNAMIC_3DCLOCKGATING) += -DSUPPORT_DYNAMIC_3DCLOCKGATING
SYS_CFLAGS.$(REENTRANCY_PROTECTION)			+= -DREENTRANCY_PROTECTION
SYS_CFLAGS.$(SCHEDULER_CONTROL_SUPPORT) 	+= -DSCHEDULER_CONTROL_SUPPORT
SYS_CFLAGS.$(USE_IMG_POWER_DOMAIN_FUNCTION) += -DUSE_IMG_POWER_DOMAIN_FUNCTION

SYS_CFLAGS.$(USE_DMALLOC)					+= -DDMALLOC

SYS_CFLAGS.$(DEBUG_LINUX_MEMORY_ALLOCATIONS)	+= -DDEBUG_LINUX_MEMORY_ALLOCATIONS
SYS_CFLAGS.$(DEBUG_LINUX_MEM_AREAS)				+= -DDEBUG_LINUX_MEM_AREAS
SYS_CFLAGS.$(DEBUG_LINUX_MMAP_AREAS)			+= -DDEBUG_LINUX_MMAP_AREAS
SYS_CFLAGS.$(DEBUG_LINUX_XML_PROC_FILES)		+= -DDEBUG_LINUX_XML_PROC_FILES
SYS_CFLAGS.$(DEBUG_LINUX_SLAB_ALLOCATIONS)		+= -DDEBUG_LINUX_SLAB_ALLOCATIONS
SYS_CFLAGS.$(DEBUG_BRIDGE_KM)					+= -DDEBUG_BRIDGE_KM
SYS_CFLAGS.$(DEBUG_TRACE_BRIDGE_KM)				+= -DDEBUG_TRACE_BRIDGE_KM
SYS_CFLAGS.$(DEBUG_BRIDGE_KM_DISPATCH_TABLE)	+= -DDEBUG_BRIDGE_KM_DISPATCH_TABLE

SYS_CFLAGS.$(SUPPORT_LINUX_X86_WRITECOMBINE)	+= -DSUPPORT_LINUX_X86_WRITECOMBINE

SYS_CFLAGS.$(SGX_PDS_EVENTS_DISABLED)			+= -DSGX_PDS_EVENTS_DISABLED
SYS_CFLAGS.$(USE_SUPPORT_NO_TA3D_OVERLAP)		+= -DUSE_SUPPORT_NO_TA3D_OVERLAP
SYS_CFLAGS.$(SUPPORT_SGX_TILING)				+= -DSUPPORT_SGX_TILING
SYS_CFLAGS.$(TRANSFER_QUEUE)					+= -DTRANSFER_QUEUE

SYS_CFLAGS.$(SUPPORT_SGX_MMU_DUMMY_PAGE)		+= -DSUPPORT_SGX_MMU_DUMMY_PAGE

SYS_CFLAGS.$(PVRSRV_USSE_EDM_STATUS_DEBUG)		+= -DPVRSRV_USSE_EDM_STATUS_DEBUG

SYS_CFLAGS.$(PVRSRV_CLIENT_RESET_ON_HWTIMEOUT)		+= -DPVRSRV_CLIENT_RESET_ON_HWTIMEOUT
SYS_CFLAGS.$(PVRSRV_RESET_ON_HWTIMEOUT)			+= -DPVRSRV_RESET_ON_HWTIMEOUT

SYS_CFLAGS.$(NO_HARDWARE)						+= -DNO_HARDWARE

SYS_CFLAGS.$(SUPPORT_DRI_DRM)					+= -DSUPPORT_DRI_DRM
SYS_CFLAGS.$(SUPPORT_LIBDRM_LITE)				+= -DSUPPORT_LIBDRM_LITE
SYS_CFLAGS.$(PVR_PROC_USE_SEQ_FILE)				+= -DPVR_PROC_USE_SEQ_FILE

ifneq ("$(NO_HARDWARE)", "1")
SYS_CFLAGS.$(SYS_USING_INTERRUPTS)		+= -DSYS_USING_INTERRUPTS
SYS_CFLAGS.$(SUPPORT_HW_RECOVERY)		+= -DSUPPORT_HW_RECOVERY
SYS_CFLAGS.$(SUPPORT_ACTIVE_POWER_MANAGEMENT)	+= -DSUPPORT_ACTIVE_POWER_MANAGEMENT
endif

SYS_CFLAGS.$(SUPPORT_SECURE_HANDLES)	+= -DPVR_SECURE_HANDLES
SYS_CFLAGS.$(SUPPORT_SECURE_FD_EXPORT)  += -DPVR_SECURE_FD_EXPORT
SYS_CFLAGS.$(SUPPORT_SECURE_DRM_AUTH_EXPORT)	+= -DPVR_SECURE_DRM_AUTH_EXPORT

SYS_CFLAGS.$(USE_PTHREADS)				+= -DUSE_PTHREADS
SYS_CFLAGS.$(USE_GCC__thread_KEYWORD)	+= -DUSE_GCC__thread_KEYWORD
SYS_CFLAGS.$(OPTIMISE_NON_NPTL_SINGLE_THREAD_TLS_LOOKUP) += -DOPTIMISE_NON_NPTL_SINGLE_THREAD_TLS_LOOKUP
SYS_CFLAGS.$(DISABLE_THREADS)			+= -DDISABLE_THREADS
SYS_CFLAGS.$(SUPPORT_SGX_EVENT_OBJECT)			+= -DSUPPORT_SGX_EVENT_OBJECT
SYS_CFLAGS.$(SUPPORT_SGX_LOW_LATENCY_SCHEDULING)	+= -DSUPPORT_SGX_LOW_LATENCY_SCHEDULING
SYS_CFLAGS.$(LDM_PLATFORM)			+= -DLDM_PLATFORM
SYS_CFLAGS.$(LDM_PCI)				+= -DLDM_PCI
SYS_CFLAGS.$(PVR_MANUAL_POWER_CONTROL)		+= -DPVR_MANUAL_POWER_CONTROL

SYS_CFLAGS.$(PVR2D_ALT_2DHW)			+= -DPVR2D_ALT_2DHW

SYS_CFLAGS.$(SUPPORT_SGX_HWPERF)		+= -DSUPPORT_SGX_HWPERF

SYS_CFLAGS.$(SUPPORT_SLC)				+= -DSGX_FEATURE_SYSTEM_CACHE
SYS_CFLAGS.$(BYPASS_SLC)				+= -DSGX_BYPASS_SYSTEM_CACHE

SYS_CFLAGS.$(INTEL_D3_CHANGES)			+= -DINTEL_D3_CHANGES=1
SYS_CFLAGS.$(INTEL_D3_PAD)				+= -DINTEL_D3_PAD=1
SYS_CFLAGS.$(INTEL_D3_FLUSH)			+= -DINTEL_D3_FLUSH=1
SYS_CFLAGS.$(INTEL_D3_DISABLE_TEXTURE_STREAM)	+= -DINTEL_D3_DISABLE_TEXTURE_STREAM=1
SYS_CFLAGS.$(INTEL_D3_GDL)				+= -DINTEL_D3_GDL=1
SYS_CFLAGS.$(INTEL_D3_NO_PCI_ENUM)		+= -DINTEL_D3_NO_PCI_ENUM=1
SYS_CFLAGS.$(INTEL_D3_P_CHANGES)		+= -DINTEL_D3_P_CHANGES=1
SYS_CFLAGS.$(INTEL_D3_CACHED_CBUF)		+= -DINTEL_D3_CACHED_CBUF=1
SYS_CFLAGS.$(INTEL_D3_MEEGO)			+= -DINTEL_D3_MEEGO=1

SYS_CFLAGS.$(SUPPORT_PDUMP_DELAYED_INITPHASE_TERMINATION) += -DSUPPORT_PDUMP_DELAYED_INITPHASE_TERMINATION

SYS_CFLAGS.$(SUPPORT_LINUX_USING_WORKQUEUES) += -DPVR_LINUX_USING_WORKQUEUES \
						-DPVR_LINUX_MISR_USING_PRIVATE_WORKQUEUE \
						-DPVR_LINUX_TIMERS_USING_WORKQUEUES \
						-DSYS_CUSTOM_POWERLOCK_WRAP

SYS_CFLAGS += -DDEBUG_LOG_PATH_TRUNCATE=\"$(PVR_BUILD_DIR)\"

ALL_CFLAGS_kbuild	=	-DLINUX \
						$(CBUILD) $(CBUILD.$(BUILD)) \
						$(SYS_CFLAGS) $(SYS_CFLAGS.1) \
						$(MODULE_CFLAGS) $(MODULE_CFLAGS.$(BUILD)) \
						$(CORE) \
						$(EXTRA_CFLAGS)

ccflags-y := -Idrivers/staging/ice4100/sgx535 \
	-Idrivers/staging/ice4100/sgx535/include \
	-Idrivers/staging/ice4100/sgx535/include/env/linux \
	-Idrivers/staging/ice4100/sgx535/bridged \
	-Idrivers/staging/ice4100/sgx535/bridged/sgx \
	-Idrivers/staging/ice4100/sgx535/devices/sgx \
	-Idrivers/staging/ice4100/sgx535/system \
	-Idrivers/staging/ice4100/sgx535/system/include \
	-Idrivers/staging/ice4100/sgx535/system/sgx_intel_ce \
	-Idrivers/staging/ice4100/sgx535/hwdefs \
	-Idrivers/staging/ice4100/pal/include \
	$(ALL_CFLAGS_kbuild)

pvrsrvkm-y	:= osfunc.o \
	mmap.o \
	module.o \
	pdump.o \
	proc.o \
	pvr_bridge_k.o \
	pvr_debug.o \
	pvr_drm.o \
	mm.o \
	mutils.o \
	event.o \
	osperproc.o \
	common/buffer_manager.o \
	common/devicemem.o \
	common/deviceclass.o \
	common/handle.o \
	common/hash.o \
	common/lists.o \
	common/metrics.o \
	common/pvrsrv.o \
	common/queue.o \
	common/ra.o \
	common/resman.o \
	common/power.o \
	common/mem.o \
	common/pdump_common.o \
	common/perproc.o \
	bridged/bridged_support.o \
	bridged/bridged_pvr_bridge.o \
	bridged/sgx/bridged_sgx_bridge.o \
	devices/sgx/sgxinit.o \
	devices/sgx/sgxpower.o \
	devices/sgx/sgxreset.o \
	devices/sgx/sgxutils.o \
	devices/sgx/sgxkick.o \
	devices/sgx/sgxtransfer.o \
	devices/sgx/mmu.o \
	devices/sgx/pb.o \
	system/sgx_intel_ce/sysconfig.o \
	system/sgx_intel_ce/sysutils.o

obj-$(CONFIG_CE_SGX535) += pvrsrvkm.o