gc_hal_options.h 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275
  1. /****************************************************************************
  2. *
  3. * Copyright (c) 2005 - 2014 by Vivante Corp. All rights reserved.
  4. *
  5. * The material in this file is confidential and contains trade secrets
  6. * of Vivante Corporation. This is proprietary information owned by
  7. * Vivante Corporation. No part of this work may be disclosed,
  8. * reproduced, copied, transmitted, or used in any way for any purpose,
  9. * without the express written permission of Vivante Corporation.
  10. *
  11. *****************************************************************************/
  12. #ifndef __gc_hal_options_h_
  13. #define __gc_hal_options_h_
  14. /*
  15. gcdSECURITY
  16. */
  17. #ifndef gcdSECURITY
  18. # define gcdSECURITY 0
  19. #endif
  20. /*
  21. gcdPRINT_VERSION
  22. Print HAL version.
  23. */
  24. #ifndef gcdPRINT_VERSION
  25. # define gcdPRINT_VERSION 0
  26. #endif
  27. /*
  28. USE_NEW_LINUX_SIGNAL
  29. This define enables the Linux kernel signaling between kernel and user.
  30. */
  31. #ifndef USE_NEW_LINUX_SIGNAL
  32. # define USE_NEW_LINUX_SIGNAL 0
  33. #endif
  34. /*
  35. VIVANTE_PROFILER
  36. This define enables the profiler.
  37. */
  38. #ifndef VIVANTE_PROFILER
  39. # define VIVANTE_PROFILER 1
  40. #endif
  41. /*
  42. VIVANTE_PROFILER_CONTEXT
  43. This define enables the profiler according each context.
  44. */
  45. #ifndef VIVANTE_PROFILER_CONTEXT
  46. # define VIVANTE_PROFILER_CONTEXT 1
  47. #endif
  48. #ifndef VIVANTE_PROFILER_PERDRAW
  49. # define VIVANTE_PROFILER_PERDRAW 0
  50. #endif
  51. #ifndef VIVANTE_PROFILER_NEW
  52. # define VIVANTE_PROFILER_NEW 0
  53. #endif
  54. #ifndef VIVANTE_PROFILER_PM
  55. # define VIVANTE_PROFILER_PM 1
  56. #endif
  57. /*
  58. gcdUSE_VG
  59. Enable VG HAL layer (only for GC350).
  60. */
  61. #ifndef gcdUSE_VG
  62. # define gcdUSE_VG 0
  63. #endif
  64. /*
  65. USE_SW_FB
  66. Set to 1 if the frame buffer memory cannot be accessed by the GPU.
  67. */
  68. #ifndef USE_SW_FB
  69. # define USE_SW_FB 0
  70. #endif
  71. /*
  72. PROFILE_HAL_COUNTERS
  73. This define enables HAL counter profiling support. HW and SHADER
  74. counter profiling depends on this.
  75. */
  76. #ifndef PROFILE_HAL_COUNTERS
  77. # define PROFILE_HAL_COUNTERS 1
  78. #endif
  79. /*
  80. PROFILE_HW_COUNTERS
  81. This define enables HW counter profiling support.
  82. */
  83. #ifndef PROFILE_HW_COUNTERS
  84. # define PROFILE_HW_COUNTERS 1
  85. #endif
  86. /*
  87. PROFILE_SHADER_COUNTERS
  88. This define enables SHADER counter profiling support.
  89. */
  90. #ifndef PROFILE_SHADER_COUNTERS
  91. # define PROFILE_SHADER_COUNTERS 1
  92. #endif
  93. /*
  94. COMMAND_PROCESSOR_VERSION
  95. The version of the command buffer and task manager.
  96. */
  97. #define COMMAND_PROCESSOR_VERSION 1
  98. /*
  99. gcdDUMP_KEY
  100. Set this to a string that appears in 'cat /proc/<pid>/cmdline'. E.g. 'camera'.
  101. HAL will create dumps for the processes matching this key.
  102. */
  103. #ifndef gcdDUMP_KEY
  104. # define gcdDUMP_KEY "process"
  105. #endif
  106. /*
  107. gcdDUMP_PATH
  108. The dump file location. Some processes cannot write to the sdcard.
  109. Try apps' data dir, e.g. /data/data/com.android.launcher
  110. */
  111. #ifndef gcdDUMP_PATH
  112. #if defined(ANDROID)
  113. # define gcdDUMP_PATH "/mnt/sdcard/"
  114. #else
  115. # define gcdDUMP_PATH "./"
  116. #endif
  117. #endif
  118. /*
  119. gcdDUMP
  120. When set to 1, a dump of all states and memory uploads, as well as other
  121. hardware related execution will be printed to the debug console. This
  122. data can be used for playing back applications.
  123. */
  124. #ifndef gcdDUMP
  125. # define gcdDUMP 0
  126. #endif
  127. /*
  128. gcdDUMP_API
  129. When set to 1, a high level dump of the EGL and GL/VG APs's are
  130. captured.
  131. */
  132. #ifndef gcdDUMP_API
  133. # define gcdDUMP_API 0
  134. #endif
  135. /*
  136. gcdDEBUG_OPTION
  137. When set to 1, the debug options are enabled. We must set other MACRO to enable
  138. sub case.
  139. */
  140. #ifndef gcdDEBUG_OPTION
  141. # define gcdDEBUG_OPTION 0
  142. #if gcdDEBUG_OPTION
  143. /*
  144. gcdDEBUG_OPTION_KEY
  145. The process name of debug application.
  146. */
  147. #ifndef gcdDEBUG_OPTION_KEY
  148. # define gcdDEBUG_OPTION_KEY "process"
  149. # endif
  150. /*
  151. gcdDEBUG_OPTION_NO_GL_DRAWS
  152. When set to 1, all glDrawArrays and glDrawElements will be skip.
  153. */
  154. #ifndef gcdDEBUG_OPTION_NO_GL_DRAWS
  155. # define gcdDEBUG_OPTION_NO_GL_DRAWS 0
  156. # endif
  157. /*
  158. gcdDEBUG_OPTION_NO_DRAW_PRIMITIVES
  159. When set to 1, all DrawPrimitives will be skip.
  160. */
  161. #ifndef gcdDEBUG_OPTION_NO_DRAW_PRIMITIVES
  162. # define gcdDEBUG_OPTION_NO_DRAW_PRIMITIVES 0
  163. # endif
  164. /*
  165. gcdDEBUG_OPTION_SKIP_SWAP
  166. When set to 1, just one out of gcdDEBUG_OPTION_SKIP_FRAMES(such as 1/10) eglSwapBuffers will be resolve,
  167. others skip.
  168. */
  169. #ifndef gcdDEBUG_OPTION_SKIP_SWAP
  170. # define gcdDEBUG_OPTION_SKIP_SWAP 0
  171. # define gcdDEBUG_OPTION_SKIP_FRAMES 10
  172. # endif
  173. /*
  174. gcdDEBUG_OPTION_FORCE_16BIT_RENDER_TARGET
  175. When set to 1, the format of render target will force to RGB565.
  176. */
  177. #ifndef gcdDEBUG_OPTION_FORCE_16BIT_RENDER_TARGET
  178. # define gcdDEBUG_OPTION_FORCE_16BIT_RENDER_TARGET 0
  179. # endif
  180. /*
  181. gcdDEBUG_OPTION_NONE_TEXTURE
  182. When set to 1, the type of texture will be set to AQ_TEXTURE_SAMPLE_MODE_TYPE_NONE.
  183. */
  184. #ifndef gcdDEBUG_OPTION_NONE_TEXTURE
  185. # define gcdDEBUG_OPTION_NONE_TEXTURE 0
  186. # endif
  187. /*
  188. gcdDEBUG_OPTION_NONE_DEPTH
  189. When set to 1, the depth format of surface will be set to gcvSURF_UNKNOWN.
  190. */
  191. #ifndef gcdDEBUG_OPTION_NONE_DEPTH
  192. # define gcdDEBUG_OPTION_NONE_DEPTH 0
  193. # endif
  194. # endif
  195. #endif
  196. /*
  197. gcdDUMP_SWAP_PER_DRAW
  198. When set to 1, dump swap command for every single draw to make simulation comparison happy.
  199. Only valid for ES3 driver for now.
  200. */
  201. #ifndef gcdDUMP_SWAP_PER_DRAW
  202. # define gcdDUMP_SWAP_PER_DRAW 0
  203. #endif
  204. /*
  205. gcdDUMP_FRAMERATE
  206. When set to a value other than zero, averaqe frame rate will be dumped.
  207. The value set is the starting frame that the average will be calculated.
  208. This is needed because sometimes first few frames are too slow to be included
  209. in the average. Frame count starts from 1.
  210. */
  211. #ifndef gcdDUMP_FRAMERATE
  212. # define gcdDUMP_FRAMERATE 0
  213. #endif
  214. /*
  215. gcdENABLE_FSCALE_VAL_ADJUST
  216. When non-zero, FSCALE_VAL when gcvPOWER_ON can be adjusted externally.
  217. */
  218. #ifndef gcdENABLE_FSCALE_VAL_ADJUST
  219. # define gcdENABLE_FSCALE_VAL_ADJUST 1
  220. #endif
  221. /*
  222. gcdDUMP_IN_KERNEL
  223. When set to 1, all dumps will happen in the kernel. This is handy if
  224. you want the kernel to dump its command buffers as well and the data
  225. needs to be in sync.
  226. */
  227. #ifndef gcdDUMP_IN_KERNEL
  228. # define gcdDUMP_IN_KERNEL 0
  229. #endif
  230. /*
  231. gcdDUMP_COMMAND
  232. When set to non-zero, the command queue will dump all incoming command
  233. and context buffers as well as all other modifications to the command
  234. queue.
  235. */
  236. #ifndef gcdDUMP_COMMAND
  237. # define gcdDUMP_COMMAND 0
  238. #endif
  239. /*
  240. gcdDUMP_2D
  241. When set to non-zero, it will dump the 2D command and surface.
  242. */
  243. #ifndef gcdDUMP_2D
  244. # define gcdDUMP_2D 0
  245. #endif
  246. /*
  247. gcdDUMP_FRAME_TGA
  248. When set to a value other than 0, a dump of the frame specified by the value,
  249. will be done into frame.tga. Frame count starts from 1.
  250. */
  251. #ifndef gcdDUMP_FRAME_TGA
  252. # define gcdDUMP_FRAME_TGA 0
  253. #endif
  254. /*
  255. gcdNULL_DRIVER
  256. Set to 1 for infinite speed hardware.
  257. Set to 2 for bypassing the HAL.
  258. Set to 3 for bypassing the drivers.
  259. */
  260. #ifndef gcdNULL_DRIVER
  261. # define gcdNULL_DRIVER 0
  262. #endif
  263. /*
  264. gcdENABLE_TIMEOUT_DETECTION
  265. Enable timeout detection.
  266. */
  267. #ifndef gcdENABLE_TIMEOUT_DETECTION
  268. # define gcdENABLE_TIMEOUT_DETECTION 0
  269. #endif
  270. /*
  271. gcdCMD_BUFFER_SIZE
  272. Number of bytes in a command buffer.
  273. */
  274. #ifndef gcdCMD_BUFFER_SIZE
  275. # define gcdCMD_BUFFER_SIZE (128 << 10)
  276. #endif
  277. /*
  278. gcdCMD_BUFFERS
  279. Number of command buffers to use per client.
  280. */
  281. #ifndef gcdCMD_BUFFERS
  282. # define gcdCMD_BUFFERS 2
  283. #endif
  284. /*
  285. gcdMAX_CMD_BUFFERS
  286. Maximum number of command buffers to use per client.
  287. */
  288. #ifndef gcdMAX_CMD_BUFFERS
  289. # define gcdMAX_CMD_BUFFERS 8
  290. #endif
  291. /*
  292. gcdCOMMAND_QUEUES
  293. Number of command queues in the kernel.
  294. */
  295. #ifndef gcdCOMMAND_QUEUES
  296. # define gcdCOMMAND_QUEUES 2
  297. #endif
  298. /*
  299. gcdPOWER_CONTROL_DELAY
  300. The delay in milliseconds required to wait until the GPU has woke up
  301. from a suspend or power-down state. This is system dependent because
  302. the bus clock also needs to stabalize.
  303. */
  304. #ifndef gcdPOWER_CONTROL_DELAY
  305. # define gcdPOWER_CONTROL_DELAY 0
  306. #endif
  307. /*
  308. gcdMIRROR_PAGETABLE
  309. Enable it when GPUs with old MMU and new MMU exist at same SoC. It makes
  310. each GPU use same virtual address to access same physical memory.
  311. */
  312. #ifndef gcdMIRROR_PAGETABLE
  313. # define gcdMIRROR_PAGETABLE 0
  314. #endif
  315. /*
  316. gcdMMU_SIZE
  317. Size of the MMU page table in bytes. Each 4 bytes can hold 4kB worth of
  318. virtual data.
  319. */
  320. #ifndef gcdMMU_SIZE
  321. #if gcdMIRROR_PAGETABLE
  322. # define gcdMMU_SIZE 0x200000
  323. #else
  324. # define gcdMMU_SIZE (256 << 10)
  325. #endif
  326. #endif
  327. /*
  328. gcdSECURE_USER
  329. Use logical addresses instead of physical addresses in user land. In
  330. this case a hint table is created for both command buffers and context
  331. buffers, and that hint table will be used to patch up those buffers in
  332. the kernel when they are ready to submit.
  333. */
  334. #ifndef gcdSECURE_USER
  335. # define gcdSECURE_USER 0
  336. #endif
  337. /*
  338. gcdSECURE_CACHE_SLOTS
  339. Number of slots in the logical to DMA address cache table. Each time a
  340. logical address needs to be translated into a DMA address for the GPU,
  341. this cache will be walked. The replacement scheme is LRU.
  342. */
  343. #ifndef gcdSECURE_CACHE_SLOTS
  344. # define gcdSECURE_CACHE_SLOTS 1024
  345. #endif
  346. /*
  347. gcdSECURE_CACHE_METHOD
  348. Replacement scheme used for Secure Cache. The following options are
  349. available:
  350. gcdSECURE_CACHE_LRU
  351. A standard LRU cache.
  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. gcdSECURE_CACHE_HASH
  357. A 256-entry hash table.
  358. gcdSECURE_CACHE_TABLE
  359. A simple cache but with potential of a lot of cache replacement.
  360. */
  361. #ifndef gcdSECURE_CACHE_METHOD
  362. # define gcdSECURE_CACHE_METHOD gcdSECURE_CACHE_HASH
  363. #endif
  364. /*
  365. gcdREGISTER_ACCESS_FROM_USER
  366. Set to 1 to allow IOCTL calls to get through from user land. This
  367. should only be in debug or development drops.
  368. */
  369. #ifndef gcdREGISTER_ACCESS_FROM_USER
  370. # define gcdREGISTER_ACCESS_FROM_USER 1
  371. #endif
  372. /*
  373. gcdHEAP_SIZE
  374. Set the allocation size for the internal heaps. Each time a heap is
  375. full, a new heap will be allocated with this minmimum amount of bytes.
  376. The bigger this size, the fewer heaps there are to allocate, the better
  377. the performance. However, heaps won't be freed until they are
  378. completely free, so there might be some more memory waste if the size is
  379. too big.
  380. */
  381. #ifndef gcdHEAP_SIZE
  382. # define gcdHEAP_SIZE (64 << 10)
  383. #endif
  384. /*
  385. gcdPOWER_SUSPEND_WHEN_IDLE
  386. Set to 1 to make GPU enter gcvPOWER_SUSPEND when idle detected,
  387. otherwise GPU will enter gcvPOWER_IDLE.
  388. */
  389. #ifndef gcdPOWER_SUSPEND_WHEN_IDLE
  390. # define gcdPOWER_SUSPEND_WHEN_IDLE 1
  391. #endif
  392. #ifndef gcdFPGA_BUILD
  393. # define gcdFPGA_BUILD 0
  394. #endif
  395. /*
  396. gcdGPU_TIMEOUT
  397. This define specified the number of milliseconds the system will wait
  398. before it broadcasts the GPU is stuck. In other words, it will define
  399. the timeout of any operation that needs to wait for the GPU.
  400. If the value is 0, no timeout will be checked for.
  401. */
  402. #ifndef gcdGPU_TIMEOUT
  403. #if gcdFPGA_BUILD
  404. # define gcdGPU_TIMEOUT 0
  405. # define gcdGPU_2D_TIMEOUT 0
  406. # else
  407. # define gcdGPU_TIMEOUT 20000
  408. # define gcdGPU_2D_TIMEOUT 4000
  409. # endif
  410. #endif
  411. /*
  412. gcdGPU_ADVANCETIMER
  413. it is advance timer.
  414. */
  415. #ifndef gcdGPU_ADVANCETIMER
  416. # define gcdGPU_ADVANCETIMER 250
  417. #endif
  418. /*
  419. gcdSTATIC_LINK
  420. This define disalbes static linking;
  421. */
  422. #ifndef gcdSTATIC_LINK
  423. # define gcdSTATIC_LINK 0
  424. #endif
  425. /*
  426. gcdUSE_NEW_HEAP
  427. Setting this define to 1 enables new heap.
  428. */
  429. #ifndef gcdUSE_NEW_HEAP
  430. # define gcdUSE_NEW_HEAP 0
  431. #endif
  432. /*
  433. gcdCMD_NO_2D_CONTEXT
  434. This define enables no-context 2D command buffer.
  435. */
  436. #ifndef gcdCMD_NO_2D_CONTEXT
  437. # define gcdCMD_NO_2D_CONTEXT 1
  438. #endif
  439. /*
  440. gcdENABLE_BUFFER_ALIGNMENT
  441. When enabled, video memory is allocated with atleast 16KB aligment
  442. between multiple sub-buffers.
  443. */
  444. #ifndef gcdENABLE_BUFFER_ALIGNMENT
  445. # define gcdENABLE_BUFFER_ALIGNMENT 1
  446. #endif
  447. /*
  448. gcdENABLE_BANK_ALIGNMENT
  449. When enabled, video memory is allocated bank aligned. The vendor can modify
  450. _GetSurfaceBankAlignment() and _GetBankOffsetBytes() to define how
  451. different types of allocations are bank and channel aligned.
  452. When disabled (default), no bank alignment is done.
  453. */
  454. #ifndef gcdENABLE_BANK_ALIGNMENT
  455. # define gcdENABLE_BANK_ALIGNMENT 0
  456. #endif
  457. /*
  458. gcdBANK_BIT_START
  459. Specifies the start bit of the bank (inclusive).
  460. */
  461. #ifndef gcdBANK_BIT_START
  462. # define gcdBANK_BIT_START 12
  463. #endif
  464. /*
  465. gcdBANK_BIT_END
  466. Specifies the end bit of the bank (inclusive).
  467. */
  468. #ifndef gcdBANK_BIT_END
  469. # define gcdBANK_BIT_END 14
  470. #endif
  471. /*
  472. gcdBANK_CHANNEL_BIT
  473. When set, video memory when allocated bank aligned is allocated such that
  474. render and depth buffer addresses alternate on the channel bit specified.
  475. This option has an effect only when gcdENABLE_BANK_ALIGNMENT is enabled.
  476. When disabled (default), no alteration is done.
  477. */
  478. #ifndef gcdBANK_CHANNEL_BIT
  479. # define gcdBANK_CHANNEL_BIT 7
  480. #endif
  481. /*
  482. gcdDYNAMIC_SPEED
  483. When non-zero, it informs the kernel driver to use the speed throttling
  484. broadcasting functions to inform the system the GPU should be spet up or
  485. slowed down. It will send a broadcast for slowdown each "interval"
  486. specified by this define in milliseconds
  487. (gckOS_BroadcastCalibrateSpeed).
  488. */
  489. #ifndef gcdDYNAMIC_SPEED
  490. # define gcdDYNAMIC_SPEED 2000
  491. #endif
  492. /*
  493. gcdDYNAMIC_EVENT_THRESHOLD
  494. When non-zero, it specifies the maximum number of available events at
  495. which the kernel driver will issue a broadcast to speed up the GPU
  496. (gckOS_BroadcastHurry).
  497. */
  498. #ifndef gcdDYNAMIC_EVENT_THRESHOLD
  499. # define gcdDYNAMIC_EVENT_THRESHOLD 5
  500. #endif
  501. /*
  502. gcdENABLE_PROFILING
  503. Enable profiling macros.
  504. */
  505. #ifndef gcdENABLE_PROFILING
  506. # define gcdENABLE_PROFILING 0
  507. #endif
  508. /*
  509. gcdENABLE_128B_MERGE
  510. Enable 128B merge for the BUS control.
  511. */
  512. #ifndef gcdENABLE_128B_MERGE
  513. # define gcdENABLE_128B_MERGE 0
  514. #endif
  515. /*
  516. gcdFRAME_DB
  517. When non-zero, it specified the number of frames inside the frame
  518. database. The frame DB will collect per-frame timestamps and hardware
  519. counters.
  520. */
  521. #ifndef gcdFRAME_DB
  522. # define gcdFRAME_DB 0
  523. # define gcdFRAME_DB_RESET 0
  524. # define gcdFRAME_DB_NAME "/var/log/frameDB.log"
  525. #endif
  526. /*
  527. gcdDISABLE_CORES_2D3D
  528. disable the 2D3D cores for 2D openVG
  529. */
  530. #ifndef gcdDISABLE_CORES_2D3D
  531. # define gcdDISABLE_CORES_2D3D 0
  532. #endif
  533. /*
  534. gcdPAGED_MEMORY_CACHEABLE
  535. When non-zero, paged memory will be cacheable.
  536. Normally, driver will detemines whether a video memory
  537. is cacheable or not. When cacheable is not neccessary,
  538. it will be writecombine.
  539. This option is only for those SOC which can't enable
  540. writecombine without enabling cacheable.
  541. */
  542. #ifndef gcdPAGED_MEMORY_CACHEABLE
  543. # define gcdPAGED_MEMORY_CACHEABLE 0
  544. #endif
  545. /*
  546. gcdNONPAGED_MEMORY_CACHEABLE
  547. When non-zero, non paged memory will be cacheable.
  548. */
  549. #ifndef gcdNONPAGED_MEMORY_CACHEABLE
  550. # define gcdNONPAGED_MEMORY_CACHEABLE 0
  551. #endif
  552. /*
  553. gcdNONPAGED_MEMORY_BUFFERABLE
  554. When non-zero, non paged memory will be bufferable.
  555. gcdNONPAGED_MEMORY_BUFFERABLE and gcdNONPAGED_MEMORY_CACHEABLE
  556. can't be set 1 at same time
  557. */
  558. #ifndef gcdNONPAGED_MEMORY_BUFFERABLE
  559. # define gcdNONPAGED_MEMORY_BUFFERABLE 1
  560. #endif
  561. /*
  562. gcdENABLE_INFINITE_SPEED_HW
  563. enable the Infinte HW , this is for 2D openVG
  564. */
  565. #ifndef gcdENABLE_INFINITE_SPEED_HW
  566. # define gcdENABLE_INFINITE_SPEED_HW 0
  567. #endif
  568. /*
  569. gcdMULTI_GPU
  570. Enable/disable multi-GPU support.
  571. 0 : Disable multi-GPU support
  572. 1 : Enable one of the 3D cores
  573. [2..X] : Number of 3D GPU Cores
  574. */
  575. #ifndef gcdMULTI_GPU
  576. # define gcdMULTI_GPU 0
  577. #endif
  578. /*
  579. gcdMULTI_GPU_AFFINITY
  580. Enable/disable the binding of a context to one GPU
  581. */
  582. #ifndef gcdMULTI_GPU_AFFINITY
  583. # define gcdMULTI_GPU_AFFINITY 0
  584. #endif
  585. /*
  586. gcdPOWEROFF_TIMEOUT
  587. When non-zero, GPU will power off automatically from
  588. idle state, and gcdPOWEROFF_TIMEOUT is also the default
  589. timeout in milliseconds.
  590. */
  591. #ifndef gcdPOWEROFF_TIMEOUT
  592. # define gcdPOWEROFF_TIMEOUT 300
  593. #endif
  594. /*
  595. QNX_SINGLE_THREADED_DEBUGGING
  596. */
  597. #ifndef QNX_SINGLE_THREADED_DEBUGGING
  598. # define QNX_SINGLE_THREADED_DEBUGGING 0
  599. #endif
  600. /*
  601. gcdRENDER_THREADS
  602. Number of render threads. Make it zero, and there will be no render
  603. threads.
  604. */
  605. #ifndef gcdRENDER_THREADS
  606. # define gcdRENDER_THREADS 0
  607. #endif
  608. /*
  609. gcdSMP
  610. This define enables SMP support.
  611. Currently, it only works on Linux/Android,
  612. Kbuild will config it according to whether
  613. CONFIG_SMP is set.
  614. */
  615. #ifndef gcdSMP
  616. #ifdef __APPLE__
  617. # define gcdSMP 1
  618. #else
  619. # define gcdSMP 0
  620. #endif
  621. #endif
  622. /*
  623. gcdSHARED_RESOLVE_BUFFER_ENABLED
  624. Use shared resolve buffer for all app buffers.
  625. */
  626. #ifndef gcdSHARED_RESOLVE_BUFFER_ENABLED
  627. # define gcdSHARED_RESOLVE_BUFFER_ENABLED 0
  628. #endif
  629. /*
  630. gcdUSE_TRIANGLE_STRIP_PATCH
  631. */
  632. #ifndef gcdUSE_TRIANGLE_STRIP_PATCH
  633. # define gcdUSE_TRIANGLE_STRIP_PATCH 1
  634. #endif
  635. /*
  636. gcdENABLE_OUTER_CACHE_PATCH
  637. Enable the outer cache patch.
  638. */
  639. #ifndef gcdENABLE_OUTER_CACHE_PATCH
  640. # define gcdENABLE_OUTER_CACHE_PATCH 0
  641. #endif
  642. /*
  643. gcdPROCESS_ADDRESS_SPACE
  644. When non-zero, every process which attaches to galcore has its own GPU
  645. address space, size of which is gcdPROCESS_ADDRESS_SPACE_SIZE.
  646. */
  647. #ifndef gcdPROCESS_ADDRESS_SPACE
  648. # define gcdPROCESS_ADDRESS_SPACE 0
  649. # define gcdPROCESS_ADDRESS_SPACE_SIZE 0x80000000
  650. #endif
  651. /*
  652. gcdSHARED_PAGETABLE
  653. When non-zero, multiple GPUs in one chip with same MMU use
  654. one shared pagetable. So that when accessing same surface,
  655. they can use same GPU virtual address.
  656. */
  657. #ifndef gcdSHARED_PAGETABLE
  658. # define gcdSHARED_PAGETABLE !gcdPROCESS_ADDRESS_SPACE
  659. #endif
  660. #ifndef gcdUSE_PVR
  661. # define gcdUSE_PVR 1
  662. #endif
  663. /*
  664. gcdSMALL_BLOCK_SIZE
  665. When non-zero, a part of VIDMEM will be reserved for requests
  666. whose requesting size is less than gcdSMALL_BLOCK_SIZE.
  667. For Linux, it's the size of a page. If this requeset fallbacks
  668. to gcvPOOL_CONTIGUOUS or gcvPOOL_VIRTUAL, memory will be wasted
  669. because they allocate a page at least.
  670. */
  671. #ifndef gcdSMALL_BLOCK_SIZE
  672. # define gcdSMALL_BLOCK_SIZE 4096
  673. # define gcdRATIO_FOR_SMALL_MEMORY 32
  674. #endif
  675. /*
  676. gcdCONTIGUOUS_SIZE_LIMIT
  677. When non-zero, size of video node from gcvPOOL_CONTIGUOUS is
  678. limited by gcdCONTIGUOUS_SIZE_LIMIT.
  679. */
  680. #ifndef gcdCONTIGUOUS_SIZE_LIMIT
  681. # define gcdCONTIGUOUS_SIZE_LIMIT 0
  682. #endif
  683. /*
  684. gcdLINK_QUEUE_SIZE
  685. When non-zero, driver maintains a queue to record information of
  686. latest lined context buffer and command buffer. Data in this queue
  687. is be used to debug.
  688. */
  689. #ifndef gcdLINK_QUEUE_SIZE
  690. # define gcdLINK_QUEUE_SIZE 5
  691. #endif
  692. /* gcdALPHA_KILL_IN_SHADER
  693. Enable alpha kill inside the shader. This will be set automatically by the
  694. HAL if certain states match a criteria.
  695. */
  696. #ifndef gcdALPHA_KILL_IN_SHADER
  697. # define gcdALPHA_KILL_IN_SHADER 1
  698. #endif
  699. /*
  700. gcdDVFS
  701. When non-zero, software will make use of dynamic voltage and
  702. frequency feature.
  703. */
  704. #ifndef gcdDVFS
  705. # define gcdDVFS 0
  706. # define gcdDVFS_ANAYLSE_WINDOW 4
  707. # define gcdDVFS_POLLING_TIME (gcdDVFS_ANAYLSE_WINDOW * 4)
  708. #endif
  709. #ifndef gcdSYNC
  710. # define gcdSYNC 1
  711. #endif
  712. #ifndef gcdSHADER_SRC_BY_MACHINECODE
  713. # define gcdSHADER_SRC_BY_MACHINECODE 1
  714. #endif
  715. #ifndef gcdGLB27_SHADER_REPLACE_OPTIMIZATION
  716. # define gcdGLB27_SHADER_REPLACE_OPTIMIZATION 1
  717. #endif
  718. /*
  719. gcdSTREAM_OUT_BUFFER
  720. Enable suppport for the secondary stream out buffer.
  721. */
  722. #ifndef gcdSTREAM_OUT_BUFFER
  723. # define gcdSTREAM_OUT_BUFFER 0
  724. # define gcdSTREAM_OUT_NAIVE_SYNC 0
  725. #endif
  726. /*
  727. gcdUSE_HARDWARE_CONFIGURATION_TABLES
  728. Enable the use of hardware configuration tables,
  729. instead of query hardware and determine the features.
  730. */
  731. #ifndef gcdUSE_HARDWARE_CONFIGURATION_TABLES
  732. # define gcdUSE_HARDWARE_CONFIGURATION_TABLES 0
  733. #endif
  734. /*
  735. gcdSUPPORT_SWAP_RECTANGLE
  736. Support swap with a specific rectangle.
  737. Set the rectangle with eglSetSwapRectangleVIV api.
  738. Android only.
  739. */
  740. #ifndef gcdSUPPORT_SWAP_RECTANGLE
  741. # define gcdSUPPORT_SWAP_RECTANGLE 0
  742. #endif
  743. /*
  744. gcdGPU_LINEAR_BUFFER_ENABLED
  745. Use linear buffer for GPU apps so HWC can do 2D composition.
  746. Android only.
  747. */
  748. #ifndef gcdGPU_LINEAR_BUFFER_ENABLED
  749. # define gcdGPU_LINEAR_BUFFER_ENABLED 1
  750. #endif
  751. /*
  752. gcdENABLE_RENDER_INTO_WINDOW
  753. Enable Render-Into-Window (ie, No-Resolve) feature on android.
  754. NOTE that even if enabled, it still depends on hardware feature and
  755. android application behavior. When hardware feature or application
  756. behavior can not support render into window mode, it will fail back
  757. to normal mode.
  758. When Render-Into-Window is finally used, window back buffer of android
  759. applications will be allocated matching render target tiling format.
  760. Otherwise buffer tiling is decided by the above option
  761. 'gcdGPU_LINEAR_BUFFER_ENABLED'.
  762. Android only for now.
  763. */
  764. #ifndef gcdENABLE_RENDER_INTO_WINDOW
  765. # define gcdENABLE_RENDER_INTO_WINDOW 1
  766. #endif
  767. /*
  768. gcdENABLE_RENDER_INTO_WINDOW_WITH_FC
  769. Enable Direct-rendering (ie, No-Resolve) with tile status.
  770. This is expremental and in development stage.
  771. This will dynamically check if color compression is available.
  772. */
  773. #ifndef gcdENABLE_RENDER_INTO_WINDOW_WITH_FC
  774. # define gcdENABLE_RENDER_INTO_WINDOW_WITH_FC 1
  775. #endif
  776. /*
  777. gcdENABLE_BLIT_BUFFER_PRESERVE
  778. Render-Into-Window (ie, No-Resolve) does not include preserved swap
  779. behavior. This feature can enable buffer preserve in No-Resolve mode.
  780. When enabled, previous buffer (may be part of ) will be resolve-blitted
  781. to current buffer.
  782. */
  783. #ifndef gcdENABLE_BLIT_BUFFER_PRESERVE
  784. # define gcdENABLE_BLIT_BUFFER_PRESERVE 1
  785. #endif
  786. /*
  787. gcdANDROID_NATIVE_FENCE_SYNC
  788. Enable android native fence sync. It is introduced since jellybean-4.2.
  789. Depends on linux kernel option: CONFIG_SYNC.
  790. 0: Disabled
  791. 1: Build framework for native fence sync feature, and EGL extension
  792. 2: Enable async swap buffers for client
  793. * Native fence sync for client 'queueBuffer' in EGL, which is
  794. 'acquireFenceFd' for layer in compositor side.
  795. 3. Enable async hwcomposer composition.
  796. * 'releaseFenceFd' for layer in compositor side, which is native
  797. fence sync when client 'dequeueBuffer'
  798. * Native fence sync for compositor 'queueBuffer' in EGL, which is
  799. 'acquireFenceFd' for framebuffer target for DC
  800. */
  801. #ifndef gcdANDROID_NATIVE_FENCE_SYNC
  802. # define gcdANDROID_NATIVE_FENCE_SYNC 0
  803. #endif
  804. /*
  805. gcdANDROID_IMPLICIT_NATIVE_BUFFER_SYNC
  806. Enable implicit android native buffer sync.
  807. For non-HW_RENDER buffer, CPU (or other hardware) and GPU can access
  808. the buffer at the same time. This is to add implicit synchronization
  809. between CPU (or the hardware) and GPU.
  810. Eventually, please do not use implicit native buffer sync, but use
  811. "fence sync" or "android native fence sync" instead in libgui, which
  812. can be enabled in frameworks/native/libs/gui/Android.mk. This kind
  813. of synchronization should be done by app but not driver itself.
  814. Please disable this option when either "fence sync" or
  815. "android native fence sync" is enabled.
  816. */
  817. #ifndef gcdANDROID_IMPLICIT_NATIVE_BUFFER_SYNC
  818. # define gcdANDROID_IMPLICIT_NATIVE_BUFFER_SYNC 1
  819. #endif
  820. /*
  821. * Implicit native buffer sync is not needed when ANDROID_native_fence_sync
  822. * is available.
  823. */
  824. #if gcdANDROID_NATIVE_FENCE_SYNC
  825. # undef gcdANDROID_IMPLICIT_NATIVE_BUFFER_SYNC
  826. # define gcdANDROID_IMPLICIT_NATIVE_BUFFER_SYNC 0
  827. #endif
  828. /*
  829. gcdANDROID_UNALIGNED_LINEAR_COMPOSITION_ADJUST
  830. Enable source surface address adjust when composition on android.
  831. Android only.
  832. */
  833. #ifndef gcdANDROID_UNALIGNED_LINEAR_COMPOSITION_ADJUST
  834. # define gcdANDROID_UNALIGNED_LINEAR_COMPOSITION_ADJUST 1
  835. #endif
  836. /*
  837. gcdUSE_WCLIP_PATCH
  838. Enable wclipping patch.
  839. */
  840. #ifndef gcdUSE_WCLIP_PATCH
  841. # define gcdUSE_WCLIP_PATCH 1
  842. #endif
  843. #ifndef gcdUSE_NPOT_PATCH
  844. # define gcdUSE_NPOT_PATCH 1
  845. #endif
  846. /*
  847. gcd3DBLIT
  848. TODO: Should be replaced by feature bit if available.
  849. */
  850. #ifndef gcd3DBLIT
  851. # define gcd3DBLIT 0
  852. #endif
  853. /*
  854. gcdINTERNAL_COMMENT
  855. Wrap internal comment, content wrapped by it and the macor itself
  856. will be removed in release driver.
  857. */
  858. #ifndef gcdINTERNAL_COMMENT
  859. # define gcdINTERNAL_COMMENT 1
  860. #endif
  861. /*
  862. gcdRTT_DISABLE_FC
  863. Disable RTT FC support. For test only.
  864. */
  865. #ifndef gcdRTT_DISABLE_FC
  866. # define gcdRTT_DISABLE_FC 0
  867. #endif
  868. /*
  869. gcdFORCE_MIPMAP
  870. Force generate mipmap for texture.
  871. */
  872. #ifndef gcdFORCE_MIPMAP
  873. # define gcdFORCE_MIPMAP 0
  874. #endif
  875. /*
  876. gcdFORCE_BILINEAR
  877. Force bilinear for mipfilter.
  878. */
  879. #ifndef gcdFORCE_BILINEAR
  880. # define gcdFORCE_BILINEAR 1
  881. #endif
  882. /*
  883. gcdBINARY_TRACE
  884. When non-zero, binary trace will be generated.
  885. When gcdBINARY_TRACE_FILE_SIZE is non-zero, binary trace buffer will
  886. be written to a file which size is limited to
  887. gcdBINARY_TRACE_FILE_SIZE.
  888. */
  889. #ifndef gcdBINARY_TRACE
  890. # define gcdBINARY_TRACE 0
  891. # define gcdBINARY_TRACE_FILE_SIZE 0
  892. #endif
  893. #ifndef gcdMOVG
  894. # define gcdMOVG 0
  895. #if gcdMOVG
  896. # define GC355_PROFILER 1
  897. # endif
  898. # define gcdENABLE_TS_DOUBLE_BUFFER 1
  899. #else
  900. #if gcdMOVG
  901. # define GC355_PROFILER 1
  902. # define gcdENABLE_TS_DOUBLE_BUFFER 0
  903. #else
  904. # define gcdENABLE_TS_DOUBLE_BUFFER 1
  905. #endif
  906. #endif
  907. /* gcdINTERRUPT_STATISTIC
  908. *
  909. * Monitor the event send to GPU and interrupt issued by GPU.
  910. */
  911. #ifndef gcdINTERRUPT_STATISTIC
  912. #if defined(LINUX)
  913. # define gcdINTERRUPT_STATISTIC 1
  914. #else
  915. # define gcdINTERRUPT_STATISTIC 0
  916. #endif
  917. #endif
  918. /*
  919. gcdYINVERTED_RENDERING
  920. When it's not zero, we will rendering display buffer
  921. with top-bottom direction. All other offscreen rendering
  922. will be bottom-top, which follow OpenGL ES spec.
  923. */
  924. #ifndef gcdYINVERTED_RENDERING
  925. # define gcdYINVERTED_RENDERING 1
  926. #endif
  927. #if gcdYINVERTED_RENDERING
  928. /* disable unaligned linear composition adjust in Y-inverted rendering mode. */
  929. # undef gcdANDROID_UNALIGNED_LINEAR_COMPOSITION_ADJUST
  930. # define gcdANDROID_UNALIGNED_LINEAR_COMPOSITION_ADJUST 0
  931. #endif
  932. /*
  933. gcdFENCE_WAIT_LOOP_COUNT
  934. Wait fence, loop count.
  935. */
  936. #ifndef gcdFENCE_WAIT_LOOP_COUNT
  937. # define gcdFENCE_WAIT_LOOP_COUNT 10000
  938. #endif
  939. /*
  940. gcdHAL_3D_DRAWBLIT
  941. When it's not zero, we will enable HAL 3D drawblit
  942. to replace client 3dblit.
  943. */
  944. #ifndef gcdHAL_3D_DRAWBLIT
  945. # define gcdHAL_3D_DRAWBLIT 1
  946. #endif
  947. /*
  948. gcdPARTIAL_FAST_CLEAR
  949. When it's not zero, partial fast clear is enabled.
  950. Depends on gcdHAL_3D_DRAWBLIT, if gcdHAL_3D_DRAWBLIT is not enabled,
  951. only available when scissor box is completely aligned.
  952. Expremental, under test.
  953. */
  954. #ifndef gcdPARTIAL_FAST_CLEAR
  955. # define gcdPARTIAL_FAST_CLEAR 1
  956. #endif
  957. /*
  958. gcdREMOVE_SURF_ORIENTATION
  959. When it's not zero, we will remove surface orientation function.
  960. It wil become to a parameter of resolve function.
  961. */
  962. #ifndef gcdREMOVE_SURF_ORIENTATION
  963. # define gcdREMOVE_SURF_ORIENTATION 0
  964. #endif
  965. /*
  966. gcdPATTERN_FAST_PATH
  967. For pattern match
  968. */
  969. #ifndef gcdPATTERN_FAST_PATH
  970. # define gcdPATTERN_FAST_PATH 1
  971. #endif
  972. /*
  973. gcdUSE_INPUT_DEVICE
  974. disable input devices usage under fb mode to support fb+vdk multi-process
  975. */
  976. #ifndef gcdUSE_INPUT_DEVICE
  977. # define gcdUSE_INPUT_DEVICE 1
  978. #endif
  979. /*
  980. gcdFRAMEINFO_STATISTIC
  981. When enable, collect frame information.
  982. */
  983. #ifndef gcdFRAMEINFO_STATISTIC
  984. #if (defined(DBG) && DBG) || defined(DEBUG) || defined(_DEBUG) || gcdDUMP
  985. # define gcdFRAMEINFO_STATISTIC 1
  986. #else
  987. # define gcdFRAMEINFO_STATISTIC 0
  988. #endif
  989. #endif
  990. /*
  991. gcdPACKED_OUTPUT_ADDRESS
  992. When it's not zero, ps output is already packed after linked
  993. */
  994. #ifndef gcdPACKED_OUTPUT_ADDRESS
  995. # define gcdPACKED_OUTPUT_ADDRESS 1
  996. #endif
  997. /*
  998. gcdENABLE_THIRD_PARTY_OPERATION
  999. Enable third party operation like tpc or not.
  1000. */
  1001. #ifndef gcdENABLE_THIRD_PARTY_OPERATION
  1002. # define gcdENABLE_THIRD_PARTY_OPERATION 1
  1003. #endif
  1004. /*
  1005. Core configurations. By default enable all cores.
  1006. */
  1007. #ifndef gcdENABLE_3D
  1008. # define gcdENABLE_3D 0
  1009. #endif
  1010. #ifndef gcdENABLE_2D
  1011. # define gcdENABLE_2D 1
  1012. #endif
  1013. #ifndef gcdENABLE_VG
  1014. # define gcdENABLE_VG 0
  1015. #endif
  1016. #ifndef gcdGC355_MEM_PRINT
  1017. # define gcdGC355_MEM_PRINT 0
  1018. #else
  1019. #if (!((gcdENABLE_3D == 0) && (gcdENABLE_2D == 0) && (gcdENABLE_VG == 1)))
  1020. # undef gcdGC355_MEM_PRINT
  1021. # define gcdGC355_MEM_PRINT 0
  1022. # endif
  1023. #endif
  1024. #ifndef gcdENABLE_UNIFIED_CONSTANT
  1025. # define gcdENABLE_UNIFIED_CONSTANT 1
  1026. #endif
  1027. /*
  1028. gcdRECORD_COMMAND
  1029. */
  1030. #ifndef gcdRECORD_COMMAND
  1031. # define gcdRECORD_COMMAND 0
  1032. #endif
  1033. /*
  1034. gcdALLOC_CMD_FROM_RESERVE
  1035. Provide a way by which location of command buffer can be
  1036. specified. This is a DEBUG option to limit command buffer
  1037. to some memory range.
  1038. */
  1039. #ifndef gcdALLOC_CMD_FROM_RESERVE
  1040. # define gcdALLOC_CMD_FROM_RESERVE 0
  1041. #endif
  1042. #endif /* __gc_hal_options_h_ */