ENGR00156850 gpu-viv: add gpu-viv driver source
[wandboard.git] / drivers / mxc / gpu-viv / hal / kernel / inc / gc_hal_options.h
blobc33f8bd42fcbc0567c56f032f103948f629e7a06
1 /****************************************************************************
3 * Copyright (C) 2005 - 2011 by Vivante Corp.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the license, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 *****************************************************************************/
24 #ifndef __gc_hal_options_h_
25 #define __gc_hal_options_h_
28 gcdPRINT_VERSION
30 Print HAL version.
32 #ifndef gcdPRINT_VERSION
33 # define gcdPRINT_VERSION 0
34 #endif
37 USE_NEW_LINUX_SIGNAL
39 This define enables the Linux kernel signaling between kernel and user.
41 #ifndef USE_NEW_LINUX_SIGNAL
42 # define USE_NEW_LINUX_SIGNAL 0
43 #endif
46 NO_USER_DIRECT_ACCESS_FROM_KERNEL
48 This define enables the Linux kernel behavior accessing user memory.
50 #ifndef NO_USER_DIRECT_ACCESS_FROM_KERNEL
51 # define NO_USER_DIRECT_ACCESS_FROM_KERNEL 0
52 #endif
55 VIVANTE_PROFILER
57 This define enables the profiler.
59 #ifndef VIVANTE_PROFILER
60 # define VIVANTE_PROFILER 0
61 #endif
64 gcdUSE_VG
66 Enable VG HAL layer (only for GC350).
68 #ifndef gcdUSE_VG
69 # define gcdUSE_VG 0
70 #endif
73 USE_SW_FB
75 Set to 1 if the frame buffer memory cannot be accessed by the GPU.
77 #ifndef USE_SW_FB
78 # define USE_SW_FB 0
79 #endif
82 USE_SUPER_SAMPLING
84 This define enables super-sampling support.
86 #define USE_SUPER_SAMPLING 0
89 PROFILE_HAL_COUNTERS
91 This define enables HAL counter profiling support. HW and SHADER
92 counter profiling depends on this.
94 #ifndef PROFILE_HAL_COUNTERS
95 # define PROFILE_HAL_COUNTERS 1
96 #endif
99 PROFILE_HW_COUNTERS
101 This define enables HW counter profiling support.
103 #ifndef PROFILE_HW_COUNTERS
104 # define PROFILE_HW_COUNTERS 1
105 #endif
108 PROFILE_SHADER_COUNTERS
110 This define enables SHADER counter profiling support.
112 #ifndef PROFILE_SHADER_COUNTERS
113 # define PROFILE_SHADER_COUNTERS 1
114 #endif
117 COMMAND_PROCESSOR_VERSION
119 The version of the command buffer and task manager.
121 #define COMMAND_PROCESSOR_VERSION 1
124 gcdDUMP
126 When set to 1, a dump of all states and memory uploads, as well as other
127 hardware related execution will be printed to the debug console. This
128 data can be used for playing back applications.
130 #ifndef gcdDUMP
131 # define gcdDUMP 0
132 #endif
135 gcdDUMP_API
137 When set to 1, a high level dump of the EGL and GL/VG APs's are
138 captured.
140 #ifndef gcdDUMP_API
141 # define gcdDUMP_API 0
142 #endif
145 gcdDUMP_IN_KERNEL
147 When set to 1, all dumps will happen in the kernel. This is handy if
148 you want the kernel to dump its command buffers as well and the data
149 needs to be in sync.
151 #ifndef gcdDUMP_IN_KERNEL
152 # define gcdDUMP_IN_KERNEL 0
153 #endif
156 gcdDUMP_COMMAND
158 When set to non-zero, the command queue will dump all incoming command
159 and context buffers as well as all other modifications to the command
160 queue.
162 #ifndef gcdDUMP_COMMAND
163 # define gcdDUMP_COMMAND 0
164 #endif
167 gcdDUMP_FRAME_TGA
169 When set to a value other than 0, a dump of the frame specified by the value,
170 will be done into frame.tga. Frame count starts from 1.
172 #ifndef gcdDUMP_FRAME_TGA
173 #define gcdDUMP_FRAME_TGA 0
174 #endif
176 gcdNULL_DRIVER
178 Set to 1 for infinite speed hardware.
179 Set to 2 for bypassing the HAL.
180 Set to 3 for bypassing the drivers.
182 #ifndef gcdNULL_DRIVER
183 # define gcdNULL_DRIVER 0
184 #endif
187 gcdENABLE_TIMEOUT_DETECTION
189 Enable timeout detection.
191 #ifndef gcdENABLE_TIMEOUT_DETECTION
192 # define gcdENABLE_TIMEOUT_DETECTION 0
193 #endif
196 gcdCMD_BUFFER_SIZE
198 Number of bytes in a command buffer.
200 #ifndef gcdCMD_BUFFER_SIZE
201 # define gcdCMD_BUFFER_SIZE (128 << 10)
202 #endif
205 gcdCMD_BUFFERS
207 Number of command buffers to use per client.
209 #ifndef gcdCMD_BUFFERS
210 # define gcdCMD_BUFFERS 2
211 #endif
214 gcdMAX_CMD_BUFFERS
216 Maximum number of command buffers to use per client.
218 #ifndef gcdMAX_CMD_BUFFERS
219 # define gcdMAX_CMD_BUFFERS 8
220 #endif
223 gcdCOMMAND_QUEUES
225 Number of command queues in the kernel.
227 #ifndef gcdCOMMAND_QUEUES
228 # define gcdCOMMAND_QUEUES 2
229 #endif
232 gcdPOWER_CONTROL_DELAY
234 The delay in milliseconds required to wait until the GPU has woke up
235 from a suspend or power-down state. This is system dependent because
236 the bus clock also needs to stabalize.
238 #ifndef gcdPOWER_CONTROL_DELAY
239 # define gcdPOWER_CONTROL_DELAY 0
240 #endif
243 gcdMMU_SIZE
245 Size of the MMU page table in bytes. Each 4 bytes can hold 4kB worth of
246 virtual data.
248 #ifndef gcdMMU_SIZE
249 # define gcdMMU_SIZE (128 << 10)
250 #endif
253 gcdSECURE_USER
255 Use logical addresses instead of physical addresses in user land. In
256 this case a hint table is created for both command buffers and context
257 buffers, and that hint table will be used to patch up those buffers in
258 the kernel when they are ready to submit.
260 #ifndef gcdSECURE_USER
261 # define gcdSECURE_USER 0
262 #endif
265 gcdSECURE_CACHE_SLOTS
267 Number of slots in the logical to DMA address cache table. Each time a
268 logical address needs to be translated into a DMA address for the GPU,
269 this cache will be walked. The replacement scheme is LRU.
271 #ifndef gcdSECURE_CACHE_SLOTS
272 # define gcdSECURE_CACHE_SLOTS 1024
273 #endif
276 gcdSECURE_CACHE_METHOD
278 Replacement scheme used for Secure Cache. The following options are
279 available:
281 gcdSECURE_CACHE_LRU
282 A standard LRU cache.
284 gcdSECURE_CACHE_LINEAR
285 A linear walker with the idea that an application will always
286 render the scene in a similar way, so the next entry in the
287 cache should be a hit most of the time.
289 gcdSECURE_CACHE_HASH
290 A 256-entry hash table.
292 gcdSECURE_CACHE_TABLE
293 A simple cache but with potential of a lot of cache replacement.
295 #ifndef gcdSECURE_CACHE_METHOD
296 # define gcdSECURE_CACHE_METHOD gcdSECURE_CACHE_HASH
297 #endif
300 gcdREGISTER_ACCESS_FROM_USER
302 Set to 1 to allow IOCTL calls to get through from user land. This
303 should only be in debug or development drops.
305 #ifndef gcdREGISTER_ACCESS_FROM_USER
306 # define gcdREGISTER_ACCESS_FROM_USER 1
307 #endif
310 gcdHEAP_SIZE
312 Set the allocation size for the internal heaps. Each time a heap is
313 full, a new heap will be allocated with this minmimum amount of bytes.
314 The bigger this size, the fewer heaps there are to allocate, the better
315 the performance. However, heaps won't be freed until they are
316 completely free, so there might be some more memory waste if the size is
317 too big.
319 #ifndef gcdHEAP_SIZE
320 # define gcdHEAP_SIZE (64 << 10)
321 #endif
324 gcdPOWER_MANAGEMENT
326 This define enables the power management code.
328 #ifndef gcdPOWER_MANAGEMENT
329 # define gcdPOWER_MANAGEMENT 1
330 #endif
333 gcdFPGA_BUILD
335 This define enables work arounds for FPGA images.
337 #ifndef gcdFPGA_BUILD
338 # define gcdFPGA_BUILD 0
339 #endif
342 gcdGPU_TIMEOUT
344 This define specified the number of milliseconds the system will wait
345 before it broadcasts the GPU is stuck. In other words, it will define
346 the timeout of any operation that needs to wait for the GPU.
348 If the value is 0, no timeout will be checked for.
350 #ifndef gcdGPU_TIMEOUT
351 # if gcdFPGA_BUILD
352 # define gcdGPU_TIMEOUT 0
353 # else
354 # define gcdGPU_TIMEOUT 2000
355 # endif
356 #endif
359 gcdGPU_ADVANCETIMER
361 it is advance timer.
363 #ifndef gcdGPU_ADVANCETIMER
364 # define gcdGPU_ADVANCETIMER 250
365 #endif
368 gcdSTATIC_LINK
370 This define disalbes static linking;
372 #ifndef gcdSTATIC_LINK
373 # define gcdSTATIC_LINK 0
374 #endif
377 gcdUSE_NEW_HEAP
379 Setting this define to 1 enables new heap.
381 #ifndef gcdUSE_NEW_HEAP
382 # define gcdUSE_NEW_HEAP 0
383 #endif
386 gcdCMD_NO_2D_CONTEXT
388 This define enables no-context 2D command buffer.
390 #ifndef gcdCMD_NO_2D_CONTEXT
391 # define gcdCMD_NO_2D_CONTEXT 1
392 #endif
395 gcdENABLE_BANK_ALIGNMENT
397 When enabled, video memory is allocated bank aligned. The vendor can modify
398 gckOS_GetSurfaceBankAlignment() and gcoOS_GetBankOffsetBytes() to define how
399 different types of allocations are bank and channel aligned.
400 When disabled (default), no bank alignment is done.
402 #ifndef gcdENABLE_BANK_ALIGNMENT
403 # define gcdENABLE_BANK_ALIGNMENT 0
404 #endif
407 gcdDYNAMIC_SPEED
409 When non-zero, it informs the kernel driver to use the speed throttling
410 broadcasting functions to inform the system the GPU should be spet up or
411 slowed down. It will send a broadcast for slowdown each "interval"
412 specified by this define in milliseconds
413 (gckOS_BroadcastCalibrateSpeed).
415 #ifndef gcdDYNAMIC_SPEED
416 # define gcdDYNAMIC_SPEED 2000
417 #endif
420 gcdDYNAMIC_EVENT_THRESHOLD
422 When non-zero, it specifies the maximum number of available events at
423 which the kernel driver will issue a broadcast to speed up the GPU
424 (gckOS_BroadcastHurry).
426 #ifndef gcdDYNAMIC_EVENT_THRESHOLD
427 # define gcdDYNAMIC_EVENT_THRESHOLD 5
428 #endif
431 gcdENABLE_PROFILING
433 Enable profiling macros.
435 #ifndef gcdENABLE_PROFILING
436 # define gcdENABLE_PROFILING 0
437 #endif
440 gcdENABLE_128B_MERGE
442 Enable 128B merge for the BUS control.
444 #ifndef gcdENABLE_128B_MERGE
445 # define gcdENABLE_128B_MERGE 0
446 #endif
449 gcdFRAME_DB
451 When non-zero, it specified the number of frames inside the frame
452 database. The frame DB will collect per-frame timestamps and hardware
453 counters.
455 #ifndef gcdFRAME_DB
456 # define gcdFRAME_DB 0
457 # define gcdFRAME_DB_RESET 0
458 # define gcdFRAME_DB_NAME "/var/log/frameDB.log"
459 #endif
462 gcdENABLE_VG
463 enable the 2D openVG
466 #ifndef gcdENABLE_VG
467 # define gcdENABLE_VG 0
468 #endif
471 gcdPAGED_MEMORY_CACHEABLE
473 When non-zero, paged memory will be cacheable.
476 #ifndef gcdPAGED_MEMORY_CACHEABLE
477 # define gcdPAGED_MEMORY_CACHEABLE 0
478 #endif
481 gcdNONPAGED_MEMORY_CACHEABLE
483 When non-zero, non paged memory will be cacheable.
486 #ifndef gcdNONPAGED_MEMORY_CACHEABLE
487 # define gcdNONPAGED_MEMORY_CACHEABLE 0
488 #endif
491 gcdNONPAGED_MEMORY_BUFFERABLE
493 When non-zero, non paged memory will be bufferable.
494 gcdNONPAGED_MEMORY_BUFFERABLE and gcdNONPAGED_MEMORY_CACHEABLE
495 can't be set 1 at same time
498 #ifndef gcdNONPAGED_MEMORY_BUFFERABLE
499 # define gcdNONPAGED_MEMORY_BUFFERABLE 1
500 #endif
503 gcdENABLE_INFINITE_SPEED_HW
504 enable the Infinte HW , this is for 2D openVG
507 #ifndef gcdENABLE_INFINITE_SPEED_HW
508 # define gcdENABLE_INFINITE_SPEED_HW 0
509 #endif
512 gcdENABLE_TS_DOUBLE_BUFFER
513 enable the TS double buffer, this is for 2D openVG
516 #ifndef gcdENABLE_TS_DOUBLE_BUFFER
517 # define gcdENABLE_TS_DOUBLE_BUFFER 1
518 #endif
522 gcdENABLE_SHARED_INFO
524 When non-zero, enable process store some shared data in kernel
525 which can be got by other processes
527 #ifndef gcdENABLE_SHARED_INFO
528 # define gcdENABLE_SHARED_INFO 1
529 #endif
532 gcd6000_SUPPORT
534 Temporary define to enable/disable 6000 support.
536 #ifndef gcd6000_SUPPORT
537 # define gcd6000_SUPPORT 0
538 #endif
541 gcdPOWEROFF_TIMEOUT
543 When non-zero, GPU will power off automatically after idle
544 state lasting for gcdPOWEROFF_TIMEOUT milliseconds.
547 #ifndef gcdPOWEROFF_TIMEOUT
548 # define gcdPOWEROFF_TIMEOUT 5000
549 #endif
552 gcdUSE_VIDMEM_PER_PID
554 #ifndef gcdUSE_VIDMEM_PER_PID
555 # define gcdUSE_VIDMEM_PER_PID 0
556 #endif
559 QNX_SINGLE_THREADED_DEBUGGING
561 #ifndef QNX_SINGLE_THREADED_DEBUGGING
562 # define QNX_SINGLE_THREADED_DEBUGGING 0
563 #endif
566 gcdENABLE_RECOVERY
568 This define enables the recovery code.
570 #ifndef gcdENABLE_RECOVERY
571 # define gcdENABLE_RECOVERY 0
572 #endif
574 #endif /* __gc_hal_options_h_ */