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_
32 #ifndef gcdPRINT_VERSION
33 # define gcdPRINT_VERSION 0
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
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
57 This define enables the profiler.
59 #ifndef VIVANTE_PROFILER
60 # define VIVANTE_PROFILER 0
66 Enable VG HAL layer (only for GC350).
75 Set to 1 if the frame buffer memory cannot be accessed by the GPU.
84 This define enables super-sampling support.
86 #define USE_SUPER_SAMPLING 0
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
101 This define enables HW counter profiling support.
103 #ifndef PROFILE_HW_COUNTERS
104 # define PROFILE_HW_COUNTERS 1
108 PROFILE_SHADER_COUNTERS
110 This define enables SHADER counter profiling support.
112 #ifndef PROFILE_SHADER_COUNTERS
113 # define PROFILE_SHADER_COUNTERS 1
117 COMMAND_PROCESSOR_VERSION
119 The version of the command buffer and task manager.
121 #define COMMAND_PROCESSOR_VERSION 1
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.
137 When set to 1, a high level dump of the EGL and GL/VG APs's are
141 # define gcdDUMP_API 0
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
151 #ifndef gcdDUMP_IN_KERNEL
152 # define gcdDUMP_IN_KERNEL 0
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
162 #ifndef gcdDUMP_COMMAND
163 # define gcdDUMP_COMMAND 0
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
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
187 gcdENABLE_TIMEOUT_DETECTION
189 Enable timeout detection.
191 #ifndef gcdENABLE_TIMEOUT_DETECTION
192 # define gcdENABLE_TIMEOUT_DETECTION 0
198 Number of bytes in a command buffer.
200 #ifndef gcdCMD_BUFFER_SIZE
201 # define gcdCMD_BUFFER_SIZE (128 << 10)
207 Number of command buffers to use per client.
209 #ifndef gcdCMD_BUFFERS
210 # define gcdCMD_BUFFERS 2
216 Maximum number of command buffers to use per client.
218 #ifndef gcdMAX_CMD_BUFFERS
219 # define gcdMAX_CMD_BUFFERS 8
225 Number of command queues in the kernel.
227 #ifndef gcdCOMMAND_QUEUES
228 # define gcdCOMMAND_QUEUES 2
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
245 Size of the MMU page table in bytes. Each 4 bytes can hold 4kB worth of
249 # define gcdMMU_SIZE (128 << 10)
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
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
276 gcdSECURE_CACHE_METHOD
278 Replacement scheme used for Secure Cache. The following options are
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.
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
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
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
320 # define gcdHEAP_SIZE (64 << 10)
326 This define enables the power management code.
328 #ifndef gcdPOWER_MANAGEMENT
329 # define gcdPOWER_MANAGEMENT 1
335 This define enables work arounds for FPGA images.
337 #ifndef gcdFPGA_BUILD
338 # define gcdFPGA_BUILD 0
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
352 # define gcdGPU_TIMEOUT 0
354 # define gcdGPU_TIMEOUT 2000
363 #ifndef gcdGPU_ADVANCETIMER
364 # define gcdGPU_ADVANCETIMER 250
370 This define disalbes static linking;
372 #ifndef gcdSTATIC_LINK
373 # define gcdSTATIC_LINK 0
379 Setting this define to 1 enables new heap.
381 #ifndef gcdUSE_NEW_HEAP
382 # define gcdUSE_NEW_HEAP 0
388 This define enables no-context 2D command buffer.
390 #ifndef gcdCMD_NO_2D_CONTEXT
391 # define gcdCMD_NO_2D_CONTEXT 1
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
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
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
433 Enable profiling macros.
435 #ifndef gcdENABLE_PROFILING
436 # define gcdENABLE_PROFILING 0
442 Enable 128B merge for the BUS control.
444 #ifndef gcdENABLE_128B_MERGE
445 # define gcdENABLE_128B_MERGE 0
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
456 # define gcdFRAME_DB 0
457 # define gcdFRAME_DB_RESET 0
458 # define gcdFRAME_DB_NAME "/var/log/frameDB.log"
467 # define gcdENABLE_VG 0
471 gcdPAGED_MEMORY_CACHEABLE
473 When non-zero, paged memory will be cacheable.
476 #ifndef gcdPAGED_MEMORY_CACHEABLE
477 # define gcdPAGED_MEMORY_CACHEABLE 0
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
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
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
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
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
534 Temporary define to enable/disable 6000 support.
536 #ifndef gcd6000_SUPPORT
537 # define gcd6000_SUPPORT 0
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
552 gcdUSE_VIDMEM_PER_PID
554 #ifndef gcdUSE_VIDMEM_PER_PID
555 # define gcdUSE_VIDMEM_PER_PID 0
559 QNX_SINGLE_THREADED_DEBUGGING
561 #ifndef QNX_SINGLE_THREADED_DEBUGGING
562 # define QNX_SINGLE_THREADED_DEBUGGING 0
568 This define enables the recovery code.
570 #ifndef gcdENABLE_RECOVERY
571 # define gcdENABLE_RECOVERY 0
574 #endif /* __gc_hal_options_h_ */