mdp3_ppp_data.c 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619
  1. /* Copyright (c) 2007, 2012-2013 The Linux Foundation. All rights reserved.
  2. * Copyright (C) 2007 Google Incorporated
  3. *
  4. * This software is licensed under the terms of the GNU General Public
  5. * License version 2, as published by the Free Software Foundation, and
  6. * may be copied, distributed, and modified under those terms.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. #include <linux/types.h>
  14. #include "mdss_fb.h"
  15. #include "mdp3_ppp.h"
  16. #define MDP_IS_IMGTYPE_BAD(x) ((x) >= MDP_IMGTYPE_LIMIT)
  17. /* bg_config_lut not needed since it is same as src */
  18. const uint32_t src_cfg_lut[MDP_IMGTYPE_LIMIT] = {
  19. [MDP_RGB_565] = MDP_RGB_565_SRC_REG,
  20. [MDP_BGR_565] = MDP_RGB_565_SRC_REG,
  21. [MDP_RGB_888] = MDP_RGB_888_SRC_REG,
  22. [MDP_BGR_888] = MDP_RGB_888_SRC_REG,
  23. [MDP_BGRA_8888] = MDP_RGBX_8888_SRC_REG,
  24. [MDP_RGBA_8888] = MDP_RGBX_8888_SRC_REG,
  25. [MDP_ARGB_8888] = MDP_RGBX_8888_SRC_REG,
  26. [MDP_XRGB_8888] = MDP_RGBX_8888_SRC_REG,
  27. [MDP_RGBX_8888] = MDP_RGBX_8888_SRC_REG,
  28. [MDP_Y_CRCB_H2V2] = MDP_Y_CBCR_H2V2_SRC_REG,
  29. [MDP_Y_CBCR_H2V2] = MDP_Y_CBCR_H2V2_SRC_REG,
  30. [MDP_Y_CBCR_H2V2_ADRENO] = MDP_Y_CBCR_H2V2_SRC_REG,
  31. [MDP_Y_CBCR_H2V2_VENUS] = MDP_Y_CBCR_H2V2_SRC_REG,
  32. [MDP_YCRYCB_H2V1] = MDP_YCRYCB_H2V1_SRC_REG,
  33. [MDP_Y_CBCR_H2V1] = MDP_Y_CRCB_H2V1_SRC_REG,
  34. [MDP_Y_CRCB_H2V1] = MDP_Y_CRCB_H2V1_SRC_REG,
  35. [MDP_BGRX_8888] = MDP_RGBX_8888_SRC_REG,
  36. };
  37. const uint32_t out_cfg_lut[MDP_IMGTYPE_LIMIT] = {
  38. [MDP_RGB_565] = MDP_RGB_565_DST_REG,
  39. [MDP_BGR_565] = MDP_RGB_565_DST_REG,
  40. [MDP_RGB_888] = MDP_RGB_888_DST_REG,
  41. [MDP_BGR_888] = MDP_RGB_888_DST_REG,
  42. [MDP_BGRA_8888] = MDP_RGBX_8888_DST_REG,
  43. [MDP_RGBA_8888] = MDP_RGBX_8888_DST_REG,
  44. [MDP_ARGB_8888] = MDP_RGBX_8888_DST_REG,
  45. [MDP_XRGB_8888] = MDP_RGBX_8888_DST_REG,
  46. [MDP_RGBX_8888] = MDP_RGBX_8888_DST_REG,
  47. [MDP_Y_CRCB_H2V2] = MDP_Y_CBCR_H2V2_DST_REG,
  48. [MDP_Y_CBCR_H2V2] = MDP_Y_CBCR_H2V2_DST_REG,
  49. [MDP_Y_CBCR_H2V2_ADRENO] = MDP_Y_CBCR_H2V2_DST_REG,
  50. [MDP_Y_CBCR_H2V2_VENUS] = MDP_Y_CBCR_H2V2_DST_REG,
  51. [MDP_YCRYCB_H2V1] = MDP_YCRYCB_H2V1_DST_REG,
  52. [MDP_Y_CBCR_H2V1] = MDP_Y_CRCB_H2V1_DST_REG,
  53. [MDP_Y_CRCB_H2V1] = MDP_Y_CRCB_H2V1_DST_REG,
  54. [MDP_BGRX_8888] = MDP_RGBX_8888_DST_REG,
  55. };
  56. const uint32_t pack_patt_lut[MDP_IMGTYPE_LIMIT] = {
  57. [MDP_RGB_565] = PPP_GET_PACK_PATTERN(0, CLR_B, CLR_G, CLR_R, 8),
  58. [MDP_BGR_565] = PPP_GET_PACK_PATTERN(0, CLR_B, CLR_G, CLR_R, 8),
  59. [MDP_RGB_888] = PPP_GET_PACK_PATTERN(0, CLR_R, CLR_G, CLR_B, 8),
  60. [MDP_BGR_888] = PPP_GET_PACK_PATTERN(0, CLR_B, CLR_G, CLR_R, 8),
  61. [MDP_BGRA_8888] = PPP_GET_PACK_PATTERN(CLR_ALPHA, CLR_B,
  62. CLR_G, CLR_R, 8),
  63. [MDP_RGBA_8888] = PPP_GET_PACK_PATTERN(CLR_ALPHA, CLR_R,
  64. CLR_G, CLR_B, 8),
  65. [MDP_ARGB_8888] = PPP_GET_PACK_PATTERN(CLR_ALPHA, CLR_R,
  66. CLR_G, CLR_B, 8),
  67. [MDP_XRGB_8888] = PPP_GET_PACK_PATTERN(CLR_ALPHA, CLR_R,
  68. CLR_G, CLR_B, 8),
  69. [MDP_RGBX_8888] = PPP_GET_PACK_PATTERN(CLR_ALPHA, CLR_R,
  70. CLR_G, CLR_B, 8),
  71. [MDP_Y_CRCB_H2V2] = PPP_GET_PACK_PATTERN(0, 0, CLR_CR, CLR_CB, 8),
  72. [MDP_Y_CBCR_H2V2] = PPP_GET_PACK_PATTERN(0, 0, CLR_CB, CLR_CR, 8),
  73. [MDP_Y_CBCR_H2V2_ADRENO] = PPP_GET_PACK_PATTERN(0, 0, CLR_CB,
  74. CLR_CR, 8),
  75. [MDP_Y_CBCR_H2V2_VENUS] = PPP_GET_PACK_PATTERN(0, 0, CLR_CB,
  76. CLR_CR, 8),
  77. [MDP_YCRYCB_H2V1] = PPP_GET_PACK_PATTERN(CLR_Y,
  78. CLR_CR, CLR_Y, CLR_CB, 8),
  79. [MDP_Y_CBCR_H2V1] = PPP_GET_PACK_PATTERN(0, 0, CLR_CB, CLR_CR, 8),
  80. [MDP_Y_CRCB_H2V1] = PPP_GET_PACK_PATTERN(0, 0, CLR_CR, CLR_CB, 8),
  81. [MDP_BGRX_8888] = PPP_GET_PACK_PATTERN(CLR_ALPHA, CLR_B,
  82. CLR_G, CLR_R, 8),
  83. };
  84. const uint32_t swapped_pack_patt_lut[MDP_IMGTYPE_LIMIT] = {
  85. [MDP_RGB_565] = PPP_GET_PACK_PATTERN(0, CLR_B, CLR_G, CLR_R, 8),
  86. [MDP_BGR_565] = PPP_GET_PACK_PATTERN(0, CLR_R, CLR_G, CLR_B, 8),
  87. [MDP_RGB_888] = PPP_GET_PACK_PATTERN(0, CLR_B, CLR_G, CLR_R, 8),
  88. [MDP_BGR_888] = PPP_GET_PACK_PATTERN(0, CLR_R, CLR_G, CLR_B, 8),
  89. [MDP_BGRA_8888] = PPP_GET_PACK_PATTERN(CLR_ALPHA, CLR_R,
  90. CLR_G, CLR_B, 8),
  91. [MDP_RGBA_8888] = PPP_GET_PACK_PATTERN(CLR_ALPHA, CLR_B,
  92. CLR_G, CLR_R, 8),
  93. [MDP_ARGB_8888] = PPP_GET_PACK_PATTERN(CLR_ALPHA, CLR_B,
  94. CLR_G, CLR_R, 8),
  95. [MDP_XRGB_8888] = PPP_GET_PACK_PATTERN(CLR_ALPHA, CLR_B,
  96. CLR_G, CLR_R, 8),
  97. [MDP_RGBX_8888] = PPP_GET_PACK_PATTERN(CLR_ALPHA, CLR_B,
  98. CLR_G, CLR_R, 8),
  99. [MDP_Y_CRCB_H2V2] = PPP_GET_PACK_PATTERN(0, 0, CLR_CB, CLR_CR, 8),
  100. [MDP_Y_CBCR_H2V2] = PPP_GET_PACK_PATTERN(0, 0, CLR_CR, CLR_CB, 8),
  101. [MDP_Y_CBCR_H2V2_ADRENO] = PPP_GET_PACK_PATTERN(0, 0, CLR_CR,
  102. CLR_CB, 8),
  103. [MDP_Y_CBCR_H2V2_VENUS] = PPP_GET_PACK_PATTERN(0, 0, CLR_CR,
  104. CLR_CB, 8),
  105. [MDP_YCRYCB_H2V1] = PPP_GET_PACK_PATTERN(CLR_Y,
  106. CLR_CB, CLR_Y, CLR_CR, 8),
  107. [MDP_Y_CBCR_H2V1] = PPP_GET_PACK_PATTERN(0, 0, CLR_CR, CLR_CB, 8),
  108. [MDP_Y_CRCB_H2V1] = PPP_GET_PACK_PATTERN(0, 0, CLR_CB, CLR_CR, 8),
  109. [MDP_BGRX_8888] = PPP_GET_PACK_PATTERN(CLR_ALPHA, CLR_R,
  110. CLR_G, CLR_B, 8),
  111. };
  112. const uint32_t dst_op_reg[MDP_IMGTYPE_LIMIT] = {
  113. [MDP_Y_CRCB_H2V2] = PPP_OP_DST_CHROMA_420,
  114. [MDP_Y_CBCR_H2V2] = PPP_OP_DST_CHROMA_420,
  115. [MDP_Y_CBCR_H2V1] = PPP_OP_DST_CHROMA_H2V1,
  116. [MDP_Y_CRCB_H2V1] = PPP_OP_DST_CHROMA_H2V1,
  117. [MDP_YCRYCB_H2V1] = PPP_OP_DST_CHROMA_H2V1,
  118. };
  119. const uint32_t src_op_reg[MDP_IMGTYPE_LIMIT] = {
  120. [MDP_Y_CRCB_H2V2] = PPP_OP_SRC_CHROMA_420 | PPP_OP_COLOR_SPACE_YCBCR,
  121. [MDP_Y_CBCR_H2V2] = PPP_OP_SRC_CHROMA_420 | PPP_OP_COLOR_SPACE_YCBCR,
  122. [MDP_Y_CBCR_H2V2_ADRENO] = PPP_OP_SRC_CHROMA_420 |
  123. PPP_OP_COLOR_SPACE_YCBCR,
  124. [MDP_Y_CBCR_H2V2_VENUS] = PPP_OP_SRC_CHROMA_420 |
  125. PPP_OP_COLOR_SPACE_YCBCR,
  126. [MDP_Y_CBCR_H2V1] = PPP_OP_SRC_CHROMA_H2V1,
  127. [MDP_Y_CRCB_H2V1] = PPP_OP_SRC_CHROMA_H2V1,
  128. [MDP_YCRYCB_H2V1] = PPP_OP_SRC_CHROMA_H2V1,
  129. };
  130. const uint32_t bytes_per_pixel[MDP_IMGTYPE_LIMIT] = {
  131. [MDP_RGB_565] = 2,
  132. [MDP_BGR_565] = 2,
  133. [MDP_RGB_888] = 3,
  134. [MDP_BGR_888] = 3,
  135. [MDP_XRGB_8888] = 4,
  136. [MDP_ARGB_8888] = 4,
  137. [MDP_RGBA_8888] = 4,
  138. [MDP_BGRA_8888] = 4,
  139. [MDP_RGBX_8888] = 4,
  140. [MDP_Y_CBCR_H2V1] = 1,
  141. [MDP_Y_CBCR_H2V2] = 1,
  142. [MDP_Y_CBCR_H2V2_ADRENO] = 1,
  143. [MDP_Y_CBCR_H2V2_VENUS] = 1,
  144. [MDP_Y_CRCB_H2V1] = 1,
  145. [MDP_Y_CRCB_H2V2] = 1,
  146. [MDP_YCRYCB_H2V1] = 2,
  147. [MDP_BGRX_8888] = 4,
  148. };
  149. const bool per_pixel_alpha[MDP_IMGTYPE_LIMIT] = {
  150. [MDP_BGRA_8888] = true,
  151. [MDP_RGBA_8888] = true,
  152. [MDP_ARGB_8888] = true,
  153. };
  154. const bool multi_plane[MDP_IMGTYPE_LIMIT] = {
  155. [MDP_Y_CRCB_H2V2] = true,
  156. [MDP_Y_CBCR_H2V2] = true,
  157. [MDP_Y_CBCR_H2V1] = true,
  158. [MDP_Y_CRCB_H2V1] = true,
  159. };
  160. /* lut default */
  161. uint32_t default_pre_lut_val[PPP_LUT_MAX] = {
  162. 0x0,
  163. 0x151515,
  164. 0x1d1d1d,
  165. 0x232323,
  166. 0x272727,
  167. 0x2b2b2b,
  168. 0x2f2f2f,
  169. 0x333333,
  170. 0x363636,
  171. 0x393939,
  172. 0x3b3b3b,
  173. 0x3e3e3e,
  174. 0x404040,
  175. 0x434343,
  176. 0x454545,
  177. 0x474747,
  178. 0x494949,
  179. 0x4b4b4b,
  180. 0x4d4d4d,
  181. 0x4f4f4f,
  182. 0x515151,
  183. 0x535353,
  184. 0x555555,
  185. 0x565656,
  186. 0x585858,
  187. 0x5a5a5a,
  188. 0x5b5b5b,
  189. 0x5d5d5d,
  190. 0x5e5e5e,
  191. 0x606060,
  192. 0x616161,
  193. 0x636363,
  194. 0x646464,
  195. 0x666666,
  196. 0x676767,
  197. 0x686868,
  198. 0x6a6a6a,
  199. 0x6b6b6b,
  200. 0x6c6c6c,
  201. 0x6e6e6e,
  202. 0x6f6f6f,
  203. 0x707070,
  204. 0x717171,
  205. 0x727272,
  206. 0x747474,
  207. 0x757575,
  208. 0x767676,
  209. 0x777777,
  210. 0x787878,
  211. 0x797979,
  212. 0x7a7a7a,
  213. 0x7c7c7c,
  214. 0x7d7d7d,
  215. 0x7e7e7e,
  216. 0x7f7f7f,
  217. 0x808080,
  218. 0x818181,
  219. 0x828282,
  220. 0x838383,
  221. 0x848484,
  222. 0x858585,
  223. 0x868686,
  224. 0x878787,
  225. 0x888888,
  226. 0x898989,
  227. 0x8a8a8a,
  228. 0x8b8b8b,
  229. 0x8c8c8c,
  230. 0x8d8d8d,
  231. 0x8e8e8e,
  232. 0x8f8f8f,
  233. 0x8f8f8f,
  234. 0x909090,
  235. 0x919191,
  236. 0x929292,
  237. 0x939393,
  238. 0x949494,
  239. 0x959595,
  240. 0x969696,
  241. 0x969696,
  242. 0x979797,
  243. 0x989898,
  244. 0x999999,
  245. 0x9a9a9a,
  246. 0x9b9b9b,
  247. 0x9c9c9c,
  248. 0x9c9c9c,
  249. 0x9d9d9d,
  250. 0x9e9e9e,
  251. 0x9f9f9f,
  252. 0xa0a0a0,
  253. 0xa0a0a0,
  254. 0xa1a1a1,
  255. 0xa2a2a2,
  256. 0xa3a3a3,
  257. 0xa4a4a4,
  258. 0xa4a4a4,
  259. 0xa5a5a5,
  260. 0xa6a6a6,
  261. 0xa7a7a7,
  262. 0xa7a7a7,
  263. 0xa8a8a8,
  264. 0xa9a9a9,
  265. 0xaaaaaa,
  266. 0xaaaaaa,
  267. 0xababab,
  268. 0xacacac,
  269. 0xadadad,
  270. 0xadadad,
  271. 0xaeaeae,
  272. 0xafafaf,
  273. 0xafafaf,
  274. 0xb0b0b0,
  275. 0xb1b1b1,
  276. 0xb2b2b2,
  277. 0xb2b2b2,
  278. 0xb3b3b3,
  279. 0xb4b4b4,
  280. 0xb4b4b4,
  281. 0xb5b5b5,
  282. 0xb6b6b6,
  283. 0xb6b6b6,
  284. 0xb7b7b7,
  285. 0xb8b8b8,
  286. 0xb8b8b8,
  287. 0xb9b9b9,
  288. 0xbababa,
  289. 0xbababa,
  290. 0xbbbbbb,
  291. 0xbcbcbc,
  292. 0xbcbcbc,
  293. 0xbdbdbd,
  294. 0xbebebe,
  295. 0xbebebe,
  296. 0xbfbfbf,
  297. 0xc0c0c0,
  298. 0xc0c0c0,
  299. 0xc1c1c1,
  300. 0xc1c1c1,
  301. 0xc2c2c2,
  302. 0xc3c3c3,
  303. 0xc3c3c3,
  304. 0xc4c4c4,
  305. 0xc5c5c5,
  306. 0xc5c5c5,
  307. 0xc6c6c6,
  308. 0xc6c6c6,
  309. 0xc7c7c7,
  310. 0xc8c8c8,
  311. 0xc8c8c8,
  312. 0xc9c9c9,
  313. 0xc9c9c9,
  314. 0xcacaca,
  315. 0xcbcbcb,
  316. 0xcbcbcb,
  317. 0xcccccc,
  318. 0xcccccc,
  319. 0xcdcdcd,
  320. 0xcecece,
  321. 0xcecece,
  322. 0xcfcfcf,
  323. 0xcfcfcf,
  324. 0xd0d0d0,
  325. 0xd0d0d0,
  326. 0xd1d1d1,
  327. 0xd2d2d2,
  328. 0xd2d2d2,
  329. 0xd3d3d3,
  330. 0xd3d3d3,
  331. 0xd4d4d4,
  332. 0xd4d4d4,
  333. 0xd5d5d5,
  334. 0xd6d6d6,
  335. 0xd6d6d6,
  336. 0xd7d7d7,
  337. 0xd7d7d7,
  338. 0xd8d8d8,
  339. 0xd8d8d8,
  340. 0xd9d9d9,
  341. 0xd9d9d9,
  342. 0xdadada,
  343. 0xdbdbdb,
  344. 0xdbdbdb,
  345. 0xdcdcdc,
  346. 0xdcdcdc,
  347. 0xdddddd,
  348. 0xdddddd,
  349. 0xdedede,
  350. 0xdedede,
  351. 0xdfdfdf,
  352. 0xdfdfdf,
  353. 0xe0e0e0,
  354. 0xe0e0e0,
  355. 0xe1e1e1,
  356. 0xe1e1e1,
  357. 0xe2e2e2,
  358. 0xe3e3e3,
  359. 0xe3e3e3,
  360. 0xe4e4e4,
  361. 0xe4e4e4,
  362. 0xe5e5e5,
  363. 0xe5e5e5,
  364. 0xe6e6e6,
  365. 0xe6e6e6,
  366. 0xe7e7e7,
  367. 0xe7e7e7,
  368. 0xe8e8e8,
  369. 0xe8e8e8,
  370. 0xe9e9e9,
  371. 0xe9e9e9,
  372. 0xeaeaea,
  373. 0xeaeaea,
  374. 0xebebeb,
  375. 0xebebeb,
  376. 0xececec,
  377. 0xececec,
  378. 0xededed,
  379. 0xededed,
  380. 0xeeeeee,
  381. 0xeeeeee,
  382. 0xefefef,
  383. 0xefefef,
  384. 0xf0f0f0,
  385. 0xf0f0f0,
  386. 0xf1f1f1,
  387. 0xf1f1f1,
  388. 0xf2f2f2,
  389. 0xf2f2f2,
  390. 0xf2f2f2,
  391. 0xf3f3f3,
  392. 0xf3f3f3,
  393. 0xf4f4f4,
  394. 0xf4f4f4,
  395. 0xf5f5f5,
  396. 0xf5f5f5,
  397. 0xf6f6f6,
  398. 0xf6f6f6,
  399. 0xf7f7f7,
  400. 0xf7f7f7,
  401. 0xf8f8f8,
  402. 0xf8f8f8,
  403. 0xf9f9f9,
  404. 0xf9f9f9,
  405. 0xfafafa,
  406. 0xfafafa,
  407. 0xfafafa,
  408. 0xfbfbfb,
  409. 0xfbfbfb,
  410. 0xfcfcfc,
  411. 0xfcfcfc,
  412. 0xfdfdfd,
  413. 0xfdfdfd,
  414. 0xfefefe,
  415. 0xfefefe,
  416. 0xffffff,
  417. 0xffffff,
  418. };
  419. uint32_t default_post_lut_val[PPP_LUT_MAX] = {
  420. 0x0,
  421. 0x0,
  422. 0x0,
  423. 0x0,
  424. 0x0,
  425. 0x0,
  426. 0x0,
  427. 0x0,
  428. 0x0,
  429. 0x0,
  430. 0x0,
  431. 0x0,
  432. 0x0,
  433. 0x0,
  434. 0x0,
  435. 0x0,
  436. 0x10101,
  437. 0x10101,
  438. 0x10101,
  439. 0x10101,
  440. 0x10101,
  441. 0x10101,
  442. 0x10101,
  443. 0x10101,
  444. 0x10101,
  445. 0x10101,
  446. 0x20202,
  447. 0x20202,
  448. 0x20202,
  449. 0x20202,
  450. 0x20202,
  451. 0x20202,
  452. 0x30303,
  453. 0x30303,
  454. 0x30303,
  455. 0x30303,
  456. 0x30303,
  457. 0x40404,
  458. 0x40404,
  459. 0x40404,
  460. 0x40404,
  461. 0x40404,
  462. 0x50505,
  463. 0x50505,
  464. 0x50505,
  465. 0x50505,
  466. 0x60606,
  467. 0x60606,
  468. 0x60606,
  469. 0x70707,
  470. 0x70707,
  471. 0x70707,
  472. 0x70707,
  473. 0x80808,
  474. 0x80808,
  475. 0x80808,
  476. 0x90909,
  477. 0x90909,
  478. 0xa0a0a,
  479. 0xa0a0a,
  480. 0xa0a0a,
  481. 0xb0b0b,
  482. 0xb0b0b,
  483. 0xb0b0b,
  484. 0xc0c0c,
  485. 0xc0c0c,
  486. 0xd0d0d,
  487. 0xd0d0d,
  488. 0xe0e0e,
  489. 0xe0e0e,
  490. 0xe0e0e,
  491. 0xf0f0f,
  492. 0xf0f0f,
  493. 0x101010,
  494. 0x101010,
  495. 0x111111,
  496. 0x111111,
  497. 0x121212,
  498. 0x121212,
  499. 0x131313,
  500. 0x131313,
  501. 0x141414,
  502. 0x151515,
  503. 0x151515,
  504. 0x161616,
  505. 0x161616,
  506. 0x171717,
  507. 0x171717,
  508. 0x181818,
  509. 0x191919,
  510. 0x191919,
  511. 0x1a1a1a,
  512. 0x1b1b1b,
  513. 0x1b1b1b,
  514. 0x1c1c1c,
  515. 0x1c1c1c,
  516. 0x1d1d1d,
  517. 0x1e1e1e,
  518. 0x1f1f1f,
  519. 0x1f1f1f,
  520. 0x202020,
  521. 0x212121,
  522. 0x212121,
  523. 0x222222,
  524. 0x232323,
  525. 0x242424,
  526. 0x242424,
  527. 0x252525,
  528. 0x262626,
  529. 0x272727,
  530. 0x272727,
  531. 0x282828,
  532. 0x292929,
  533. 0x2a2a2a,
  534. 0x2b2b2b,
  535. 0x2c2c2c,
  536. 0x2c2c2c,
  537. 0x2d2d2d,
  538. 0x2e2e2e,
  539. 0x2f2f2f,
  540. 0x303030,
  541. 0x313131,
  542. 0x323232,
  543. 0x333333,
  544. 0x333333,
  545. 0x343434,
  546. 0x353535,
  547. 0x363636,
  548. 0x373737,
  549. 0x383838,
  550. 0x393939,
  551. 0x3a3a3a,
  552. 0x3b3b3b,
  553. 0x3c3c3c,
  554. 0x3d3d3d,
  555. 0x3e3e3e,
  556. 0x3f3f3f,
  557. 0x404040,
  558. 0x414141,
  559. 0x424242,
  560. 0x434343,
  561. 0x444444,
  562. 0x464646,
  563. 0x474747,
  564. 0x484848,
  565. 0x494949,
  566. 0x4a4a4a,
  567. 0x4b4b4b,
  568. 0x4c4c4c,
  569. 0x4d4d4d,
  570. 0x4f4f4f,
  571. 0x505050,
  572. 0x515151,
  573. 0x525252,
  574. 0x535353,
  575. 0x545454,
  576. 0x565656,
  577. 0x575757,
  578. 0x585858,
  579. 0x595959,
  580. 0x5b5b5b,
  581. 0x5c5c5c,
  582. 0x5d5d5d,
  583. 0x5e5e5e,
  584. 0x606060,
  585. 0x616161,
  586. 0x626262,
  587. 0x646464,
  588. 0x656565,
  589. 0x666666,
  590. 0x686868,
  591. 0x696969,
  592. 0x6a6a6a,
  593. 0x6c6c6c,
  594. 0x6d6d6d,
  595. 0x6f6f6f,
  596. 0x707070,
  597. 0x717171,
  598. 0x737373,
  599. 0x747474,
  600. 0x767676,
  601. 0x777777,
  602. 0x797979,
  603. 0x7a7a7a,
  604. 0x7c7c7c,
  605. 0x7d7d7d,
  606. 0x7f7f7f,
  607. 0x808080,
  608. 0x828282,
  609. 0x838383,
  610. 0x858585,
  611. 0x868686,
  612. 0x888888,
  613. 0x898989,
  614. 0x8b8b8b,
  615. 0x8d8d8d,
  616. 0x8e8e8e,
  617. 0x909090,
  618. 0x919191,
  619. 0x939393,
  620. 0x959595,
  621. 0x969696,
  622. 0x989898,
  623. 0x9a9a9a,
  624. 0x9b9b9b,
  625. 0x9d9d9d,
  626. 0x9f9f9f,
  627. 0xa1a1a1,
  628. 0xa2a2a2,
  629. 0xa4a4a4,
  630. 0xa6a6a6,
  631. 0xa7a7a7,
  632. 0xa9a9a9,
  633. 0xababab,
  634. 0xadadad,
  635. 0xafafaf,
  636. 0xb0b0b0,
  637. 0xb2b2b2,
  638. 0xb4b4b4,
  639. 0xb6b6b6,
  640. 0xb8b8b8,
  641. 0xbababa,
  642. 0xbbbbbb,
  643. 0xbdbdbd,
  644. 0xbfbfbf,
  645. 0xc1c1c1,
  646. 0xc3c3c3,
  647. 0xc5c5c5,
  648. 0xc7c7c7,
  649. 0xc9c9c9,
  650. 0xcbcbcb,
  651. 0xcdcdcd,
  652. 0xcfcfcf,
  653. 0xd1d1d1,
  654. 0xd3d3d3,
  655. 0xd5d5d5,
  656. 0xd7d7d7,
  657. 0xd9d9d9,
  658. 0xdbdbdb,
  659. 0xdddddd,
  660. 0xdfdfdf,
  661. 0xe1e1e1,
  662. 0xe3e3e3,
  663. 0xe5e5e5,
  664. 0xe7e7e7,
  665. 0xe9e9e9,
  666. 0xebebeb,
  667. 0xeeeeee,
  668. 0xf0f0f0,
  669. 0xf2f2f2,
  670. 0xf4f4f4,
  671. 0xf6f6f6,
  672. 0xf8f8f8,
  673. 0xfbfbfb,
  674. 0xfdfdfd,
  675. 0xffffff,
  676. };
  677. struct ppp_csc_table rgb2yuv = {
  678. .fwd_matrix = {
  679. 0x83,
  680. 0x102,
  681. 0x32,
  682. 0xffb5,
  683. 0xff6c,
  684. 0xe1,
  685. 0xe1,
  686. 0xff45,
  687. 0xffdc,
  688. },
  689. .rev_matrix = {
  690. 0x254,
  691. 0x0,
  692. 0x331,
  693. 0x254,
  694. 0xff38,
  695. 0xfe61,
  696. 0x254,
  697. 0x409,
  698. 0x0,
  699. },
  700. .bv = {
  701. 0x10,
  702. 0x80,
  703. 0x80,
  704. },
  705. .lv = {
  706. 0x10,
  707. 0xeb,
  708. 0x10,
  709. 0xf0,
  710. },
  711. };
  712. struct ppp_csc_table default_table2 = {
  713. .fwd_matrix = {
  714. 0x5d,
  715. 0x13a,
  716. 0x20,
  717. 0xffcd,
  718. 0xff54,
  719. 0xe1,
  720. 0xe1,
  721. 0xff35,
  722. },
  723. .rev_matrix = {
  724. 0x254,
  725. 0x0,
  726. 0x396,
  727. 0x254,
  728. 0xff94,
  729. 0xfef0,
  730. 0x254,
  731. 0x43a,
  732. 0x0,
  733. },
  734. .bv = {
  735. 0x10,
  736. 0x80,
  737. 0x80,
  738. },
  739. .lv = {
  740. 0x10,
  741. 0xeb,
  742. 0x10,
  743. 0xf0,
  744. },
  745. };
  746. const struct ppp_table upscale_table[PPP_UPSCALE_MAX] = {
  747. { 0x5fffc, 0x0 },
  748. { 0x50200, 0x7fc00000 },
  749. { 0x5fffc, 0xff80000d },
  750. { 0x50204, 0x7ec003f9 },
  751. { 0x5fffc, 0xfec0001c },
  752. { 0x50208, 0x7d4003f3 },
  753. { 0x5fffc, 0xfe40002b },
  754. { 0x5020c, 0x7b8003ed },
  755. { 0x5fffc, 0xfd80003c },
  756. { 0x50210, 0x794003e8 },
  757. { 0x5fffc, 0xfcc0004d },
  758. { 0x50214, 0x76c003e4 },
  759. { 0x5fffc, 0xfc40005f },
  760. { 0x50218, 0x73c003e0 },
  761. { 0x5fffc, 0xfb800071 },
  762. { 0x5021c, 0x708003de },
  763. { 0x5fffc, 0xfac00085 },
  764. { 0x50220, 0x6d0003db },
  765. { 0x5fffc, 0xfa000098 },
  766. { 0x50224, 0x698003d9 },
  767. { 0x5fffc, 0xf98000ac },
  768. { 0x50228, 0x654003d8 },
  769. { 0x5fffc, 0xf8c000c1 },
  770. { 0x5022c, 0x610003d7 },
  771. { 0x5fffc, 0xf84000d5 },
  772. { 0x50230, 0x5c8003d7 },
  773. { 0x5fffc, 0xf7c000e9 },
  774. { 0x50234, 0x580003d7 },
  775. { 0x5fffc, 0xf74000fd },
  776. { 0x50238, 0x534003d8 },
  777. { 0x5fffc, 0xf6c00112 },
  778. { 0x5023c, 0x4e8003d8 },
  779. { 0x5fffc, 0xf6800126 },
  780. { 0x50240, 0x494003da },
  781. { 0x5fffc, 0xf600013a },
  782. { 0x50244, 0x448003db },
  783. { 0x5fffc, 0xf600014d },
  784. { 0x50248, 0x3f4003dd },
  785. { 0x5fffc, 0xf5c00160 },
  786. { 0x5024c, 0x3a4003df },
  787. { 0x5fffc, 0xf5c00172 },
  788. { 0x50250, 0x354003e1 },
  789. { 0x5fffc, 0xf5c00184 },
  790. { 0x50254, 0x304003e3 },
  791. { 0x5fffc, 0xf6000195 },
  792. { 0x50258, 0x2b0003e6 },
  793. { 0x5fffc, 0xf64001a6 },
  794. { 0x5025c, 0x260003e8 },
  795. { 0x5fffc, 0xf6c001b4 },
  796. { 0x50260, 0x214003eb },
  797. { 0x5fffc, 0xf78001c2 },
  798. { 0x50264, 0x1c4003ee },
  799. { 0x5fffc, 0xf80001cf },
  800. { 0x50268, 0x17c003f1 },
  801. { 0x5fffc, 0xf90001db },
  802. { 0x5026c, 0x134003f3 },
  803. { 0x5fffc, 0xfa0001e5 },
  804. { 0x50270, 0xf0003f6 },
  805. { 0x5fffc, 0xfb4001ee },
  806. { 0x50274, 0xac003f9 },
  807. { 0x5fffc, 0xfcc001f5 },
  808. { 0x50278, 0x70003fb },
  809. { 0x5fffc, 0xfe4001fb },
  810. { 0x5027c, 0x34003fe },
  811. };
  812. const struct ppp_table mdp_gaussian_blur_table[PPP_BLUR_SCALE_MAX] = {
  813. /* max variance */
  814. { 0x5fffc, 0x20000080 },
  815. { 0x50280, 0x20000080 },
  816. { 0x5fffc, 0x20000080 },
  817. { 0x50284, 0x20000080 },
  818. { 0x5fffc, 0x20000080 },
  819. { 0x50288, 0x20000080 },
  820. { 0x5fffc, 0x20000080 },
  821. { 0x5028c, 0x20000080 },
  822. { 0x5fffc, 0x20000080 },
  823. { 0x50290, 0x20000080 },
  824. { 0x5fffc, 0x20000080 },
  825. { 0x50294, 0x20000080 },
  826. { 0x5fffc, 0x20000080 },
  827. { 0x50298, 0x20000080 },
  828. { 0x5fffc, 0x20000080 },
  829. { 0x5029c, 0x20000080 },
  830. { 0x5fffc, 0x20000080 },
  831. { 0x502a0, 0x20000080 },
  832. { 0x5fffc, 0x20000080 },
  833. { 0x502a4, 0x20000080 },
  834. { 0x5fffc, 0x20000080 },
  835. { 0x502a8, 0x20000080 },
  836. { 0x5fffc, 0x20000080 },
  837. { 0x502ac, 0x20000080 },
  838. { 0x5fffc, 0x20000080 },
  839. { 0x502b0, 0x20000080 },
  840. { 0x5fffc, 0x20000080 },
  841. { 0x502b4, 0x20000080 },
  842. { 0x5fffc, 0x20000080 },
  843. { 0x502b8, 0x20000080 },
  844. { 0x5fffc, 0x20000080 },
  845. { 0x502bc, 0x20000080 },
  846. { 0x5fffc, 0x20000080 },
  847. { 0x502c0, 0x20000080 },
  848. { 0x5fffc, 0x20000080 },
  849. { 0x502c4, 0x20000080 },
  850. { 0x5fffc, 0x20000080 },
  851. { 0x502c8, 0x20000080 },
  852. { 0x5fffc, 0x20000080 },
  853. { 0x502cc, 0x20000080 },
  854. { 0x5fffc, 0x20000080 },
  855. { 0x502d0, 0x20000080 },
  856. { 0x5fffc, 0x20000080 },
  857. { 0x502d4, 0x20000080 },
  858. { 0x5fffc, 0x20000080 },
  859. { 0x502d8, 0x20000080 },
  860. { 0x5fffc, 0x20000080 },
  861. { 0x502dc, 0x20000080 },
  862. { 0x5fffc, 0x20000080 },
  863. { 0x502e0, 0x20000080 },
  864. { 0x5fffc, 0x20000080 },
  865. { 0x502e4, 0x20000080 },
  866. { 0x5fffc, 0x20000080 },
  867. { 0x502e8, 0x20000080 },
  868. { 0x5fffc, 0x20000080 },
  869. { 0x502ec, 0x20000080 },
  870. { 0x5fffc, 0x20000080 },
  871. { 0x502f0, 0x20000080 },
  872. { 0x5fffc, 0x20000080 },
  873. { 0x502f4, 0x20000080 },
  874. { 0x5fffc, 0x20000080 },
  875. { 0x502f8, 0x20000080 },
  876. { 0x5fffc, 0x20000080 },
  877. { 0x502fc, 0x20000080 },
  878. { 0x5fffc, 0x20000080 },
  879. { 0x50300, 0x20000080 },
  880. { 0x5fffc, 0x20000080 },
  881. { 0x50304, 0x20000080 },
  882. { 0x5fffc, 0x20000080 },
  883. { 0x50308, 0x20000080 },
  884. { 0x5fffc, 0x20000080 },
  885. { 0x5030c, 0x20000080 },
  886. { 0x5fffc, 0x20000080 },
  887. { 0x50310, 0x20000080 },
  888. { 0x5fffc, 0x20000080 },
  889. { 0x50314, 0x20000080 },
  890. { 0x5fffc, 0x20000080 },
  891. { 0x50318, 0x20000080 },
  892. { 0x5fffc, 0x20000080 },
  893. { 0x5031c, 0x20000080 },
  894. { 0x5fffc, 0x20000080 },
  895. { 0x50320, 0x20000080 },
  896. { 0x5fffc, 0x20000080 },
  897. { 0x50324, 0x20000080 },
  898. { 0x5fffc, 0x20000080 },
  899. { 0x50328, 0x20000080 },
  900. { 0x5fffc, 0x20000080 },
  901. { 0x5032c, 0x20000080 },
  902. { 0x5fffc, 0x20000080 },
  903. { 0x50330, 0x20000080 },
  904. { 0x5fffc, 0x20000080 },
  905. { 0x50334, 0x20000080 },
  906. { 0x5fffc, 0x20000080 },
  907. { 0x50338, 0x20000080 },
  908. { 0x5fffc, 0x20000080 },
  909. { 0x5033c, 0x20000080 },
  910. { 0x5fffc, 0x20000080 },
  911. { 0x50340, 0x20000080 },
  912. { 0x5fffc, 0x20000080 },
  913. { 0x50344, 0x20000080 },
  914. { 0x5fffc, 0x20000080 },
  915. { 0x50348, 0x20000080 },
  916. { 0x5fffc, 0x20000080 },
  917. { 0x5034c, 0x20000080 },
  918. { 0x5fffc, 0x20000080 },
  919. { 0x50350, 0x20000080 },
  920. { 0x5fffc, 0x20000080 },
  921. { 0x50354, 0x20000080 },
  922. { 0x5fffc, 0x20000080 },
  923. { 0x50358, 0x20000080 },
  924. { 0x5fffc, 0x20000080 },
  925. { 0x5035c, 0x20000080 },
  926. { 0x5fffc, 0x20000080 },
  927. { 0x50360, 0x20000080 },
  928. { 0x5fffc, 0x20000080 },
  929. { 0x50364, 0x20000080 },
  930. { 0x5fffc, 0x20000080 },
  931. { 0x50368, 0x20000080 },
  932. { 0x5fffc, 0x20000080 },
  933. { 0x5036c, 0x20000080 },
  934. { 0x5fffc, 0x20000080 },
  935. { 0x50370, 0x20000080 },
  936. { 0x5fffc, 0x20000080 },
  937. { 0x50374, 0x20000080 },
  938. { 0x5fffc, 0x20000080 },
  939. { 0x50378, 0x20000080 },
  940. { 0x5fffc, 0x20000080 },
  941. { 0x5037c, 0x20000080 },
  942. };
  943. const struct ppp_table downscale_x_table_pt2topt4[] = {
  944. { 0x5fffc, 0x740008c },
  945. { 0x50280, 0x33800088 },
  946. { 0x5fffc, 0x800008e },
  947. { 0x50284, 0x33400084 },
  948. { 0x5fffc, 0x8400092 },
  949. { 0x50288, 0x33000080 },
  950. { 0x5fffc, 0x9000094 },
  951. { 0x5028c, 0x3300007b },
  952. { 0x5fffc, 0x9c00098 },
  953. { 0x50290, 0x32400077 },
  954. { 0x5fffc, 0xa40009b },
  955. { 0x50294, 0x32000073 },
  956. { 0x5fffc, 0xb00009d },
  957. { 0x50298, 0x31c0006f },
  958. { 0x5fffc, 0xbc000a0 },
  959. { 0x5029c, 0x3140006b },
  960. { 0x5fffc, 0xc8000a2 },
  961. { 0x502a0, 0x31000067 },
  962. { 0x5fffc, 0xd8000a5 },
  963. { 0x502a4, 0x30800062 },
  964. { 0x5fffc, 0xe4000a8 },
  965. { 0x502a8, 0x2fc0005f },
  966. { 0x5fffc, 0xec000aa },
  967. { 0x502ac, 0x2fc0005b },
  968. { 0x5fffc, 0xf8000ad },
  969. { 0x502b0, 0x2f400057 },
  970. { 0x5fffc, 0x108000b0 },
  971. { 0x502b4, 0x2e400054 },
  972. { 0x5fffc, 0x114000b2 },
  973. { 0x502b8, 0x2e000050 },
  974. { 0x5fffc, 0x124000b4 },
  975. { 0x502bc, 0x2d80004c },
  976. { 0x5fffc, 0x130000b6 },
  977. { 0x502c0, 0x2d000049 },
  978. { 0x5fffc, 0x140000b8 },
  979. { 0x502c4, 0x2c800045 },
  980. { 0x5fffc, 0x150000b9 },
  981. { 0x502c8, 0x2c000042 },
  982. { 0x5fffc, 0x15c000bd },
  983. { 0x502cc, 0x2b40003e },
  984. { 0x5fffc, 0x16c000bf },
  985. { 0x502d0, 0x2a80003b },
  986. { 0x5fffc, 0x17c000bf },
  987. { 0x502d4, 0x2a000039 },
  988. { 0x5fffc, 0x188000c2 },
  989. { 0x502d8, 0x29400036 },
  990. { 0x5fffc, 0x19c000c4 },
  991. { 0x502dc, 0x28800032 },
  992. { 0x5fffc, 0x1ac000c5 },
  993. { 0x502e0, 0x2800002f },
  994. { 0x5fffc, 0x1bc000c7 },
  995. { 0x502e4, 0x2740002c },
  996. { 0x5fffc, 0x1cc000c8 },
  997. { 0x502e8, 0x26c00029 },
  998. { 0x5fffc, 0x1dc000c9 },
  999. { 0x502ec, 0x26000027 },
  1000. { 0x5fffc, 0x1ec000cc },
  1001. { 0x502f0, 0x25000024 },
  1002. { 0x5fffc, 0x200000cc },
  1003. { 0x502f4, 0x24800021 },
  1004. { 0x5fffc, 0x210000cd },
  1005. { 0x502f8, 0x23800020 },
  1006. { 0x5fffc, 0x220000ce },
  1007. { 0x502fc, 0x2300001d },
  1008. };
  1009. static const struct ppp_table downscale_x_table_pt4topt6[] = {
  1010. { 0x5fffc, 0x740008c },
  1011. { 0x50280, 0x33800088 },
  1012. { 0x5fffc, 0x800008e },
  1013. { 0x50284, 0x33400084 },
  1014. { 0x5fffc, 0x8400092 },
  1015. { 0x50288, 0x33000080 },
  1016. { 0x5fffc, 0x9000094 },
  1017. { 0x5028c, 0x3300007b },
  1018. { 0x5fffc, 0x9c00098 },
  1019. { 0x50290, 0x32400077 },
  1020. { 0x5fffc, 0xa40009b },
  1021. { 0x50294, 0x32000073 },
  1022. { 0x5fffc, 0xb00009d },
  1023. { 0x50298, 0x31c0006f },
  1024. { 0x5fffc, 0xbc000a0 },
  1025. { 0x5029c, 0x3140006b },
  1026. { 0x5fffc, 0xc8000a2 },
  1027. { 0x502a0, 0x31000067 },
  1028. { 0x5fffc, 0xd8000a5 },
  1029. { 0x502a4, 0x30800062 },
  1030. { 0x5fffc, 0xe4000a8 },
  1031. { 0x502a8, 0x2fc0005f },
  1032. { 0x5fffc, 0xec000aa },
  1033. { 0x502ac, 0x2fc0005b },
  1034. { 0x5fffc, 0xf8000ad },
  1035. { 0x502b0, 0x2f400057 },
  1036. { 0x5fffc, 0x108000b0 },
  1037. { 0x502b4, 0x2e400054 },
  1038. { 0x5fffc, 0x114000b2 },
  1039. { 0x502b8, 0x2e000050 },
  1040. { 0x5fffc, 0x124000b4 },
  1041. { 0x502bc, 0x2d80004c },
  1042. { 0x5fffc, 0x130000b6 },
  1043. { 0x502c0, 0x2d000049 },
  1044. { 0x5fffc, 0x140000b8 },
  1045. { 0x502c4, 0x2c800045 },
  1046. { 0x5fffc, 0x150000b9 },
  1047. { 0x502c8, 0x2c000042 },
  1048. { 0x5fffc, 0x15c000bd },
  1049. { 0x502cc, 0x2b40003e },
  1050. { 0x5fffc, 0x16c000bf },
  1051. { 0x502d0, 0x2a80003b },
  1052. { 0x5fffc, 0x17c000bf },
  1053. { 0x502d4, 0x2a000039 },
  1054. { 0x5fffc, 0x188000c2 },
  1055. { 0x502d8, 0x29400036 },
  1056. { 0x5fffc, 0x19c000c4 },
  1057. { 0x502dc, 0x28800032 },
  1058. { 0x5fffc, 0x1ac000c5 },
  1059. { 0x502e0, 0x2800002f },
  1060. { 0x5fffc, 0x1bc000c7 },
  1061. { 0x502e4, 0x2740002c },
  1062. { 0x5fffc, 0x1cc000c8 },
  1063. { 0x502e8, 0x26c00029 },
  1064. { 0x5fffc, 0x1dc000c9 },
  1065. { 0x502ec, 0x26000027 },
  1066. { 0x5fffc, 0x1ec000cc },
  1067. { 0x502f0, 0x25000024 },
  1068. { 0x5fffc, 0x200000cc },
  1069. { 0x502f4, 0x24800021 },
  1070. { 0x5fffc, 0x210000cd },
  1071. { 0x502f8, 0x23800020 },
  1072. { 0x5fffc, 0x220000ce },
  1073. { 0x502fc, 0x2300001d },
  1074. };
  1075. static const struct ppp_table downscale_x_table_pt6topt8[] = {
  1076. { 0x5fffc, 0xfe000070 },
  1077. { 0x50280, 0x4bc00068 },
  1078. { 0x5fffc, 0xfe000078 },
  1079. { 0x50284, 0x4bc00060 },
  1080. { 0x5fffc, 0xfe000080 },
  1081. { 0x50288, 0x4b800059 },
  1082. { 0x5fffc, 0xfe000089 },
  1083. { 0x5028c, 0x4b000052 },
  1084. { 0x5fffc, 0xfe400091 },
  1085. { 0x50290, 0x4a80004b },
  1086. { 0x5fffc, 0xfe40009a },
  1087. { 0x50294, 0x4a000044 },
  1088. { 0x5fffc, 0xfe8000a3 },
  1089. { 0x50298, 0x4940003d },
  1090. { 0x5fffc, 0xfec000ac },
  1091. { 0x5029c, 0x48400037 },
  1092. { 0x5fffc, 0xff0000b4 },
  1093. { 0x502a0, 0x47800031 },
  1094. { 0x5fffc, 0xff8000bd },
  1095. { 0x502a4, 0x4640002b },
  1096. { 0x5fffc, 0xc5 },
  1097. { 0x502a8, 0x45000026 },
  1098. { 0x5fffc, 0x8000ce },
  1099. { 0x502ac, 0x43800021 },
  1100. { 0x5fffc, 0x10000d6 },
  1101. { 0x502b0, 0x4240001c },
  1102. { 0x5fffc, 0x18000df },
  1103. { 0x502b4, 0x40800018 },
  1104. { 0x5fffc, 0x24000e6 },
  1105. { 0x502b8, 0x3f000014 },
  1106. { 0x5fffc, 0x30000ee },
  1107. { 0x502bc, 0x3d400010 },
  1108. { 0x5fffc, 0x40000f5 },
  1109. { 0x502c0, 0x3b80000c },
  1110. { 0x5fffc, 0x50000fc },
  1111. { 0x502c4, 0x39800009 },
  1112. { 0x5fffc, 0x6000102 },
  1113. { 0x502c8, 0x37c00006 },
  1114. { 0x5fffc, 0x7000109 },
  1115. { 0x502cc, 0x35800004 },
  1116. { 0x5fffc, 0x840010e },
  1117. { 0x502d0, 0x33800002 },
  1118. { 0x5fffc, 0x9800114 },
  1119. { 0x502d4, 0x31400000 },
  1120. { 0x5fffc, 0xac00119 },
  1121. { 0x502d8, 0x2f4003fe },
  1122. { 0x5fffc, 0xc40011e },
  1123. { 0x502dc, 0x2d0003fc },
  1124. { 0x5fffc, 0xdc00121 },
  1125. { 0x502e0, 0x2b0003fb },
  1126. { 0x5fffc, 0xf400125 },
  1127. { 0x502e4, 0x28c003fa },
  1128. { 0x5fffc, 0x11000128 },
  1129. { 0x502e8, 0x268003f9 },
  1130. { 0x5fffc, 0x12c0012a },
  1131. { 0x502ec, 0x244003f9 },
  1132. { 0x5fffc, 0x1480012c },
  1133. { 0x502f0, 0x224003f8 },
  1134. { 0x5fffc, 0x1640012e },
  1135. { 0x502f4, 0x200003f8 },
  1136. { 0x5fffc, 0x1800012f },
  1137. { 0x502f8, 0x1e0003f8 },
  1138. { 0x5fffc, 0x1a00012f },
  1139. { 0x502fc, 0x1c0003f8 },
  1140. };
  1141. static const struct ppp_table downscale_x_table_pt8topt1[] = {
  1142. { 0x5fffc, 0x0 },
  1143. { 0x50280, 0x7fc00000 },
  1144. { 0x5fffc, 0xff80000d },
  1145. { 0x50284, 0x7ec003f9 },
  1146. { 0x5fffc, 0xfec0001c },
  1147. { 0x50288, 0x7d4003f3 },
  1148. { 0x5fffc, 0xfe40002b },
  1149. { 0x5028c, 0x7b8003ed },
  1150. { 0x5fffc, 0xfd80003c },
  1151. { 0x50290, 0x794003e8 },
  1152. { 0x5fffc, 0xfcc0004d },
  1153. { 0x50294, 0x76c003e4 },
  1154. { 0x5fffc, 0xfc40005f },
  1155. { 0x50298, 0x73c003e0 },
  1156. { 0x5fffc, 0xfb800071 },
  1157. { 0x5029c, 0x708003de },
  1158. { 0x5fffc, 0xfac00085 },
  1159. { 0x502a0, 0x6d0003db },
  1160. { 0x5fffc, 0xfa000098 },
  1161. { 0x502a4, 0x698003d9 },
  1162. { 0x5fffc, 0xf98000ac },
  1163. { 0x502a8, 0x654003d8 },
  1164. { 0x5fffc, 0xf8c000c1 },
  1165. { 0x502ac, 0x610003d7 },
  1166. { 0x5fffc, 0xf84000d5 },
  1167. { 0x502b0, 0x5c8003d7 },
  1168. { 0x5fffc, 0xf7c000e9 },
  1169. { 0x502b4, 0x580003d7 },
  1170. { 0x5fffc, 0xf74000fd },
  1171. { 0x502b8, 0x534003d8 },
  1172. { 0x5fffc, 0xf6c00112 },
  1173. { 0x502bc, 0x4e8003d8 },
  1174. { 0x5fffc, 0xf6800126 },
  1175. { 0x502c0, 0x494003da },
  1176. { 0x5fffc, 0xf600013a },
  1177. { 0x502c4, 0x448003db },
  1178. { 0x5fffc, 0xf600014d },
  1179. { 0x502c8, 0x3f4003dd },
  1180. { 0x5fffc, 0xf5c00160 },
  1181. { 0x502cc, 0x3a4003df },
  1182. { 0x5fffc, 0xf5c00172 },
  1183. { 0x502d0, 0x354003e1 },
  1184. { 0x5fffc, 0xf5c00184 },
  1185. { 0x502d4, 0x304003e3 },
  1186. { 0x5fffc, 0xf6000195 },
  1187. { 0x502d8, 0x2b0003e6 },
  1188. { 0x5fffc, 0xf64001a6 },
  1189. { 0x502dc, 0x260003e8 },
  1190. { 0x5fffc, 0xf6c001b4 },
  1191. { 0x502e0, 0x214003eb },
  1192. { 0x5fffc, 0xf78001c2 },
  1193. { 0x502e4, 0x1c4003ee },
  1194. { 0x5fffc, 0xf80001cf },
  1195. { 0x502e8, 0x17c003f1 },
  1196. { 0x5fffc, 0xf90001db },
  1197. { 0x502ec, 0x134003f3 },
  1198. { 0x5fffc, 0xfa0001e5 },
  1199. { 0x502f0, 0xf0003f6 },
  1200. { 0x5fffc, 0xfb4001ee },
  1201. { 0x502f4, 0xac003f9 },
  1202. { 0x5fffc, 0xfcc001f5 },
  1203. { 0x502f8, 0x70003fb },
  1204. { 0x5fffc, 0xfe4001fb },
  1205. { 0x502fc, 0x34003fe },
  1206. };
  1207. static const struct ppp_table *downscale_x_table[PPP_DOWNSCALE_MAX] = {
  1208. [PPP_DOWNSCALE_PT2TOPT4] = downscale_x_table_pt2topt4,
  1209. [PPP_DOWNSCALE_PT4TOPT6] = downscale_x_table_pt4topt6,
  1210. [PPP_DOWNSCALE_PT6TOPT8] = downscale_x_table_pt6topt8,
  1211. [PPP_DOWNSCALE_PT8TOPT1] = downscale_x_table_pt8topt1,
  1212. };
  1213. static const struct ppp_table downscale_y_table_pt2topt4[] = {
  1214. { 0x5fffc, 0x740008c },
  1215. { 0x50300, 0x33800088 },
  1216. { 0x5fffc, 0x800008e },
  1217. { 0x50304, 0x33400084 },
  1218. { 0x5fffc, 0x8400092 },
  1219. { 0x50308, 0x33000080 },
  1220. { 0x5fffc, 0x9000094 },
  1221. { 0x5030c, 0x3300007b },
  1222. { 0x5fffc, 0x9c00098 },
  1223. { 0x50310, 0x32400077 },
  1224. { 0x5fffc, 0xa40009b },
  1225. { 0x50314, 0x32000073 },
  1226. { 0x5fffc, 0xb00009d },
  1227. { 0x50318, 0x31c0006f },
  1228. { 0x5fffc, 0xbc000a0 },
  1229. { 0x5031c, 0x3140006b },
  1230. { 0x5fffc, 0xc8000a2 },
  1231. { 0x50320, 0x31000067 },
  1232. { 0x5fffc, 0xd8000a5 },
  1233. { 0x50324, 0x30800062 },
  1234. { 0x5fffc, 0xe4000a8 },
  1235. { 0x50328, 0x2fc0005f },
  1236. { 0x5fffc, 0xec000aa },
  1237. { 0x5032c, 0x2fc0005b },
  1238. { 0x5fffc, 0xf8000ad },
  1239. { 0x50330, 0x2f400057 },
  1240. { 0x5fffc, 0x108000b0 },
  1241. { 0x50334, 0x2e400054 },
  1242. { 0x5fffc, 0x114000b2 },
  1243. { 0x50338, 0x2e000050 },
  1244. { 0x5fffc, 0x124000b4 },
  1245. { 0x5033c, 0x2d80004c },
  1246. { 0x5fffc, 0x130000b6 },
  1247. { 0x50340, 0x2d000049 },
  1248. { 0x5fffc, 0x140000b8 },
  1249. { 0x50344, 0x2c800045 },
  1250. { 0x5fffc, 0x150000b9 },
  1251. { 0x50348, 0x2c000042 },
  1252. { 0x5fffc, 0x15c000bd },
  1253. { 0x5034c, 0x2b40003e },
  1254. { 0x5fffc, 0x16c000bf },
  1255. { 0x50350, 0x2a80003b },
  1256. { 0x5fffc, 0x17c000bf },
  1257. { 0x50354, 0x2a000039 },
  1258. { 0x5fffc, 0x188000c2 },
  1259. { 0x50358, 0x29400036 },
  1260. { 0x5fffc, 0x19c000c4 },
  1261. { 0x5035c, 0x28800032 },
  1262. { 0x5fffc, 0x1ac000c5 },
  1263. { 0x50360, 0x2800002f },
  1264. { 0x5fffc, 0x1bc000c7 },
  1265. { 0x50364, 0x2740002c },
  1266. { 0x5fffc, 0x1cc000c8 },
  1267. { 0x50368, 0x26c00029 },
  1268. { 0x5fffc, 0x1dc000c9 },
  1269. { 0x5036c, 0x26000027 },
  1270. { 0x5fffc, 0x1ec000cc },
  1271. { 0x50370, 0x25000024 },
  1272. { 0x5fffc, 0x200000cc },
  1273. { 0x50374, 0x24800021 },
  1274. { 0x5fffc, 0x210000cd },
  1275. { 0x50378, 0x23800020 },
  1276. { 0x5fffc, 0x220000ce },
  1277. { 0x5037c, 0x2300001d },
  1278. };
  1279. static const struct ppp_table downscale_y_table_pt4topt6[] = {
  1280. { 0x5fffc, 0x740008c },
  1281. { 0x50300, 0x33800088 },
  1282. { 0x5fffc, 0x800008e },
  1283. { 0x50304, 0x33400084 },
  1284. { 0x5fffc, 0x8400092 },
  1285. { 0x50308, 0x33000080 },
  1286. { 0x5fffc, 0x9000094 },
  1287. { 0x5030c, 0x3300007b },
  1288. { 0x5fffc, 0x9c00098 },
  1289. { 0x50310, 0x32400077 },
  1290. { 0x5fffc, 0xa40009b },
  1291. { 0x50314, 0x32000073 },
  1292. { 0x5fffc, 0xb00009d },
  1293. { 0x50318, 0x31c0006f },
  1294. { 0x5fffc, 0xbc000a0 },
  1295. { 0x5031c, 0x3140006b },
  1296. { 0x5fffc, 0xc8000a2 },
  1297. { 0x50320, 0x31000067 },
  1298. { 0x5fffc, 0xd8000a5 },
  1299. { 0x50324, 0x30800062 },
  1300. { 0x5fffc, 0xe4000a8 },
  1301. { 0x50328, 0x2fc0005f },
  1302. { 0x5fffc, 0xec000aa },
  1303. { 0x5032c, 0x2fc0005b },
  1304. { 0x5fffc, 0xf8000ad },
  1305. { 0x50330, 0x2f400057 },
  1306. { 0x5fffc, 0x108000b0 },
  1307. { 0x50334, 0x2e400054 },
  1308. { 0x5fffc, 0x114000b2 },
  1309. { 0x50338, 0x2e000050 },
  1310. { 0x5fffc, 0x124000b4 },
  1311. { 0x5033c, 0x2d80004c },
  1312. { 0x5fffc, 0x130000b6 },
  1313. { 0x50340, 0x2d000049 },
  1314. { 0x5fffc, 0x140000b8 },
  1315. { 0x50344, 0x2c800045 },
  1316. { 0x5fffc, 0x150000b9 },
  1317. { 0x50348, 0x2c000042 },
  1318. { 0x5fffc, 0x15c000bd },
  1319. { 0x5034c, 0x2b40003e },
  1320. { 0x5fffc, 0x16c000bf },
  1321. { 0x50350, 0x2a80003b },
  1322. { 0x5fffc, 0x17c000bf },
  1323. { 0x50354, 0x2a000039 },
  1324. { 0x5fffc, 0x188000c2 },
  1325. { 0x50358, 0x29400036 },
  1326. { 0x5fffc, 0x19c000c4 },
  1327. { 0x5035c, 0x28800032 },
  1328. { 0x5fffc, 0x1ac000c5 },
  1329. { 0x50360, 0x2800002f },
  1330. { 0x5fffc, 0x1bc000c7 },
  1331. { 0x50364, 0x2740002c },
  1332. { 0x5fffc, 0x1cc000c8 },
  1333. { 0x50368, 0x26c00029 },
  1334. { 0x5fffc, 0x1dc000c9 },
  1335. { 0x5036c, 0x26000027 },
  1336. { 0x5fffc, 0x1ec000cc },
  1337. { 0x50370, 0x25000024 },
  1338. { 0x5fffc, 0x200000cc },
  1339. { 0x50374, 0x24800021 },
  1340. { 0x5fffc, 0x210000cd },
  1341. { 0x50378, 0x23800020 },
  1342. { 0x5fffc, 0x220000ce },
  1343. { 0x5037c, 0x2300001d },
  1344. };
  1345. static const struct ppp_table downscale_y_table_pt6topt8[] = {
  1346. { 0x5fffc, 0xfe000070 },
  1347. { 0x50300, 0x4bc00068 },
  1348. { 0x5fffc, 0xfe000078 },
  1349. { 0x50304, 0x4bc00060 },
  1350. { 0x5fffc, 0xfe000080 },
  1351. { 0x50308, 0x4b800059 },
  1352. { 0x5fffc, 0xfe000089 },
  1353. { 0x5030c, 0x4b000052 },
  1354. { 0x5fffc, 0xfe400091 },
  1355. { 0x50310, 0x4a80004b },
  1356. { 0x5fffc, 0xfe40009a },
  1357. { 0x50314, 0x4a000044 },
  1358. { 0x5fffc, 0xfe8000a3 },
  1359. { 0x50318, 0x4940003d },
  1360. { 0x5fffc, 0xfec000ac },
  1361. { 0x5031c, 0x48400037 },
  1362. { 0x5fffc, 0xff0000b4 },
  1363. { 0x50320, 0x47800031 },
  1364. { 0x5fffc, 0xff8000bd },
  1365. { 0x50324, 0x4640002b },
  1366. { 0x5fffc, 0xc5 },
  1367. { 0x50328, 0x45000026 },
  1368. { 0x5fffc, 0x8000ce },
  1369. { 0x5032c, 0x43800021 },
  1370. { 0x5fffc, 0x10000d6 },
  1371. { 0x50330, 0x4240001c },
  1372. { 0x5fffc, 0x18000df },
  1373. { 0x50334, 0x40800018 },
  1374. { 0x5fffc, 0x24000e6 },
  1375. { 0x50338, 0x3f000014 },
  1376. { 0x5fffc, 0x30000ee },
  1377. { 0x5033c, 0x3d400010 },
  1378. { 0x5fffc, 0x40000f5 },
  1379. { 0x50340, 0x3b80000c },
  1380. { 0x5fffc, 0x50000fc },
  1381. { 0x50344, 0x39800009 },
  1382. { 0x5fffc, 0x6000102 },
  1383. { 0x50348, 0x37c00006 },
  1384. { 0x5fffc, 0x7000109 },
  1385. { 0x5034c, 0x35800004 },
  1386. { 0x5fffc, 0x840010e },
  1387. { 0x50350, 0x33800002 },
  1388. { 0x5fffc, 0x9800114 },
  1389. { 0x50354, 0x31400000 },
  1390. { 0x5fffc, 0xac00119 },
  1391. { 0x50358, 0x2f4003fe },
  1392. { 0x5fffc, 0xc40011e },
  1393. { 0x5035c, 0x2d0003fc },
  1394. { 0x5fffc, 0xdc00121 },
  1395. { 0x50360, 0x2b0003fb },
  1396. { 0x5fffc, 0xf400125 },
  1397. { 0x50364, 0x28c003fa },
  1398. { 0x5fffc, 0x11000128 },
  1399. { 0x50368, 0x268003f9 },
  1400. { 0x5fffc, 0x12c0012a },
  1401. { 0x5036c, 0x244003f9 },
  1402. { 0x5fffc, 0x1480012c },
  1403. { 0x50370, 0x224003f8 },
  1404. { 0x5fffc, 0x1640012e },
  1405. { 0x50374, 0x200003f8 },
  1406. { 0x5fffc, 0x1800012f },
  1407. { 0x50378, 0x1e0003f8 },
  1408. { 0x5fffc, 0x1a00012f },
  1409. { 0x5037c, 0x1c0003f8 },
  1410. };
  1411. static const struct ppp_table downscale_y_table_pt8topt1[] = {
  1412. { 0x5fffc, 0x0 },
  1413. { 0x50300, 0x7fc00000 },
  1414. { 0x5fffc, 0xff80000d },
  1415. { 0x50304, 0x7ec003f9 },
  1416. { 0x5fffc, 0xfec0001c },
  1417. { 0x50308, 0x7d4003f3 },
  1418. { 0x5fffc, 0xfe40002b },
  1419. { 0x5030c, 0x7b8003ed },
  1420. { 0x5fffc, 0xfd80003c },
  1421. { 0x50310, 0x794003e8 },
  1422. { 0x5fffc, 0xfcc0004d },
  1423. { 0x50314, 0x76c003e4 },
  1424. { 0x5fffc, 0xfc40005f },
  1425. { 0x50318, 0x73c003e0 },
  1426. { 0x5fffc, 0xfb800071 },
  1427. { 0x5031c, 0x708003de },
  1428. { 0x5fffc, 0xfac00085 },
  1429. { 0x50320, 0x6d0003db },
  1430. { 0x5fffc, 0xfa000098 },
  1431. { 0x50324, 0x698003d9 },
  1432. { 0x5fffc, 0xf98000ac },
  1433. { 0x50328, 0x654003d8 },
  1434. { 0x5fffc, 0xf8c000c1 },
  1435. { 0x5032c, 0x610003d7 },
  1436. { 0x5fffc, 0xf84000d5 },
  1437. { 0x50330, 0x5c8003d7 },
  1438. { 0x5fffc, 0xf7c000e9 },
  1439. { 0x50334, 0x580003d7 },
  1440. { 0x5fffc, 0xf74000fd },
  1441. { 0x50338, 0x534003d8 },
  1442. { 0x5fffc, 0xf6c00112 },
  1443. { 0x5033c, 0x4e8003d8 },
  1444. { 0x5fffc, 0xf6800126 },
  1445. { 0x50340, 0x494003da },
  1446. { 0x5fffc, 0xf600013a },
  1447. { 0x50344, 0x448003db },
  1448. { 0x5fffc, 0xf600014d },
  1449. { 0x50348, 0x3f4003dd },
  1450. { 0x5fffc, 0xf5c00160 },
  1451. { 0x5034c, 0x3a4003df },
  1452. { 0x5fffc, 0xf5c00172 },
  1453. { 0x50350, 0x354003e1 },
  1454. { 0x5fffc, 0xf5c00184 },
  1455. { 0x50354, 0x304003e3 },
  1456. { 0x5fffc, 0xf6000195 },
  1457. { 0x50358, 0x2b0003e6 },
  1458. { 0x5fffc, 0xf64001a6 },
  1459. { 0x5035c, 0x260003e8 },
  1460. { 0x5fffc, 0xf6c001b4 },
  1461. { 0x50360, 0x214003eb },
  1462. { 0x5fffc, 0xf78001c2 },
  1463. { 0x50364, 0x1c4003ee },
  1464. { 0x5fffc, 0xf80001cf },
  1465. { 0x50368, 0x17c003f1 },
  1466. { 0x5fffc, 0xf90001db },
  1467. { 0x5036c, 0x134003f3 },
  1468. { 0x5fffc, 0xfa0001e5 },
  1469. { 0x50370, 0xf0003f6 },
  1470. { 0x5fffc, 0xfb4001ee },
  1471. { 0x50374, 0xac003f9 },
  1472. { 0x5fffc, 0xfcc001f5 },
  1473. { 0x50378, 0x70003fb },
  1474. { 0x5fffc, 0xfe4001fb },
  1475. { 0x5037c, 0x34003fe },
  1476. };
  1477. static const struct ppp_table *downscale_y_table[PPP_DOWNSCALE_MAX] = {
  1478. [PPP_DOWNSCALE_PT2TOPT4] = downscale_y_table_pt2topt4,
  1479. [PPP_DOWNSCALE_PT4TOPT6] = downscale_y_table_pt4topt6,
  1480. [PPP_DOWNSCALE_PT6TOPT8] = downscale_y_table_pt6topt8,
  1481. [PPP_DOWNSCALE_PT8TOPT1] = downscale_y_table_pt8topt1,
  1482. };
  1483. void ppp_load_table(const struct ppp_table *table, int len)
  1484. {
  1485. int i;
  1486. for (i = 0; i < len; i++)
  1487. PPP_WRITEL(table[i].val, table[i].reg);
  1488. }
  1489. void ppp_load_up_lut(void)
  1490. {
  1491. ppp_load_table(upscale_table,
  1492. PPP_UPSCALE_MAX);
  1493. }
  1494. void ppp_load_gaussian_lut(void)
  1495. {
  1496. ppp_load_table(mdp_gaussian_blur_table,
  1497. PPP_BLUR_SCALE_MAX);
  1498. }
  1499. void ppp_load_x_scale_table(int idx)
  1500. {
  1501. ppp_load_table(downscale_x_table[idx], 64);
  1502. }
  1503. void ppp_load_y_scale_table(int idx)
  1504. {
  1505. ppp_load_table(downscale_y_table[idx], 64);
  1506. }
  1507. uint32_t ppp_bpp(uint32_t type)
  1508. {
  1509. if (MDP_IS_IMGTYPE_BAD(type))
  1510. return 0;
  1511. return bytes_per_pixel[type];
  1512. }
  1513. uint32_t ppp_src_config(uint32_t type)
  1514. {
  1515. if (MDP_IS_IMGTYPE_BAD(type))
  1516. return 0;
  1517. return src_cfg_lut[type];
  1518. }
  1519. uint32_t ppp_out_config(uint32_t type)
  1520. {
  1521. if (MDP_IS_IMGTYPE_BAD(type))
  1522. return 0;
  1523. return out_cfg_lut[type];
  1524. }
  1525. uint32_t ppp_pack_pattern(uint32_t type, uint32_t yuv2rgb)
  1526. {
  1527. if (MDP_IS_IMGTYPE_BAD(type))
  1528. return 0;
  1529. if (yuv2rgb)
  1530. return swapped_pack_patt_lut[type];
  1531. return pack_patt_lut[type];
  1532. }
  1533. uint32_t ppp_dst_op_reg(uint32_t type)
  1534. {
  1535. if (MDP_IS_IMGTYPE_BAD(type))
  1536. return 0;
  1537. return dst_op_reg[type];
  1538. }
  1539. uint32_t ppp_src_op_reg(uint32_t type)
  1540. {
  1541. if (MDP_IS_IMGTYPE_BAD(type))
  1542. return 0;
  1543. return src_op_reg[type];
  1544. }
  1545. bool ppp_per_p_alpha(uint32_t type)
  1546. {
  1547. if (MDP_IS_IMGTYPE_BAD(type))
  1548. return 0;
  1549. return per_pixel_alpha[type];
  1550. }
  1551. bool ppp_multi_plane(uint32_t type)
  1552. {
  1553. if (MDP_IS_IMGTYPE_BAD(type))
  1554. return 0;
  1555. return multi_plane[type];
  1556. }
  1557. uint32_t *ppp_default_pre_lut(void)
  1558. {
  1559. return default_pre_lut_val;
  1560. }
  1561. uint32_t *ppp_default_post_lut(void)
  1562. {
  1563. return default_post_lut_val;
  1564. }
  1565. struct ppp_csc_table *ppp_csc_rgb2yuv(void)
  1566. {
  1567. return &rgb2yuv;
  1568. }
  1569. struct ppp_csc_table *ppp_csc_table2(void)
  1570. {
  1571. return &default_table2;
  1572. }