mdp_ppp_v20.c 83 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548
  1. /* Copyright (c) 2008-2009, 2012 The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. */
  13. #include <linux/module.h>
  14. #include <linux/kernel.h>
  15. #include <linux/sched.h>
  16. #include <linux/time.h>
  17. #include <linux/init.h>
  18. #include <linux/interrupt.h>
  19. #include <linux/fb.h>
  20. #include "linux/proc_fs.h"
  21. #include <mach/hardware.h>
  22. #include <linux/io.h>
  23. #include <asm/system.h>
  24. #include <asm/mach-types.h>
  25. #include <linux/semaphore.h>
  26. #include <asm/div64.h>
  27. #include "mdp.h"
  28. #include "msm_fb.h"
  29. static MDP_SCALE_MODE mdp_curr_up_scale_xy;
  30. static MDP_SCALE_MODE mdp_curr_down_scale_x;
  31. static MDP_SCALE_MODE mdp_curr_down_scale_y;
  32. static long long mdp_do_div(long long num, long long den)
  33. {
  34. do_div(num, den);
  35. return num;
  36. }
  37. struct mdp_table_entry mdp_gaussian_blur_table[] = {
  38. /* max variance */
  39. { 0x5fffc, 0x20000080 },
  40. { 0x50280, 0x20000080 },
  41. { 0x5fffc, 0x20000080 },
  42. { 0x50284, 0x20000080 },
  43. { 0x5fffc, 0x20000080 },
  44. { 0x50288, 0x20000080 },
  45. { 0x5fffc, 0x20000080 },
  46. { 0x5028c, 0x20000080 },
  47. { 0x5fffc, 0x20000080 },
  48. { 0x50290, 0x20000080 },
  49. { 0x5fffc, 0x20000080 },
  50. { 0x50294, 0x20000080 },
  51. { 0x5fffc, 0x20000080 },
  52. { 0x50298, 0x20000080 },
  53. { 0x5fffc, 0x20000080 },
  54. { 0x5029c, 0x20000080 },
  55. { 0x5fffc, 0x20000080 },
  56. { 0x502a0, 0x20000080 },
  57. { 0x5fffc, 0x20000080 },
  58. { 0x502a4, 0x20000080 },
  59. { 0x5fffc, 0x20000080 },
  60. { 0x502a8, 0x20000080 },
  61. { 0x5fffc, 0x20000080 },
  62. { 0x502ac, 0x20000080 },
  63. { 0x5fffc, 0x20000080 },
  64. { 0x502b0, 0x20000080 },
  65. { 0x5fffc, 0x20000080 },
  66. { 0x502b4, 0x20000080 },
  67. { 0x5fffc, 0x20000080 },
  68. { 0x502b8, 0x20000080 },
  69. { 0x5fffc, 0x20000080 },
  70. { 0x502bc, 0x20000080 },
  71. { 0x5fffc, 0x20000080 },
  72. { 0x502c0, 0x20000080 },
  73. { 0x5fffc, 0x20000080 },
  74. { 0x502c4, 0x20000080 },
  75. { 0x5fffc, 0x20000080 },
  76. { 0x502c8, 0x20000080 },
  77. { 0x5fffc, 0x20000080 },
  78. { 0x502cc, 0x20000080 },
  79. { 0x5fffc, 0x20000080 },
  80. { 0x502d0, 0x20000080 },
  81. { 0x5fffc, 0x20000080 },
  82. { 0x502d4, 0x20000080 },
  83. { 0x5fffc, 0x20000080 },
  84. { 0x502d8, 0x20000080 },
  85. { 0x5fffc, 0x20000080 },
  86. { 0x502dc, 0x20000080 },
  87. { 0x5fffc, 0x20000080 },
  88. { 0x502e0, 0x20000080 },
  89. { 0x5fffc, 0x20000080 },
  90. { 0x502e4, 0x20000080 },
  91. { 0x5fffc, 0x20000080 },
  92. { 0x502e8, 0x20000080 },
  93. { 0x5fffc, 0x20000080 },
  94. { 0x502ec, 0x20000080 },
  95. { 0x5fffc, 0x20000080 },
  96. { 0x502f0, 0x20000080 },
  97. { 0x5fffc, 0x20000080 },
  98. { 0x502f4, 0x20000080 },
  99. { 0x5fffc, 0x20000080 },
  100. { 0x502f8, 0x20000080 },
  101. { 0x5fffc, 0x20000080 },
  102. { 0x502fc, 0x20000080 },
  103. { 0x5fffc, 0x20000080 },
  104. { 0x50300, 0x20000080 },
  105. { 0x5fffc, 0x20000080 },
  106. { 0x50304, 0x20000080 },
  107. { 0x5fffc, 0x20000080 },
  108. { 0x50308, 0x20000080 },
  109. { 0x5fffc, 0x20000080 },
  110. { 0x5030c, 0x20000080 },
  111. { 0x5fffc, 0x20000080 },
  112. { 0x50310, 0x20000080 },
  113. { 0x5fffc, 0x20000080 },
  114. { 0x50314, 0x20000080 },
  115. { 0x5fffc, 0x20000080 },
  116. { 0x50318, 0x20000080 },
  117. { 0x5fffc, 0x20000080 },
  118. { 0x5031c, 0x20000080 },
  119. { 0x5fffc, 0x20000080 },
  120. { 0x50320, 0x20000080 },
  121. { 0x5fffc, 0x20000080 },
  122. { 0x50324, 0x20000080 },
  123. { 0x5fffc, 0x20000080 },
  124. { 0x50328, 0x20000080 },
  125. { 0x5fffc, 0x20000080 },
  126. { 0x5032c, 0x20000080 },
  127. { 0x5fffc, 0x20000080 },
  128. { 0x50330, 0x20000080 },
  129. { 0x5fffc, 0x20000080 },
  130. { 0x50334, 0x20000080 },
  131. { 0x5fffc, 0x20000080 },
  132. { 0x50338, 0x20000080 },
  133. { 0x5fffc, 0x20000080 },
  134. { 0x5033c, 0x20000080 },
  135. { 0x5fffc, 0x20000080 },
  136. { 0x50340, 0x20000080 },
  137. { 0x5fffc, 0x20000080 },
  138. { 0x50344, 0x20000080 },
  139. { 0x5fffc, 0x20000080 },
  140. { 0x50348, 0x20000080 },
  141. { 0x5fffc, 0x20000080 },
  142. { 0x5034c, 0x20000080 },
  143. { 0x5fffc, 0x20000080 },
  144. { 0x50350, 0x20000080 },
  145. { 0x5fffc, 0x20000080 },
  146. { 0x50354, 0x20000080 },
  147. { 0x5fffc, 0x20000080 },
  148. { 0x50358, 0x20000080 },
  149. { 0x5fffc, 0x20000080 },
  150. { 0x5035c, 0x20000080 },
  151. { 0x5fffc, 0x20000080 },
  152. { 0x50360, 0x20000080 },
  153. { 0x5fffc, 0x20000080 },
  154. { 0x50364, 0x20000080 },
  155. { 0x5fffc, 0x20000080 },
  156. { 0x50368, 0x20000080 },
  157. { 0x5fffc, 0x20000080 },
  158. { 0x5036c, 0x20000080 },
  159. { 0x5fffc, 0x20000080 },
  160. { 0x50370, 0x20000080 },
  161. { 0x5fffc, 0x20000080 },
  162. { 0x50374, 0x20000080 },
  163. { 0x5fffc, 0x20000080 },
  164. { 0x50378, 0x20000080 },
  165. { 0x5fffc, 0x20000080 },
  166. { 0x5037c, 0x20000080 },
  167. };
  168. static void load_scale_table(
  169. struct mdp_table_entry *table, int len)
  170. {
  171. int i;
  172. for (i = 0; i < len; i++)
  173. MDP_OUTP(MDP_BASE + table[i].reg, table[i].val);
  174. }
  175. static void mdp_load_pr_upscale_table(void)
  176. {
  177. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  178. MDP_OUTP(MDP_BASE + 0x50200, 0x7fc00000);
  179. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  180. MDP_OUTP(MDP_BASE + 0x50204, 0x7fc00000);
  181. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  182. MDP_OUTP(MDP_BASE + 0x50208, 0x7fc00000);
  183. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  184. MDP_OUTP(MDP_BASE + 0x5020c, 0x7fc00000);
  185. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  186. MDP_OUTP(MDP_BASE + 0x50210, 0x7fc00000);
  187. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  188. MDP_OUTP(MDP_BASE + 0x50214, 0x7fc00000);
  189. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  190. MDP_OUTP(MDP_BASE + 0x50218, 0x7fc00000);
  191. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  192. MDP_OUTP(MDP_BASE + 0x5021c, 0x7fc00000);
  193. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  194. MDP_OUTP(MDP_BASE + 0x50220, 0x7fc00000);
  195. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  196. MDP_OUTP(MDP_BASE + 0x50224, 0x7fc00000);
  197. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  198. MDP_OUTP(MDP_BASE + 0x50228, 0x7fc00000);
  199. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  200. MDP_OUTP(MDP_BASE + 0x5022c, 0x7fc00000);
  201. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  202. MDP_OUTP(MDP_BASE + 0x50230, 0x7fc00000);
  203. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  204. MDP_OUTP(MDP_BASE + 0x50234, 0x7fc00000);
  205. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  206. MDP_OUTP(MDP_BASE + 0x50238, 0x7fc00000);
  207. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  208. MDP_OUTP(MDP_BASE + 0x5023c, 0x7fc00000);
  209. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  210. MDP_OUTP(MDP_BASE + 0x50240, 0x0);
  211. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  212. MDP_OUTP(MDP_BASE + 0x50244, 0x0);
  213. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  214. MDP_OUTP(MDP_BASE + 0x50248, 0x0);
  215. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  216. MDP_OUTP(MDP_BASE + 0x5024c, 0x0);
  217. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  218. MDP_OUTP(MDP_BASE + 0x50250, 0x0);
  219. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  220. MDP_OUTP(MDP_BASE + 0x50254, 0x0);
  221. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  222. MDP_OUTP(MDP_BASE + 0x50258, 0x0);
  223. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  224. MDP_OUTP(MDP_BASE + 0x5025c, 0x0);
  225. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  226. MDP_OUTP(MDP_BASE + 0x50260, 0x0);
  227. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  228. MDP_OUTP(MDP_BASE + 0x50264, 0x0);
  229. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  230. MDP_OUTP(MDP_BASE + 0x50268, 0x0);
  231. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  232. MDP_OUTP(MDP_BASE + 0x5026c, 0x0);
  233. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  234. MDP_OUTP(MDP_BASE + 0x50270, 0x0);
  235. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  236. MDP_OUTP(MDP_BASE + 0x50274, 0x0);
  237. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  238. MDP_OUTP(MDP_BASE + 0x50278, 0x0);
  239. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  240. MDP_OUTP(MDP_BASE + 0x5027c, 0x0);
  241. }
  242. static void mdp_load_pr_downscale_table_x_point2TOpoint4(void)
  243. {
  244. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  245. MDP_OUTP(MDP_BASE + 0x50280, 0x7fc00000);
  246. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  247. MDP_OUTP(MDP_BASE + 0x50284, 0x7fc00000);
  248. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  249. MDP_OUTP(MDP_BASE + 0x50288, 0x7fc00000);
  250. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  251. MDP_OUTP(MDP_BASE + 0x5028c, 0x7fc00000);
  252. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  253. MDP_OUTP(MDP_BASE + 0x50290, 0x7fc00000);
  254. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  255. MDP_OUTP(MDP_BASE + 0x50294, 0x7fc00000);
  256. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  257. MDP_OUTP(MDP_BASE + 0x50298, 0x7fc00000);
  258. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  259. MDP_OUTP(MDP_BASE + 0x5029c, 0x7fc00000);
  260. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  261. MDP_OUTP(MDP_BASE + 0x502a0, 0x7fc00000);
  262. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  263. MDP_OUTP(MDP_BASE + 0x502a4, 0x7fc00000);
  264. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  265. MDP_OUTP(MDP_BASE + 0x502a8, 0x7fc00000);
  266. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  267. MDP_OUTP(MDP_BASE + 0x502ac, 0x7fc00000);
  268. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  269. MDP_OUTP(MDP_BASE + 0x502b0, 0x7fc00000);
  270. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  271. MDP_OUTP(MDP_BASE + 0x502b4, 0x7fc00000);
  272. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  273. MDP_OUTP(MDP_BASE + 0x502b8, 0x7fc00000);
  274. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  275. MDP_OUTP(MDP_BASE + 0x502bc, 0x7fc00000);
  276. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  277. MDP_OUTP(MDP_BASE + 0x502c0, 0x0);
  278. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  279. MDP_OUTP(MDP_BASE + 0x502c4, 0x0);
  280. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  281. MDP_OUTP(MDP_BASE + 0x502c8, 0x0);
  282. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  283. MDP_OUTP(MDP_BASE + 0x502cc, 0x0);
  284. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  285. MDP_OUTP(MDP_BASE + 0x502d0, 0x0);
  286. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  287. MDP_OUTP(MDP_BASE + 0x502d4, 0x0);
  288. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  289. MDP_OUTP(MDP_BASE + 0x502d8, 0x0);
  290. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  291. MDP_OUTP(MDP_BASE + 0x502dc, 0x0);
  292. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  293. MDP_OUTP(MDP_BASE + 0x502e0, 0x0);
  294. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  295. MDP_OUTP(MDP_BASE + 0x502e4, 0x0);
  296. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  297. MDP_OUTP(MDP_BASE + 0x502e8, 0x0);
  298. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  299. MDP_OUTP(MDP_BASE + 0x502ec, 0x0);
  300. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  301. MDP_OUTP(MDP_BASE + 0x502f0, 0x0);
  302. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  303. MDP_OUTP(MDP_BASE + 0x502f4, 0x0);
  304. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  305. MDP_OUTP(MDP_BASE + 0x502f8, 0x0);
  306. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  307. MDP_OUTP(MDP_BASE + 0x502fc, 0x0);
  308. }
  309. static void mdp_load_pr_downscale_table_y_point2TOpoint4(void)
  310. {
  311. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  312. MDP_OUTP(MDP_BASE + 0x50300, 0x7fc00000);
  313. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  314. MDP_OUTP(MDP_BASE + 0x50304, 0x7fc00000);
  315. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  316. MDP_OUTP(MDP_BASE + 0x50308, 0x7fc00000);
  317. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  318. MDP_OUTP(MDP_BASE + 0x5030c, 0x7fc00000);
  319. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  320. MDP_OUTP(MDP_BASE + 0x50310, 0x7fc00000);
  321. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  322. MDP_OUTP(MDP_BASE + 0x50314, 0x7fc00000);
  323. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  324. MDP_OUTP(MDP_BASE + 0x50318, 0x7fc00000);
  325. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  326. MDP_OUTP(MDP_BASE + 0x5031c, 0x7fc00000);
  327. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  328. MDP_OUTP(MDP_BASE + 0x50320, 0x7fc00000);
  329. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  330. MDP_OUTP(MDP_BASE + 0x50324, 0x7fc00000);
  331. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  332. MDP_OUTP(MDP_BASE + 0x50328, 0x7fc00000);
  333. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  334. MDP_OUTP(MDP_BASE + 0x5032c, 0x7fc00000);
  335. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  336. MDP_OUTP(MDP_BASE + 0x50330, 0x7fc00000);
  337. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  338. MDP_OUTP(MDP_BASE + 0x50334, 0x7fc00000);
  339. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  340. MDP_OUTP(MDP_BASE + 0x50338, 0x7fc00000);
  341. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  342. MDP_OUTP(MDP_BASE + 0x5033c, 0x7fc00000);
  343. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  344. MDP_OUTP(MDP_BASE + 0x50340, 0x0);
  345. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  346. MDP_OUTP(MDP_BASE + 0x50344, 0x0);
  347. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  348. MDP_OUTP(MDP_BASE + 0x50348, 0x0);
  349. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  350. MDP_OUTP(MDP_BASE + 0x5034c, 0x0);
  351. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  352. MDP_OUTP(MDP_BASE + 0x50350, 0x0);
  353. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  354. MDP_OUTP(MDP_BASE + 0x50354, 0x0);
  355. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  356. MDP_OUTP(MDP_BASE + 0x50358, 0x0);
  357. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  358. MDP_OUTP(MDP_BASE + 0x5035c, 0x0);
  359. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  360. MDP_OUTP(MDP_BASE + 0x50360, 0x0);
  361. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  362. MDP_OUTP(MDP_BASE + 0x50364, 0x0);
  363. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  364. MDP_OUTP(MDP_BASE + 0x50368, 0x0);
  365. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  366. MDP_OUTP(MDP_BASE + 0x5036c, 0x0);
  367. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  368. MDP_OUTP(MDP_BASE + 0x50370, 0x0);
  369. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  370. MDP_OUTP(MDP_BASE + 0x50374, 0x0);
  371. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  372. MDP_OUTP(MDP_BASE + 0x50378, 0x0);
  373. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  374. MDP_OUTP(MDP_BASE + 0x5037c, 0x0);
  375. }
  376. static void mdp_load_pr_downscale_table_x_point4TOpoint6(void)
  377. {
  378. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  379. MDP_OUTP(MDP_BASE + 0x50280, 0x7fc00000);
  380. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  381. MDP_OUTP(MDP_BASE + 0x50284, 0x7fc00000);
  382. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  383. MDP_OUTP(MDP_BASE + 0x50288, 0x7fc00000);
  384. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  385. MDP_OUTP(MDP_BASE + 0x5028c, 0x7fc00000);
  386. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  387. MDP_OUTP(MDP_BASE + 0x50290, 0x7fc00000);
  388. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  389. MDP_OUTP(MDP_BASE + 0x50294, 0x7fc00000);
  390. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  391. MDP_OUTP(MDP_BASE + 0x50298, 0x7fc00000);
  392. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  393. MDP_OUTP(MDP_BASE + 0x5029c, 0x7fc00000);
  394. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  395. MDP_OUTP(MDP_BASE + 0x502a0, 0x7fc00000);
  396. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  397. MDP_OUTP(MDP_BASE + 0x502a4, 0x7fc00000);
  398. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  399. MDP_OUTP(MDP_BASE + 0x502a8, 0x7fc00000);
  400. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  401. MDP_OUTP(MDP_BASE + 0x502ac, 0x7fc00000);
  402. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  403. MDP_OUTP(MDP_BASE + 0x502b0, 0x7fc00000);
  404. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  405. MDP_OUTP(MDP_BASE + 0x502b4, 0x7fc00000);
  406. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  407. MDP_OUTP(MDP_BASE + 0x502b8, 0x7fc00000);
  408. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  409. MDP_OUTP(MDP_BASE + 0x502bc, 0x7fc00000);
  410. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  411. MDP_OUTP(MDP_BASE + 0x502c0, 0x0);
  412. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  413. MDP_OUTP(MDP_BASE + 0x502c4, 0x0);
  414. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  415. MDP_OUTP(MDP_BASE + 0x502c8, 0x0);
  416. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  417. MDP_OUTP(MDP_BASE + 0x502cc, 0x0);
  418. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  419. MDP_OUTP(MDP_BASE + 0x502d0, 0x0);
  420. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  421. MDP_OUTP(MDP_BASE + 0x502d4, 0x0);
  422. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  423. MDP_OUTP(MDP_BASE + 0x502d8, 0x0);
  424. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  425. MDP_OUTP(MDP_BASE + 0x502dc, 0x0);
  426. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  427. MDP_OUTP(MDP_BASE + 0x502e0, 0x0);
  428. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  429. MDP_OUTP(MDP_BASE + 0x502e4, 0x0);
  430. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  431. MDP_OUTP(MDP_BASE + 0x502e8, 0x0);
  432. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  433. MDP_OUTP(MDP_BASE + 0x502ec, 0x0);
  434. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  435. MDP_OUTP(MDP_BASE + 0x502f0, 0x0);
  436. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  437. MDP_OUTP(MDP_BASE + 0x502f4, 0x0);
  438. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  439. MDP_OUTP(MDP_BASE + 0x502f8, 0x0);
  440. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  441. MDP_OUTP(MDP_BASE + 0x502fc, 0x0);
  442. }
  443. static void mdp_load_pr_downscale_table_y_point4TOpoint6(void)
  444. {
  445. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  446. MDP_OUTP(MDP_BASE + 0x50300, 0x7fc00000);
  447. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  448. MDP_OUTP(MDP_BASE + 0x50304, 0x7fc00000);
  449. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  450. MDP_OUTP(MDP_BASE + 0x50308, 0x7fc00000);
  451. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  452. MDP_OUTP(MDP_BASE + 0x5030c, 0x7fc00000);
  453. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  454. MDP_OUTP(MDP_BASE + 0x50310, 0x7fc00000);
  455. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  456. MDP_OUTP(MDP_BASE + 0x50314, 0x7fc00000);
  457. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  458. MDP_OUTP(MDP_BASE + 0x50318, 0x7fc00000);
  459. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  460. MDP_OUTP(MDP_BASE + 0x5031c, 0x7fc00000);
  461. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  462. MDP_OUTP(MDP_BASE + 0x50320, 0x7fc00000);
  463. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  464. MDP_OUTP(MDP_BASE + 0x50324, 0x7fc00000);
  465. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  466. MDP_OUTP(MDP_BASE + 0x50328, 0x7fc00000);
  467. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  468. MDP_OUTP(MDP_BASE + 0x5032c, 0x7fc00000);
  469. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  470. MDP_OUTP(MDP_BASE + 0x50330, 0x7fc00000);
  471. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  472. MDP_OUTP(MDP_BASE + 0x50334, 0x7fc00000);
  473. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  474. MDP_OUTP(MDP_BASE + 0x50338, 0x7fc00000);
  475. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  476. MDP_OUTP(MDP_BASE + 0x5033c, 0x7fc00000);
  477. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  478. MDP_OUTP(MDP_BASE + 0x50340, 0x0);
  479. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  480. MDP_OUTP(MDP_BASE + 0x50344, 0x0);
  481. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  482. MDP_OUTP(MDP_BASE + 0x50348, 0x0);
  483. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  484. MDP_OUTP(MDP_BASE + 0x5034c, 0x0);
  485. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  486. MDP_OUTP(MDP_BASE + 0x50350, 0x0);
  487. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  488. MDP_OUTP(MDP_BASE + 0x50354, 0x0);
  489. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  490. MDP_OUTP(MDP_BASE + 0x50358, 0x0);
  491. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  492. MDP_OUTP(MDP_BASE + 0x5035c, 0x0);
  493. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  494. MDP_OUTP(MDP_BASE + 0x50360, 0x0);
  495. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  496. MDP_OUTP(MDP_BASE + 0x50364, 0x0);
  497. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  498. MDP_OUTP(MDP_BASE + 0x50368, 0x0);
  499. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  500. MDP_OUTP(MDP_BASE + 0x5036c, 0x0);
  501. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  502. MDP_OUTP(MDP_BASE + 0x50370, 0x0);
  503. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  504. MDP_OUTP(MDP_BASE + 0x50374, 0x0);
  505. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  506. MDP_OUTP(MDP_BASE + 0x50378, 0x0);
  507. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  508. MDP_OUTP(MDP_BASE + 0x5037c, 0x0);
  509. }
  510. static void mdp_load_pr_downscale_table_x_point6TOpoint8(void)
  511. {
  512. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  513. MDP_OUTP(MDP_BASE + 0x50280, 0x7fc00000);
  514. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  515. MDP_OUTP(MDP_BASE + 0x50284, 0x7fc00000);
  516. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  517. MDP_OUTP(MDP_BASE + 0x50288, 0x7fc00000);
  518. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  519. MDP_OUTP(MDP_BASE + 0x5028c, 0x7fc00000);
  520. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  521. MDP_OUTP(MDP_BASE + 0x50290, 0x7fc00000);
  522. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  523. MDP_OUTP(MDP_BASE + 0x50294, 0x7fc00000);
  524. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  525. MDP_OUTP(MDP_BASE + 0x50298, 0x7fc00000);
  526. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  527. MDP_OUTP(MDP_BASE + 0x5029c, 0x7fc00000);
  528. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  529. MDP_OUTP(MDP_BASE + 0x502a0, 0x7fc00000);
  530. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  531. MDP_OUTP(MDP_BASE + 0x502a4, 0x7fc00000);
  532. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  533. MDP_OUTP(MDP_BASE + 0x502a8, 0x7fc00000);
  534. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  535. MDP_OUTP(MDP_BASE + 0x502ac, 0x7fc00000);
  536. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  537. MDP_OUTP(MDP_BASE + 0x502b0, 0x7fc00000);
  538. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  539. MDP_OUTP(MDP_BASE + 0x502b4, 0x7fc00000);
  540. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  541. MDP_OUTP(MDP_BASE + 0x502b8, 0x7fc00000);
  542. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  543. MDP_OUTP(MDP_BASE + 0x502bc, 0x7fc00000);
  544. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  545. MDP_OUTP(MDP_BASE + 0x502c0, 0x0);
  546. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  547. MDP_OUTP(MDP_BASE + 0x502c4, 0x0);
  548. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  549. MDP_OUTP(MDP_BASE + 0x502c8, 0x0);
  550. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  551. MDP_OUTP(MDP_BASE + 0x502cc, 0x0);
  552. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  553. MDP_OUTP(MDP_BASE + 0x502d0, 0x0);
  554. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  555. MDP_OUTP(MDP_BASE + 0x502d4, 0x0);
  556. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  557. MDP_OUTP(MDP_BASE + 0x502d8, 0x0);
  558. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  559. MDP_OUTP(MDP_BASE + 0x502dc, 0x0);
  560. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  561. MDP_OUTP(MDP_BASE + 0x502e0, 0x0);
  562. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  563. MDP_OUTP(MDP_BASE + 0x502e4, 0x0);
  564. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  565. MDP_OUTP(MDP_BASE + 0x502e8, 0x0);
  566. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  567. MDP_OUTP(MDP_BASE + 0x502ec, 0x0);
  568. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  569. MDP_OUTP(MDP_BASE + 0x502f0, 0x0);
  570. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  571. MDP_OUTP(MDP_BASE + 0x502f4, 0x0);
  572. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  573. MDP_OUTP(MDP_BASE + 0x502f8, 0x0);
  574. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  575. MDP_OUTP(MDP_BASE + 0x502fc, 0x0);
  576. }
  577. static void mdp_load_pr_downscale_table_y_point6TOpoint8(void)
  578. {
  579. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  580. MDP_OUTP(MDP_BASE + 0x50300, 0x7fc00000);
  581. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  582. MDP_OUTP(MDP_BASE + 0x50304, 0x7fc00000);
  583. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  584. MDP_OUTP(MDP_BASE + 0x50308, 0x7fc00000);
  585. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  586. MDP_OUTP(MDP_BASE + 0x5030c, 0x7fc00000);
  587. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  588. MDP_OUTP(MDP_BASE + 0x50310, 0x7fc00000);
  589. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  590. MDP_OUTP(MDP_BASE + 0x50314, 0x7fc00000);
  591. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  592. MDP_OUTP(MDP_BASE + 0x50318, 0x7fc00000);
  593. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  594. MDP_OUTP(MDP_BASE + 0x5031c, 0x7fc00000);
  595. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  596. MDP_OUTP(MDP_BASE + 0x50320, 0x7fc00000);
  597. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  598. MDP_OUTP(MDP_BASE + 0x50324, 0x7fc00000);
  599. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  600. MDP_OUTP(MDP_BASE + 0x50328, 0x7fc00000);
  601. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  602. MDP_OUTP(MDP_BASE + 0x5032c, 0x7fc00000);
  603. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  604. MDP_OUTP(MDP_BASE + 0x50330, 0x7fc00000);
  605. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  606. MDP_OUTP(MDP_BASE + 0x50334, 0x7fc00000);
  607. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  608. MDP_OUTP(MDP_BASE + 0x50338, 0x7fc00000);
  609. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  610. MDP_OUTP(MDP_BASE + 0x5033c, 0x7fc00000);
  611. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  612. MDP_OUTP(MDP_BASE + 0x50340, 0x0);
  613. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  614. MDP_OUTP(MDP_BASE + 0x50344, 0x0);
  615. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  616. MDP_OUTP(MDP_BASE + 0x50348, 0x0);
  617. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  618. MDP_OUTP(MDP_BASE + 0x5034c, 0x0);
  619. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  620. MDP_OUTP(MDP_BASE + 0x50350, 0x0);
  621. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  622. MDP_OUTP(MDP_BASE + 0x50354, 0x0);
  623. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  624. MDP_OUTP(MDP_BASE + 0x50358, 0x0);
  625. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  626. MDP_OUTP(MDP_BASE + 0x5035c, 0x0);
  627. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  628. MDP_OUTP(MDP_BASE + 0x50360, 0x0);
  629. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  630. MDP_OUTP(MDP_BASE + 0x50364, 0x0);
  631. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  632. MDP_OUTP(MDP_BASE + 0x50368, 0x0);
  633. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  634. MDP_OUTP(MDP_BASE + 0x5036c, 0x0);
  635. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  636. MDP_OUTP(MDP_BASE + 0x50370, 0x0);
  637. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  638. MDP_OUTP(MDP_BASE + 0x50374, 0x0);
  639. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  640. MDP_OUTP(MDP_BASE + 0x50378, 0x0);
  641. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  642. MDP_OUTP(MDP_BASE + 0x5037c, 0x0);
  643. }
  644. static void mdp_load_pr_downscale_table_x_point8TO1(void)
  645. {
  646. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  647. MDP_OUTP(MDP_BASE + 0x50280, 0x7fc00000);
  648. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  649. MDP_OUTP(MDP_BASE + 0x50284, 0x7fc00000);
  650. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  651. MDP_OUTP(MDP_BASE + 0x50288, 0x7fc00000);
  652. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  653. MDP_OUTP(MDP_BASE + 0x5028c, 0x7fc00000);
  654. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  655. MDP_OUTP(MDP_BASE + 0x50290, 0x7fc00000);
  656. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  657. MDP_OUTP(MDP_BASE + 0x50294, 0x7fc00000);
  658. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  659. MDP_OUTP(MDP_BASE + 0x50298, 0x7fc00000);
  660. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  661. MDP_OUTP(MDP_BASE + 0x5029c, 0x7fc00000);
  662. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  663. MDP_OUTP(MDP_BASE + 0x502a0, 0x7fc00000);
  664. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  665. MDP_OUTP(MDP_BASE + 0x502a4, 0x7fc00000);
  666. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  667. MDP_OUTP(MDP_BASE + 0x502a8, 0x7fc00000);
  668. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  669. MDP_OUTP(MDP_BASE + 0x502ac, 0x7fc00000);
  670. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  671. MDP_OUTP(MDP_BASE + 0x502b0, 0x7fc00000);
  672. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  673. MDP_OUTP(MDP_BASE + 0x502b4, 0x7fc00000);
  674. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  675. MDP_OUTP(MDP_BASE + 0x502b8, 0x7fc00000);
  676. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  677. MDP_OUTP(MDP_BASE + 0x502bc, 0x7fc00000);
  678. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  679. MDP_OUTP(MDP_BASE + 0x502c0, 0x0);
  680. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  681. MDP_OUTP(MDP_BASE + 0x502c4, 0x0);
  682. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  683. MDP_OUTP(MDP_BASE + 0x502c8, 0x0);
  684. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  685. MDP_OUTP(MDP_BASE + 0x502cc, 0x0);
  686. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  687. MDP_OUTP(MDP_BASE + 0x502d0, 0x0);
  688. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  689. MDP_OUTP(MDP_BASE + 0x502d4, 0x0);
  690. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  691. MDP_OUTP(MDP_BASE + 0x502d8, 0x0);
  692. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  693. MDP_OUTP(MDP_BASE + 0x502dc, 0x0);
  694. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  695. MDP_OUTP(MDP_BASE + 0x502e0, 0x0);
  696. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  697. MDP_OUTP(MDP_BASE + 0x502e4, 0x0);
  698. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  699. MDP_OUTP(MDP_BASE + 0x502e8, 0x0);
  700. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  701. MDP_OUTP(MDP_BASE + 0x502ec, 0x0);
  702. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  703. MDP_OUTP(MDP_BASE + 0x502f0, 0x0);
  704. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  705. MDP_OUTP(MDP_BASE + 0x502f4, 0x0);
  706. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  707. MDP_OUTP(MDP_BASE + 0x502f8, 0x0);
  708. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  709. MDP_OUTP(MDP_BASE + 0x502fc, 0x0);
  710. }
  711. static void mdp_load_pr_downscale_table_y_point8TO1(void)
  712. {
  713. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  714. MDP_OUTP(MDP_BASE + 0x50300, 0x7fc00000);
  715. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  716. MDP_OUTP(MDP_BASE + 0x50304, 0x7fc00000);
  717. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  718. MDP_OUTP(MDP_BASE + 0x50308, 0x7fc00000);
  719. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  720. MDP_OUTP(MDP_BASE + 0x5030c, 0x7fc00000);
  721. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  722. MDP_OUTP(MDP_BASE + 0x50310, 0x7fc00000);
  723. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  724. MDP_OUTP(MDP_BASE + 0x50314, 0x7fc00000);
  725. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  726. MDP_OUTP(MDP_BASE + 0x50318, 0x7fc00000);
  727. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  728. MDP_OUTP(MDP_BASE + 0x5031c, 0x7fc00000);
  729. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  730. MDP_OUTP(MDP_BASE + 0x50320, 0x7fc00000);
  731. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  732. MDP_OUTP(MDP_BASE + 0x50324, 0x7fc00000);
  733. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  734. MDP_OUTP(MDP_BASE + 0x50328, 0x7fc00000);
  735. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  736. MDP_OUTP(MDP_BASE + 0x5032c, 0x7fc00000);
  737. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  738. MDP_OUTP(MDP_BASE + 0x50330, 0x7fc00000);
  739. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  740. MDP_OUTP(MDP_BASE + 0x50334, 0x7fc00000);
  741. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  742. MDP_OUTP(MDP_BASE + 0x50338, 0x7fc00000);
  743. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  744. MDP_OUTP(MDP_BASE + 0x5033c, 0x7fc00000);
  745. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  746. MDP_OUTP(MDP_BASE + 0x50340, 0x0);
  747. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  748. MDP_OUTP(MDP_BASE + 0x50344, 0x0);
  749. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  750. MDP_OUTP(MDP_BASE + 0x50348, 0x0);
  751. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  752. MDP_OUTP(MDP_BASE + 0x5034c, 0x0);
  753. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  754. MDP_OUTP(MDP_BASE + 0x50350, 0x0);
  755. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  756. MDP_OUTP(MDP_BASE + 0x50354, 0x0);
  757. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  758. MDP_OUTP(MDP_BASE + 0x50358, 0x0);
  759. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  760. MDP_OUTP(MDP_BASE + 0x5035c, 0x0);
  761. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  762. MDP_OUTP(MDP_BASE + 0x50360, 0x0);
  763. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  764. MDP_OUTP(MDP_BASE + 0x50364, 0x0);
  765. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  766. MDP_OUTP(MDP_BASE + 0x50368, 0x0);
  767. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  768. MDP_OUTP(MDP_BASE + 0x5036c, 0x0);
  769. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  770. MDP_OUTP(MDP_BASE + 0x50370, 0x0);
  771. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  772. MDP_OUTP(MDP_BASE + 0x50374, 0x0);
  773. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  774. MDP_OUTP(MDP_BASE + 0x50378, 0x0);
  775. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ff);
  776. MDP_OUTP(MDP_BASE + 0x5037c, 0x0);
  777. }
  778. static void mdp_load_bc_upscale_table(void)
  779. {
  780. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  781. MDP_OUTP(MDP_BASE + 0x50200, 0x7fc00000);
  782. MDP_OUTP(MDP_BASE + 0x5fffc, 0xff80000d);
  783. MDP_OUTP(MDP_BASE + 0x50204, 0x7ec003f9);
  784. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfec0001c);
  785. MDP_OUTP(MDP_BASE + 0x50208, 0x7d4003f3);
  786. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfe40002b);
  787. MDP_OUTP(MDP_BASE + 0x5020c, 0x7b8003ed);
  788. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfd80003c);
  789. MDP_OUTP(MDP_BASE + 0x50210, 0x794003e8);
  790. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfcc0004d);
  791. MDP_OUTP(MDP_BASE + 0x50214, 0x76c003e4);
  792. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfc40005f);
  793. MDP_OUTP(MDP_BASE + 0x50218, 0x73c003e0);
  794. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfb800071);
  795. MDP_OUTP(MDP_BASE + 0x5021c, 0x708003de);
  796. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfac00085);
  797. MDP_OUTP(MDP_BASE + 0x50220, 0x6d0003db);
  798. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfa000098);
  799. MDP_OUTP(MDP_BASE + 0x50224, 0x698003d9);
  800. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf98000ac);
  801. MDP_OUTP(MDP_BASE + 0x50228, 0x654003d8);
  802. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf8c000c1);
  803. MDP_OUTP(MDP_BASE + 0x5022c, 0x610003d7);
  804. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf84000d5);
  805. MDP_OUTP(MDP_BASE + 0x50230, 0x5c8003d7);
  806. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf7c000e9);
  807. MDP_OUTP(MDP_BASE + 0x50234, 0x580003d7);
  808. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf74000fd);
  809. MDP_OUTP(MDP_BASE + 0x50238, 0x534003d8);
  810. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf6c00112);
  811. MDP_OUTP(MDP_BASE + 0x5023c, 0x4e8003d8);
  812. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf6800126);
  813. MDP_OUTP(MDP_BASE + 0x50240, 0x494003da);
  814. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf600013a);
  815. MDP_OUTP(MDP_BASE + 0x50244, 0x448003db);
  816. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf600014d);
  817. MDP_OUTP(MDP_BASE + 0x50248, 0x3f4003dd);
  818. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf5c00160);
  819. MDP_OUTP(MDP_BASE + 0x5024c, 0x3a4003df);
  820. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf5c00172);
  821. MDP_OUTP(MDP_BASE + 0x50250, 0x354003e1);
  822. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf5c00184);
  823. MDP_OUTP(MDP_BASE + 0x50254, 0x304003e3);
  824. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf6000195);
  825. MDP_OUTP(MDP_BASE + 0x50258, 0x2b0003e6);
  826. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf64001a6);
  827. MDP_OUTP(MDP_BASE + 0x5025c, 0x260003e8);
  828. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf6c001b4);
  829. MDP_OUTP(MDP_BASE + 0x50260, 0x214003eb);
  830. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf78001c2);
  831. MDP_OUTP(MDP_BASE + 0x50264, 0x1c4003ee);
  832. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf80001cf);
  833. MDP_OUTP(MDP_BASE + 0x50268, 0x17c003f1);
  834. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf90001db);
  835. MDP_OUTP(MDP_BASE + 0x5026c, 0x134003f3);
  836. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfa0001e5);
  837. MDP_OUTP(MDP_BASE + 0x50270, 0xf0003f6);
  838. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfb4001ee);
  839. MDP_OUTP(MDP_BASE + 0x50274, 0xac003f9);
  840. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfcc001f5);
  841. MDP_OUTP(MDP_BASE + 0x50278, 0x70003fb);
  842. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfe4001fb);
  843. MDP_OUTP(MDP_BASE + 0x5027c, 0x34003fe);
  844. }
  845. static void mdp_load_bc_downscale_table_x_point2TOpoint4(void)
  846. {
  847. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ac00084);
  848. MDP_OUTP(MDP_BASE + 0x50280, 0x23400083);
  849. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1b000084);
  850. MDP_OUTP(MDP_BASE + 0x50284, 0x23000083);
  851. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1b400084);
  852. MDP_OUTP(MDP_BASE + 0x50288, 0x23000082);
  853. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1b400085);
  854. MDP_OUTP(MDP_BASE + 0x5028c, 0x23000081);
  855. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1b800085);
  856. MDP_OUTP(MDP_BASE + 0x50290, 0x23000080);
  857. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1bc00086);
  858. MDP_OUTP(MDP_BASE + 0x50294, 0x22c0007f);
  859. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1c000086);
  860. MDP_OUTP(MDP_BASE + 0x50298, 0x2280007f);
  861. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1c400086);
  862. MDP_OUTP(MDP_BASE + 0x5029c, 0x2280007e);
  863. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1c800086);
  864. MDP_OUTP(MDP_BASE + 0x502a0, 0x2280007d);
  865. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1cc00086);
  866. MDP_OUTP(MDP_BASE + 0x502a4, 0x2240007d);
  867. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1cc00087);
  868. MDP_OUTP(MDP_BASE + 0x502a8, 0x2240007c);
  869. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1d000087);
  870. MDP_OUTP(MDP_BASE + 0x502ac, 0x2240007b);
  871. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1d400087);
  872. MDP_OUTP(MDP_BASE + 0x502b0, 0x2200007b);
  873. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1d400088);
  874. MDP_OUTP(MDP_BASE + 0x502b4, 0x22400079);
  875. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1d800088);
  876. MDP_OUTP(MDP_BASE + 0x502b8, 0x22400078);
  877. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1dc00088);
  878. MDP_OUTP(MDP_BASE + 0x502bc, 0x22400077);
  879. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1dc00089);
  880. MDP_OUTP(MDP_BASE + 0x502c0, 0x22000077);
  881. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1e000089);
  882. MDP_OUTP(MDP_BASE + 0x502c4, 0x22000076);
  883. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1e400089);
  884. MDP_OUTP(MDP_BASE + 0x502c8, 0x22000075);
  885. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ec00088);
  886. MDP_OUTP(MDP_BASE + 0x502cc, 0x21c00075);
  887. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ec00089);
  888. MDP_OUTP(MDP_BASE + 0x502d0, 0x21c00074);
  889. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1f000089);
  890. MDP_OUTP(MDP_BASE + 0x502d4, 0x21c00073);
  891. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1f400089);
  892. MDP_OUTP(MDP_BASE + 0x502d8, 0x21800073);
  893. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1f40008a);
  894. MDP_OUTP(MDP_BASE + 0x502dc, 0x21800072);
  895. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1f80008a);
  896. MDP_OUTP(MDP_BASE + 0x502e0, 0x21800071);
  897. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1fc0008a);
  898. MDP_OUTP(MDP_BASE + 0x502e4, 0x21800070);
  899. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1fc0008b);
  900. MDP_OUTP(MDP_BASE + 0x502e8, 0x2180006f);
  901. MDP_OUTP(MDP_BASE + 0x5fffc, 0x2000008c);
  902. MDP_OUTP(MDP_BASE + 0x502ec, 0x2140006e);
  903. MDP_OUTP(MDP_BASE + 0x5fffc, 0x2040008c);
  904. MDP_OUTP(MDP_BASE + 0x502f0, 0x2140006d);
  905. MDP_OUTP(MDP_BASE + 0x5fffc, 0x2080008c);
  906. MDP_OUTP(MDP_BASE + 0x502f4, 0x2100006d);
  907. MDP_OUTP(MDP_BASE + 0x5fffc, 0x20c0008c);
  908. MDP_OUTP(MDP_BASE + 0x502f8, 0x2100006c);
  909. MDP_OUTP(MDP_BASE + 0x5fffc, 0x20c0008d);
  910. MDP_OUTP(MDP_BASE + 0x502fc, 0x2100006b);
  911. }
  912. static void mdp_load_bc_downscale_table_y_point2TOpoint4(void)
  913. {
  914. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ac00084);
  915. MDP_OUTP(MDP_BASE + 0x50300, 0x23400083);
  916. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1b000084);
  917. MDP_OUTP(MDP_BASE + 0x50304, 0x23000083);
  918. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1b400084);
  919. MDP_OUTP(MDP_BASE + 0x50308, 0x23000082);
  920. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1b400085);
  921. MDP_OUTP(MDP_BASE + 0x5030c, 0x23000081);
  922. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1b800085);
  923. MDP_OUTP(MDP_BASE + 0x50310, 0x23000080);
  924. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1bc00086);
  925. MDP_OUTP(MDP_BASE + 0x50314, 0x22c0007f);
  926. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1c000086);
  927. MDP_OUTP(MDP_BASE + 0x50318, 0x2280007f);
  928. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1c400086);
  929. MDP_OUTP(MDP_BASE + 0x5031c, 0x2280007e);
  930. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1c800086);
  931. MDP_OUTP(MDP_BASE + 0x50320, 0x2280007d);
  932. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1cc00086);
  933. MDP_OUTP(MDP_BASE + 0x50324, 0x2240007d);
  934. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1cc00087);
  935. MDP_OUTP(MDP_BASE + 0x50328, 0x2240007c);
  936. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1d000087);
  937. MDP_OUTP(MDP_BASE + 0x5032c, 0x2240007b);
  938. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1d400087);
  939. MDP_OUTP(MDP_BASE + 0x50330, 0x2200007b);
  940. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1d400088);
  941. MDP_OUTP(MDP_BASE + 0x50334, 0x22400079);
  942. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1d800088);
  943. MDP_OUTP(MDP_BASE + 0x50338, 0x22400078);
  944. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1dc00088);
  945. MDP_OUTP(MDP_BASE + 0x5033c, 0x22400077);
  946. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1dc00089);
  947. MDP_OUTP(MDP_BASE + 0x50340, 0x22000077);
  948. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1e000089);
  949. MDP_OUTP(MDP_BASE + 0x50344, 0x22000076);
  950. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1e400089);
  951. MDP_OUTP(MDP_BASE + 0x50348, 0x22000075);
  952. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ec00088);
  953. MDP_OUTP(MDP_BASE + 0x5034c, 0x21c00075);
  954. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ec00089);
  955. MDP_OUTP(MDP_BASE + 0x50350, 0x21c00074);
  956. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1f000089);
  957. MDP_OUTP(MDP_BASE + 0x50354, 0x21c00073);
  958. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1f400089);
  959. MDP_OUTP(MDP_BASE + 0x50358, 0x21800073);
  960. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1f40008a);
  961. MDP_OUTP(MDP_BASE + 0x5035c, 0x21800072);
  962. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1f80008a);
  963. MDP_OUTP(MDP_BASE + 0x50360, 0x21800071);
  964. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1fc0008a);
  965. MDP_OUTP(MDP_BASE + 0x50364, 0x21800070);
  966. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1fc0008b);
  967. MDP_OUTP(MDP_BASE + 0x50368, 0x2180006f);
  968. MDP_OUTP(MDP_BASE + 0x5fffc, 0x2000008c);
  969. MDP_OUTP(MDP_BASE + 0x5036c, 0x2140006e);
  970. MDP_OUTP(MDP_BASE + 0x5fffc, 0x2040008c);
  971. MDP_OUTP(MDP_BASE + 0x50370, 0x2140006d);
  972. MDP_OUTP(MDP_BASE + 0x5fffc, 0x2080008c);
  973. MDP_OUTP(MDP_BASE + 0x50374, 0x2100006d);
  974. MDP_OUTP(MDP_BASE + 0x5fffc, 0x20c0008c);
  975. MDP_OUTP(MDP_BASE + 0x50378, 0x2100006c);
  976. MDP_OUTP(MDP_BASE + 0x5fffc, 0x20c0008d);
  977. MDP_OUTP(MDP_BASE + 0x5037c, 0x2100006b);
  978. }
  979. static void mdp_load_bc_downscale_table_x_point4TOpoint6(void)
  980. {
  981. MDP_OUTP(MDP_BASE + 0x5fffc, 0x740008c);
  982. MDP_OUTP(MDP_BASE + 0x50280, 0x33800088);
  983. MDP_OUTP(MDP_BASE + 0x5fffc, 0x800008e);
  984. MDP_OUTP(MDP_BASE + 0x50284, 0x33400084);
  985. MDP_OUTP(MDP_BASE + 0x5fffc, 0x8400092);
  986. MDP_OUTP(MDP_BASE + 0x50288, 0x33000080);
  987. MDP_OUTP(MDP_BASE + 0x5fffc, 0x9000094);
  988. MDP_OUTP(MDP_BASE + 0x5028c, 0x3300007b);
  989. MDP_OUTP(MDP_BASE + 0x5fffc, 0x9c00098);
  990. MDP_OUTP(MDP_BASE + 0x50290, 0x32400077);
  991. MDP_OUTP(MDP_BASE + 0x5fffc, 0xa40009b);
  992. MDP_OUTP(MDP_BASE + 0x50294, 0x32000073);
  993. MDP_OUTP(MDP_BASE + 0x5fffc, 0xb00009d);
  994. MDP_OUTP(MDP_BASE + 0x50298, 0x31c0006f);
  995. MDP_OUTP(MDP_BASE + 0x5fffc, 0xbc000a0);
  996. MDP_OUTP(MDP_BASE + 0x5029c, 0x3140006b);
  997. MDP_OUTP(MDP_BASE + 0x5fffc, 0xc8000a2);
  998. MDP_OUTP(MDP_BASE + 0x502a0, 0x31000067);
  999. MDP_OUTP(MDP_BASE + 0x5fffc, 0xd8000a5);
  1000. MDP_OUTP(MDP_BASE + 0x502a4, 0x30800062);
  1001. MDP_OUTP(MDP_BASE + 0x5fffc, 0xe4000a8);
  1002. MDP_OUTP(MDP_BASE + 0x502a8, 0x2fc0005f);
  1003. MDP_OUTP(MDP_BASE + 0x5fffc, 0xec000aa);
  1004. MDP_OUTP(MDP_BASE + 0x502ac, 0x2fc0005b);
  1005. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf8000ad);
  1006. MDP_OUTP(MDP_BASE + 0x502b0, 0x2f400057);
  1007. MDP_OUTP(MDP_BASE + 0x5fffc, 0x108000b0);
  1008. MDP_OUTP(MDP_BASE + 0x502b4, 0x2e400054);
  1009. MDP_OUTP(MDP_BASE + 0x5fffc, 0x114000b2);
  1010. MDP_OUTP(MDP_BASE + 0x502b8, 0x2e000050);
  1011. MDP_OUTP(MDP_BASE + 0x5fffc, 0x124000b4);
  1012. MDP_OUTP(MDP_BASE + 0x502bc, 0x2d80004c);
  1013. MDP_OUTP(MDP_BASE + 0x5fffc, 0x130000b6);
  1014. MDP_OUTP(MDP_BASE + 0x502c0, 0x2d000049);
  1015. MDP_OUTP(MDP_BASE + 0x5fffc, 0x140000b8);
  1016. MDP_OUTP(MDP_BASE + 0x502c4, 0x2c800045);
  1017. MDP_OUTP(MDP_BASE + 0x5fffc, 0x150000b9);
  1018. MDP_OUTP(MDP_BASE + 0x502c8, 0x2c000042);
  1019. MDP_OUTP(MDP_BASE + 0x5fffc, 0x15c000bd);
  1020. MDP_OUTP(MDP_BASE + 0x502cc, 0x2b40003e);
  1021. MDP_OUTP(MDP_BASE + 0x5fffc, 0x16c000bf);
  1022. MDP_OUTP(MDP_BASE + 0x502d0, 0x2a80003b);
  1023. MDP_OUTP(MDP_BASE + 0x5fffc, 0x17c000bf);
  1024. MDP_OUTP(MDP_BASE + 0x502d4, 0x2a000039);
  1025. MDP_OUTP(MDP_BASE + 0x5fffc, 0x188000c2);
  1026. MDP_OUTP(MDP_BASE + 0x502d8, 0x29400036);
  1027. MDP_OUTP(MDP_BASE + 0x5fffc, 0x19c000c4);
  1028. MDP_OUTP(MDP_BASE + 0x502dc, 0x28800032);
  1029. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ac000c5);
  1030. MDP_OUTP(MDP_BASE + 0x502e0, 0x2800002f);
  1031. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1bc000c7);
  1032. MDP_OUTP(MDP_BASE + 0x502e4, 0x2740002c);
  1033. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1cc000c8);
  1034. MDP_OUTP(MDP_BASE + 0x502e8, 0x26c00029);
  1035. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1dc000c9);
  1036. MDP_OUTP(MDP_BASE + 0x502ec, 0x26000027);
  1037. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ec000cc);
  1038. MDP_OUTP(MDP_BASE + 0x502f0, 0x25000024);
  1039. MDP_OUTP(MDP_BASE + 0x5fffc, 0x200000cc);
  1040. MDP_OUTP(MDP_BASE + 0x502f4, 0x24800021);
  1041. MDP_OUTP(MDP_BASE + 0x5fffc, 0x210000cd);
  1042. MDP_OUTP(MDP_BASE + 0x502f8, 0x23800020);
  1043. MDP_OUTP(MDP_BASE + 0x5fffc, 0x220000ce);
  1044. MDP_OUTP(MDP_BASE + 0x502fc, 0x2300001d);
  1045. }
  1046. static void mdp_load_bc_downscale_table_y_point4TOpoint6(void)
  1047. {
  1048. MDP_OUTP(MDP_BASE + 0x5fffc, 0x740008c);
  1049. MDP_OUTP(MDP_BASE + 0x50300, 0x33800088);
  1050. MDP_OUTP(MDP_BASE + 0x5fffc, 0x800008e);
  1051. MDP_OUTP(MDP_BASE + 0x50304, 0x33400084);
  1052. MDP_OUTP(MDP_BASE + 0x5fffc, 0x8400092);
  1053. MDP_OUTP(MDP_BASE + 0x50308, 0x33000080);
  1054. MDP_OUTP(MDP_BASE + 0x5fffc, 0x9000094);
  1055. MDP_OUTP(MDP_BASE + 0x5030c, 0x3300007b);
  1056. MDP_OUTP(MDP_BASE + 0x5fffc, 0x9c00098);
  1057. MDP_OUTP(MDP_BASE + 0x50310, 0x32400077);
  1058. MDP_OUTP(MDP_BASE + 0x5fffc, 0xa40009b);
  1059. MDP_OUTP(MDP_BASE + 0x50314, 0x32000073);
  1060. MDP_OUTP(MDP_BASE + 0x5fffc, 0xb00009d);
  1061. MDP_OUTP(MDP_BASE + 0x50318, 0x31c0006f);
  1062. MDP_OUTP(MDP_BASE + 0x5fffc, 0xbc000a0);
  1063. MDP_OUTP(MDP_BASE + 0x5031c, 0x3140006b);
  1064. MDP_OUTP(MDP_BASE + 0x5fffc, 0xc8000a2);
  1065. MDP_OUTP(MDP_BASE + 0x50320, 0x31000067);
  1066. MDP_OUTP(MDP_BASE + 0x5fffc, 0xd8000a5);
  1067. MDP_OUTP(MDP_BASE + 0x50324, 0x30800062);
  1068. MDP_OUTP(MDP_BASE + 0x5fffc, 0xe4000a8);
  1069. MDP_OUTP(MDP_BASE + 0x50328, 0x2fc0005f);
  1070. MDP_OUTP(MDP_BASE + 0x5fffc, 0xec000aa);
  1071. MDP_OUTP(MDP_BASE + 0x5032c, 0x2fc0005b);
  1072. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf8000ad);
  1073. MDP_OUTP(MDP_BASE + 0x50330, 0x2f400057);
  1074. MDP_OUTP(MDP_BASE + 0x5fffc, 0x108000b0);
  1075. MDP_OUTP(MDP_BASE + 0x50334, 0x2e400054);
  1076. MDP_OUTP(MDP_BASE + 0x5fffc, 0x114000b2);
  1077. MDP_OUTP(MDP_BASE + 0x50338, 0x2e000050);
  1078. MDP_OUTP(MDP_BASE + 0x5fffc, 0x124000b4);
  1079. MDP_OUTP(MDP_BASE + 0x5033c, 0x2d80004c);
  1080. MDP_OUTP(MDP_BASE + 0x5fffc, 0x130000b6);
  1081. MDP_OUTP(MDP_BASE + 0x50340, 0x2d000049);
  1082. MDP_OUTP(MDP_BASE + 0x5fffc, 0x140000b8);
  1083. MDP_OUTP(MDP_BASE + 0x50344, 0x2c800045);
  1084. MDP_OUTP(MDP_BASE + 0x5fffc, 0x150000b9);
  1085. MDP_OUTP(MDP_BASE + 0x50348, 0x2c000042);
  1086. MDP_OUTP(MDP_BASE + 0x5fffc, 0x15c000bd);
  1087. MDP_OUTP(MDP_BASE + 0x5034c, 0x2b40003e);
  1088. MDP_OUTP(MDP_BASE + 0x5fffc, 0x16c000bf);
  1089. MDP_OUTP(MDP_BASE + 0x50350, 0x2a80003b);
  1090. MDP_OUTP(MDP_BASE + 0x5fffc, 0x17c000bf);
  1091. MDP_OUTP(MDP_BASE + 0x50354, 0x2a000039);
  1092. MDP_OUTP(MDP_BASE + 0x5fffc, 0x188000c2);
  1093. MDP_OUTP(MDP_BASE + 0x50358, 0x29400036);
  1094. MDP_OUTP(MDP_BASE + 0x5fffc, 0x19c000c4);
  1095. MDP_OUTP(MDP_BASE + 0x5035c, 0x28800032);
  1096. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ac000c5);
  1097. MDP_OUTP(MDP_BASE + 0x50360, 0x2800002f);
  1098. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1bc000c7);
  1099. MDP_OUTP(MDP_BASE + 0x50364, 0x2740002c);
  1100. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1cc000c8);
  1101. MDP_OUTP(MDP_BASE + 0x50368, 0x26c00029);
  1102. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1dc000c9);
  1103. MDP_OUTP(MDP_BASE + 0x5036c, 0x26000027);
  1104. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1ec000cc);
  1105. MDP_OUTP(MDP_BASE + 0x50370, 0x25000024);
  1106. MDP_OUTP(MDP_BASE + 0x5fffc, 0x200000cc);
  1107. MDP_OUTP(MDP_BASE + 0x50374, 0x24800021);
  1108. MDP_OUTP(MDP_BASE + 0x5fffc, 0x210000cd);
  1109. MDP_OUTP(MDP_BASE + 0x50378, 0x23800020);
  1110. MDP_OUTP(MDP_BASE + 0x5fffc, 0x220000ce);
  1111. MDP_OUTP(MDP_BASE + 0x5037c, 0x2300001d);
  1112. }
  1113. static void mdp_load_bc_downscale_table_x_point6TOpoint8(void)
  1114. {
  1115. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfe000070);
  1116. MDP_OUTP(MDP_BASE + 0x50280, 0x4bc00068);
  1117. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfe000078);
  1118. MDP_OUTP(MDP_BASE + 0x50284, 0x4bc00060);
  1119. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfe000080);
  1120. MDP_OUTP(MDP_BASE + 0x50288, 0x4b800059);
  1121. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfe000089);
  1122. MDP_OUTP(MDP_BASE + 0x5028c, 0x4b000052);
  1123. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfe400091);
  1124. MDP_OUTP(MDP_BASE + 0x50290, 0x4a80004b);
  1125. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfe40009a);
  1126. MDP_OUTP(MDP_BASE + 0x50294, 0x4a000044);
  1127. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfe8000a3);
  1128. MDP_OUTP(MDP_BASE + 0x50298, 0x4940003d);
  1129. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfec000ac);
  1130. MDP_OUTP(MDP_BASE + 0x5029c, 0x48400037);
  1131. MDP_OUTP(MDP_BASE + 0x5fffc, 0xff0000b4);
  1132. MDP_OUTP(MDP_BASE + 0x502a0, 0x47800031);
  1133. MDP_OUTP(MDP_BASE + 0x5fffc, 0xff8000bd);
  1134. MDP_OUTP(MDP_BASE + 0x502a4, 0x4640002b);
  1135. MDP_OUTP(MDP_BASE + 0x5fffc, 0xc5);
  1136. MDP_OUTP(MDP_BASE + 0x502a8, 0x45000026);
  1137. MDP_OUTP(MDP_BASE + 0x5fffc, 0x8000ce);
  1138. MDP_OUTP(MDP_BASE + 0x502ac, 0x43800021);
  1139. MDP_OUTP(MDP_BASE + 0x5fffc, 0x10000d6);
  1140. MDP_OUTP(MDP_BASE + 0x502b0, 0x4240001c);
  1141. MDP_OUTP(MDP_BASE + 0x5fffc, 0x18000df);
  1142. MDP_OUTP(MDP_BASE + 0x502b4, 0x40800018);
  1143. MDP_OUTP(MDP_BASE + 0x5fffc, 0x24000e6);
  1144. MDP_OUTP(MDP_BASE + 0x502b8, 0x3f000014);
  1145. MDP_OUTP(MDP_BASE + 0x5fffc, 0x30000ee);
  1146. MDP_OUTP(MDP_BASE + 0x502bc, 0x3d400010);
  1147. MDP_OUTP(MDP_BASE + 0x5fffc, 0x40000f5);
  1148. MDP_OUTP(MDP_BASE + 0x502c0, 0x3b80000c);
  1149. MDP_OUTP(MDP_BASE + 0x5fffc, 0x50000fc);
  1150. MDP_OUTP(MDP_BASE + 0x502c4, 0x39800009);
  1151. MDP_OUTP(MDP_BASE + 0x5fffc, 0x6000102);
  1152. MDP_OUTP(MDP_BASE + 0x502c8, 0x37c00006);
  1153. MDP_OUTP(MDP_BASE + 0x5fffc, 0x7000109);
  1154. MDP_OUTP(MDP_BASE + 0x502cc, 0x35800004);
  1155. MDP_OUTP(MDP_BASE + 0x5fffc, 0x840010e);
  1156. MDP_OUTP(MDP_BASE + 0x502d0, 0x33800002);
  1157. MDP_OUTP(MDP_BASE + 0x5fffc, 0x9800114);
  1158. MDP_OUTP(MDP_BASE + 0x502d4, 0x31400000);
  1159. MDP_OUTP(MDP_BASE + 0x5fffc, 0xac00119);
  1160. MDP_OUTP(MDP_BASE + 0x502d8, 0x2f4003fe);
  1161. MDP_OUTP(MDP_BASE + 0x5fffc, 0xc40011e);
  1162. MDP_OUTP(MDP_BASE + 0x502dc, 0x2d0003fc);
  1163. MDP_OUTP(MDP_BASE + 0x5fffc, 0xdc00121);
  1164. MDP_OUTP(MDP_BASE + 0x502e0, 0x2b0003fb);
  1165. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf400125);
  1166. MDP_OUTP(MDP_BASE + 0x502e4, 0x28c003fa);
  1167. MDP_OUTP(MDP_BASE + 0x5fffc, 0x11000128);
  1168. MDP_OUTP(MDP_BASE + 0x502e8, 0x268003f9);
  1169. MDP_OUTP(MDP_BASE + 0x5fffc, 0x12c0012a);
  1170. MDP_OUTP(MDP_BASE + 0x502ec, 0x244003f9);
  1171. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1480012c);
  1172. MDP_OUTP(MDP_BASE + 0x502f0, 0x224003f8);
  1173. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1640012e);
  1174. MDP_OUTP(MDP_BASE + 0x502f4, 0x200003f8);
  1175. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1800012f);
  1176. MDP_OUTP(MDP_BASE + 0x502f8, 0x1e0003f8);
  1177. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1a00012f);
  1178. MDP_OUTP(MDP_BASE + 0x502fc, 0x1c0003f8);
  1179. }
  1180. static void mdp_load_bc_downscale_table_y_point6TOpoint8(void)
  1181. {
  1182. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfe000070);
  1183. MDP_OUTP(MDP_BASE + 0x50300, 0x4bc00068);
  1184. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfe000078);
  1185. MDP_OUTP(MDP_BASE + 0x50304, 0x4bc00060);
  1186. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfe000080);
  1187. MDP_OUTP(MDP_BASE + 0x50308, 0x4b800059);
  1188. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfe000089);
  1189. MDP_OUTP(MDP_BASE + 0x5030c, 0x4b000052);
  1190. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfe400091);
  1191. MDP_OUTP(MDP_BASE + 0x50310, 0x4a80004b);
  1192. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfe40009a);
  1193. MDP_OUTP(MDP_BASE + 0x50314, 0x4a000044);
  1194. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfe8000a3);
  1195. MDP_OUTP(MDP_BASE + 0x50318, 0x4940003d);
  1196. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfec000ac);
  1197. MDP_OUTP(MDP_BASE + 0x5031c, 0x48400037);
  1198. MDP_OUTP(MDP_BASE + 0x5fffc, 0xff0000b4);
  1199. MDP_OUTP(MDP_BASE + 0x50320, 0x47800031);
  1200. MDP_OUTP(MDP_BASE + 0x5fffc, 0xff8000bd);
  1201. MDP_OUTP(MDP_BASE + 0x50324, 0x4640002b);
  1202. MDP_OUTP(MDP_BASE + 0x5fffc, 0xc5);
  1203. MDP_OUTP(MDP_BASE + 0x50328, 0x45000026);
  1204. MDP_OUTP(MDP_BASE + 0x5fffc, 0x8000ce);
  1205. MDP_OUTP(MDP_BASE + 0x5032c, 0x43800021);
  1206. MDP_OUTP(MDP_BASE + 0x5fffc, 0x10000d6);
  1207. MDP_OUTP(MDP_BASE + 0x50330, 0x4240001c);
  1208. MDP_OUTP(MDP_BASE + 0x5fffc, 0x18000df);
  1209. MDP_OUTP(MDP_BASE + 0x50334, 0x40800018);
  1210. MDP_OUTP(MDP_BASE + 0x5fffc, 0x24000e6);
  1211. MDP_OUTP(MDP_BASE + 0x50338, 0x3f000014);
  1212. MDP_OUTP(MDP_BASE + 0x5fffc, 0x30000ee);
  1213. MDP_OUTP(MDP_BASE + 0x5033c, 0x3d400010);
  1214. MDP_OUTP(MDP_BASE + 0x5fffc, 0x40000f5);
  1215. MDP_OUTP(MDP_BASE + 0x50340, 0x3b80000c);
  1216. MDP_OUTP(MDP_BASE + 0x5fffc, 0x50000fc);
  1217. MDP_OUTP(MDP_BASE + 0x50344, 0x39800009);
  1218. MDP_OUTP(MDP_BASE + 0x5fffc, 0x6000102);
  1219. MDP_OUTP(MDP_BASE + 0x50348, 0x37c00006);
  1220. MDP_OUTP(MDP_BASE + 0x5fffc, 0x7000109);
  1221. MDP_OUTP(MDP_BASE + 0x5034c, 0x35800004);
  1222. MDP_OUTP(MDP_BASE + 0x5fffc, 0x840010e);
  1223. MDP_OUTP(MDP_BASE + 0x50350, 0x33800002);
  1224. MDP_OUTP(MDP_BASE + 0x5fffc, 0x9800114);
  1225. MDP_OUTP(MDP_BASE + 0x50354, 0x31400000);
  1226. MDP_OUTP(MDP_BASE + 0x5fffc, 0xac00119);
  1227. MDP_OUTP(MDP_BASE + 0x50358, 0x2f4003fe);
  1228. MDP_OUTP(MDP_BASE + 0x5fffc, 0xc40011e);
  1229. MDP_OUTP(MDP_BASE + 0x5035c, 0x2d0003fc);
  1230. MDP_OUTP(MDP_BASE + 0x5fffc, 0xdc00121);
  1231. MDP_OUTP(MDP_BASE + 0x50360, 0x2b0003fb);
  1232. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf400125);
  1233. MDP_OUTP(MDP_BASE + 0x50364, 0x28c003fa);
  1234. MDP_OUTP(MDP_BASE + 0x5fffc, 0x11000128);
  1235. MDP_OUTP(MDP_BASE + 0x50368, 0x268003f9);
  1236. MDP_OUTP(MDP_BASE + 0x5fffc, 0x12c0012a);
  1237. MDP_OUTP(MDP_BASE + 0x5036c, 0x244003f9);
  1238. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1480012c);
  1239. MDP_OUTP(MDP_BASE + 0x50370, 0x224003f8);
  1240. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1640012e);
  1241. MDP_OUTP(MDP_BASE + 0x50374, 0x200003f8);
  1242. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1800012f);
  1243. MDP_OUTP(MDP_BASE + 0x50378, 0x1e0003f8);
  1244. MDP_OUTP(MDP_BASE + 0x5fffc, 0x1a00012f);
  1245. MDP_OUTP(MDP_BASE + 0x5037c, 0x1c0003f8);
  1246. }
  1247. static void mdp_load_bc_downscale_table_x_point8TO1(void)
  1248. {
  1249. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  1250. MDP_OUTP(MDP_BASE + 0x50280, 0x7fc00000);
  1251. MDP_OUTP(MDP_BASE + 0x5fffc, 0xff80000d);
  1252. MDP_OUTP(MDP_BASE + 0x50284, 0x7ec003f9);
  1253. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfec0001c);
  1254. MDP_OUTP(MDP_BASE + 0x50288, 0x7d4003f3);
  1255. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfe40002b);
  1256. MDP_OUTP(MDP_BASE + 0x5028c, 0x7b8003ed);
  1257. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfd80003c);
  1258. MDP_OUTP(MDP_BASE + 0x50290, 0x794003e8);
  1259. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfcc0004d);
  1260. MDP_OUTP(MDP_BASE + 0x50294, 0x76c003e4);
  1261. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfc40005f);
  1262. MDP_OUTP(MDP_BASE + 0x50298, 0x73c003e0);
  1263. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfb800071);
  1264. MDP_OUTP(MDP_BASE + 0x5029c, 0x708003de);
  1265. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfac00085);
  1266. MDP_OUTP(MDP_BASE + 0x502a0, 0x6d0003db);
  1267. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfa000098);
  1268. MDP_OUTP(MDP_BASE + 0x502a4, 0x698003d9);
  1269. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf98000ac);
  1270. MDP_OUTP(MDP_BASE + 0x502a8, 0x654003d8);
  1271. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf8c000c1);
  1272. MDP_OUTP(MDP_BASE + 0x502ac, 0x610003d7);
  1273. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf84000d5);
  1274. MDP_OUTP(MDP_BASE + 0x502b0, 0x5c8003d7);
  1275. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf7c000e9);
  1276. MDP_OUTP(MDP_BASE + 0x502b4, 0x580003d7);
  1277. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf74000fd);
  1278. MDP_OUTP(MDP_BASE + 0x502b8, 0x534003d8);
  1279. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf6c00112);
  1280. MDP_OUTP(MDP_BASE + 0x502bc, 0x4e8003d8);
  1281. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf6800126);
  1282. MDP_OUTP(MDP_BASE + 0x502c0, 0x494003da);
  1283. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf600013a);
  1284. MDP_OUTP(MDP_BASE + 0x502c4, 0x448003db);
  1285. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf600014d);
  1286. MDP_OUTP(MDP_BASE + 0x502c8, 0x3f4003dd);
  1287. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf5c00160);
  1288. MDP_OUTP(MDP_BASE + 0x502cc, 0x3a4003df);
  1289. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf5c00172);
  1290. MDP_OUTP(MDP_BASE + 0x502d0, 0x354003e1);
  1291. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf5c00184);
  1292. MDP_OUTP(MDP_BASE + 0x502d4, 0x304003e3);
  1293. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf6000195);
  1294. MDP_OUTP(MDP_BASE + 0x502d8, 0x2b0003e6);
  1295. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf64001a6);
  1296. MDP_OUTP(MDP_BASE + 0x502dc, 0x260003e8);
  1297. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf6c001b4);
  1298. MDP_OUTP(MDP_BASE + 0x502e0, 0x214003eb);
  1299. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf78001c2);
  1300. MDP_OUTP(MDP_BASE + 0x502e4, 0x1c4003ee);
  1301. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf80001cf);
  1302. MDP_OUTP(MDP_BASE + 0x502e8, 0x17c003f1);
  1303. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf90001db);
  1304. MDP_OUTP(MDP_BASE + 0x502ec, 0x134003f3);
  1305. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfa0001e5);
  1306. MDP_OUTP(MDP_BASE + 0x502f0, 0xf0003f6);
  1307. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfb4001ee);
  1308. MDP_OUTP(MDP_BASE + 0x502f4, 0xac003f9);
  1309. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfcc001f5);
  1310. MDP_OUTP(MDP_BASE + 0x502f8, 0x70003fb);
  1311. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfe4001fb);
  1312. MDP_OUTP(MDP_BASE + 0x502fc, 0x34003fe);
  1313. }
  1314. static void mdp_load_bc_downscale_table_y_point8TO1(void)
  1315. {
  1316. MDP_OUTP(MDP_BASE + 0x5fffc, 0x0);
  1317. MDP_OUTP(MDP_BASE + 0x50300, 0x7fc00000);
  1318. MDP_OUTP(MDP_BASE + 0x5fffc, 0xff80000d);
  1319. MDP_OUTP(MDP_BASE + 0x50304, 0x7ec003f9);
  1320. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfec0001c);
  1321. MDP_OUTP(MDP_BASE + 0x50308, 0x7d4003f3);
  1322. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfe40002b);
  1323. MDP_OUTP(MDP_BASE + 0x5030c, 0x7b8003ed);
  1324. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfd80003c);
  1325. MDP_OUTP(MDP_BASE + 0x50310, 0x794003e8);
  1326. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfcc0004d);
  1327. MDP_OUTP(MDP_BASE + 0x50314, 0x76c003e4);
  1328. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfc40005f);
  1329. MDP_OUTP(MDP_BASE + 0x50318, 0x73c003e0);
  1330. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfb800071);
  1331. MDP_OUTP(MDP_BASE + 0x5031c, 0x708003de);
  1332. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfac00085);
  1333. MDP_OUTP(MDP_BASE + 0x50320, 0x6d0003db);
  1334. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfa000098);
  1335. MDP_OUTP(MDP_BASE + 0x50324, 0x698003d9);
  1336. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf98000ac);
  1337. MDP_OUTP(MDP_BASE + 0x50328, 0x654003d8);
  1338. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf8c000c1);
  1339. MDP_OUTP(MDP_BASE + 0x5032c, 0x610003d7);
  1340. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf84000d5);
  1341. MDP_OUTP(MDP_BASE + 0x50330, 0x5c8003d7);
  1342. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf7c000e9);
  1343. MDP_OUTP(MDP_BASE + 0x50334, 0x580003d7);
  1344. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf74000fd);
  1345. MDP_OUTP(MDP_BASE + 0x50338, 0x534003d8);
  1346. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf6c00112);
  1347. MDP_OUTP(MDP_BASE + 0x5033c, 0x4e8003d8);
  1348. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf6800126);
  1349. MDP_OUTP(MDP_BASE + 0x50340, 0x494003da);
  1350. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf600013a);
  1351. MDP_OUTP(MDP_BASE + 0x50344, 0x448003db);
  1352. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf600014d);
  1353. MDP_OUTP(MDP_BASE + 0x50348, 0x3f4003dd);
  1354. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf5c00160);
  1355. MDP_OUTP(MDP_BASE + 0x5034c, 0x3a4003df);
  1356. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf5c00172);
  1357. MDP_OUTP(MDP_BASE + 0x50350, 0x354003e1);
  1358. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf5c00184);
  1359. MDP_OUTP(MDP_BASE + 0x50354, 0x304003e3);
  1360. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf6000195);
  1361. MDP_OUTP(MDP_BASE + 0x50358, 0x2b0003e6);
  1362. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf64001a6);
  1363. MDP_OUTP(MDP_BASE + 0x5035c, 0x260003e8);
  1364. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf6c001b4);
  1365. MDP_OUTP(MDP_BASE + 0x50360, 0x214003eb);
  1366. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf78001c2);
  1367. MDP_OUTP(MDP_BASE + 0x50364, 0x1c4003ee);
  1368. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf80001cf);
  1369. MDP_OUTP(MDP_BASE + 0x50368, 0x17c003f1);
  1370. MDP_OUTP(MDP_BASE + 0x5fffc, 0xf90001db);
  1371. MDP_OUTP(MDP_BASE + 0x5036c, 0x134003f3);
  1372. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfa0001e5);
  1373. MDP_OUTP(MDP_BASE + 0x50370, 0xf0003f6);
  1374. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfb4001ee);
  1375. MDP_OUTP(MDP_BASE + 0x50374, 0xac003f9);
  1376. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfcc001f5);
  1377. MDP_OUTP(MDP_BASE + 0x50378, 0x70003fb);
  1378. MDP_OUTP(MDP_BASE + 0x5fffc, 0xfe4001fb);
  1379. MDP_OUTP(MDP_BASE + 0x5037c, 0x34003fe);
  1380. }
  1381. static int mdp_get_edge_cond(MDPIBUF *iBuf, uint32 *dup, uint32 *dup2)
  1382. {
  1383. uint32 reg;
  1384. uint32 dst_roi_width; /* Dimensions of DST ROI. */
  1385. uint32 dst_roi_height; /* Used to calculate scaling ratios. */
  1386. /*
  1387. * positions of the luma pixel(relative to the image ) required for
  1388. * scaling the ROI
  1389. */
  1390. int32 luma_interp_point_left = 0; /* left-most luma pixel needed */
  1391. int32 luma_interp_point_right = 0; /* right-most luma pixel needed */
  1392. int32 luma_interp_point_top = 0; /* top-most luma pixel needed */
  1393. int32 luma_interp_point_bottom = 0; /* bottom-most luma pixel needed */
  1394. /*
  1395. * positions of the chroma pixel(relative to the image ) required for
  1396. * interpolating a chroma value at all required luma positions
  1397. */
  1398. /* left-most chroma pixel needed */
  1399. int32 chroma_interp_point_left = 0;
  1400. /* right-most chroma pixel needed */
  1401. int32 chroma_interp_point_right = 0;
  1402. /* top-most chroma pixel needed */
  1403. int32 chroma_interp_point_top = 0;
  1404. /* bottom-most chroma pixel needed */
  1405. int32 chroma_interp_point_bottom = 0;
  1406. /*
  1407. * a rectangular region within the chroma plane of the "image".
  1408. * Chroma pixels falling inside of this rectangle belongs to the ROI
  1409. */
  1410. int32 chroma_bound_left = 0;
  1411. int32 chroma_bound_right = 0;
  1412. int32 chroma_bound_top = 0;
  1413. int32 chroma_bound_bottom = 0;
  1414. /*
  1415. * number of chroma pixels to replicate on the left, right,
  1416. * top and bottom edge of the ROI.
  1417. */
  1418. int32 chroma_repeat_left = 0;
  1419. int32 chroma_repeat_right = 0;
  1420. int32 chroma_repeat_top = 0;
  1421. int32 chroma_repeat_bottom = 0;
  1422. /*
  1423. * number of luma pixels to replicate on the left, right,
  1424. * top and bottom edge of the ROI.
  1425. */
  1426. int32 luma_repeat_left = 0;
  1427. int32 luma_repeat_right = 0;
  1428. int32 luma_repeat_top = 0;
  1429. int32 luma_repeat_bottom = 0;
  1430. boolean chroma_edge_enable;
  1431. uint32 _is_scale_enabled = 0;
  1432. uint32 _is_yuv_offsite_vertical = 0;
  1433. /* fg edge duplicate */
  1434. reg = 0x0;
  1435. if (iBuf->mdpImg.mdpOp & MDPOP_ASCALE) { /* if scaling enabled */
  1436. _is_scale_enabled = 1;
  1437. /*
  1438. * if rotation mode involves a 90 deg rotation, flip
  1439. * dst_roi_width with dst_roi_height.
  1440. * Scaling ratios is based on source ROI dimensions, and
  1441. * dst ROI dimensions before rotation.
  1442. */
  1443. if (iBuf->mdpImg.mdpOp & MDPOP_ROT90) {
  1444. dst_roi_width = iBuf->roi.dst_height;
  1445. dst_roi_height = iBuf->roi.dst_width;
  1446. } else {
  1447. dst_roi_width = iBuf->roi.dst_width;
  1448. dst_roi_height = iBuf->roi.dst_height;
  1449. }
  1450. /*
  1451. * Find out the luma pixels needed for scaling in the
  1452. * x direction (LEFT and RIGHT). Locations of pixels are
  1453. * relative to the ROI. Upper-left corner of ROI corresponds
  1454. * to coordinates (0,0). Also set the number of luma pixel
  1455. * to repeat.
  1456. */
  1457. if (iBuf->roi.width > 3 * dst_roi_width) {
  1458. /* scale factor < 1/3 */
  1459. luma_interp_point_left = 0;
  1460. luma_interp_point_right = (iBuf->roi.width - 1);
  1461. luma_repeat_left = 0;
  1462. luma_repeat_right = 0;
  1463. } else if (iBuf->roi.width == 3 * dst_roi_width) {
  1464. /* scale factor == 1/3 */
  1465. luma_interp_point_left = 0;
  1466. luma_interp_point_right = (iBuf->roi.width - 1) + 1;
  1467. luma_repeat_left = 0;
  1468. luma_repeat_right = 1;
  1469. } else if ((iBuf->roi.width > dst_roi_width) &&
  1470. (iBuf->roi.width < 3 * dst_roi_width)) {
  1471. /* 1/3 < scale factor < 1 */
  1472. luma_interp_point_left = -1;
  1473. luma_interp_point_right = (iBuf->roi.width - 1) + 1;
  1474. luma_repeat_left = 1;
  1475. luma_repeat_right = 1;
  1476. }
  1477. else if (iBuf->roi.width == dst_roi_width) {
  1478. /* scale factor == 1 */
  1479. luma_interp_point_left = -1;
  1480. luma_interp_point_right = (iBuf->roi.width - 1) + 2;
  1481. luma_repeat_left = 1;
  1482. luma_repeat_right = 2;
  1483. } else { /* (iBuf->roi.width < dst_roi_width) */
  1484. /* scale factor > 1 */
  1485. luma_interp_point_left = -2;
  1486. luma_interp_point_right = (iBuf->roi.width - 1) + 2;
  1487. luma_repeat_left = 2;
  1488. luma_repeat_right = 2;
  1489. }
  1490. /*
  1491. * Find out the number of pixels needed for scaling in the
  1492. * y direction (TOP and BOTTOM). Locations of pixels are
  1493. * relative to the ROI. Upper-left corner of ROI corresponds
  1494. * to coordinates (0,0). Also set the number of luma pixel
  1495. * to repeat.
  1496. */
  1497. if (iBuf->roi.height > 3 * dst_roi_height) {
  1498. /* scale factor < 1/3 */
  1499. luma_interp_point_top = 0;
  1500. luma_interp_point_bottom = (iBuf->roi.height - 1);
  1501. luma_repeat_top = 0;
  1502. luma_repeat_bottom = 0;
  1503. } else if (iBuf->roi.height == 3 * dst_roi_height) {
  1504. /* scale factor == 1/3 */
  1505. luma_interp_point_top = 0;
  1506. luma_interp_point_bottom = (iBuf->roi.height - 1) + 1;
  1507. luma_repeat_top = 0;
  1508. luma_repeat_bottom = 1;
  1509. } else if ((iBuf->roi.height > dst_roi_height) &&
  1510. (iBuf->roi.height < 3 * dst_roi_height)) {
  1511. /* 1/3 < scale factor < 1 */
  1512. luma_interp_point_top = -1;
  1513. luma_interp_point_bottom = (iBuf->roi.height - 1) + 1;
  1514. luma_repeat_top = 1;
  1515. luma_repeat_bottom = 1;
  1516. } else if (iBuf->roi.height == dst_roi_height) {
  1517. /* scale factor == 1 */
  1518. luma_interp_point_top = -1;
  1519. luma_interp_point_bottom = (iBuf->roi.height - 1) + 2;
  1520. luma_repeat_top = 1;
  1521. luma_repeat_bottom = 2;
  1522. } else { /* (iBuf->roi.height < dst_roi_height) */
  1523. /* scale factor > 1 */
  1524. luma_interp_point_top = -2;
  1525. luma_interp_point_bottom = (iBuf->roi.height - 1) + 2;
  1526. luma_repeat_top = 2;
  1527. luma_repeat_bottom = 2;
  1528. }
  1529. } /* if (iBuf->scale.scale_flag) */
  1530. else { /* scaling disabled */
  1531. /*
  1532. * Since no scaling needed, Tile Fetch does not require any
  1533. * more luma pixel than what the ROI contains.
  1534. */
  1535. luma_interp_point_left = (int32) 0;
  1536. luma_interp_point_right = (int32) (iBuf->roi.width - 1);
  1537. luma_interp_point_top = (int32) 0;
  1538. luma_interp_point_bottom = (int32) (iBuf->roi.height - 1);
  1539. luma_repeat_left = 0;
  1540. luma_repeat_right = 0;
  1541. luma_repeat_top = 0;
  1542. luma_repeat_bottom = 0;
  1543. }
  1544. /* After adding the ROI offsets, we have locations of
  1545. * luma_interp_points relative to the image.
  1546. */
  1547. luma_interp_point_left += (int32) (iBuf->roi.x);
  1548. luma_interp_point_right += (int32) (iBuf->roi.x);
  1549. luma_interp_point_top += (int32) (iBuf->roi.y);
  1550. luma_interp_point_bottom += (int32) (iBuf->roi.y);
  1551. /*
  1552. * After adding the ROI offsets, we have locations of
  1553. * chroma_interp_points relative to the image.
  1554. */
  1555. chroma_interp_point_left = luma_interp_point_left;
  1556. chroma_interp_point_right = luma_interp_point_right;
  1557. chroma_interp_point_top = luma_interp_point_top;
  1558. chroma_interp_point_bottom = luma_interp_point_bottom;
  1559. chroma_edge_enable = TRUE;
  1560. /* find out which chroma pixels are needed for chroma upsampling. */
  1561. switch (iBuf->mdpImg.imgType) {
  1562. /*
  1563. * cosite in horizontal axis
  1564. * fully sampled in vertical axis
  1565. */
  1566. case MDP_Y_CBCR_H2V1:
  1567. case MDP_Y_CRCB_H2V1:
  1568. case MDP_YCRYCB_H2V1:
  1569. /* floor( luma_interp_point_left / 2 ); */
  1570. chroma_interp_point_left = luma_interp_point_left >> 1;
  1571. /* floor( ( luma_interp_point_right + 1 ) / 2 ); */
  1572. chroma_interp_point_right = (luma_interp_point_right + 1) >> 1;
  1573. chroma_interp_point_top = luma_interp_point_top;
  1574. chroma_interp_point_bottom = luma_interp_point_bottom;
  1575. break;
  1576. /*
  1577. * cosite in horizontal axis
  1578. * offsite in vertical axis
  1579. */
  1580. case MDP_Y_CBCR_H2V2:
  1581. case MDP_Y_CBCR_H2V2_ADRENO:
  1582. case MDP_Y_CRCB_H2V2:
  1583. /* floor( luma_interp_point_left / 2) */
  1584. chroma_interp_point_left = luma_interp_point_left >> 1;
  1585. /* floor( ( luma_interp_point_right + 1 )/ 2 ) */
  1586. chroma_interp_point_right = (luma_interp_point_right + 1) >> 1;
  1587. /* floor( (luma_interp_point_top - 1 ) / 2 ) */
  1588. chroma_interp_point_top = (luma_interp_point_top - 1) >> 1;
  1589. /* floor( ( luma_interp_point_bottom + 1 ) / 2 ) */
  1590. chroma_interp_point_bottom =
  1591. (luma_interp_point_bottom + 1) >> 1;
  1592. _is_yuv_offsite_vertical = 1;
  1593. break;
  1594. default:
  1595. chroma_edge_enable = FALSE;
  1596. chroma_interp_point_left = luma_interp_point_left;
  1597. chroma_interp_point_right = luma_interp_point_right;
  1598. chroma_interp_point_top = luma_interp_point_top;
  1599. chroma_interp_point_bottom = luma_interp_point_bottom;
  1600. break;
  1601. }
  1602. /* only if the image type is in YUV domain, we calculate chroma edge */
  1603. if (chroma_edge_enable) {
  1604. /* Defines which chroma pixels belongs to the roi */
  1605. switch (iBuf->mdpImg.imgType) {
  1606. /*
  1607. * Cosite in horizontal direction, and fully sampled
  1608. * in vertical direction.
  1609. */
  1610. case MDP_Y_CBCR_H2V1:
  1611. case MDP_Y_CRCB_H2V1:
  1612. case MDP_YCRYCB_H2V1:
  1613. /*
  1614. * width of chroma ROI is 1/2 of size of luma ROI
  1615. * height of chroma ROI same as size of luma ROI
  1616. */
  1617. chroma_bound_left = iBuf->roi.x / 2;
  1618. /* there are half as many chroma pixel as luma pixels */
  1619. chroma_bound_right =
  1620. (iBuf->roi.width + iBuf->roi.x - 1) / 2;
  1621. chroma_bound_top = iBuf->roi.y;
  1622. chroma_bound_bottom =
  1623. (iBuf->roi.height + iBuf->roi.y - 1);
  1624. break;
  1625. case MDP_Y_CBCR_H2V2:
  1626. case MDP_Y_CBCR_H2V2_ADRENO:
  1627. case MDP_Y_CRCB_H2V2:
  1628. /*
  1629. * cosite in horizontal dir, and offsite in vertical dir
  1630. * width of chroma ROI is 1/2 of size of luma ROI
  1631. * height of chroma ROI is 1/2 of size of luma ROI
  1632. */
  1633. chroma_bound_left = iBuf->roi.x / 2;
  1634. chroma_bound_right =
  1635. (iBuf->roi.width + iBuf->roi.x - 1) / 2;
  1636. chroma_bound_top = iBuf->roi.y / 2;
  1637. chroma_bound_bottom =
  1638. (iBuf->roi.height + iBuf->roi.y - 1) / 2;
  1639. break;
  1640. default:
  1641. /*
  1642. * If no valid chroma sub-sampling format specified,
  1643. * assume 4:4:4 ( i.e. fully sampled). Set ROI
  1644. * boundaries for chroma same as ROI boundaries for
  1645. * luma.
  1646. */
  1647. chroma_bound_left = iBuf->roi.x;
  1648. chroma_bound_right = iBuf->roi.width + iBuf->roi.x - 1;
  1649. chroma_bound_top = iBuf->roi.y;
  1650. chroma_bound_bottom =
  1651. (iBuf->roi.height + iBuf->roi.y - 1);
  1652. break;
  1653. }
  1654. /*
  1655. * Knowing which chroma pixels are needed, and which chroma
  1656. * pixels belong to the ROI (i.e. available for fetching ),
  1657. * calculate how many chroma pixels Tile Fetch needs to
  1658. * duplicate. If any required chroma pixels falls outside
  1659. * of the ROI, Tile Fetch must obtain them by replicating
  1660. * pixels.
  1661. */
  1662. if (chroma_bound_left > chroma_interp_point_left)
  1663. chroma_repeat_left =
  1664. chroma_bound_left - chroma_interp_point_left;
  1665. else
  1666. chroma_repeat_left = 0;
  1667. if (chroma_interp_point_right > chroma_bound_right)
  1668. chroma_repeat_right =
  1669. chroma_interp_point_right - chroma_bound_right;
  1670. else
  1671. chroma_repeat_right = 0;
  1672. if (chroma_bound_top > chroma_interp_point_top)
  1673. chroma_repeat_top =
  1674. chroma_bound_top - chroma_interp_point_top;
  1675. else
  1676. chroma_repeat_top = 0;
  1677. if (chroma_interp_point_bottom > chroma_bound_bottom)
  1678. chroma_repeat_bottom =
  1679. chroma_interp_point_bottom - chroma_bound_bottom;
  1680. else
  1681. chroma_repeat_bottom = 0;
  1682. if (_is_scale_enabled && (iBuf->roi.height == 1)
  1683. && _is_yuv_offsite_vertical) {
  1684. chroma_repeat_bottom = 3;
  1685. chroma_repeat_top = 0;
  1686. }
  1687. }
  1688. /* make sure chroma repeats are non-negative */
  1689. if ((chroma_repeat_left < 0) || (chroma_repeat_right < 0) ||
  1690. (chroma_repeat_top < 0) || (chroma_repeat_bottom < 0))
  1691. return -1;
  1692. /* make sure chroma repeats are no larger than 3 pixels */
  1693. if ((chroma_repeat_left > 3) || (chroma_repeat_right > 3) ||
  1694. (chroma_repeat_top > 3) || (chroma_repeat_bottom > 3))
  1695. return -1;
  1696. /* make sure luma repeats are non-negative */
  1697. if ((luma_repeat_left < 0) || (luma_repeat_right < 0) ||
  1698. (luma_repeat_top < 0) || (luma_repeat_bottom < 0))
  1699. return -1;
  1700. /* make sure luma repeats are no larger than 3 pixels */
  1701. if ((luma_repeat_left > 3) || (luma_repeat_right > 3) ||
  1702. (luma_repeat_top > 3) || (luma_repeat_bottom > 3))
  1703. return -1;
  1704. /* write chroma_repeat_left to register */
  1705. reg |= (chroma_repeat_left & 3) << MDP_LEFT_CHROMA;
  1706. /* write chroma_repeat_right to register */
  1707. reg |= (chroma_repeat_right & 3) << MDP_RIGHT_CHROMA;
  1708. /* write chroma_repeat_top to register */
  1709. reg |= (chroma_repeat_top & 3) << MDP_TOP_CHROMA;
  1710. /* write chroma_repeat_bottom to register */
  1711. reg |= (chroma_repeat_bottom & 3) << MDP_BOTTOM_CHROMA;
  1712. /* write luma_repeat_left to register */
  1713. reg |= (luma_repeat_left & 3) << MDP_LEFT_LUMA;
  1714. /* write luma_repeat_right to register */
  1715. reg |= (luma_repeat_right & 3) << MDP_RIGHT_LUMA;
  1716. /* write luma_repeat_top to register */
  1717. reg |= (luma_repeat_top & 3) << MDP_TOP_LUMA;
  1718. /* write luma_repeat_bottom to register */
  1719. reg |= (luma_repeat_bottom & 3) << MDP_BOTTOM_LUMA;
  1720. /* done with reg */
  1721. *dup = reg;
  1722. /* bg edge duplicate */
  1723. reg = 0x0;
  1724. switch (iBuf->ibuf_type) {
  1725. case MDP_Y_CBCR_H2V2:
  1726. case MDP_Y_CRCB_H2V2:
  1727. /*
  1728. * Edge condition for MDP_Y_CRCB/CBCR_H2V2 cosite only.
  1729. * For 420 cosite, 1 chroma replicated on all sides except
  1730. * left, so reg 101b8 should be 0x0209. For 420 offsite,
  1731. * 1 chroma replicated all sides.
  1732. */
  1733. if (iBuf->roi.lcd_y == 0) {
  1734. reg |= BIT(MDP_TOP_CHROMA);
  1735. }
  1736. if ((iBuf->roi.lcd_y + iBuf->roi.dst_height) ==
  1737. iBuf->ibuf_height) {
  1738. reg |= BIT(MDP_BOTTOM_CHROMA);
  1739. }
  1740. if (((iBuf->roi.lcd_x + iBuf->roi.dst_width) ==
  1741. iBuf->ibuf_width) && ((iBuf->roi.dst_width % 2) == 0)) {
  1742. reg |= BIT(MDP_RIGHT_CHROMA);
  1743. }
  1744. break;
  1745. case MDP_Y_CBCR_H2V1:
  1746. case MDP_Y_CRCB_H2V1:
  1747. case MDP_YCRYCB_H2V1:
  1748. if (((iBuf->roi.lcd_x + iBuf->roi.dst_width) ==
  1749. iBuf->ibuf_width) && ((iBuf->roi.dst_width % 2) == 0)) {
  1750. reg |= BIT(MDP_RIGHT_CHROMA);
  1751. }
  1752. break;
  1753. default:
  1754. break;
  1755. }
  1756. *dup2 = reg;
  1757. return 0;
  1758. }
  1759. #define ADJUST_IP /* for 1/3 scale factor fix */
  1760. static int mdp_calc_scale_params(
  1761. /* ROI origin coordinate for the dimension */
  1762. uint32 org,
  1763. /* src ROI dimension */
  1764. uint32 dim_in,
  1765. /* scaled ROI dimension*/
  1766. uint32 dim_out,
  1767. /* is this ROI width dimension? */
  1768. boolean is_W,
  1769. /* initial phase location address */
  1770. int32 *phase_init_ptr,
  1771. /* phase increment location address */
  1772. uint32 *phase_step_ptr,
  1773. /* ROI start over-fetch location address */
  1774. uint32 *num_repl_beg_ptr,
  1775. /* ROI end over-fetch location address */
  1776. uint32 *num_repl_end_ptr)
  1777. {
  1778. boolean rpa_on = FALSE;
  1779. int init_phase = 0;
  1780. uint32 beg_of = 0;
  1781. uint32 end_of = 0;
  1782. uint64 numer = 0;
  1783. uint64 denom = 0;
  1784. /*uint64 inverter = 1; */
  1785. int64 point5 = 1;
  1786. int64 one = 1;
  1787. int64 k1, k2, k3, k4; /* linear equation coefficients */
  1788. uint64 int_mask;
  1789. uint64 fract_mask;
  1790. uint64 Os;
  1791. int64 Osprime;
  1792. int64 Od;
  1793. int64 Odprime;
  1794. int64 Oreq;
  1795. uint64 Es;
  1796. uint64 Ed;
  1797. uint64 Ereq;
  1798. #ifdef ADJUST_IP
  1799. int64 IP64;
  1800. int64 delta;
  1801. #endif
  1802. uint32 mult;
  1803. /*
  1804. * The phase accumulator should really be rational for all cases in a
  1805. * general purpose polyphase scaler for a tiled architecture with
  1806. * non-zero * origin capability because there is no way to represent
  1807. * certain scale factors in fixed point regardless of precision.
  1808. * The error incurred in attempting to use fixed point is most
  1809. * eggregious for SF where 1/SF is an integral multiple of 1/3.
  1810. *
  1811. * However, since the MDP2 has already been committed to HW, we
  1812. * only use the rational phase accumulator (RPA) when 1/SF is an
  1813. * integral multiple of 1/3. This will help minimize regressions in
  1814. * matching the HW to the C-Sim.
  1815. */
  1816. /*
  1817. * Set the RPA flag for this dimension.
  1818. *
  1819. * In order for 1/SF (dim_in/dim_out) to be an integral multiple of
  1820. * 1/3, dim_out must be an integral multiple of 3.
  1821. */
  1822. if (!(dim_out % 3)) {
  1823. mult = dim_out / 3;
  1824. rpa_on = (!(dim_in % mult));
  1825. }
  1826. numer = dim_out;
  1827. denom = dim_in;
  1828. /*
  1829. * convert to U30.34 before division
  1830. *
  1831. * The K vectors carry 4 extra bits of precision
  1832. * and are rounded.
  1833. *
  1834. * We initially go 5 bits over then round by adding
  1835. * 1 and right shifting by 1
  1836. * so final result is U31.33
  1837. */
  1838. numer <<= PQF_PLUS_5;
  1839. /* now calculate the scale factor (aka k3) */
  1840. k3 = ((mdp_do_div(numer, denom) + 1) >> 1);
  1841. /* check scale factor for legal range [0.25 - 4.0] */
  1842. if (((k3 >> 4) < (1LL << PQF_MINUS_2)) ||
  1843. ((k3 >> 4) > (1LL << PQF_PLUS_2))) {
  1844. return -1;
  1845. }
  1846. /* calculate inverse scale factor (aka k1) for phase init */
  1847. numer = dim_in;
  1848. denom = dim_out;
  1849. numer <<= PQF_PLUS_5;
  1850. k1 = ((mdp_do_div(numer, denom) + 1) >> 1);
  1851. /*
  1852. * calculate initial phase and ROI overfetch
  1853. */
  1854. /* convert point5 & one to S39.24 (will always be positive) */
  1855. point5 <<= (PQF_PLUS_4 - 1);
  1856. one <<= PQF_PLUS_4;
  1857. k2 = ((k1 - one) >> 1);
  1858. init_phase = (int)(k2 >> 4);
  1859. k4 = ((k3 - one) >> 1);
  1860. if (k3 == one) {
  1861. /* the simple case; SF = 1.0 */
  1862. beg_of = 1;
  1863. end_of = 2;
  1864. } else {
  1865. /* calculate the masks */
  1866. fract_mask = one - 1;
  1867. int_mask = ~fract_mask;
  1868. if (!rpa_on) {
  1869. /*
  1870. * FIXED POINT IMPLEMENTATION
  1871. */
  1872. if (!org) {
  1873. /* A fairly simple case; ROI origin = 0 */
  1874. if (k1 < one) {
  1875. /* upscaling */
  1876. beg_of = end_of = 2;
  1877. }
  1878. /* 0.33 <= SF < 1.0 */
  1879. else if (k1 < (3LL << PQF_PLUS_4))
  1880. beg_of = end_of = 1;
  1881. /* 0.33 == SF */
  1882. else if (k1 == (3LL << PQF_PLUS_4)) {
  1883. beg_of = 0;
  1884. end_of = 1;
  1885. }
  1886. /* 0.25 <= SF < 0.33 */
  1887. else
  1888. beg_of = end_of = 0;
  1889. } else {
  1890. /*
  1891. * The complicated case; ROI origin != 0
  1892. * init_phase needs to be adjusted
  1893. * OF is also position dependent
  1894. */
  1895. /* map (org - .5) into destination space */
  1896. Os = ((uint64) org << 1) - 1;
  1897. Od = ((k3 * Os) >> 1) + k4;
  1898. /* take the ceiling */
  1899. Odprime = (Od & int_mask);
  1900. if (Odprime != Od)
  1901. Odprime += one;
  1902. /* now map that back to source space */
  1903. Osprime = (k1 * (Odprime >> PQF_PLUS_4)) + k2;
  1904. /* then floor & decrement to calculate the required
  1905. starting coordinate */
  1906. Oreq = (Osprime & int_mask) - one;
  1907. /* calculate end coord in destination space then map to
  1908. source space */
  1909. Ed = Odprime +
  1910. ((uint64) dim_out << PQF_PLUS_4) - one;
  1911. Es = (k1 * (Ed >> PQF_PLUS_4)) + k2;
  1912. /* now floor & increment by 2 to calculate the required
  1913. ending coordinate */
  1914. Ereq = (Es & int_mask) + (one << 1);
  1915. /* calculate initial phase */
  1916. #ifdef ADJUST_IP
  1917. IP64 = Osprime - Oreq;
  1918. delta = ((int64) (org) << PQF_PLUS_4) - Oreq;
  1919. IP64 -= delta;
  1920. /* limit to valid range before the left shift */
  1921. delta = (IP64 & (1LL << 63)) ? 4 : -4;
  1922. delta <<= PQF_PLUS_4;
  1923. while (abs((int)(IP64 >> PQF_PLUS_4)) > 4)
  1924. IP64 += delta;
  1925. /* right shift to account for extra bits of precision */
  1926. init_phase = (int)(IP64 >> 4);
  1927. #else /* ADJUST_IP */
  1928. /* just calculate the real initial phase */
  1929. init_phase = (int)((Osprime - Oreq) >> 4);
  1930. #endif /* ADJUST_IP */
  1931. /* calculate the overfetch */
  1932. beg_of = org - (uint32) (Oreq >> PQF_PLUS_4);
  1933. end_of =
  1934. (uint32) (Ereq >> PQF_PLUS_4) - (org +
  1935. dim_in -
  1936. 1);
  1937. }
  1938. } else {
  1939. /*
  1940. * RPA IMPLEMENTATION
  1941. *
  1942. * init_phase needs to be calculated in all RPA_on cases
  1943. * because it's a numerator, not a fixed point value.
  1944. */
  1945. /* map (org - .5) into destination space */
  1946. Os = ((uint64) org << PQF_PLUS_4) - point5;
  1947. Od = mdp_do_div((dim_out * (Os + point5)),
  1948. dim_in) - point5;
  1949. /* take the ceiling */
  1950. Odprime = (Od & int_mask);
  1951. if (Odprime != Od)
  1952. Odprime += one;
  1953. /* now map that back to source space */
  1954. Osprime =
  1955. mdp_do_div((dim_in * (Odprime + point5)),
  1956. dim_out) - point5;
  1957. /* then floor & decrement to calculate the required
  1958. starting coordinate */
  1959. Oreq = (Osprime & int_mask) - one;
  1960. /* calculate end coord in destination space then map to
  1961. source space */
  1962. Ed = Odprime + ((uint64) dim_out << PQF_PLUS_4) - one;
  1963. Es = mdp_do_div((dim_in * (Ed + point5)),
  1964. dim_out) - point5;
  1965. /* now floor & increment by 2 to calculate the required
  1966. ending coordinate */
  1967. Ereq = (Es & int_mask) + (one << 1);
  1968. /* calculate initial phase */
  1969. #ifdef ADJUST_IP
  1970. IP64 = Osprime - Oreq;
  1971. delta = ((int64) (org) << PQF_PLUS_4) - Oreq;
  1972. IP64 -= delta;
  1973. /* limit to valid range before the left shift */
  1974. delta = (IP64 & (1LL << 63)) ? 4 : -4;
  1975. delta <<= PQF_PLUS_4;
  1976. while (abs((int)(IP64 >> PQF_PLUS_4)) > 4)
  1977. IP64 += delta;
  1978. /* right shift to account for extra bits of precision */
  1979. init_phase = (int)(IP64 >> 4);
  1980. #else /* ADJUST_IP */
  1981. /* just calculate the real initial phase */
  1982. init_phase = (int)((Osprime - Oreq) >> 4);
  1983. #endif /* ADJUST_IP */
  1984. /* calculate the overfetch */
  1985. beg_of = org - (uint32) (Oreq >> PQF_PLUS_4);
  1986. end_of =
  1987. (uint32) (Ereq >> PQF_PLUS_4) - (org + dim_in - 1);
  1988. }
  1989. }
  1990. /* return the scale parameters */
  1991. *phase_init_ptr = init_phase;
  1992. *phase_step_ptr = (uint32) (k1 >> 4);
  1993. *num_repl_beg_ptr = beg_of;
  1994. *num_repl_end_ptr = end_of;
  1995. return 0;
  1996. }
  1997. static uint8 *mdp_adjust_rot_addr(MDPIBUF *iBuf, uint8 *addr, uint32 uv)
  1998. {
  1999. uint32 dest_ystride = iBuf->ibuf_width * iBuf->bpp;
  2000. uint32 h_slice = 1;
  2001. if (uv && ((iBuf->ibuf_type == MDP_Y_CBCR_H2V2) ||
  2002. (iBuf->ibuf_type == MDP_Y_CRCB_H2V2)))
  2003. h_slice = 2;
  2004. if (MDP_CHKBIT(iBuf->mdpImg.mdpOp, MDPOP_ROT90) ^
  2005. MDP_CHKBIT(iBuf->mdpImg.mdpOp, MDPOP_LR)) {
  2006. addr =
  2007. addr + (iBuf->roi.dst_width -
  2008. MIN(16, iBuf->roi.dst_width)) * iBuf->bpp;
  2009. }
  2010. if (MDP_CHKBIT(iBuf->mdpImg.mdpOp, MDPOP_UD)) {
  2011. addr =
  2012. addr + ((iBuf->roi.dst_height -
  2013. MIN(16, iBuf->roi.dst_height))/h_slice) * dest_ystride;
  2014. }
  2015. return addr;
  2016. }
  2017. void mdp_set_scale(MDPIBUF *iBuf,
  2018. uint32 dst_roi_width,
  2019. uint32 dst_roi_height,
  2020. boolean inputRGB, boolean outputRGB, uint32 *pppop_reg_ptr)
  2021. {
  2022. uint32 dst_roi_width_scale;
  2023. uint32 dst_roi_height_scale;
  2024. boolean use_pr;
  2025. uint32 phasex_step = 0;
  2026. uint32 phasey_step = 0;
  2027. int32 phasex_init = 0;
  2028. int32 phasey_init = 0;
  2029. uint32 lines_dup = 0;
  2030. uint32 lines_dup_bg = 0;
  2031. uint32 dummy;
  2032. uint32 mdp_blur = 0;
  2033. if (iBuf->mdpImg.mdpOp & MDPOP_ASCALE) {
  2034. if (iBuf->mdpImg.mdpOp & MDPOP_ROT90) {
  2035. dst_roi_width_scale = dst_roi_height;
  2036. dst_roi_height_scale = dst_roi_width;
  2037. } else {
  2038. dst_roi_width_scale = dst_roi_width;
  2039. dst_roi_height_scale = dst_roi_height;
  2040. }
  2041. mdp_blur = iBuf->mdpImg.mdpOp & MDPOP_BLUR;
  2042. if ((dst_roi_width_scale != iBuf->roi.width) ||
  2043. (dst_roi_height_scale != iBuf->roi.height) ||
  2044. mdp_blur) {
  2045. *pppop_reg_ptr |=
  2046. (PPP_OP_SCALE_Y_ON | PPP_OP_SCALE_X_ON);
  2047. /* let's use SHIM logic to calculate the
  2048. partial ROI scaling */
  2049. mdp_calc_scale_params(iBuf->roi.x, iBuf->roi.width,
  2050. dst_roi_width_scale, 1,
  2051. &phasex_init, &phasex_step,
  2052. &dummy, &dummy);
  2053. mdp_calc_scale_params(iBuf->roi.y, iBuf->roi.height,
  2054. dst_roi_height_scale, 0,
  2055. &phasey_init, &phasey_step,
  2056. &dummy, &dummy);
  2057. MDP_OUTP(MDP_CMD_DEBUG_ACCESS_BASE + 0x013c,
  2058. phasex_init);
  2059. MDP_OUTP(MDP_CMD_DEBUG_ACCESS_BASE + 0x0140,
  2060. phasey_init);
  2061. MDP_OUTP(MDP_CMD_DEBUG_ACCESS_BASE + 0x0144,
  2062. phasex_step);
  2063. MDP_OUTP(MDP_CMD_DEBUG_ACCESS_BASE + 0x0148,
  2064. phasey_step);
  2065. /* disable the pixel repeat option for scaling */
  2066. use_pr = false;
  2067. if ((dst_roi_width_scale > iBuf->roi.width) ||
  2068. (dst_roi_height_scale > iBuf->roi.height)) {
  2069. if ((use_pr)
  2070. && (mdp_curr_up_scale_xy !=
  2071. MDP_PR_SCALE_UP)) {
  2072. mdp_load_pr_upscale_table();
  2073. mdp_curr_up_scale_xy = MDP_PR_SCALE_UP;
  2074. } else if ((!use_pr)
  2075. && (mdp_curr_up_scale_xy !=
  2076. MDP_BC_SCALE_UP)) {
  2077. mdp_load_bc_upscale_table();
  2078. mdp_curr_up_scale_xy = MDP_BC_SCALE_UP;
  2079. }
  2080. }
  2081. if (mdp_blur) {
  2082. load_scale_table(mdp_gaussian_blur_table,
  2083. ARRAY_SIZE(mdp_gaussian_blur_table));
  2084. mdp_curr_down_scale_x = MDP_SCALE_BLUR;
  2085. mdp_curr_down_scale_y = MDP_SCALE_BLUR;
  2086. }
  2087. /* 0.2 < x <= 1 scaling factor */
  2088. if ((dst_roi_width_scale <= iBuf->roi.width) &&
  2089. !mdp_blur) {
  2090. if (((dst_roi_width_scale * 10) /
  2091. iBuf->roi.width) > 8) {
  2092. if ((use_pr)
  2093. && (mdp_curr_down_scale_x !=
  2094. MDP_PR_SCALE_POINT8_1)) {
  2095. mdp_load_pr_downscale_table_x_point8TO1
  2096. ();
  2097. mdp_curr_down_scale_x =
  2098. MDP_PR_SCALE_POINT8_1;
  2099. } else if ((!use_pr)
  2100. && (mdp_curr_down_scale_x !=
  2101. MDP_BC_SCALE_POINT8_1)) {
  2102. mdp_load_bc_downscale_table_x_point8TO1
  2103. ();
  2104. mdp_curr_down_scale_x =
  2105. MDP_BC_SCALE_POINT8_1;
  2106. }
  2107. } else
  2108. if (((dst_roi_width_scale * 10) /
  2109. iBuf->roi.width) > 6) {
  2110. if ((use_pr)
  2111. && (mdp_curr_down_scale_x !=
  2112. MDP_PR_SCALE_POINT6_POINT8)) {
  2113. mdp_load_pr_downscale_table_x_point6TOpoint8
  2114. ();
  2115. mdp_curr_down_scale_x =
  2116. MDP_PR_SCALE_POINT6_POINT8;
  2117. } else if ((!use_pr)
  2118. && (mdp_curr_down_scale_x !=
  2119. MDP_BC_SCALE_POINT6_POINT8))
  2120. {
  2121. mdp_load_bc_downscale_table_x_point6TOpoint8
  2122. ();
  2123. mdp_curr_down_scale_x =
  2124. MDP_BC_SCALE_POINT6_POINT8;
  2125. }
  2126. } else
  2127. if (((dst_roi_width_scale * 10) /
  2128. iBuf->roi.width) > 4) {
  2129. if ((use_pr)
  2130. && (mdp_curr_down_scale_x !=
  2131. MDP_PR_SCALE_POINT4_POINT6)) {
  2132. mdp_load_pr_downscale_table_x_point4TOpoint6
  2133. ();
  2134. mdp_curr_down_scale_x =
  2135. MDP_PR_SCALE_POINT4_POINT6;
  2136. } else if ((!use_pr)
  2137. && (mdp_curr_down_scale_x !=
  2138. MDP_BC_SCALE_POINT4_POINT6))
  2139. {
  2140. mdp_load_bc_downscale_table_x_point4TOpoint6
  2141. ();
  2142. mdp_curr_down_scale_x =
  2143. MDP_BC_SCALE_POINT4_POINT6;
  2144. }
  2145. } else {
  2146. if ((use_pr)
  2147. && (mdp_curr_down_scale_x !=
  2148. MDP_PR_SCALE_POINT2_POINT4)) {
  2149. mdp_load_pr_downscale_table_x_point2TOpoint4
  2150. ();
  2151. mdp_curr_down_scale_x =
  2152. MDP_PR_SCALE_POINT2_POINT4;
  2153. } else if ((!use_pr)
  2154. && (mdp_curr_down_scale_x !=
  2155. MDP_BC_SCALE_POINT2_POINT4))
  2156. {
  2157. mdp_load_bc_downscale_table_x_point2TOpoint4
  2158. ();
  2159. mdp_curr_down_scale_x =
  2160. MDP_BC_SCALE_POINT2_POINT4;
  2161. }
  2162. }
  2163. }
  2164. /* 0.2 < y <= 1 scaling factor */
  2165. if ((dst_roi_height_scale <= iBuf->roi.height) &&
  2166. !mdp_blur) {
  2167. if (((dst_roi_height_scale * 10) /
  2168. iBuf->roi.height) > 8) {
  2169. if ((use_pr)
  2170. && (mdp_curr_down_scale_y !=
  2171. MDP_PR_SCALE_POINT8_1)) {
  2172. mdp_load_pr_downscale_table_y_point8TO1
  2173. ();
  2174. mdp_curr_down_scale_y =
  2175. MDP_PR_SCALE_POINT8_1;
  2176. } else if ((!use_pr)
  2177. && (mdp_curr_down_scale_y !=
  2178. MDP_BC_SCALE_POINT8_1)) {
  2179. mdp_load_bc_downscale_table_y_point8TO1
  2180. ();
  2181. mdp_curr_down_scale_y =
  2182. MDP_BC_SCALE_POINT8_1;
  2183. }
  2184. } else
  2185. if (((dst_roi_height_scale * 10) /
  2186. iBuf->roi.height) > 6) {
  2187. if ((use_pr)
  2188. && (mdp_curr_down_scale_y !=
  2189. MDP_PR_SCALE_POINT6_POINT8)) {
  2190. mdp_load_pr_downscale_table_y_point6TOpoint8
  2191. ();
  2192. mdp_curr_down_scale_y =
  2193. MDP_PR_SCALE_POINT6_POINT8;
  2194. } else if ((!use_pr)
  2195. && (mdp_curr_down_scale_y !=
  2196. MDP_BC_SCALE_POINT6_POINT8))
  2197. {
  2198. mdp_load_bc_downscale_table_y_point6TOpoint8
  2199. ();
  2200. mdp_curr_down_scale_y =
  2201. MDP_BC_SCALE_POINT6_POINT8;
  2202. }
  2203. } else
  2204. if (((dst_roi_height_scale * 10) /
  2205. iBuf->roi.height) > 4) {
  2206. if ((use_pr)
  2207. && (mdp_curr_down_scale_y !=
  2208. MDP_PR_SCALE_POINT4_POINT6)) {
  2209. mdp_load_pr_downscale_table_y_point4TOpoint6
  2210. ();
  2211. mdp_curr_down_scale_y =
  2212. MDP_PR_SCALE_POINT4_POINT6;
  2213. } else if ((!use_pr)
  2214. && (mdp_curr_down_scale_y !=
  2215. MDP_BC_SCALE_POINT4_POINT6))
  2216. {
  2217. mdp_load_bc_downscale_table_y_point4TOpoint6
  2218. ();
  2219. mdp_curr_down_scale_y =
  2220. MDP_BC_SCALE_POINT4_POINT6;
  2221. }
  2222. } else {
  2223. if ((use_pr)
  2224. && (mdp_curr_down_scale_y !=
  2225. MDP_PR_SCALE_POINT2_POINT4)) {
  2226. mdp_load_pr_downscale_table_y_point2TOpoint4
  2227. ();
  2228. mdp_curr_down_scale_y =
  2229. MDP_PR_SCALE_POINT2_POINT4;
  2230. } else if ((!use_pr)
  2231. && (mdp_curr_down_scale_y !=
  2232. MDP_BC_SCALE_POINT2_POINT4))
  2233. {
  2234. mdp_load_bc_downscale_table_y_point2TOpoint4
  2235. ();
  2236. mdp_curr_down_scale_y =
  2237. MDP_BC_SCALE_POINT2_POINT4;
  2238. }
  2239. }
  2240. }
  2241. } else {
  2242. iBuf->mdpImg.mdpOp &= ~(MDPOP_ASCALE);
  2243. }
  2244. }
  2245. /* setting edge condition here after scaling check */
  2246. if (mdp_get_edge_cond(iBuf, &lines_dup, &lines_dup_bg))
  2247. printk(KERN_ERR "msm_fb: mdp_get_edge_cond() error!\n");
  2248. MDP_OUTP(MDP_CMD_DEBUG_ACCESS_BASE + 0x01b8, lines_dup);
  2249. MDP_OUTP(MDP_CMD_DEBUG_ACCESS_BASE + 0x01bc, lines_dup_bg);
  2250. }
  2251. void mdp_init_scale_table(void)
  2252. {
  2253. mdp_curr_up_scale_xy = MDP_INIT_SCALE;
  2254. mdp_curr_down_scale_x = MDP_INIT_SCALE;
  2255. mdp_curr_down_scale_y = MDP_INIT_SCALE;
  2256. }
  2257. void mdp_adjust_start_addr(uint8 **src0,
  2258. uint8 **src1,
  2259. int v_slice,
  2260. int h_slice,
  2261. int x,
  2262. int y,
  2263. uint32 width,
  2264. uint32 height, int bpp, MDPIBUF *iBuf, int layer)
  2265. {
  2266. if (iBuf->mdpImg.imgType == MDP_Y_CBCR_H2V2_ADRENO && layer == 0)
  2267. *src0 += (x + y * ALIGN(width, 32)) * bpp;
  2268. else
  2269. *src0 += (x + y * width) * bpp;
  2270. /* if it's dest/bg buffer, we need to adjust it for rotation */
  2271. if (layer != 0)
  2272. *src0 = mdp_adjust_rot_addr(iBuf, *src0, 0);
  2273. if (*src1) {
  2274. /*
  2275. * MDP_Y_CBCR_H2V2/MDP_Y_CRCB_H2V2 cosite for now
  2276. * we need to shift x direction same as y dir for offsite
  2277. */
  2278. if (iBuf->mdpImg.imgType == MDP_Y_CBCR_H2V2_ADRENO
  2279. && layer == 0)
  2280. *src1 += ((x / h_slice) * h_slice + ((y == 0) ? 0 :
  2281. (((y + 1) / v_slice - 1) * (ALIGN(width/2, 32) * 2))))
  2282. * bpp;
  2283. else
  2284. *src1 += ((x / h_slice) * h_slice +
  2285. ((y == 0) ? 0 : ((y + 1) / v_slice - 1) * width)) * bpp;
  2286. /* if it's dest/bg buffer, we need to adjust it for rotation */
  2287. if (layer != 0)
  2288. *src1 = mdp_adjust_rot_addr(iBuf, *src1, 1);
  2289. }
  2290. }
  2291. void mdp_set_blend_attr(MDPIBUF *iBuf,
  2292. uint32 *alpha,
  2293. uint32 *tpVal,
  2294. uint32 perPixelAlpha, uint32 *pppop_reg_ptr)
  2295. {
  2296. if (mdp_rev == MDP_REV_303) {
  2297. int bg_alpha;
  2298. *alpha = iBuf->mdpImg.alpha;
  2299. *tpVal = iBuf->mdpImg.tpVal;
  2300. if (iBuf->mdpImg.mdpOp & MDPOP_FG_PM_ALPHA) {
  2301. if (perPixelAlpha) {
  2302. *pppop_reg_ptr |= PPP_OP_ROT_ON |
  2303. PPP_OP_BLEND_ON |
  2304. PPP_OP_BLEND_CONSTANT_ALPHA;
  2305. } else {
  2306. if ((iBuf->mdpImg.mdpOp & MDPOP_ALPHAB)
  2307. && (iBuf->mdpImg.alpha == 0xff)) {
  2308. iBuf->mdpImg.mdpOp &= ~(MDPOP_ALPHAB);
  2309. }
  2310. if ((iBuf->mdpImg.mdpOp & MDPOP_ALPHAB)
  2311. || (iBuf->mdpImg.mdpOp & MDPOP_TRANSP)) {
  2312. *pppop_reg_ptr |= PPP_OP_ROT_ON |
  2313. PPP_OP_BLEND_ON |
  2314. PPP_OP_BLEND_CONSTANT_ALPHA |
  2315. PPP_OP_BLEND_ALPHA_BLEND_NORMAL;
  2316. }
  2317. }
  2318. bg_alpha = PPP_BLEND_BG_USE_ALPHA_SEL |
  2319. PPP_BLEND_BG_ALPHA_REVERSE;
  2320. if ((perPixelAlpha) && !(iBuf->mdpImg.mdpOp &
  2321. MDPOP_LAYER_IS_FG)) {
  2322. bg_alpha |= PPP_BLEND_BG_SRCPIXEL_ALPHA;
  2323. } else {
  2324. bg_alpha |= PPP_BLEND_BG_CONSTANT_ALPHA;
  2325. bg_alpha |= iBuf->mdpImg.alpha << 24;
  2326. }
  2327. outpdw(MDP_BASE + 0x70010, bg_alpha);
  2328. if (iBuf->mdpImg.mdpOp & MDPOP_TRANSP)
  2329. *pppop_reg_ptr |= PPP_BLEND_CALPHA_TRNASP;
  2330. } else if (perPixelAlpha) {
  2331. if (iBuf->mdpImg.mdpOp & MDPOP_LAYER_IS_FG)
  2332. *pppop_reg_ptr |= PPP_OP_ROT_ON |
  2333. PPP_OP_BLEND_ON |
  2334. PPP_OP_BLEND_CONSTANT_ALPHA;
  2335. else
  2336. *pppop_reg_ptr |= PPP_OP_ROT_ON |
  2337. PPP_OP_BLEND_ON |
  2338. PPP_OP_BLEND_SRCPIXEL_ALPHA;
  2339. outpdw(MDP_BASE + 0x70010, 0);
  2340. } else {
  2341. if ((iBuf->mdpImg.mdpOp & MDPOP_ALPHAB)
  2342. && (iBuf->mdpImg.alpha == 0xff)) {
  2343. iBuf->mdpImg.mdpOp &=
  2344. ~(MDPOP_ALPHAB);
  2345. }
  2346. if ((iBuf->mdpImg.mdpOp & MDPOP_ALPHAB)
  2347. || (iBuf->mdpImg.mdpOp & MDPOP_TRANSP)) {
  2348. *pppop_reg_ptr |= PPP_OP_ROT_ON |
  2349. PPP_OP_BLEND_ON |
  2350. PPP_OP_BLEND_CONSTANT_ALPHA |
  2351. PPP_OP_BLEND_ALPHA_BLEND_NORMAL;
  2352. }
  2353. if (iBuf->mdpImg.mdpOp & MDPOP_TRANSP)
  2354. *pppop_reg_ptr |=
  2355. PPP_BLEND_CALPHA_TRNASP;
  2356. outpdw(MDP_BASE + 0x70010, 0);
  2357. }
  2358. } else {
  2359. if (perPixelAlpha) {
  2360. *pppop_reg_ptr |= PPP_OP_ROT_ON |
  2361. PPP_OP_BLEND_ON | PPP_OP_BLEND_SRCPIXEL_ALPHA;
  2362. } else {
  2363. if ((iBuf->mdpImg.mdpOp & MDPOP_ALPHAB)
  2364. && (iBuf->mdpImg.alpha == 0xff)) {
  2365. iBuf->mdpImg.mdpOp &= ~(MDPOP_ALPHAB);
  2366. }
  2367. if ((iBuf->mdpImg.mdpOp & MDPOP_ALPHAB)
  2368. && (iBuf->mdpImg.mdpOp & MDPOP_TRANSP)) {
  2369. *pppop_reg_ptr |=
  2370. PPP_OP_ROT_ON | PPP_OP_BLEND_ON |
  2371. PPP_OP_BLEND_CONSTANT_ALPHA |
  2372. PPP_OP_BLEND_ALPHA_BLEND_NORMAL |
  2373. PPP_BLEND_CALPHA_TRNASP;
  2374. *alpha = iBuf->mdpImg.alpha;
  2375. *tpVal = iBuf->mdpImg.tpVal;
  2376. } else {
  2377. if (iBuf->mdpImg.mdpOp & MDPOP_TRANSP) {
  2378. *pppop_reg_ptr |= PPP_OP_ROT_ON |
  2379. PPP_OP_BLEND_ON |
  2380. PPP_OP_BLEND_SRCPIXEL_TRANSP;
  2381. *tpVal = iBuf->mdpImg.tpVal;
  2382. } else if (iBuf->mdpImg.mdpOp & MDPOP_ALPHAB) {
  2383. *pppop_reg_ptr |= PPP_OP_ROT_ON |
  2384. PPP_OP_BLEND_ON |
  2385. PPP_OP_BLEND_ALPHA_BLEND_NORMAL |
  2386. PPP_OP_BLEND_CONSTANT_ALPHA;
  2387. *alpha = iBuf->mdpImg.alpha;
  2388. }
  2389. }
  2390. }
  2391. }
  2392. }