0001-fix-missing-davinci-voodoo-header.patch 55 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726
  1. The archive of directfb-1.6.3 is still missing some header files against
  2. the tagged git tree of directfb. The following files are missing.
  3. gfxdrivers/davinci/davinci_c64x.h
  4. gfxdrivers/davinci/davincifb.h
  5. gfxdrivers/davinci/davinci_gfxdriver.h
  6. tests/voodoo/voodoo_test.h
  7. The headers of course are needed to be able to build every module of
  8. directfb. The headers are taken from the git tree of directfb
  9. http://git.directfb.org/?p=core/DirectFB.git;a=commit;h=38b784549bc59bb07c58bb29667cb658695d39a7,
  10. tag DIRECTFB_1_6_3, SHA1ID 38b784549bc59bb07c58bb29667cb658695d39a7.
  11. Signed-off-by: Carsten Schoenert <c.schoenert@gmail.com>
  12. diff -puNr -Naur directfb-1.6.3-orig/gfxdrivers/davinci/davinci_c64x.h directfb-1.6.3/gfxdrivers/davinci/davinci_c64x.h
  13. --- directfb-1.6.3-orig/gfxdrivers/davinci/davinci_c64x.h 1970-01-01 01:00:00.000000000 +0100
  14. +++ directfb-1.6.3/gfxdrivers/davinci/davinci_c64x.h 2013-04-07 21:33:25.928530187 +0200
  15. @@ -0,0 +1,935 @@
  16. +/*
  17. + TI Davinci driver - C64X+ DSP Library
  18. +
  19. + (c) Copyright 2008 directfb.org
  20. + (c) Copyright 2007 Telio AG
  21. +
  22. + Written by Denis Oliver Kropp <dok@directfb.org> and
  23. + Olaf Dreesen <olaf@directfb.org>.
  24. +
  25. + All rights reserved.
  26. +
  27. + This library is free software; you can redistribute it and/or
  28. + modify it under the terms of the GNU General Public License
  29. + version 2 as published by the Free Software Foundation.
  30. +
  31. + This library is distributed in the hope that it will be useful,
  32. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  33. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  34. + General Public License for more details.
  35. +
  36. + You should have received a copy of the GNU General Public
  37. + License along with this library; if not, write to the
  38. + Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  39. + Boston, MA 02111-1307, USA.
  40. +*/
  41. +
  42. +#ifndef __DAVINCI_C64X_H__
  43. +#define __DAVINCI_C64X_H__
  44. +
  45. +#include <unistd.h>
  46. +
  47. +#include <directfb.h>
  48. +
  49. +#include <direct/messages.h>
  50. +#include <direct/trace.h>
  51. +
  52. +#include <linux/c64x.h>
  53. +
  54. +#define mb() __asm__ __volatile__ ("" : : : "memory")
  55. +
  56. +/**********************************************************************************************************************/
  57. +
  58. +typedef struct {
  59. + int magic;
  60. +
  61. + int fd;
  62. + c64xTaskControl *ctl;
  63. + void *mem;
  64. +
  65. + c64xTask *QueueL;
  66. +} DavinciC64x;
  67. +
  68. +typedef struct {
  69. + int magic;
  70. + unsigned int max_tasks;
  71. + unsigned int num_tasks;
  72. + c64xTask *tasks;
  73. +} DavinciC64xTasks;
  74. +
  75. +typedef enum {
  76. + C64X_TEF_NONE = 0x0000,
  77. + C64X_TEF_RESET = 0x0001
  78. +} DavinciC64xEmitFlags;
  79. +
  80. +/**********************************************************************************************************************/
  81. +
  82. +DFBResult davinci_c64x_open ( DavinciC64x *c64x );
  83. +
  84. +DFBResult davinci_c64x_close ( DavinciC64x *c64x );
  85. +
  86. +DFBResult davinci_c64x_wait_low( DavinciC64x *c64x );
  87. +
  88. +/**********************************************************************************************************************/
  89. +
  90. +DFBResult davinci_c64x_tasks_init ( DavinciC64xTasks *tasks,
  91. + unsigned int size );
  92. +
  93. +DFBResult davinci_c64x_tasks_destroy( DavinciC64xTasks *tasks );
  94. +
  95. +/**********************************************************************************************************************/
  96. +
  97. +DFBResult davinci_c64x_emit_tasks( DavinciC64x *c64x,
  98. + DavinciC64xTasks *tasks,
  99. + DavinciC64xEmitFlags flags );
  100. +
  101. +/**********************************************************************************************************************/
  102. +
  103. +static const char *state_names[] = { "DONE", "ERROR", "TODO", "RUNNING" };
  104. +
  105. +static inline c64xTask *
  106. +c64x_get_task( DavinciC64x *c64x )
  107. +{
  108. + c64xTaskControl *ctl = c64x->ctl;
  109. + uint32_t idx = ctl->QL_arm;
  110. + uint32_t next = (idx + 1) & C64X_QUEUE_MASK;
  111. + c64xTask *task = &c64x->QueueL[idx];
  112. + int loops = 0;
  113. + uint32_t idle = 0;
  114. +
  115. + /* Wait for the entry (and next) to be processed by the DSP (rare case). */
  116. + while (task->c64x_flags & C64X_FLAG_TODO || ctl->QL_dsp == next) {
  117. + if (loops > 666 || (idle && ctl->idlecounter - idle > 666)) {
  118. + c64xTask *dsp_task = &c64x->QueueL[ctl->QL_dsp];
  119. +
  120. + D_PERROR( "Davinci/C64X+: Blocked! [DSP %d / %d (%s), ARM %d / %d (%s)]\n",
  121. + ctl->QL_dsp,
  122. + (dsp_task->c64x_function >> 2) & 0x3fff,
  123. + state_names[dsp_task->c64x_function & 3],
  124. + ctl->QL_arm,
  125. + (task->c64x_function >> 2) & 0x3fff,
  126. + state_names[task->c64x_function & 3] );
  127. +
  128. + break;
  129. + }
  130. +
  131. + idle = ctl->idlecounter;
  132. +
  133. + /* Queue is full, waiting 10-20ms should not be too bad. */
  134. + if (loops++ > 10)
  135. + usleep( 5000 );
  136. + }
  137. +
  138. + return task;
  139. +}
  140. +
  141. +static inline void
  142. +c64x_submit_task( DavinciC64x *c64x, c64xTask *task )
  143. +{
  144. + c64xTaskControl *ctl = c64x->ctl;
  145. + uint32_t idx = ctl->QL_arm;
  146. + uint32_t next = (idx + 1) & C64X_QUEUE_MASK;
  147. +
  148. + mb();
  149. +
  150. + ctl->QL_arm = next;
  151. +
  152. + mb();
  153. +}
  154. +
  155. +/**********************************************************************************************************************/
  156. +
  157. +static inline void
  158. +davinci_c64x_wb_inv_range( DavinciC64x *c64x,
  159. + unsigned long start,
  160. + u32 length,
  161. + u32 func )
  162. +{
  163. + c64xTask *task = c64x_get_task( c64x );
  164. +
  165. + task->c64x_arg[0] = start;
  166. + task->c64x_arg[1] = length;
  167. + task->c64x_arg[2] = func;
  168. +
  169. + task->c64x_function = C64X_WB_INV_RANGE | C64X_FLAG_TODO;
  170. +
  171. + c64x_submit_task( c64x, task );
  172. +}
  173. +
  174. +static inline void
  175. +davinci_c64x_write_back_all( DavinciC64x *c64x )
  176. +{
  177. + c64xTask *task = c64x_get_task( c64x );
  178. +
  179. + task->c64x_function = C64X_WRITE_BACK_ALL | C64X_FLAG_TODO;
  180. +
  181. + c64x_submit_task( c64x, task );
  182. +}
  183. +
  184. +/**********************************************************************************************************************/
  185. +
  186. +static inline void
  187. +davinci_c64x_load_block__L( DavinciC64xTasks *tasks,
  188. + unsigned long words,
  189. + u32 num,
  190. + u32 flags )
  191. +{
  192. + c64xTask *task = &tasks->tasks[tasks->num_tasks];
  193. +
  194. + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
  195. +
  196. + task->c64x_arg[0] = words;
  197. + task->c64x_arg[1] = num;
  198. + task->c64x_arg[2] = flags;
  199. +
  200. + task->c64x_function = C64X_LOAD_BLOCK | C64X_FLAG_TODO;
  201. +
  202. + tasks->num_tasks++;
  203. +}
  204. +
  205. +static inline void
  206. +davinci_c64x_load_block( DavinciC64x *c64x,
  207. + unsigned long words,
  208. + u32 num,
  209. + u32 flags )
  210. +{
  211. + c64xTask *task = c64x_get_task( c64x );
  212. +
  213. + task->c64x_arg[0] = words;
  214. + task->c64x_arg[1] = num;
  215. + task->c64x_arg[2] = flags;
  216. +
  217. + task->c64x_function = C64X_LOAD_BLOCK | C64X_FLAG_TODO;
  218. +
  219. + c64x_submit_task( c64x, task );
  220. +}
  221. +
  222. +static inline void
  223. +davinci_c64x_fetch_uyvy( DavinciC64x *c64x,
  224. + unsigned long dest,
  225. + unsigned long source,
  226. + u32 pitch,
  227. + u32 height,
  228. + u32 flags )
  229. +{
  230. + c64xTask *task = c64x_get_task( c64x );
  231. +
  232. + task->c64x_arg[0] = dest;
  233. + task->c64x_arg[1] = source;
  234. + task->c64x_arg[2] = pitch;
  235. + task->c64x_arg[3] = height;
  236. + task->c64x_arg[4] = flags;
  237. +
  238. + task->c64x_function = C64X_FETCH_UYVY | C64X_FLAG_TODO;
  239. +
  240. + c64x_submit_task( c64x, task );
  241. +}
  242. +
  243. +static inline void
  244. +davinci_c64x_mc( DavinciC64x *c64x,
  245. + unsigned long dest,
  246. + u32 dpitch,
  247. + unsigned long source0,
  248. + unsigned long source1,
  249. + u32 spitch,
  250. + u32 height,
  251. + int func )
  252. +{
  253. + c64xTask *task = c64x_get_task( c64x );
  254. +
  255. + task->c64x_arg[0] = dest;
  256. + task->c64x_arg[1] = dpitch;
  257. + task->c64x_arg[2] = source0;
  258. + task->c64x_arg[3] = source1;
  259. + task->c64x_arg[4] = spitch;
  260. + task->c64x_arg[5] = height;
  261. +
  262. + task->c64x_function = func | C64X_FLAG_TODO;
  263. +
  264. + c64x_submit_task( c64x, task );
  265. +}
  266. +
  267. +static inline void
  268. +davinci_c64x_put_idct_uyvy_16x16__L( DavinciC64xTasks *tasks,
  269. + unsigned long dest,
  270. + u32 pitch,
  271. + u32 flags )
  272. +{
  273. + c64xTask *task = &tasks->tasks[tasks->num_tasks];
  274. +
  275. + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
  276. +
  277. + task->c64x_arg[0] = dest;
  278. + task->c64x_arg[1] = pitch;
  279. + task->c64x_arg[2] = flags;
  280. +
  281. + task->c64x_function = C64X_PUT_IDCT_UYVY_16x16 | C64X_FLAG_TODO;
  282. +
  283. + tasks->num_tasks++;
  284. +}
  285. +
  286. +static inline void
  287. +davinci_c64x_put_idct_uyvy_16x16( DavinciC64x *c64x,
  288. + unsigned long dest,
  289. + u32 pitch,
  290. + u32 flags )
  291. +{
  292. + c64xTask *task = c64x_get_task( c64x );
  293. +
  294. + task->c64x_arg[0] = dest;
  295. + task->c64x_arg[1] = pitch;
  296. + task->c64x_arg[2] = flags;
  297. +
  298. + task->c64x_function = C64X_PUT_IDCT_UYVY_16x16 | C64X_FLAG_TODO;
  299. +
  300. + c64x_submit_task( c64x, task );
  301. +}
  302. +
  303. +static inline void
  304. +davinci_c64x_put_mc_uyvy_16x16__L( DavinciC64xTasks *tasks,
  305. + unsigned long dest,
  306. + u32 pitch,
  307. + u32 flags )
  308. +{
  309. + c64xTask *task = &tasks->tasks[tasks->num_tasks];
  310. +
  311. + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
  312. +
  313. + task->c64x_arg[0] = dest;
  314. + task->c64x_arg[1] = pitch;
  315. + task->c64x_arg[2] = flags;
  316. +
  317. + task->c64x_function = C64X_PUT_MC_UYVY_16x16 | C64X_FLAG_TODO;
  318. +
  319. + tasks->num_tasks++;
  320. +}
  321. +
  322. +static inline void
  323. +davinci_c64x_put_mc_uyvy_16x16( DavinciC64x *c64x,
  324. + unsigned long dest,
  325. + u32 pitch,
  326. + u32 flags )
  327. +{
  328. + c64xTask *task = c64x_get_task( c64x );
  329. +
  330. + task->c64x_arg[0] = dest;
  331. + task->c64x_arg[1] = pitch;
  332. + task->c64x_arg[2] = flags;
  333. +
  334. + task->c64x_function = C64X_PUT_MC_UYVY_16x16 | C64X_FLAG_TODO;
  335. +
  336. + c64x_submit_task( c64x, task );
  337. +}
  338. +
  339. +static inline void
  340. +davinci_c64x_put_sum_uyvy_16x16__L( DavinciC64xTasks *tasks,
  341. + unsigned long dest,
  342. + u32 pitch,
  343. + u32 flags )
  344. +{
  345. + c64xTask *task = &tasks->tasks[tasks->num_tasks];
  346. +
  347. + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
  348. +
  349. + task->c64x_arg[0] = dest;
  350. + task->c64x_arg[1] = pitch;
  351. + task->c64x_arg[2] = flags;
  352. +
  353. + task->c64x_function = C64X_PUT_SUM_UYVY_16x16 | C64X_FLAG_TODO;
  354. +
  355. + tasks->num_tasks++;
  356. +}
  357. +
  358. +static inline void
  359. +davinci_c64x_put_sum_uyvy_16x16( DavinciC64x *c64x,
  360. + unsigned long dest,
  361. + u32 pitch,
  362. + u32 flags )
  363. +{
  364. + c64xTask *task = c64x_get_task( c64x );
  365. +
  366. + task->c64x_arg[0] = dest;
  367. + task->c64x_arg[1] = pitch;
  368. + task->c64x_arg[2] = flags;
  369. +
  370. + task->c64x_function = C64X_PUT_SUM_UYVY_16x16 | C64X_FLAG_TODO;
  371. +
  372. + c64x_submit_task( c64x, task );
  373. +}
  374. +
  375. +static inline void
  376. +davinci_c64x_dva_begin_frame__L( DavinciC64xTasks *tasks,
  377. + u32 pitch,
  378. + unsigned long current,
  379. + unsigned long past,
  380. + unsigned long future,
  381. + u32 flags )
  382. +{
  383. + c64xTask *task = &tasks->tasks[tasks->num_tasks];
  384. +
  385. + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
  386. +
  387. + task->c64x_arg[0] = pitch;
  388. + task->c64x_arg[1] = current;
  389. + task->c64x_arg[2] = past;
  390. + task->c64x_arg[3] = future;
  391. + task->c64x_arg[4] = flags;
  392. +
  393. + task->c64x_function = C64X_DVA_BEGIN_FRAME | C64X_FLAG_TODO;
  394. +
  395. + tasks->num_tasks++;
  396. +}
  397. +
  398. +static inline void
  399. +davinci_c64x_dva_begin_frame( DavinciC64x *c64x,
  400. + u32 pitch,
  401. + unsigned long current,
  402. + unsigned long past,
  403. + unsigned long future,
  404. + u32 flags )
  405. +{
  406. + c64xTask *task = c64x_get_task( c64x );
  407. +
  408. + task->c64x_arg[0] = pitch;
  409. + task->c64x_arg[1] = current;
  410. + task->c64x_arg[2] = past;
  411. + task->c64x_arg[3] = future;
  412. + task->c64x_arg[4] = flags;
  413. +
  414. + task->c64x_function = C64X_DVA_BEGIN_FRAME | C64X_FLAG_TODO;
  415. +
  416. + c64x_submit_task( c64x, task );
  417. +}
  418. +
  419. +static inline void
  420. +davinci_c64x_dva_motion_block__L( DavinciC64xTasks *tasks,
  421. + unsigned long macroblock )
  422. +{
  423. + c64xTask *task = &tasks->tasks[tasks->num_tasks];
  424. +
  425. + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
  426. +
  427. + task->c64x_arg[0] = macroblock;
  428. +
  429. + task->c64x_function = C64X_DVA_MOTION_BLOCK | C64X_FLAG_TODO;
  430. +
  431. + tasks->num_tasks++;
  432. +}
  433. +
  434. +static inline void
  435. +davinci_c64x_dva_motion_block( DavinciC64x *c64x,
  436. + unsigned long macroblock )
  437. +{
  438. + c64xTask *task = c64x_get_task( c64x );
  439. +
  440. + task->c64x_arg[0] = macroblock;
  441. +
  442. + task->c64x_function = C64X_DVA_MOTION_BLOCK | C64X_FLAG_TODO;
  443. +
  444. + c64x_submit_task( c64x, task );
  445. +}
  446. +
  447. +/**********************************************************************************************************************/
  448. +
  449. +static inline void
  450. +davinci_c64x_dva_idct( DavinciC64x *c64x,
  451. + unsigned long dest,
  452. + u32 pitch,
  453. + unsigned long source )
  454. +{
  455. + c64xTask *task = c64x_get_task( c64x );
  456. +
  457. + task->c64x_arg[0] = dest;
  458. + task->c64x_arg[1] = pitch;
  459. + task->c64x_arg[2] = source;
  460. +
  461. + task->c64x_function = C64X_DVA_IDCT | C64X_FLAG_TODO;
  462. +
  463. + c64x_submit_task( c64x, task );
  464. +}
  465. +
  466. +/**********************************************************************************************************************/
  467. +
  468. +static inline void
  469. +davinci_c64x_put_uyvy_16x16( DavinciC64x *c64x,
  470. + unsigned long dest,
  471. + u32 pitch,
  472. + unsigned long source,
  473. + u32 flags )
  474. +{
  475. + c64xTask *task = c64x_get_task( c64x );
  476. +
  477. + task->c64x_arg[0] = dest;
  478. + task->c64x_arg[1] = pitch;
  479. + task->c64x_arg[2] = source;
  480. + task->c64x_arg[3] = flags;
  481. +
  482. + task->c64x_function = C64X_PUT_UYVY_16x16 | C64X_FLAG_TODO;
  483. +
  484. + c64x_submit_task( c64x, task );
  485. +}
  486. +
  487. +static inline void
  488. +davinci_c64x_dither_argb__L( DavinciC64xTasks *tasks,
  489. + unsigned long dst_rgb,
  490. + unsigned long dst_alpha,
  491. + u32 dst_pitch,
  492. + unsigned long source,
  493. + u32 src_pitch,
  494. + u32 width,
  495. + u32 height )
  496. +{
  497. + c64xTask *task = &tasks->tasks[tasks->num_tasks];
  498. +
  499. + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
  500. +
  501. + task->c64x_arg[0] = dst_rgb;
  502. + task->c64x_arg[1] = dst_alpha;
  503. + task->c64x_arg[2] = dst_pitch;
  504. + task->c64x_arg[3] = source;
  505. + task->c64x_arg[4] = src_pitch;
  506. + task->c64x_arg[5] = width;
  507. + task->c64x_arg[6] = height;
  508. +
  509. + task->c64x_function = C64X_DITHER_ARGB | C64X_FLAG_TODO;
  510. +
  511. + tasks->num_tasks++;
  512. +}
  513. +
  514. +static inline void
  515. +davinci_c64x_dither_argb( DavinciC64x *c64x,
  516. + unsigned long dst_rgb,
  517. + unsigned long dst_alpha,
  518. + u32 dst_pitch,
  519. + unsigned long source,
  520. + u32 src_pitch,
  521. + u32 width,
  522. + u32 height )
  523. +{
  524. + c64xTask *task = c64x_get_task( c64x );
  525. +
  526. + task->c64x_arg[0] = dst_rgb;
  527. + task->c64x_arg[1] = dst_alpha;
  528. + task->c64x_arg[2] = dst_pitch;
  529. + task->c64x_arg[3] = source;
  530. + task->c64x_arg[4] = src_pitch;
  531. + task->c64x_arg[5] = width;
  532. + task->c64x_arg[6] = height;
  533. +
  534. + task->c64x_function = C64X_DITHER_ARGB | C64X_FLAG_TODO;
  535. +
  536. + c64x_submit_task( c64x, task );
  537. +}
  538. +
  539. +static inline void
  540. +davinci_c64x_fill_16__L( DavinciC64xTasks *tasks,
  541. + unsigned long dest,
  542. + u32 pitch,
  543. + u32 width,
  544. + u32 height,
  545. + u32 value )
  546. +{
  547. + c64xTask *task = &tasks->tasks[tasks->num_tasks];
  548. +
  549. + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
  550. +
  551. + task->c64x_arg[0] = dest;
  552. + task->c64x_arg[1] = pitch;
  553. + task->c64x_arg[2] = width;
  554. + task->c64x_arg[3] = height;
  555. + task->c64x_arg[4] = value;
  556. +
  557. + task->c64x_function = C64X_FILL_16 | C64X_FLAG_TODO;
  558. +
  559. + tasks->num_tasks++;
  560. +}
  561. +
  562. +static inline void
  563. +davinci_c64x_fill_16( DavinciC64x *c64x,
  564. + unsigned long dest,
  565. + u32 pitch,
  566. + u32 width,
  567. + u32 height,
  568. + u32 value )
  569. +{
  570. + c64xTask *task = c64x_get_task( c64x );
  571. +
  572. + task->c64x_arg[0] = dest;
  573. + task->c64x_arg[1] = pitch;
  574. + task->c64x_arg[2] = width;
  575. + task->c64x_arg[3] = height;
  576. + task->c64x_arg[4] = value;
  577. +
  578. + task->c64x_function = C64X_FILL_16 | C64X_FLAG_TODO;
  579. +
  580. + c64x_submit_task( c64x, task );
  581. +}
  582. +
  583. +static inline void
  584. +davinci_c64x_fill_32__L( DavinciC64xTasks *tasks,
  585. + unsigned long dest,
  586. + u32 pitch,
  587. + u32 width,
  588. + u32 height,
  589. + u32 value )
  590. +{
  591. + c64xTask *task = &tasks->tasks[tasks->num_tasks];
  592. +
  593. + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
  594. +
  595. + task->c64x_arg[0] = dest;
  596. + task->c64x_arg[1] = pitch;
  597. + task->c64x_arg[2] = width;
  598. + task->c64x_arg[3] = height;
  599. + task->c64x_arg[4] = value;
  600. +
  601. + task->c64x_function = C64X_FILL_32 | C64X_FLAG_TODO;
  602. +
  603. + tasks->num_tasks++;
  604. +}
  605. +
  606. +static inline void
  607. +davinci_c64x_fill_32( DavinciC64x *c64x,
  608. + unsigned long dest,
  609. + u32 pitch,
  610. + u32 width,
  611. + u32 height,
  612. + u32 value )
  613. +{
  614. + c64xTask *task = c64x_get_task( c64x );
  615. +
  616. + task->c64x_arg[0] = dest;
  617. + task->c64x_arg[1] = pitch;
  618. + task->c64x_arg[2] = width;
  619. + task->c64x_arg[3] = height;
  620. + task->c64x_arg[4] = value;
  621. +
  622. + task->c64x_function = C64X_FILL_32 | C64X_FLAG_TODO;
  623. +
  624. + c64x_submit_task( c64x, task );
  625. +}
  626. +
  627. +static inline void
  628. +davinci_c64x_blit_16__L( DavinciC64xTasks *tasks,
  629. + unsigned long dest,
  630. + u32 dpitch,
  631. + unsigned long src,
  632. + u32 spitch,
  633. + u32 width,
  634. + u32 height )
  635. +{
  636. + c64xTask *task = &tasks->tasks[tasks->num_tasks];
  637. +
  638. + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
  639. +
  640. + task->c64x_arg[0] = dest;
  641. + task->c64x_arg[1] = dpitch;
  642. + task->c64x_arg[2] = src;
  643. + task->c64x_arg[3] = spitch;
  644. + task->c64x_arg[4] = width;
  645. + task->c64x_arg[5] = height;
  646. +
  647. + task->c64x_function = C64X_COPY_16 | C64X_FLAG_TODO;
  648. +
  649. + tasks->num_tasks++;
  650. +}
  651. +
  652. +static inline void
  653. +davinci_c64x_blit_16( DavinciC64x *c64x,
  654. + unsigned long dest,
  655. + u32 dpitch,
  656. + unsigned long src,
  657. + u32 spitch,
  658. + u32 width,
  659. + u32 height )
  660. +{
  661. + c64xTask *task = c64x_get_task( c64x );
  662. +
  663. + task->c64x_arg[0] = dest;
  664. + task->c64x_arg[1] = dpitch;
  665. + task->c64x_arg[2] = src;
  666. + task->c64x_arg[3] = spitch;
  667. + task->c64x_arg[4] = width;
  668. + task->c64x_arg[5] = height;
  669. +
  670. + task->c64x_function = C64X_COPY_16 | C64X_FLAG_TODO;
  671. +
  672. + c64x_submit_task( c64x, task );
  673. +}
  674. +
  675. +static inline void
  676. +davinci_c64x_blit_32__L( DavinciC64xTasks *tasks,
  677. + unsigned long dest,
  678. + u32 dpitch,
  679. + unsigned long src,
  680. + u32 spitch,
  681. + u32 width,
  682. + u32 height )
  683. +{
  684. + c64xTask *task = &tasks->tasks[tasks->num_tasks];
  685. +
  686. + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
  687. +
  688. + task->c64x_arg[0] = dest;
  689. + task->c64x_arg[1] = dpitch;
  690. + task->c64x_arg[2] = src;
  691. + task->c64x_arg[3] = spitch;
  692. + task->c64x_arg[4] = width;
  693. + task->c64x_arg[5] = height;
  694. +
  695. + task->c64x_function = C64X_COPY_32 | C64X_FLAG_TODO;
  696. +
  697. + tasks->num_tasks++;
  698. +}
  699. +
  700. +static inline void
  701. +davinci_c64x_blit_32( DavinciC64x *c64x,
  702. + unsigned long dest,
  703. + u32 dpitch,
  704. + unsigned long src,
  705. + u32 spitch,
  706. + u32 width,
  707. + u32 height )
  708. +{
  709. + c64xTask *task = c64x_get_task( c64x );
  710. +
  711. + task->c64x_arg[0] = dest;
  712. + task->c64x_arg[1] = dpitch;
  713. + task->c64x_arg[2] = src;
  714. + task->c64x_arg[3] = spitch;
  715. + task->c64x_arg[4] = width;
  716. + task->c64x_arg[5] = height;
  717. +
  718. + task->c64x_function = C64X_COPY_32 | C64X_FLAG_TODO;
  719. +
  720. + c64x_submit_task( c64x, task );
  721. +}
  722. +
  723. +static inline void
  724. +davinci_c64x_stretch_32__L( DavinciC64xTasks *tasks,
  725. + unsigned long dest,
  726. + u32 dpitch,
  727. + unsigned long src,
  728. + u32 spitch,
  729. + u32 dw,
  730. + u32 dh,
  731. + u32 sw,
  732. + u32 sh,
  733. + const DFBRegion *clip )
  734. +{
  735. + c64xTask *task = &tasks->tasks[tasks->num_tasks];
  736. +
  737. + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
  738. +
  739. + task->c64x_arg[0] = dest;
  740. + task->c64x_arg[1] = src;
  741. + task->c64x_arg[2] = dpitch | (spitch << 16);
  742. + task->c64x_arg[3] = dh | (dw << 16);
  743. + task->c64x_arg[4] = sh | (sw << 16);
  744. + task->c64x_arg[5] = clip->x2 | (clip->y2 << 16);
  745. + task->c64x_arg[6] = clip->x1 | (clip->y1 << 16);
  746. +
  747. + if (sw > dw && sh > dh)
  748. + task->c64x_function = C64X_STRETCH_32_down | C64X_FLAG_TODO;
  749. + else
  750. + task->c64x_function = C64X_STRETCH_32_up | C64X_FLAG_TODO;
  751. +
  752. + tasks->num_tasks++;
  753. +}
  754. +
  755. +static inline void
  756. +davinci_c64x_stretch_32( DavinciC64x *c64x,
  757. + unsigned long dest,
  758. + u32 dpitch,
  759. + unsigned long src,
  760. + u32 spitch,
  761. + u32 dw,
  762. + u32 dh,
  763. + u32 sw,
  764. + u32 sh,
  765. + const DFBRegion *clip )
  766. +{
  767. + c64xTask *task = c64x_get_task( c64x );
  768. +
  769. + task->c64x_arg[0] = dest;
  770. + task->c64x_arg[1] = src;
  771. + task->c64x_arg[2] = dpitch | (spitch << 16);
  772. + task->c64x_arg[3] = dh | (dw << 16);
  773. + task->c64x_arg[4] = sh | (sw << 16);
  774. + task->c64x_arg[5] = clip->x2 | (clip->y2 << 16);
  775. + task->c64x_arg[6] = clip->x1 | (clip->y1 << 16);
  776. +
  777. + if (sw > dw && sh > dh)
  778. + task->c64x_function = C64X_STRETCH_32_down | C64X_FLAG_TODO;
  779. + else
  780. + task->c64x_function = C64X_STRETCH_32_up | C64X_FLAG_TODO;
  781. +
  782. + c64x_submit_task( c64x, task );
  783. +}
  784. +
  785. +static inline void
  786. +davinci_c64x_blit_blend_32__L( DavinciC64xTasks *tasks,
  787. + u32 sub_func,
  788. + unsigned long dest,
  789. + u32 dpitch,
  790. + unsigned long src,
  791. + u32 spitch,
  792. + u32 width,
  793. + u32 height,
  794. + u32 argb,
  795. + u8 alpha )
  796. +{
  797. + c64xTask *task = &tasks->tasks[tasks->num_tasks];
  798. +
  799. + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
  800. +
  801. + task->c64x_arg[0] = dest;
  802. + task->c64x_arg[1] = dpitch;
  803. + task->c64x_arg[2] = src;
  804. + task->c64x_arg[3] = spitch;
  805. + task->c64x_arg[4] = width | (height << 16);
  806. + task->c64x_arg[5] = argb;
  807. + task->c64x_arg[6] = alpha;
  808. +
  809. + task->c64x_function = (sub_func << 16) | C64X_BLEND_32 | C64X_FLAG_TODO;
  810. +
  811. + tasks->num_tasks++;
  812. +}
  813. +
  814. +static inline void
  815. +davinci_c64x_blit_blend_32( DavinciC64x *c64x,
  816. + u32 sub_func,
  817. + unsigned long dest,
  818. + u32 dpitch,
  819. + unsigned long src,
  820. + u32 spitch,
  821. + u32 width,
  822. + u32 height,
  823. + u32 argb,
  824. + u8 alpha )
  825. +{
  826. + c64xTask *task = c64x_get_task( c64x );
  827. +
  828. + task->c64x_arg[0] = dest;
  829. + task->c64x_arg[1] = dpitch;
  830. + task->c64x_arg[2] = src;
  831. + task->c64x_arg[3] = spitch;
  832. + task->c64x_arg[4] = width | (height << 16);
  833. + task->c64x_arg[5] = argb;
  834. + task->c64x_arg[6] = alpha;
  835. +
  836. + task->c64x_function = (sub_func << 16) | C64X_BLEND_32 | C64X_FLAG_TODO;
  837. +
  838. + c64x_submit_task( c64x, task );
  839. +}
  840. +
  841. +static inline void
  842. +davinci_c64x_blit_keyed_16__L( DavinciC64xTasks *tasks,
  843. + unsigned long dest,
  844. + u32 dpitch,
  845. + unsigned long src,
  846. + u32 spitch,
  847. + u32 width,
  848. + u32 height,
  849. + u32 key,
  850. + u32 mask )
  851. +{
  852. + c64xTask *task = &tasks->tasks[tasks->num_tasks];
  853. +
  854. + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
  855. +
  856. + task->c64x_arg[0] = dest;
  857. + task->c64x_arg[1] = (dpitch << 16) | (spitch & 0xffff);
  858. + task->c64x_arg[2] = src;
  859. + task->c64x_arg[3] = width;
  860. + task->c64x_arg[4] = height;
  861. + task->c64x_arg[5] = key;
  862. + task->c64x_arg[6] = mask;
  863. +
  864. + task->c64x_function = C64X_COPY_KEYED_16 | C64X_FLAG_TODO;
  865. +
  866. + tasks->num_tasks++;
  867. +}
  868. +
  869. +static inline void
  870. +davinci_c64x_blit_keyed_16( DavinciC64x *c64x,
  871. + unsigned long dest,
  872. + u32 dpitch,
  873. + unsigned long src,
  874. + u32 spitch,
  875. + u32 width,
  876. + u32 height,
  877. + u32 key,
  878. + u32 mask )
  879. +{
  880. + c64xTask *task = c64x_get_task( c64x );
  881. +
  882. + task->c64x_arg[0] = dest;
  883. + task->c64x_arg[1] = (dpitch << 16) | (spitch & 0xffff);
  884. + task->c64x_arg[2] = src;
  885. + task->c64x_arg[3] = width;
  886. + task->c64x_arg[4] = height;
  887. + task->c64x_arg[5] = key;
  888. + task->c64x_arg[6] = mask;
  889. +
  890. + task->c64x_function = C64X_COPY_KEYED_16 | C64X_FLAG_TODO;
  891. +
  892. + c64x_submit_task( c64x, task );
  893. +}
  894. +
  895. +static inline void
  896. +davinci_c64x_blit_keyed_32__L( DavinciC64xTasks *tasks,
  897. + unsigned long dest,
  898. + u32 dpitch,
  899. + unsigned long src,
  900. + u32 spitch,
  901. + u32 width,
  902. + u32 height,
  903. + u32 key,
  904. + u32 mask )
  905. +{
  906. + c64xTask *task = &tasks->tasks[tasks->num_tasks];
  907. +
  908. + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
  909. +
  910. + task->c64x_arg[0] = dest;
  911. + task->c64x_arg[1] = (dpitch << 16) | (spitch & 0xffff);
  912. + task->c64x_arg[2] = src;
  913. + task->c64x_arg[3] = width;
  914. + task->c64x_arg[4] = height;
  915. + task->c64x_arg[5] = key;
  916. + task->c64x_arg[6] = mask;
  917. +
  918. + task->c64x_function = C64X_COPY_KEYED_32 | C64X_FLAG_TODO;
  919. +
  920. + tasks->num_tasks++;
  921. +}
  922. +
  923. +static inline void
  924. +davinci_c64x_blit_keyed_32( DavinciC64x *c64x,
  925. + unsigned long dest,
  926. + u32 dpitch,
  927. + unsigned long src,
  928. + u32 spitch,
  929. + u32 width,
  930. + u32 height,
  931. + u32 key,
  932. + u32 mask )
  933. +{
  934. + c64xTask *task = c64x_get_task( c64x );
  935. +
  936. + task->c64x_arg[0] = dest;
  937. + task->c64x_arg[1] = (dpitch << 16) | (spitch & 0xffff);
  938. + task->c64x_arg[2] = src;
  939. + task->c64x_arg[3] = width;
  940. + task->c64x_arg[4] = height;
  941. + task->c64x_arg[5] = key;
  942. + task->c64x_arg[6] = mask;
  943. +
  944. + task->c64x_function = C64X_COPY_KEYED_32 | C64X_FLAG_TODO;
  945. +
  946. + c64x_submit_task( c64x, task );
  947. +}
  948. +
  949. +#endif
  950. +
  951. diff -puNr -Naur directfb-1.6.3-orig/gfxdrivers/davinci/davincifb.h directfb-1.6.3/gfxdrivers/davinci/davincifb.h
  952. --- directfb-1.6.3-orig/gfxdrivers/davinci/davincifb.h 1970-01-01 01:00:00.000000000 +0100
  953. +++ directfb-1.6.3/gfxdrivers/davinci/davincifb.h 2013-04-07 21:33:21.488622184 +0200
  954. @@ -0,0 +1,581 @@
  955. +/*
  956. + * Copyright (C) 2006 Texas Instruments Inc
  957. + *
  958. + * This program is free software; you can redistribute it and/or modify
  959. + * it under the terms of the GNU General Public License as published by
  960. + * the Free Software Foundation; either version 2 of the License, or
  961. + * (at your option)any later version.
  962. + *
  963. + * This program is distributed in the hope that it will be useful,
  964. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  965. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  966. + * GNU General Public License for more details.
  967. + *
  968. + * You should have received a copy of the GNU General Public License
  969. + * along with this program; if not, write to the Free Software
  970. + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  971. + *
  972. + * File: davincifb.h
  973. + */
  974. +
  975. +#ifndef DAVINVI_VPBE_H
  976. +#define DAVINVI_VPBE_H
  977. +
  978. +/* include Linux files */
  979. +#include <linux/fb.h>
  980. +
  981. +/* define the custom FBIO_WAITFORVSYNC ioctl */
  982. +#define FBIO_WAITFORVSYNC _IOW('F', 0x20, u_int32_t)
  983. +#define FBIO_SETATTRIBUTE _IOW('F', 0x21, struct fb_fillrect)
  984. +
  985. +/* Backported IOCTLS. */
  986. +#define FBIO_SETPOSX _IOW('F', 0x22, u_int32_t)
  987. +#define FBIO_SETPOSY _IOW('F', 0x23, u_int32_t)
  988. +#define FBIO_SETZOOM _IOW('F', 0x24, struct zoom_params)
  989. +#define FBIO_GETSTD _IOR('F', 0x25, u_int32_t)
  990. +#define FBIO_RESIZER _IOW('F', 0x26, struct vpfe_resizer_params)
  991. +#define FBIO_SYNC _IOW('F', 0x27, u_int32_t)
  992. +
  993. +typedef struct zoom_params {
  994. + u_int32_t window_id;
  995. + u_int32_t zoom_h;
  996. + u_int32_t zoom_v;
  997. +} zoom_params_t;
  998. +
  999. +typedef struct vpfe_resizer_params
  1000. +{
  1001. + u_int32_t rsz_cnt; //busy-lock
  1002. + u_int32_t out_size; //busy-lock
  1003. + u_int32_t in_start; //busy-lock
  1004. + u_int32_t in_size; //busy-lock
  1005. + u_int32_t sdr_inadd; //shadowed
  1006. + u_int32_t sdr_inoff; //shadowed
  1007. + u_int32_t sdr_outadd; //shadowed
  1008. + u_int32_t sdr_outoff; //shadowed
  1009. + u_int32_t hfilt[16]; //busy-lock
  1010. + u_int32_t vfilt[16]; //busy-lock
  1011. + u_int32_t yenh; //busy-lock
  1012. +} vpfe_resizer_params_t;
  1013. +
  1014. +typedef struct fb_set_start {
  1015. + int offset; /* offset from smem_start */
  1016. + unsigned long physical; /* absolute physical address when offset < 0 */
  1017. +
  1018. + u_int64_t sync; /* input: target sync counter for change or 0 for no sync at all,
  1019. + output: sync counter of actual change or 0 if still pending */
  1020. +} fb_set_start_t;
  1021. +
  1022. +
  1023. +#ifdef _IOC_TYPECHECK
  1024. +#undef _IOC_TYPECHECK
  1025. +#define _IOC_TYPECHECK(x) (sizeof(x))
  1026. +#endif
  1027. +
  1028. +#define RAM_CLUT_SIZE 256*3
  1029. +#define FBIO_ENABLE_DISABLE_WIN \
  1030. + _IOW('F', 0x30, unsigned char)
  1031. +#define FBIO_SET_BITMAP_BLEND_FACTOR \
  1032. + _IOW('F', 0x31, vpbe_bitmap_blend_params_t)
  1033. +#define FBIO_SET_BITMAP_WIN_RAM_CLUT \
  1034. + _IOW('F', 0x32, unsigned char)*RAM_CLUT_SIZE)
  1035. +#define FBIO_ENABLE_DISABLE_ATTRIBUTE_WIN \
  1036. + _IOW('F', 0x33, unsigned int)
  1037. +#define FBIO_GET_BLINK_INTERVAL \
  1038. + _IOR('F', 0x34, vpbe_blink_option_t)
  1039. +#define FBIO_SET_BLINK_INTERVAL \
  1040. + _IOW('F', 0x35, vpbe_blink_option_t)
  1041. +#define FBIO_GET_VIDEO_CONFIG_PARAMS \
  1042. + _IOR('F', 0x36, vpbe_video_config_params_t)
  1043. +#define FBIO_SET_VIDEO_CONFIG_PARAMS \
  1044. + _IOW('F', 0x37, vpbe_video_config_params_t)
  1045. +#define FBIO_GET_BITMAP_CONFIG_PARAMS \
  1046. + _IOR('F', 0x38, vpbe_bitmap_config_params_t)
  1047. +#define FBIO_SET_BITMAP_CONFIG_PARAMS \
  1048. + _IOW('F', 0x39, vpbe_bitmap_config_params_t)
  1049. +#define FBIO_SET_DCLK \
  1050. + _IOW('F', 0x40, vpbe_dclk_t)
  1051. +#define FBIO_SET_INTERFACE \
  1052. + _IOW('F', 0x41, unsigned char)
  1053. +#define FBIO_GET_INTERFACE \
  1054. + _IOR('F', 0x42, unsigned char)
  1055. +#define FBIO_QUERY_TIMING \
  1056. + _IOWR('F', 0x43, struct vpbe_mode_info)
  1057. +#define FBIO_SET_TIMING \
  1058. + _IOW('F', 0x44, struct vpbe_fb_videomode)
  1059. +#define FBIO_GET_TIMING \
  1060. + _IOR('F', 0x45, struct vpbe_fb_videomode)
  1061. +#define FBIO_SET_VENC_CLK_SOURCE \
  1062. + _IOW('F', 0x46, unsigned char)
  1063. +#define FBIO_SET_BACKG_COLOR \
  1064. + _IOW('F', 0x47, vpbe_backg_color_t)
  1065. +#define FBIO_ENABLE_DISPLAY \
  1066. + _IOW('F', 0x48, unsigned char)
  1067. +#define FBIO_SETPOS \
  1068. + _IOW('F', 0x49, u_int32_t)
  1069. +#define FBIO_SET_CURSOR \
  1070. + _IOW('F', 0x50, struct fb_cursor)
  1071. +#define FBIO_SET_START \
  1072. + _IOW('F', 0x66, struct fb_set_start)
  1073. +
  1074. +/*
  1075. + * Defines and Constants
  1076. + */
  1077. +#ifdef __KERNEL__
  1078. +#define DAVINCIFB_DEVICE "davincifb"
  1079. +#define DAVINCIFB_DRIVER "davincifb"
  1080. +
  1081. +#define MULTIPLE_BUFFERING 1
  1082. +
  1083. +#ifdef MULTIPLE_BUFFERING
  1084. +#define DOUBLE_BUF 2
  1085. +#define TRIPLE_BUF 3
  1086. +#else
  1087. +#define DOUBLE_BUF 1
  1088. +#define TRIPLE_BUF 1
  1089. +#endif
  1090. +
  1091. +/* usage: if (is_win(info->fix.id, OSD0)) ... */
  1092. +#define is_win(name, x) ((strcmp(name, x ## _FBNAME) == 0) ? 1 : 0)
  1093. +
  1094. +/*
  1095. + * display controller register I/O routines
  1096. + */
  1097. +u32 dispc_reg_in(u32 offset);
  1098. +u32 dispc_reg_out(u32 offset, u32 val);
  1099. +u32 dispc_reg_merge(u32 offset, u32 val, u32 mask);
  1100. +
  1101. +#endif /*__KERNEL__*/
  1102. +
  1103. +/* Error return codes */
  1104. +#define VPBE_INVALID_PARA_VALUE 700
  1105. +#define VPBE_WRONG_WINDOW_ID 701
  1106. +#define VPBE_CURRENTLY_IN_REQUIRED_MODE 702
  1107. +#define VPBE_INSUFFICIENT_CLUT_VALUES 703
  1108. +#define VPBE_CLUT_WRITE_TIMEOUT 704
  1109. +#define VPBE_VID0_BUF_ADR_NULL 705
  1110. +#define VPBE_WINDOW_NOT_DISABLED 706
  1111. +#define VPBE_WINDOW_NOT_ENABLED 707
  1112. +
  1113. +#ifndef __KERNEL__
  1114. +/* Window ID definations */
  1115. +#define OSD0 0
  1116. +#define VID0 1
  1117. +#define OSD1 2
  1118. +#define VID1 3
  1119. +#endif
  1120. +
  1121. +/* There are 4 framebuffers, each represented by an fb_info and
  1122. + * a dm_win_info structure */
  1123. +#define OSD0_FBNAME "dm_osd0_fb"
  1124. +#define OSD1_FBNAME "dm_osd1_fb"
  1125. +#define VID0_FBNAME "dm_vid0_fb"
  1126. +#define VID1_FBNAME "dm_vid1_fb"
  1127. +
  1128. +/* FIXME: Digital LCD RGB matrix coefficients */
  1129. +#define DLCD_DGY_VAL 0
  1130. +#define DLCD_DRV_VAL 0
  1131. +#define DLCD_DGU_VAL 0
  1132. +#define DLCD_DBU_VAL 0
  1133. +
  1134. +/* Defines for bitmap format */
  1135. +#define VPBE_BITMAP_BIT_1 1
  1136. +#define VPBE_BITMAP_BIT_2 2
  1137. +#define VPBE_BITMAP_BIT_4 4
  1138. +#define VPBE_BITMAP_BIT_8 8
  1139. +#define VPBE_BITMAP_RGB565 16
  1140. +#define VPBE_VIDEO_YUV422 16
  1141. +#define VPBE_VIDEO_RGB888 24
  1142. +
  1143. +/* Defines foe cursor parameter validation*/
  1144. +#define MAX_CURSOR_WIDTH 0x3FF
  1145. +#define MAX_CURSOR_HEIGHT 0x1FF
  1146. +#define MAX_CURSOR_LINEWIDTH 7
  1147. +
  1148. +#define BASEX 0x80
  1149. +#define BASEY 0x12
  1150. +#define BASEX_DLCD 0x59
  1151. +#define BASEY_DLCD 0x22
  1152. +
  1153. +/*
  1154. + * Enumerations
  1155. + */
  1156. +/* Enum for blending factor */
  1157. +typedef enum vpbe_blend_factor {
  1158. + OSD_CONTRIBUTION_ZERO = 0,
  1159. + OSD_CONTRIBUTION_1_BY_8 = 1,
  1160. + OSD_CONTRIBUTION_2_BY_8 = 2,
  1161. + OSD_CONTRIBUTION_3_BY_8 = 3,
  1162. + OSD_CONTRIBUTION_4_BY_8 = 4,
  1163. + OSD_CONTRIBUTION_5_BY_8 = 5,
  1164. + OSD_CONTRIBUTION_6_BY_8 = 6,
  1165. + OSD_CONTRIBUTION_ONE = 7
  1166. +} vpbe_blend_factor_t;
  1167. +
  1168. +/* Enum for Boolean variables */
  1169. +typedef enum {
  1170. + SET_0 = 0,
  1171. + SET_1 = 1
  1172. +} CB_CR_ORDER, ATTRIBUTE, ROM_RAM_CLUT;
  1173. +
  1174. +/* Defines for Display Interface */
  1175. +#define PRGB 0
  1176. +#define COMPOSITE 1
  1177. +#define SVIDEO 2
  1178. +#define COMPONENT 3
  1179. +#define RGB 4
  1180. +#define YCC16 5
  1181. +#define YCC8 6
  1182. +#define SRGB 7
  1183. +#define EPSON 8
  1184. +#define CASIO1G 9
  1185. +#define UDISP 10
  1186. +#define STN 11
  1187. +#define VPBE_MAX_INTERFACES 12
  1188. +
  1189. +/* Defines for Display Mode */
  1190. +#define LCD 0
  1191. +#define NTSC 1
  1192. +#define PAL 2
  1193. +#define P525 3
  1194. +#define P625 4
  1195. +
  1196. +#define DEFAULT_MODE 0
  1197. +#define P480 0
  1198. +#define P400 1
  1199. +#define P350 2
  1200. +#define NON_EXISTING_MODE 255
  1201. +/* Enable/Disable enum */
  1202. +typedef enum {
  1203. + VPBE_DISABLE = 0,
  1204. + VPBE_ENABLE = 1
  1205. +} ATTENUATION, TRANSPARENCY, EXPANSION, BLINKING;
  1206. +
  1207. +typedef enum clk_source {
  1208. + CLK_SOURCE_CLK27 = 0,
  1209. + CLK_SOURCE_CLK54 = 1,
  1210. + CLK_SOURCE_VPBECLK = 2
  1211. +} CLK_SOURCE;
  1212. +
  1213. +/*
  1214. + * Structures and Union Definitions
  1215. + */
  1216. +
  1217. +/* Structure for transparency and the blending factor for the bitmap window */
  1218. +typedef struct vpbe_bitmap_blend_params {
  1219. + unsigned int colorkey; /* color key to be blend */
  1220. + unsigned int enable_colorkeying; /* enable color keying */
  1221. + unsigned int bf; /* valid range from 0 to 7 only. */
  1222. +} vpbe_bitmap_blend_params_t;
  1223. +
  1224. +/* Structure for window expansion */
  1225. +typedef struct vpbe_win_expansion {
  1226. + EXPANSION horizontal;
  1227. + EXPANSION vertical; /* 1: Enable 0:disable */
  1228. +} vpbe_win_expansion_t;
  1229. +
  1230. +/* Structure for OSD window blinking options */
  1231. +typedef struct vpbe_blink_option {
  1232. + BLINKING blinking; /* 1: Enable blinking 0: Disable */
  1233. + unsigned int interval; /* Valid only if blinking is 1 */
  1234. +} vpbe_blink_option_t;
  1235. +
  1236. +/* Structure for DCLK parameters */
  1237. +typedef struct vpbe_dclk {
  1238. + unsigned char dclk_pattern_width;
  1239. + unsigned int dclk_pattern0;
  1240. + unsigned int dclk_pattern1;
  1241. + unsigned int dclk_pattern2;
  1242. + unsigned int dclk_pattern3;
  1243. +} vpbe_dclk_t;
  1244. +
  1245. +/* Structure for display format */
  1246. +typedef struct vpbe_display_format {
  1247. + unsigned char interface; /* Output interface type */
  1248. + unsigned char mode; /* output mode */
  1249. +} vpbe_display_format_t;
  1250. +
  1251. +/* Structure for background color */
  1252. +typedef struct vpbe_backg_color {
  1253. + unsigned char clut_select; /* 2: RAM CLUT 1:ROM1 CLUT 0:ROM0 CLUT */
  1254. + unsigned char color_offset; /* index of color */
  1255. +} vpbe_backg_color_t;
  1256. +
  1257. +/* Structure for Video window configurable parameters */
  1258. +typedef struct vpbe_video_config_params {
  1259. + CB_CR_ORDER cb_cr_order; /*Cb/Cr order in input data for a pixel. */
  1260. + /* 0: cb cr 1: cr cb */
  1261. + vpbe_win_expansion_t exp_info; /* HZ/VT Expansion enable disable */
  1262. +} vpbe_video_config_params_t;
  1263. +
  1264. +/*Union of structures giving the CLUT index for the 1, 2, 4 bit bitmap values.*/
  1265. +typedef union vpbe_clut_idx {
  1266. + struct _for_4bit_bimap {
  1267. + unsigned char bitmap_val_0;
  1268. + unsigned char bitmap_val_1;
  1269. + unsigned char bitmap_val_2;
  1270. + unsigned char bitmap_val_3;
  1271. + unsigned char bitmap_val_4;
  1272. + unsigned char bitmap_val_5;
  1273. + unsigned char bitmap_val_6;
  1274. + unsigned char bitmap_val_7;
  1275. + unsigned char bitmap_val_8;
  1276. + unsigned char bitmap_val_9;
  1277. + unsigned char bitmap_val_10;
  1278. + unsigned char bitmap_val_11;
  1279. + unsigned char bitmap_val_12;
  1280. + unsigned char bitmap_val_13;
  1281. + unsigned char bitmap_val_14;
  1282. + unsigned char bitmap_val_15;
  1283. + } for_4bit_bimap;
  1284. + struct _for_2bit_bimap {
  1285. + unsigned char bitmap_val_0;
  1286. + unsigned char dummy0[4];
  1287. + unsigned char bitmap_val_1;
  1288. + unsigned char dummy1[4];
  1289. + unsigned char bitmap_val_2;
  1290. + unsigned char dummy2[4];
  1291. + unsigned char bitmap_val_3;
  1292. + } for_2bit_bimap;
  1293. + struct _for_1bit_bimap {
  1294. + unsigned char bitmap_val_0;
  1295. + unsigned char dummy0[14];
  1296. + unsigned char bitmap_val_1;
  1297. + } for_1bit_bimap;
  1298. +} vpbe_clut_idx_t;
  1299. +
  1300. +/* Structure for bitmap window configurable parameters */
  1301. +typedef struct vpbe_bitmap_config_params {
  1302. + /* Only for bitmap width = 1,2,4 bits */
  1303. + vpbe_clut_idx_t clut_idx;
  1304. + /* Attenuation value for YUV o/p for bitmap window */
  1305. + unsigned char attenuation_enable;
  1306. + /* 0: ROM DM270, 1:ROM DM320, 2:RAM CLUT */
  1307. + unsigned char clut_select;
  1308. +} vpbe_bitmap_config_params_t;
  1309. +
  1310. +/* Unioun for video/OSD configuration parameters */
  1311. +typedef union vpbe_conf_params {
  1312. +
  1313. + struct vpbe_video_params {
  1314. + CB_CR_ORDER cb_cr_order;
  1315. + /* HZ/VT Expansion enable disable */
  1316. + vpbe_win_expansion_t exp_info;
  1317. + } video_params;
  1318. +
  1319. + struct vpbe_bitmap_params {
  1320. + /* Attenuation value for YUV o/p */
  1321. + ATTENUATION attenuation_enable;
  1322. + /* 0: ROM DM270, 1: ROM DM320, 2:RAM CLUT */
  1323. + unsigned char clut_select;
  1324. + /* Only for bitmap width = 1,2,4 bits */
  1325. + vpbe_clut_idx_t clut_idx;
  1326. + /* 0: OSD window is bitmap window */
  1327. + /* 1: OSD window is attribute window */
  1328. + ATTRIBUTE enable_attribute;
  1329. + /* To hold bps value.
  1330. + Used to switch back from attribute to bitmap. */
  1331. + unsigned int stored_bits_per_pixel;
  1332. + /* Blending information */
  1333. + vpbe_bitmap_blend_params_t blend_info;
  1334. + /* OSD Blinking information */
  1335. + vpbe_blink_option_t blink_info;
  1336. + } bitmap_params;
  1337. +
  1338. +} vpbe_conf_params_t;
  1339. +
  1340. +typedef struct vpbe_video_params vpbe_video_params_t;
  1341. +typedef struct vpbe_bitmap_params vpbe_bitmap_params_t;
  1342. +
  1343. +/* Structure to hold window position */
  1344. +typedef struct vpbe_window_position {
  1345. + unsigned int xpos; /* X position of the window */
  1346. + unsigned int ypos; /* Y position of the window */
  1347. +} vpbe_window_position_t;
  1348. +
  1349. +#ifdef __KERNEL__
  1350. +/* Structure for each window */
  1351. +typedef struct vpbe_dm_win_info {
  1352. + struct fb_info info;
  1353. + vpbe_window_position_t win_pos; /* X,Y position of window */
  1354. + /* Size of window is already there in var_info structure. */
  1355. +
  1356. + dma_addr_t fb_base_phys; /*framebuffer area */
  1357. + unsigned int fb_base; /*window memory pointer */
  1358. + unsigned int fb_size; /*memory size */
  1359. + unsigned int pseudo_palette[17];
  1360. + int alloc_fb_mem;
  1361. + /*flag to identify if framebuffer area is fixed or not */
  1362. + unsigned long sdram_address;
  1363. + struct vpbe_dm_info *dm;
  1364. + unsigned char window_enable; /*Additions for all windows */
  1365. + zoom_params_t zoom; /*Zooming parameters */
  1366. + unsigned char field_frame_select; /*To select Field or frame */
  1367. + unsigned char numbufs; /*Number of buffers valid 2 or 3 */
  1368. + vpbe_conf_params_t conf_params;
  1369. + /*window configuration parameter union pointer */
  1370. +} vpbe_dm_win_info_t;
  1371. +#endif /*__KERNEL__*/
  1372. +
  1373. +/*
  1374. + * Videmode structure for display interface and mode settings
  1375. + */
  1376. +typedef struct vpbe_fb_videomode {
  1377. + unsigned char name[10]; /* Mode name ( NTSC , PAL) */
  1378. + unsigned int vmode; /* FB_MODE_INTERLACED or FB_MODE_NON_INTERLACED */
  1379. + unsigned int xres; /* X Resolution of the display */
  1380. + unsigned int yres; /* Y Resolution of the display */
  1381. + unsigned int fps; /* frames per second */
  1382. + /* Timing Parameters applicable for std = 0 only */
  1383. + unsigned int left_margin;
  1384. + unsigned int right_margin;
  1385. + unsigned int upper_margin;
  1386. + unsigned int lower_margin;
  1387. + unsigned int hsync_len;
  1388. + unsigned int vsync_len;
  1389. + unsigned int sync; /* 0: hsync -ve/vsync -ve */
  1390. + /*1: hsync -ve/vsync +ve */
  1391. + /*2: hsync +ve/vsync -ve */
  1392. + /*3: hsync +ve/vsync +ve */
  1393. + unsigned int basepx; /* Display x,y start position */
  1394. + unsigned int basepy;
  1395. +/* 1= Mode s available in modelist 0=Mode is not available in modelist */
  1396. + unsigned int std;
  1397. +} vpbe_fb_videomode_t;
  1398. +
  1399. +/* Structure to interface videomode to application*/
  1400. +typedef struct vpbe_mode_info {
  1401. + vpbe_fb_videomode_t vid_mode;
  1402. + unsigned char interface;
  1403. + unsigned char mode_idx;
  1404. +} vpbe_mode_info_t;
  1405. +
  1406. +#ifdef __KERNEL__
  1407. +/*
  1408. + * Structure for the driver holding information of windows,
  1409. + * memory base addresses etc.
  1410. + */
  1411. +typedef struct vpbe_dm_info {
  1412. + vpbe_dm_win_info_t *osd0;
  1413. + vpbe_dm_win_info_t *osd1;
  1414. + vpbe_dm_win_info_t *vid0;
  1415. + vpbe_dm_win_info_t *vid1;
  1416. +
  1417. +/* to map the registers */
  1418. + dma_addr_t mmio_base_phys;
  1419. + unsigned int mmio_base;
  1420. + unsigned int mmio_size;
  1421. +
  1422. + wait_queue_head_t vsync_wait;
  1423. + unsigned int vsync_cnt;
  1424. + int timeout;
  1425. +
  1426. + /* this is the function that configures the output device (NTSC/PAL/LCD)
  1427. + * for the required output format (composite/s-video/component/rgb)
  1428. + */
  1429. + void (*output_device_config) (void);
  1430. +
  1431. + struct device *dev;
  1432. +
  1433. + vpbe_backg_color_t backg; /* background color */
  1434. + vpbe_dclk_t dclk; /*DCLK parameters */
  1435. + vpbe_display_format_t display; /*Display interface and mode */
  1436. + vpbe_fb_videomode_t videomode; /*Cuurent videomode */
  1437. + char ram_clut[256][3]; /*RAM CLUT array */
  1438. + struct fb_cursor cursor; /* cursor config params from fb.h */
  1439. +/*Flag that indicates whether any of the display is enabled or not*/
  1440. + int display_enable;
  1441. +} vpbe_dm_info_t;
  1442. +
  1443. +/*
  1444. + * Functions Definitions for 'davincifb' module
  1445. + */
  1446. +int vpbe_mem_alloc_window_buf(vpbe_dm_win_info_t *);
  1447. +int vpbe_mem_release_window_buf(vpbe_dm_win_info_t *);
  1448. +void init_display_function(vpbe_display_format_t *);
  1449. +int vpbe_mem_alloc_struct(vpbe_dm_win_info_t **);
  1450. +void set_vid0_default_conf(void);
  1451. +void set_vid1_default_conf(void);
  1452. +void set_osd0_default_conf(void);
  1453. +void set_osd1_default_conf(void);
  1454. +void set_cursor_default_conf(void);
  1455. +void set_dm_default_conf(void);
  1456. +void set_win_enable(char *, unsigned int);
  1457. +int within_vid0_limits(u32, u32, u32, u32);
  1458. +void vpbe_set_display_default(void);
  1459. +#ifdef __KERNEL__
  1460. +void set_win_position(char *, u32, u32, u32, u32);
  1461. +void change_win_param(int);
  1462. +void set_interlaced(char *, unsigned int);
  1463. +#endif /* __KERNEL__ */
  1464. +
  1465. +/*
  1466. + * Function definations for 'osd' module
  1467. + */
  1468. +
  1469. +int vpbe_enable_window(vpbe_dm_win_info_t *);
  1470. +int vpbe_disable_window(vpbe_dm_win_info_t *);
  1471. +int vpbe_vid_osd_select_field_frame(u8 *, u8);
  1472. +int vpbe_bitmap_set_blend_factor(u8 *, vpbe_bitmap_blend_params_t *);
  1473. +int vpbe_bitmap_set_ram_clut(void);
  1474. +int vpbe_enable_disable_attribute_window(u32);
  1475. +int vpbe_get_blinking(u8 *, vpbe_blink_option_t *);
  1476. +int vpbe_set_blinking(u8 *, vpbe_blink_option_t *);
  1477. +int vpbe_set_vid_params(u8 *, vpbe_video_config_params_t *);
  1478. +int vpbe_get_vid_params(u8 *, vpbe_video_config_params_t *);
  1479. +int vpbe_bitmap_get_params(u8 *, vpbe_bitmap_config_params_t *);
  1480. +int vpbe_bitmap_set_params(u8 *, vpbe_bitmap_config_params_t *);
  1481. +int vpbe_set_cursor_params(struct fb_cursor *);
  1482. +int vpbe_set_vid_expansion(vpbe_win_expansion_t *);
  1483. +int vpbe_set_dclk(vpbe_dclk_t *);
  1484. +int vpbe_set_display_format(vpbe_display_format_t *);
  1485. +int vpbe_set_backg_color(vpbe_backg_color_t *);
  1486. +int vpbe_set_interface(u8);
  1487. +int vpbe_query_mode(vpbe_mode_info_t *);
  1488. +int vpbe_set_mode(struct vpbe_fb_videomode *);
  1489. +int vpbe_set_venc_clk_source(u8);
  1490. +void set_vid0_default_conf(void);
  1491. +void set_osd0_default_conf(void);
  1492. +void set_vid1_default_conf(void);
  1493. +void set_osd1_default_conf(void);
  1494. +void set_cursor_default_conf(void);
  1495. +void set_dm_default_conf(void);
  1496. +/*
  1497. + * Function definations for 'venc' module
  1498. + */
  1499. +
  1500. +void davincifb_ntsc_composite_config(void);
  1501. +void davincifb_ntsc_svideo_config(void);
  1502. +void davincifb_ntsc_component_config(void);
  1503. +void davincifb_pal_composite_config(void);
  1504. +void davincifb_pal_svideo_config(void);
  1505. +void davincifb_pal_component_config(void);
  1506. +
  1507. +void vpbe_davincifb_ntsc_rgb_config(void);
  1508. +void vpbe_davincifb_pal_rgb_config(void);
  1509. +void vpbe_davincifb_525p_component_config(void);
  1510. +void vpbe_davincifb_625p_component_config(void);
  1511. +
  1512. +void vpbe_enable_venc(int);
  1513. +void vpbe_enable_dacs(int);
  1514. +/*
  1515. + * Function definations for 'dlcd' module
  1516. + */
  1517. +void vpbe_davincifb_480p_prgb_config(void);
  1518. +void vpbe_davincifb_400p_prgb_config(void);
  1519. +void vpbe_davincifb_350p_prgb_config(void);
  1520. +void vpbe_set_display_timing(struct vpbe_fb_videomode *);
  1521. +
  1522. +void vpbe_enable_lcd(int);
  1523. +/*
  1524. + * Following functions are not implemented
  1525. + */
  1526. +void vpbe_davincifb_default_ycc16_config(void);
  1527. +void vpbe_davincifb_default_ycc8_config(void);
  1528. +void vpbe_davincifb_default_srgb_config(void);
  1529. +void vpbe_davincifb_default_epson_config(void);
  1530. +void vpbe_davincifb_default_casio_config(void);
  1531. +void vpbe_davincifb_default_UDISP_config(void);
  1532. +void vpbe_davincifb_default_STN_config(void);
  1533. +#endif /*__KERNEL__*/
  1534. +
  1535. +#endif /* End of #ifndef DAVINCI_VPBE_H */
  1536. diff -puNr -Naur directfb-1.6.3-orig/gfxdrivers/davinci/davinci_gfxdriver.h directfb-1.6.3/gfxdrivers/davinci/davinci_gfxdriver.h
  1537. --- directfb-1.6.3-orig/gfxdrivers/davinci/davinci_gfxdriver.h 1970-01-01 01:00:00.000000000 +0100
  1538. +++ directfb-1.6.3/gfxdrivers/davinci/davinci_gfxdriver.h 2013-04-07 21:33:19.560662133 +0200
  1539. @@ -0,0 +1,169 @@
  1540. +/*
  1541. + TI Davinci driver - Graphics Driver
  1542. +
  1543. + (c) Copyright 2007 Telio AG
  1544. +
  1545. + Written by Denis Oliver Kropp <dok@directfb.org>
  1546. +
  1547. + Code is derived from VMWare driver.
  1548. +
  1549. + (c) Copyright 2001-2009 The world wide DirectFB Open Source Community (directfb.org)
  1550. + (c) Copyright 2000-2004 Convergence (integrated media) GmbH
  1551. +
  1552. + All rights reserved.
  1553. +
  1554. + This library is free software; you can redistribute it and/or
  1555. + modify it under the terms of the GNU Lesser General Public
  1556. + License as published by the Free Software Foundation; either
  1557. + version 2 of the License, or (at your option) any later version.
  1558. +
  1559. + This library is distributed in the hope that it will be useful,
  1560. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  1561. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1562. + Lesser General Public License for more details.
  1563. +
  1564. + You should have received a copy of the GNU Lesser General Public
  1565. + License along with this library; if not, write to the
  1566. + Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  1567. + Boston, MA 02111-1307, USA.
  1568. +*/
  1569. +
  1570. +#ifndef __DAVINCI_GFXDRIVER_H__
  1571. +#define __DAVINCI_GFXDRIVER_H__
  1572. +
  1573. +#include <sys/ioctl.h>
  1574. +#include <davincifb.h>
  1575. +
  1576. +#include <core/surface_buffer.h>
  1577. +
  1578. +#include "davincifb.h"
  1579. +
  1580. +#include "davinci_c64x.h"
  1581. +
  1582. +
  1583. +typedef struct {
  1584. + /* validation flags */
  1585. + int v_flags;
  1586. +
  1587. + /* cached/computed values */
  1588. + void *dst_addr;
  1589. + unsigned long dst_phys;
  1590. + unsigned int dst_size;
  1591. + unsigned long dst_pitch;
  1592. + DFBSurfacePixelFormat dst_format;
  1593. + unsigned long dst_bpp;
  1594. +
  1595. + void *src_addr;
  1596. + unsigned long src_phys;
  1597. + unsigned long src_pitch;
  1598. + DFBSurfacePixelFormat src_format;
  1599. + unsigned long src_bpp;
  1600. +
  1601. + unsigned long source_mult;
  1602. +
  1603. + unsigned long fillcolor;
  1604. +
  1605. + int blit_blend_sub_function;
  1606. + int draw_blend_sub_function;
  1607. +
  1608. + DFBColor color;
  1609. + unsigned long color_argb;
  1610. + unsigned long colorkey;
  1611. +
  1612. + DFBSurfaceBlittingFlags blitting_flags;
  1613. +
  1614. + DFBRegion clip;
  1615. +
  1616. + /** Add shared data here... **/
  1617. + struct fb_fix_screeninfo fix[4];
  1618. +
  1619. + CoreSurfacePool *osd_pool;
  1620. + CoreSurfacePool *video_pool;
  1621. +
  1622. + bool synced;
  1623. +} DavinciDeviceData;
  1624. +
  1625. +
  1626. +typedef struct {
  1627. + int num;
  1628. + int fd;
  1629. + void *mem;
  1630. + int size;
  1631. +} DavinciFB;
  1632. +
  1633. +typedef struct {
  1634. + DavinciDeviceData *ddev;
  1635. +
  1636. + CoreDFB *core;
  1637. +
  1638. + CoreScreen *screen;
  1639. + CoreLayer *osd;
  1640. + CoreLayer *video;
  1641. +
  1642. + DavinciFB fb[4];
  1643. +
  1644. + DavinciC64x c64x;
  1645. + bool c64x_present;
  1646. +
  1647. + DavinciC64xTasks tasks;
  1648. +} DavinciDriverData;
  1649. +
  1650. +
  1651. +static inline DFBResult
  1652. +davincifb_pan_display( const DavinciFB *fb,
  1653. + struct fb_var_screeninfo *var,
  1654. + const CoreSurfaceBufferLock *lock,
  1655. + DFBSurfaceFlipFlags flags,
  1656. + int x,
  1657. + int y )
  1658. +{
  1659. + int ret;
  1660. +
  1661. + if (lock) {
  1662. +#ifdef FBIO_SET_START
  1663. + CoreSurfaceBuffer *buffer = lock->buffer;
  1664. + struct fb_set_start set_start;
  1665. +
  1666. + /* physical mode */
  1667. + set_start.offset = -1;
  1668. + set_start.sync = (flags & DSFLIP_ONSYNC) ? 1 : 0;
  1669. +
  1670. + /* life's so easy */
  1671. + set_start.physical = lock->phys + DFB_BYTES_PER_LINE( buffer->format, x ) + y * lock->pitch;
  1672. +
  1673. + ret = ioctl( fb->fd, FBIO_SET_START, &set_start );
  1674. + if (ret < 0)
  1675. + D_DEBUG( "FBIO_SET_START (0x%08lx, sync %llu) failed!\n",
  1676. + set_start.physical, set_start.sync );
  1677. +
  1678. + if (ret == 0) {
  1679. + if (flags & DSFLIP_WAIT)
  1680. + ioctl( fb->fd, FBIO_WAITFORVSYNC );
  1681. +
  1682. + return DFB_OK;
  1683. + }
  1684. +
  1685. + /* fallback */
  1686. +#endif
  1687. + var->xoffset = x; /* poor version */
  1688. + var->yoffset = y + lock->offset / lock->pitch;
  1689. + }
  1690. + else {
  1691. + var->xoffset = x;
  1692. + var->yoffset = y;
  1693. + }
  1694. +
  1695. + var->activate = /*(flags & DSFLIP_ONSYNC) ? FB_ACTIVATE_VBL :*/ FB_ACTIVATE_NOW;
  1696. +
  1697. + ret = ioctl( fb->fd, FBIOPAN_DISPLAY, var );
  1698. + if (ret)
  1699. + D_PERROR( "Davinci/FB: FBIOPAN_DISPLAY (fb%d - %d,%d) failed!\n",
  1700. + fb->num, var->xoffset, var->yoffset );
  1701. +
  1702. + if (flags & DSFLIP_WAIT)
  1703. + ioctl( fb->fd, FBIO_WAITFORVSYNC );
  1704. +
  1705. + return DFB_OK;
  1706. +}
  1707. +
  1708. +#endif
  1709. diff -puNr -Naur directfb-1.6.3-orig/tests/voodoo/voodoo_test.h directfb-1.6.3/tests/voodoo/voodoo_test.h
  1710. --- directfb-1.6.3-orig/tests/voodoo/voodoo_test.h 1970-01-01 01:00:00.000000000 +0100
  1711. +++ directfb-1.6.3/tests/voodoo/voodoo_test.h 2013-04-07 21:33:31.824408024 +0200
  1712. @@ -0,0 +1,10 @@
  1713. +#ifndef __VOODOO_TEST_H__
  1714. +#define __VOODOO_TEST_H__
  1715. +
  1716. +typedef enum {
  1717. + VOODOO_TEST_INCREASE,
  1718. + VOODOO_TEST_QUERY
  1719. +} VoodooTestCall;
  1720. +
  1721. +#endif
  1722. +