]> git.karo-electronics.de Git - karo-tx-linux.git/blob - drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h
420437f514bcefaa0c0d6ce28f5622afd30994b8
[karo-tx-linux.git] / drivers / mxc / gpu-viv / hal / kernel / inc / gc_hal_options.h
1 /****************************************************************************
2 *
3 *    Copyright (C) 2005 - 2013 by Vivante Corp.
4 *
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.
9 *
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.
14 *
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.
18 *
19 *****************************************************************************/
20
21
22 #ifndef __gc_hal_options_h_
23 #define __gc_hal_options_h_
24
25 /*
26     gcdPRINT_VERSION
27
28         Print HAL version.
29 */
30 #ifndef gcdPRINT_VERSION
31 #   define gcdPRINT_VERSION                     0
32 #endif
33
34 /*
35     USE_NEW_LINUX_SIGNAL
36
37         This define enables the Linux kernel signaling between kernel and user.
38 */
39 #ifndef USE_NEW_LINUX_SIGNAL
40 #   define USE_NEW_LINUX_SIGNAL                 0
41 #endif
42
43 /*
44     VIVANTE_PROFILER
45
46         This define enables the profiler.
47 */
48 #ifndef VIVANTE_PROFILER
49 #   define VIVANTE_PROFILER                     1
50 #endif
51
52 #ifndef VIVANTE_PROFILER_PERDRAW
53 #   define  VIVANTE_PROFILER_PERDRAW    0
54 #endif
55
56 /*
57     VIVANTE_PROFILER_CONTEXT
58
59         This define enables the profiler according to each hw context.
60 */
61 #ifndef VIVANTE_PROFILER_CONTEXT
62 #   define VIVANTE_PROFILER_CONTEXT             1
63 #endif
64
65 /*
66     gcdUSE_VG
67
68         Enable VG HAL layer (only for GC350).
69 */
70 #ifndef gcdUSE_VG
71 #   define gcdUSE_VG                            0
72 #endif
73
74 /*
75     USE_SW_FB
76
77         Set to 1 if the frame buffer memory cannot be accessed by the GPU.
78 */
79 #ifndef USE_SW_FB
80 #   define USE_SW_FB                            0
81 #endif
82
83 /*
84     USE_SUPER_SAMPLING
85
86         This define enables super-sampling support.
87 */
88 #define USE_SUPER_SAMPLING                      0
89
90 /*
91     PROFILE_HAL_COUNTERS
92
93         This define enables HAL counter profiling support.  HW and SHADER
94         counter profiling depends on this.
95 */
96 #ifndef PROFILE_HAL_COUNTERS
97 #   define PROFILE_HAL_COUNTERS                 1
98 #endif
99
100 /*
101     PROFILE_HW_COUNTERS
102
103         This define enables HW counter profiling support.
104 */
105 #ifndef PROFILE_HW_COUNTERS
106 #   define PROFILE_HW_COUNTERS                  1
107 #endif
108
109 /*
110     PROFILE_SHADER_COUNTERS
111
112         This define enables SHADER counter profiling support.
113 */
114 #ifndef PROFILE_SHADER_COUNTERS
115 #   define PROFILE_SHADER_COUNTERS              1
116 #endif
117
118 /*
119     COMMAND_PROCESSOR_VERSION
120
121         The version of the command buffer and task manager.
122 */
123 #define COMMAND_PROCESSOR_VERSION               1
124
125 /*
126     gcdDUMP_KEY
127
128         Set this to a string that appears in 'cat /proc/<pid>/cmdline'. E.g. 'camera'.
129         HAL will create dumps for the processes matching this key.
130 */
131 #ifndef gcdDUMP_KEY
132 #   define gcdDUMP_KEY                          "process"
133 #endif
134
135 /*
136     gcdDUMP_PATH
137
138         The dump file location. Some processes cannot write to the sdcard.
139         Try apps' data dir, e.g. /data/data/com.android.launcher
140 */
141 #ifndef gcdDUMP_PATH
142 #if defined(ANDROID)
143 #   define gcdDUMP_PATH                         "/mnt/sdcard/"
144 #else
145 #   define gcdDUMP_PATH                         "./"
146 #endif
147 #endif
148
149 /*
150     gcdDUMP
151
152         When set to 1, a dump of all states and memory uploads, as well as other
153         hardware related execution will be printed to the debug console.  This
154         data can be used for playing back applications.
155 */
156 #ifndef gcdDUMP
157 #   define gcdDUMP                              0
158 #endif
159
160 /*
161     gcdDUMP_API
162
163         When set to 1, a high level dump of the EGL and GL/VG APs's are
164         captured.
165 */
166 #ifndef gcdDUMP_API
167 #   define gcdDUMP_API                          0
168 #endif
169
170 /*
171     gcdDUMP_FRAMERATE
172         When set to a value other than zero, averaqe frame rate will be dumped.
173         The value set is the starting frame that the average will be calculated.
174         This is needed because sometimes first few frames are too slow to be included
175         in the average. Frame count starts from 1.
176 */
177 #ifndef gcdDUMP_FRAMERATE
178 #   define gcdDUMP_FRAMERATE                                    0
179 #endif
180
181 /*
182     gcdVIRTUAL_COMMAND_BUFFER
183         When set to 1, user command buffer and context buffer will be allocated
184         from gcvPOOL_VIRTUAL.
185 */
186 #ifndef gcdVIRTUAL_COMMAND_BUFFER
187 #   define gcdVIRTUAL_COMMAND_BUFFER            0
188 #endif
189
190 /*
191     gcdENABLE_FSCALE_VAL_ADJUST
192         When non-zero, FSCALE_VAL when gcvPOWER_ON can be adjusted externally.
193  */
194 #ifndef gcdENABLE_FSCALE_VAL_ADJUST
195 #   define gcdENABLE_FSCALE_VAL_ADJUST          1
196 #endif
197
198 /*
199     gcdDUMP_IN_KERNEL
200
201         When set to 1, all dumps will happen in the kernel.  This is handy if
202         you want the kernel to dump its command buffers as well and the data
203         needs to be in sync.
204 */
205 #ifndef gcdDUMP_IN_KERNEL
206 #   define gcdDUMP_IN_KERNEL                    0
207 #endif
208
209 /*
210     gcdDUMP_COMMAND
211
212         When set to non-zero, the command queue will dump all incoming command
213         and context buffers as well as all other modifications to the command
214         queue.
215 */
216 #ifndef gcdDUMP_COMMAND
217 #   define gcdDUMP_COMMAND                      0
218 #endif
219
220 /*
221     gcdDUMP_FRAME_TGA
222
223     When set to a value other than 0, a dump of the frame specified by the value,
224     will be done into frame.tga. Frame count starts from 1.
225  */
226 #ifndef gcdDUMP_FRAME_TGA
227 #define gcdDUMP_FRAME_TGA                       0
228 #endif
229 /*
230     gcdNULL_DRIVER
231
232     Set to 1 for infinite speed hardware.
233     Set to 2 for bypassing the HAL.
234     Set to 3 for bypassing the drivers.
235 */
236 #ifndef gcdNULL_DRIVER
237 #   define gcdNULL_DRIVER                       0
238 #endif
239
240 /*
241     gcdENABLE_TIMEOUT_DETECTION
242
243         Enable timeout detection.
244 */
245 #ifndef gcdENABLE_TIMEOUT_DETECTION
246 #   define gcdENABLE_TIMEOUT_DETECTION          0
247 #endif
248
249 /*
250     gcdCMD_BUFFER_SIZE
251
252         Number of bytes in a command buffer.
253 */
254 #ifndef gcdCMD_BUFFER_SIZE
255 #   define gcdCMD_BUFFER_SIZE                   (128 << 10)
256 #endif
257
258 /*
259     gcdCMD_BUFFERS
260
261         Number of command buffers to use per client.
262 */
263 #ifndef gcdCMD_BUFFERS
264 #   define gcdCMD_BUFFERS                       2
265 #endif
266
267 /*
268     gcdMAX_CMD_BUFFERS
269
270         Maximum number of command buffers to use per client.
271 */
272 #ifndef gcdMAX_CMD_BUFFERS
273 #   define gcdMAX_CMD_BUFFERS                   8
274 #endif
275
276 /*
277     gcdCOMMAND_QUEUES
278
279         Number of command queues in the kernel.
280 */
281 #ifndef gcdCOMMAND_QUEUES
282 #   define gcdCOMMAND_QUEUES                    2
283 #endif
284
285 /*
286     gcdPOWER_CONTROL_DELAY
287
288         The delay in milliseconds required to wait until the GPU has woke up
289         from a suspend or power-down state.  This is system dependent because
290         the bus clock also needs to stabalize.
291 */
292 #ifndef gcdPOWER_CONTROL_DELAY
293 #   define gcdPOWER_CONTROL_DELAY               0
294 #endif
295
296 /*
297     gcdMIRROR_PAGETABLE
298
299         Enable it when GPUs with old MMU and new MMU exist at same SoC. It makes
300         each GPU use same virtual address to access same physical memory.
301 */
302 #ifndef gcdMIRROR_PAGETABLE
303 #   define gcdMIRROR_PAGETABLE                  0
304 #endif
305
306 /*
307     gcdMMU_SIZE
308
309         Size of the MMU page table in bytes.  Each 4 bytes can hold 4kB worth of
310         virtual data.
311 */
312 #ifndef gcdMMU_SIZE
313 #if gcdMIRROR_PAGETABLE
314 #   define gcdMMU_SIZE                          0x200000
315 #else
316 #   define gcdMMU_SIZE                          (2048 << 10)
317 #endif
318 #endif
319
320 /*
321     gcdSECURE_USER
322
323         Use logical addresses instead of physical addresses in user land.  In
324         this case a hint table is created for both command buffers and context
325         buffers, and that hint table will be used to patch up those buffers in
326         the kernel when they are ready to submit.
327 */
328 #ifndef gcdSECURE_USER
329 #   define gcdSECURE_USER                       0
330 #endif
331
332 /*
333     gcdSECURE_CACHE_SLOTS
334
335         Number of slots in the logical to DMA address cache table.  Each time a
336         logical address needs to be translated into a DMA address for the GPU,
337         this cache will be walked.  The replacement scheme is LRU.
338 */
339 #ifndef gcdSECURE_CACHE_SLOTS
340 #   define gcdSECURE_CACHE_SLOTS                1024
341 #endif
342
343 /*
344     gcdSECURE_CACHE_METHOD
345
346         Replacement scheme used for Secure Cache.  The following options are
347         available:
348
349             gcdSECURE_CACHE_LRU
350                 A standard LRU cache.
351
352             gcdSECURE_CACHE_LINEAR
353                 A linear walker with the idea that an application will always
354                 render the scene in a similar way, so the next entry in the
355                 cache should be a hit most of the time.
356
357             gcdSECURE_CACHE_HASH
358                 A 256-entry hash table.
359
360             gcdSECURE_CACHE_TABLE
361                 A simple cache but with potential of a lot of cache replacement.
362 */
363 #ifndef gcdSECURE_CACHE_METHOD
364 #   define gcdSECURE_CACHE_METHOD               gcdSECURE_CACHE_HASH
365 #endif
366
367 /*
368     gcdREGISTER_ACCESS_FROM_USER
369
370         Set to 1 to allow IOCTL calls to get through from user land.  This
371         should only be in debug or development drops.
372 */
373 #ifndef gcdREGISTER_ACCESS_FROM_USER
374 #   define gcdREGISTER_ACCESS_FROM_USER         1
375 #endif
376
377 /*
378     gcdUSER_HEAP_ALLOCATOR
379
380         Set to 1 to enable user mode heap allocator for fast memory allocation
381         and destroying. Otherwise, memory allocation/destroying in user mode
382         will be directly managed by system. Only for linux for now.
383 */
384 #ifndef gcdUSER_HEAP_ALLOCATOR
385 #   define gcdUSER_HEAP_ALLOCATOR               1
386 #endif
387
388 /*
389     gcdHEAP_SIZE
390
391         Set the allocation size for the internal heaps.  Each time a heap is
392         full, a new heap will be allocated with this minmimum amount of bytes.
393         The bigger this size, the fewer heaps there are to allocate, the better
394         the performance.  However, heaps won't be freed until they are
395         completely free, so there might be some more memory waste if the size is
396         too big.
397 */
398 #ifndef gcdHEAP_SIZE
399 #   define gcdHEAP_SIZE                         (64 << 10)
400 #endif
401
402 /*
403     gcdPOWER_SUSNPEND_WHEN_IDLE
404
405         Set to 1 to make GPU enter gcvPOWER_SUSPEND when idle detected,
406         otherwise GPU will enter gcvPOWER_IDLE.
407 */
408 #ifndef gcdPOWER_SUSNPEND_WHEN_IDLE
409 #   define gcdPOWER_SUSNPEND_WHEN_IDLE          1
410 #endif
411
412 /*
413     gcdFPGA_BUILD
414
415         This define enables work arounds for FPGA images.
416 */
417 #ifndef gcdFPGA_BUILD
418 #   define gcdFPGA_BUILD                        0
419 #endif
420
421 /*
422     gcdGPU_TIMEOUT
423
424         This define specified the number of milliseconds the system will wait
425         before it broadcasts the GPU is stuck.  In other words, it will define
426         the timeout of any operation that needs to wait for the GPU.
427
428         If the value is 0, no timeout will be checked for.
429 */
430 #ifndef gcdGPU_TIMEOUT
431 #if gcdFPGA_BUILD
432 #       define gcdGPU_TIMEOUT                   0
433 #   else
434 #       define gcdGPU_TIMEOUT                   20000
435 #   endif
436 #endif
437
438 /*
439     gcdGPU_ADVANCETIMER
440
441         it is advance timer.
442 */
443 #ifndef gcdGPU_ADVANCETIMER
444 #   define gcdGPU_ADVANCETIMER                  250
445 #endif
446
447 /*
448     gcdSTATIC_LINK
449
450         This define disalbes static linking;
451 */
452 #ifndef gcdSTATIC_LINK
453 #   define gcdSTATIC_LINK                       0
454 #endif
455
456 /*
457     gcdUSE_NEW_HEAP
458
459         Setting this define to 1 enables new heap.
460 */
461 #ifndef gcdUSE_NEW_HEAP
462 #   define gcdUSE_NEW_HEAP                      0
463 #endif
464
465 /*
466     gcdCMD_NO_2D_CONTEXT
467
468         This define enables no-context 2D command buffer.
469 */
470 #ifndef gcdCMD_NO_2D_CONTEXT
471 #   define gcdCMD_NO_2D_CONTEXT                 1
472 #endif
473
474 /*
475     gcdENABLE_BANK_ALIGNMENT
476
477     When enabled, video memory is allocated bank aligned. The vendor can modify
478     _GetSurfaceBankAlignment() and gcoSURF_GetBankOffsetBytes() to define how
479     different types of allocations are bank and channel aligned.
480     When disabled (default), no bank alignment is done.
481 */
482 #ifndef gcdENABLE_BANK_ALIGNMENT
483 #   define gcdENABLE_BANK_ALIGNMENT             0
484 #endif
485
486 /*
487     gcdBANK_BIT_START
488
489     Specifies the start bit of the bank (inclusive).
490 */
491 #ifndef gcdBANK_BIT_START
492 #   define gcdBANK_BIT_START                    12
493 #endif
494
495 /*
496     gcdBANK_BIT_END
497
498     Specifies the end bit of the bank (inclusive).
499 */
500 #ifndef gcdBANK_BIT_END
501 #   define gcdBANK_BIT_END                      14
502 #endif
503
504 /*
505     gcdBANK_CHANNEL_BIT
506
507     When set, video memory when allocated bank aligned is allocated such that
508     render and depth buffer addresses alternate on the channel bit specified.
509     This option has an effect only when gcdENABLE_BANK_ALIGNMENT is enabled.
510     When disabled (default), no alteration is done.
511 */
512 #ifndef gcdBANK_CHANNEL_BIT
513 #   define gcdBANK_CHANNEL_BIT                  7
514 #endif
515
516 /*
517     gcdDYNAMIC_SPEED
518
519         When non-zero, it informs the kernel driver to use the speed throttling
520         broadcasting functions to inform the system the GPU should be spet up or
521         slowed down. It will send a broadcast for slowdown each "interval"
522         specified by this define in milliseconds
523         (gckOS_BroadcastCalibrateSpeed).
524 */
525 #ifndef gcdDYNAMIC_SPEED
526 #    define gcdDYNAMIC_SPEED                    2000
527 #endif
528
529 /*
530     gcdDYNAMIC_EVENT_THRESHOLD
531
532         When non-zero, it specifies the maximum number of available events at
533         which the kernel driver will issue a broadcast to speed up the GPU
534         (gckOS_BroadcastHurry).
535 */
536 #ifndef gcdDYNAMIC_EVENT_THRESHOLD
537 #    define gcdDYNAMIC_EVENT_THRESHOLD          5
538 #endif
539
540 /*
541     gcdENABLE_PROFILING
542
543         Enable profiling macros.
544 */
545 #ifndef gcdENABLE_PROFILING
546 #   define gcdENABLE_PROFILING                  0
547 #endif
548
549 /*
550     gcdENABLE_128B_MERGE
551
552         Enable 128B merge for the BUS control.
553 */
554 #ifndef gcdENABLE_128B_MERGE
555 #   define gcdENABLE_128B_MERGE                 0
556 #endif
557
558 /*
559     gcdFRAME_DB
560
561         When non-zero, it specified the number of frames inside the frame
562         database. The frame DB will collect per-frame timestamps and hardware
563         counters.
564 */
565 #ifndef gcdFRAME_DB
566 #   define gcdFRAME_DB                          0
567 #   define gcdFRAME_DB_RESET                    0
568 #   define gcdFRAME_DB_NAME                     "/var/log/frameDB.log"
569 #endif
570
571 /*
572     gcdENABLE_VG
573             enable the 2D openVG
574 */
575
576 #ifndef gcdENABLE_VG
577 #   define gcdENABLE_VG                         0
578 #endif
579
580 /*
581     gcdDYNAMIC_MAP_RESERVED_MEMORY
582
583         When gcvPOOL_SYSTEM is constructed from RESERVED memory,
584         driver can map the whole reserved memory to kernel space
585         at the beginning, or just map a piece of memory when need
586         to access.
587
588         Notice:
589         -  It's only for the 2D openVG. For other cores, there is
590            _NO_ need to map reserved memory to kernel.
591         -  It's meaningless when memory is allocated by
592            gckOS_AllocateContiguous, in that case, memory is always
593            mapped by system when allocated.
594 */
595 #ifndef gcdDYNAMIC_MAP_RESERVED_MEMORY
596 #   define gcdDYNAMIC_MAP_RESERVED_MEMORY      1
597 #endif
598
599 /*
600    gcdPAGED_MEMORY_CACHEABLE
601
602         When non-zero, paged memory will be cacheable.
603
604         Normally, driver will detemines whether a video memory
605         is cacheable or not. When cacheable is not neccessary,
606         it will be writecombine.
607
608         This option is only for those SOC which can't enable
609         writecombine without enabling cacheable.
610 */
611
612 #ifndef gcdPAGED_MEMORY_CACHEABLE
613 #   define gcdPAGED_MEMORY_CACHEABLE            0
614 #endif
615
616 /*
617    gcdNONPAGED_MEMORY_CACHEABLE
618
619         When non-zero, non paged memory will be cacheable.
620 */
621
622 #ifndef gcdNONPAGED_MEMORY_CACHEABLE
623 #   define gcdNONPAGED_MEMORY_CACHEABLE         0
624 #endif
625
626 /*
627    gcdNONPAGED_MEMORY_BUFFERABLE
628
629         When non-zero, non paged memory will be bufferable.
630         gcdNONPAGED_MEMORY_BUFFERABLE and gcdNONPAGED_MEMORY_CACHEABLE
631         can't be set 1 at same time
632 */
633
634 #ifndef gcdNONPAGED_MEMORY_BUFFERABLE
635 #   define gcdNONPAGED_MEMORY_BUFFERABLE        1
636 #endif
637
638 /*
639     gcdENABLE_INFINITE_SPEED_HW
640             enable the Infinte HW , this is for 2D openVG
641 */
642
643 #ifndef gcdENABLE_INFINITE_SPEED_HW
644 #   define gcdENABLE_INFINITE_SPEED_HW          0
645 #endif
646
647 /*
648     gcdENABLE_TS_DOUBLE_BUFFER
649             enable the TS double buffer, this is for 2D openVG
650 */
651
652 #ifndef gcdENABLE_TS_DOUBLE_BUFFER
653 #   define gcdENABLE_TS_DOUBLE_BUFFER           1
654 #endif
655
656 /*
657     gcd6000_SUPPORT
658
659     Temporary define to enable/disable 6000 support.
660  */
661 #ifndef gcd6000_SUPPORT
662 #   define gcd6000_SUPPORT                      0
663 #endif
664
665 /*
666     gcdPOWEROFF_TIMEOUT
667
668         When non-zero, GPU will power off automatically from
669         idle state, and gcdPOWEROFF_TIMEOUT is also the default
670         timeout in milliseconds.
671  */
672
673 #ifndef gcdPOWEROFF_TIMEOUT
674 #   define gcdPOWEROFF_TIMEOUT                  300
675 #endif
676
677 /*
678     gcdUSE_VIDMEM_PER_PID
679 */
680 #ifndef gcdUSE_VIDMEM_PER_PID
681 #   define gcdUSE_VIDMEM_PER_PID                0
682 #endif
683
684 /*
685     QNX_SINGLE_THREADED_DEBUGGING
686 */
687 #ifndef QNX_SINGLE_THREADED_DEBUGGING
688 #   define QNX_SINGLE_THREADED_DEBUGGING        0
689 #endif
690
691 /*
692     gcdENABLE_RECOVERY
693
694         This define enables the recovery code.
695 */
696 #ifndef gcdENABLE_RECOVERY
697 #   define gcdENABLE_RECOVERY                   1
698 #endif
699
700 /*
701     gcdRENDER_THREADS
702
703         Number of render threads. Make it zero, and there will be no render
704         threads.
705 */
706 #ifndef gcdRENDER_THREADS
707 #   define gcdRENDER_THREADS                    0
708 #endif
709
710 /*
711     gcdSMP
712
713         This define enables SMP support.
714
715         Currently, it only works on Linux/Android,
716         Kbuild will config it according to whether
717         CONFIG_SMP is set.
718
719 */
720 #ifndef gcdSMP
721 #   define gcdSMP                               0
722 #endif
723
724 /*
725     gcdSUPPORT_SWAP_RECTANGLE
726
727         Support swap with a specific rectangle.
728
729         Set the rectangle with eglSetSwapRectangleANDROID api.
730 */
731 #ifndef gcdSUPPORT_SWAP_RECTANGLE
732 #   define gcdSUPPORT_SWAP_RECTANGLE            0
733 #endif
734
735 /*
736     gcdGPU_LINEAR_BUFFER_ENABLED
737
738         Use linear buffer for GPU apps so HWC can do 2D composition.
739 */
740 #ifndef gcdGPU_LINEAR_BUFFER_ENABLED
741 #   define gcdGPU_LINEAR_BUFFER_ENABLED         1
742 #endif
743
744 /*
745     gcdENABLE_RENDER_INTO_WINDOW
746
747         Enable Render-Into-Window (ie, No-Resolve) feature on android.
748         NOTE that even if enabled, it still depends on hardware feature and
749         android application behavior. When hardware feature or application
750         behavior can not support render into window mode, it will fail back
751         to normal mode.
752         When Render-Into-Window is finally used, window back buffer of android
753         applications will be allocated matching render target tiling format.
754         Otherwise buffer tiling is decided by the above option
755         'gcdGPU_LINEAR_BUFFER_ENABLED'.
756 */
757 #ifndef gcdENABLE_RENDER_INTO_WINDOW
758 #   define gcdENABLE_RENDER_INTO_WINDOW         1
759 #endif
760
761 /*
762     gcdSHARED_RESOLVE_BUFFER_ENABLED
763
764         Use shared resolve buffer for all app buffers.
765 */
766 #ifndef gcdSHARED_RESOLVE_BUFFER_ENABLED
767 #   define gcdSHARED_RESOLVE_BUFFER_ENABLED         0
768 #endif
769
770 /*
771      gcdUSE_TRIANGLE_STRIP_PATCH
772  */
773 #ifndef gcdUSE_TRIANGLE_STRIP_PATCH
774 #   define gcdUSE_TRIANGLE_STRIP_PATCH            1
775 #endif
776
777 /*
778     gcdENABLE_OUTER_CACHE_PATCH
779
780         Enable the outer cache patch.
781 */
782 #ifndef gcdENABLE_OUTER_CACHE_PATCH
783 #   define gcdENABLE_OUTER_CACHE_PATCH          0
784 #endif
785
786 #ifndef gcdANDROID_UNALIGNED_LINEAR_COMPOSITION_ADJUST
787 #   ifdef ANDROID
788 #      define  gcdANDROID_UNALIGNED_LINEAR_COMPOSITION_ADJUST    1
789 #   else
790 #      define  gcdANDROID_UNALIGNED_LINEAR_COMPOSITION_ADJUST    0
791 #   endif
792 #endif
793
794 #ifndef gcdENABLE_PE_DITHER_FIX
795 #   define gcdENABLE_PE_DITHER_FIX              1
796 #endif
797
798 #ifndef gcdSHARED_PAGETABLE
799 #   define gcdSHARED_PAGETABLE                  1
800 #endif
801 #ifndef gcdUSE_PVR
802 #   define gcdUSE_PVR                                   1
803 #endif
804
805 /*
806     gcdSMALL_BLOCK_SIZE
807
808         When non-zero, a part of VIDMEM will be reserved for requests
809         whose requesting size is less than gcdSMALL_BLOCK_SIZE.
810
811         For Linux, it's the size of a page. If this requeset fallbacks
812         to gcvPOOL_CONTIGUOUS or gcvPOOL_VIRTUAL, memory will be wasted
813         because they allocate a page at least.
814  */
815 #ifndef gcdSMALL_BLOCK_SIZE
816 #   define gcdSMALL_BLOCK_SIZE                  4096
817 #   define gcdRATIO_FOR_SMALL_MEMORY            32
818 #endif
819
820 /*
821     gcdCONTIGUOUS_SIZE_LIMIT
822         When non-zero, size of video node from gcvPOOL_CONTIGUOUS is
823         limited by gcdCONTIGUOUS_SIZE_LIMIT.
824  */
825 #ifndef gcdCONTIGUOUS_SIZE_LIMIT
826 #   define gcdCONTIGUOUS_SIZE_LIMIT             0
827 #endif
828
829 #ifndef gcdDISALBE_EARLY_EARLY_Z
830 #   define gcdDISALBE_EARLY_EARLY_Z             1
831 #endif
832
833 #ifndef gcdSHADER_SRC_BY_MACHINECODE
834 #   define gcdSHADER_SRC_BY_MACHINECODE         1
835 #endif
836
837 /*
838     gcdLINK_QUEUE_SIZE
839
840         When non-zero, driver maintains a queue to record information of
841         latest lined context buffer and command buffer. Data in this queue
842         is be used to debug.
843 */
844 #ifndef gcdLINK_QUEUE_SIZE
845 #   define gcdLINK_QUEUE_SIZE                  0
846 #endif
847
848 /*  gcdALPHA_KILL_IN_SHADER
849  *
850  *  Enable alpha kill inside the shader. This will be set automatically by the
851  *  HAL if certain states match a criteria.
852  */
853 #ifndef gcdALPHA_KILL_IN_SHADER
854 #   define gcdALPHA_KILL_IN_SHADER              1
855 #endif
856
857 /*  gcdHIGH_PRECISION_DELAY_ENABLE
858  *
859  *  Enable high precision schedule delay with 1ms unit. otherwise schedule delay up to 10ms.
860  *  Browser app performance will have obvious drop without this enablement
861  */
862 #ifndef gcdHIGH_PRECISION_DELAY_ENABLE
863 #   define gcdHIGH_PRECISION_DELAY_ENABLE        1
864 #endif
865
866 #ifndef gcdUSE_WCLIP_PATCH
867 #   define gcdUSE_WCLIP_PATCH                   1
868 #endif
869
870 #ifndef gcdHZ_L2_DISALBE
871 #   define gcdHZ_L2_DISALBE                     1
872 #endif
873
874 #ifndef gcdBUGFIX15_DISABLE
875 #   define gcdBUGFIX15_DISABLE                  1
876 #endif
877
878 #ifndef gcdDISABLE_HZ_FAST_CLEAR
879 #   define gcdDISABLE_HZ_FAST_CLEAR             1
880 #endif
881
882 #ifndef gcdUSE_NPOT_PATCH
883 #define gcdUSE_NPOT_PATCH                       1
884 #endif
885
886 #ifndef gcdSYNC
887 #   define gcdSYNC                              1
888 #endif
889
890 #ifndef gcdENABLE_SPECIAL_HINT3
891 #   define gcdENABLE_SPECIAL_HINT3               1
892 #endif
893
894 #if defined(ANDROID)
895 #ifndef gcdPRE_ROTATION
896 #   define gcdPRE_ROTATION                      1
897 #endif
898 #endif
899
900 /*
901     gcdDVFS
902
903         When non-zero, software will make use of dynamic voltage and
904         frequency feature.
905  */
906 #ifndef gcdDVFS
907 #   define gcdDVFS                               0
908 #   define gcdDVFS_ANAYLSE_WINDOW                4
909 #   define gcdDVFS_POLLING_TIME                  (gcdDVFS_ANAYLSE_WINDOW * 4)
910 #endif
911
912 /*
913     gcdANDROID_NATIVE_FENCE_SYNC
914
915         Enable android native fence sync. It is introduced since jellybean-4.2.
916         Depends on linux kernel option: CONFIG_SYNC.
917
918         0: Disabled
919         1: Build framework for native fence sync feature, and EGL extension
920         2: Enable async swap buffers for client
921            * Native fence sync for client 'queueBuffer' in EGL, which is
922              'acquireFenceFd' for layer in compositor side.
923         3. Enable async hwcomposer composition.
924            * 'releaseFenceFd' for layer in compositor side, which is native
925              fence sync when client 'dequeueBuffer'
926            * Native fence sync for compositor 'queueBuffer' in EGL, which is
927              'acquireFenceFd' for framebuffer target for DC
928  */
929 #ifndef gcdANDROID_NATIVE_FENCE_SYNC
930 #   define gcdANDROID_NATIVE_FENCE_SYNC        0
931 #endif
932
933 #ifndef gcdFORCE_MIPMAP
934 #   define gcdFORCE_MIPMAP                     0
935 #endif
936
937 /*
938     gcdFORCE_GAL_LOAD_TWICE
939
940         When non-zero, each thread except the main one will load libGAL.so twice to avoid potential segmetantion fault when app using dlopen/dlclose.
941         If threads exit arbitrarily, libGAL.so may not unload until the process quit.
942  */
943 #ifndef gcdFORCE_GAL_LOAD_TWICE
944 #   define gcdFORCE_GAL_LOAD_TWICE             0
945 #endif
946
947 #endif /* __gc_hal_options_h_ */