1 diff -urNp DirectFB-1.5.3_orig/gfxdrivers/davinci/davinci_c64x.h DirectFB-1.5.3/gfxdrivers/davinci/davinci_c64x.h
2 --- DirectFB-1.5.3_orig/gfxdrivers/davinci/davinci_c64x.h 1969-12-31 19:00:00.000000000 -0500
3 +++ DirectFB-1.5.3/gfxdrivers/davinci/davinci_c64x.h 2012-05-09 02:20:38.342006623 -0400
6 + TI Davinci driver - C64X+ DSP Library
8 + (c) Copyright 2008 directfb.org
9 + (c) Copyright 2007 Telio AG
11 + Written by Denis Oliver Kropp <dok@directfb.org> and
12 + Olaf Dreesen <olaf@directfb.org>.
14 + All rights reserved.
16 + This library is free software; you can redistribute it and/or
17 + modify it under the terms of the GNU General Public License
18 + version 2 as published by the Free Software Foundation.
20 + This library is distributed in the hope that it will be useful,
21 + but WITHOUT ANY WARRANTY; without even the implied warranty of
22 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 + General Public License for more details.
25 + You should have received a copy of the GNU General Public
26 + License along with this library; if not, write to the
27 + Free Software Foundation, Inc., 59 Temple Place - Suite 330,
28 + Boston, MA 02111-1307, USA.
31 +#ifndef __DAVINCI_C64X_H__
32 +#define __DAVINCI_C64X_H__
36 +#include <directfb.h>
38 +#include <direct/messages.h>
39 +#include <direct/trace.h>
41 +#include <linux/c64x.h>
43 +#define mb() __asm__ __volatile__ ("" : : : "memory")
45 +/**********************************************************************************************************************/
51 + c64xTaskControl *ctl;
59 + unsigned int max_tasks;
60 + unsigned int num_tasks;
65 + C64X_TEF_NONE = 0x0000,
66 + C64X_TEF_RESET = 0x0001
67 +} DavinciC64xEmitFlags;
69 +/**********************************************************************************************************************/
71 +DFBResult davinci_c64x_open ( DavinciC64x *c64x );
73 +DFBResult davinci_c64x_close ( DavinciC64x *c64x );
75 +DFBResult davinci_c64x_wait_low( DavinciC64x *c64x );
77 +/**********************************************************************************************************************/
79 +DFBResult davinci_c64x_tasks_init ( DavinciC64xTasks *tasks,
80 + unsigned int size );
82 +DFBResult davinci_c64x_tasks_destroy( DavinciC64xTasks *tasks );
84 +/**********************************************************************************************************************/
86 +DFBResult davinci_c64x_emit_tasks( DavinciC64x *c64x,
87 + DavinciC64xTasks *tasks,
88 + DavinciC64xEmitFlags flags );
90 +/**********************************************************************************************************************/
92 +static const char *state_names[] = { "DONE", "ERROR", "TODO", "RUNNING" };
94 +static inline c64xTask *
95 +c64x_get_task( DavinciC64x *c64x )
97 + c64xTaskControl *ctl = c64x->ctl;
98 + uint32_t idx = ctl->QL_arm;
99 + uint32_t next = (idx + 1) & C64X_QUEUE_MASK;
100 + c64xTask *task = &c64x->QueueL[idx];
104 + /* Wait for the entry (and next) to be processed by the DSP (rare case). */
105 + while (task->c64x_flags & C64X_FLAG_TODO || ctl->QL_dsp == next) {
106 + if (loops > 666 || (idle && ctl->idlecounter - idle > 666)) {
107 + c64xTask *dsp_task = &c64x->QueueL[ctl->QL_dsp];
109 + D_PERROR( "Davinci/C64X+: Blocked! [DSP %d / %d (%s), ARM %d / %d (%s)]\n",
111 + (dsp_task->c64x_function >> 2) & 0x3fff,
112 + state_names[dsp_task->c64x_function & 3],
114 + (task->c64x_function >> 2) & 0x3fff,
115 + state_names[task->c64x_function & 3] );
120 + idle = ctl->idlecounter;
122 + /* Queue is full, waiting 10-20ms should not be too bad. */
131 +c64x_submit_task( DavinciC64x *c64x, c64xTask *task )
133 + c64xTaskControl *ctl = c64x->ctl;
134 + uint32_t idx = ctl->QL_arm;
135 + uint32_t next = (idx + 1) & C64X_QUEUE_MASK;
139 + ctl->QL_arm = next;
144 +/**********************************************************************************************************************/
147 +davinci_c64x_wb_inv_range( DavinciC64x *c64x,
148 + unsigned long start,
152 + c64xTask *task = c64x_get_task( c64x );
154 + task->c64x_arg[0] = start;
155 + task->c64x_arg[1] = length;
156 + task->c64x_arg[2] = func;
158 + task->c64x_function = C64X_WB_INV_RANGE | C64X_FLAG_TODO;
160 + c64x_submit_task( c64x, task );
164 +davinci_c64x_write_back_all( DavinciC64x *c64x )
166 + c64xTask *task = c64x_get_task( c64x );
168 + task->c64x_function = C64X_WRITE_BACK_ALL | C64X_FLAG_TODO;
170 + c64x_submit_task( c64x, task );
173 +/**********************************************************************************************************************/
176 +davinci_c64x_load_block__L( DavinciC64xTasks *tasks,
177 + unsigned long words,
181 + c64xTask *task = &tasks->tasks[tasks->num_tasks];
183 + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
185 + task->c64x_arg[0] = words;
186 + task->c64x_arg[1] = num;
187 + task->c64x_arg[2] = flags;
189 + task->c64x_function = C64X_LOAD_BLOCK | C64X_FLAG_TODO;
191 + tasks->num_tasks++;
195 +davinci_c64x_load_block( DavinciC64x *c64x,
196 + unsigned long words,
200 + c64xTask *task = c64x_get_task( c64x );
202 + task->c64x_arg[0] = words;
203 + task->c64x_arg[1] = num;
204 + task->c64x_arg[2] = flags;
206 + task->c64x_function = C64X_LOAD_BLOCK | C64X_FLAG_TODO;
208 + c64x_submit_task( c64x, task );
212 +davinci_c64x_fetch_uyvy( DavinciC64x *c64x,
213 + unsigned long dest,
214 + unsigned long source,
219 + c64xTask *task = c64x_get_task( c64x );
221 + task->c64x_arg[0] = dest;
222 + task->c64x_arg[1] = source;
223 + task->c64x_arg[2] = pitch;
224 + task->c64x_arg[3] = height;
225 + task->c64x_arg[4] = flags;
227 + task->c64x_function = C64X_FETCH_UYVY | C64X_FLAG_TODO;
229 + c64x_submit_task( c64x, task );
233 +davinci_c64x_mc( DavinciC64x *c64x,
234 + unsigned long dest,
236 + unsigned long source0,
237 + unsigned long source1,
242 + c64xTask *task = c64x_get_task( c64x );
244 + task->c64x_arg[0] = dest;
245 + task->c64x_arg[1] = dpitch;
246 + task->c64x_arg[2] = source0;
247 + task->c64x_arg[3] = source1;
248 + task->c64x_arg[4] = spitch;
249 + task->c64x_arg[5] = height;
251 + task->c64x_function = func | C64X_FLAG_TODO;
253 + c64x_submit_task( c64x, task );
257 +davinci_c64x_put_idct_uyvy_16x16__L( DavinciC64xTasks *tasks,
258 + unsigned long dest,
262 + c64xTask *task = &tasks->tasks[tasks->num_tasks];
264 + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
266 + task->c64x_arg[0] = dest;
267 + task->c64x_arg[1] = pitch;
268 + task->c64x_arg[2] = flags;
270 + task->c64x_function = C64X_PUT_IDCT_UYVY_16x16 | C64X_FLAG_TODO;
272 + tasks->num_tasks++;
276 +davinci_c64x_put_idct_uyvy_16x16( DavinciC64x *c64x,
277 + unsigned long dest,
281 + c64xTask *task = c64x_get_task( c64x );
283 + task->c64x_arg[0] = dest;
284 + task->c64x_arg[1] = pitch;
285 + task->c64x_arg[2] = flags;
287 + task->c64x_function = C64X_PUT_IDCT_UYVY_16x16 | C64X_FLAG_TODO;
289 + c64x_submit_task( c64x, task );
293 +davinci_c64x_put_mc_uyvy_16x16__L( DavinciC64xTasks *tasks,
294 + unsigned long dest,
298 + c64xTask *task = &tasks->tasks[tasks->num_tasks];
300 + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
302 + task->c64x_arg[0] = dest;
303 + task->c64x_arg[1] = pitch;
304 + task->c64x_arg[2] = flags;
306 + task->c64x_function = C64X_PUT_MC_UYVY_16x16 | C64X_FLAG_TODO;
308 + tasks->num_tasks++;
312 +davinci_c64x_put_mc_uyvy_16x16( DavinciC64x *c64x,
313 + unsigned long dest,
317 + c64xTask *task = c64x_get_task( c64x );
319 + task->c64x_arg[0] = dest;
320 + task->c64x_arg[1] = pitch;
321 + task->c64x_arg[2] = flags;
323 + task->c64x_function = C64X_PUT_MC_UYVY_16x16 | C64X_FLAG_TODO;
325 + c64x_submit_task( c64x, task );
329 +davinci_c64x_put_sum_uyvy_16x16__L( DavinciC64xTasks *tasks,
330 + unsigned long dest,
334 + c64xTask *task = &tasks->tasks[tasks->num_tasks];
336 + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
338 + task->c64x_arg[0] = dest;
339 + task->c64x_arg[1] = pitch;
340 + task->c64x_arg[2] = flags;
342 + task->c64x_function = C64X_PUT_SUM_UYVY_16x16 | C64X_FLAG_TODO;
344 + tasks->num_tasks++;
348 +davinci_c64x_put_sum_uyvy_16x16( DavinciC64x *c64x,
349 + unsigned long dest,
353 + c64xTask *task = c64x_get_task( c64x );
355 + task->c64x_arg[0] = dest;
356 + task->c64x_arg[1] = pitch;
357 + task->c64x_arg[2] = flags;
359 + task->c64x_function = C64X_PUT_SUM_UYVY_16x16 | C64X_FLAG_TODO;
361 + c64x_submit_task( c64x, task );
365 +davinci_c64x_dva_begin_frame__L( DavinciC64xTasks *tasks,
367 + unsigned long current,
368 + unsigned long past,
369 + unsigned long future,
372 + c64xTask *task = &tasks->tasks[tasks->num_tasks];
374 + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
376 + task->c64x_arg[0] = pitch;
377 + task->c64x_arg[1] = current;
378 + task->c64x_arg[2] = past;
379 + task->c64x_arg[3] = future;
380 + task->c64x_arg[4] = flags;
382 + task->c64x_function = C64X_DVA_BEGIN_FRAME | C64X_FLAG_TODO;
384 + tasks->num_tasks++;
388 +davinci_c64x_dva_begin_frame( DavinciC64x *c64x,
390 + unsigned long current,
391 + unsigned long past,
392 + unsigned long future,
395 + c64xTask *task = c64x_get_task( c64x );
397 + task->c64x_arg[0] = pitch;
398 + task->c64x_arg[1] = current;
399 + task->c64x_arg[2] = past;
400 + task->c64x_arg[3] = future;
401 + task->c64x_arg[4] = flags;
403 + task->c64x_function = C64X_DVA_BEGIN_FRAME | C64X_FLAG_TODO;
405 + c64x_submit_task( c64x, task );
409 +davinci_c64x_dva_motion_block__L( DavinciC64xTasks *tasks,
410 + unsigned long macroblock )
412 + c64xTask *task = &tasks->tasks[tasks->num_tasks];
414 + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
416 + task->c64x_arg[0] = macroblock;
418 + task->c64x_function = C64X_DVA_MOTION_BLOCK | C64X_FLAG_TODO;
420 + tasks->num_tasks++;
424 +davinci_c64x_dva_motion_block( DavinciC64x *c64x,
425 + unsigned long macroblock )
427 + c64xTask *task = c64x_get_task( c64x );
429 + task->c64x_arg[0] = macroblock;
431 + task->c64x_function = C64X_DVA_MOTION_BLOCK | C64X_FLAG_TODO;
433 + c64x_submit_task( c64x, task );
436 +/**********************************************************************************************************************/
439 +davinci_c64x_dva_idct( DavinciC64x *c64x,
440 + unsigned long dest,
442 + unsigned long source )
444 + c64xTask *task = c64x_get_task( c64x );
446 + task->c64x_arg[0] = dest;
447 + task->c64x_arg[1] = pitch;
448 + task->c64x_arg[2] = source;
450 + task->c64x_function = C64X_DVA_IDCT | C64X_FLAG_TODO;
452 + c64x_submit_task( c64x, task );
455 +/**********************************************************************************************************************/
458 +davinci_c64x_put_uyvy_16x16( DavinciC64x *c64x,
459 + unsigned long dest,
461 + unsigned long source,
464 + c64xTask *task = c64x_get_task( c64x );
466 + task->c64x_arg[0] = dest;
467 + task->c64x_arg[1] = pitch;
468 + task->c64x_arg[2] = source;
469 + task->c64x_arg[3] = flags;
471 + task->c64x_function = C64X_PUT_UYVY_16x16 | C64X_FLAG_TODO;
473 + c64x_submit_task( c64x, task );
477 +davinci_c64x_dither_argb__L( DavinciC64xTasks *tasks,
478 + unsigned long dst_rgb,
479 + unsigned long dst_alpha,
481 + unsigned long source,
486 + c64xTask *task = &tasks->tasks[tasks->num_tasks];
488 + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
490 + task->c64x_arg[0] = dst_rgb;
491 + task->c64x_arg[1] = dst_alpha;
492 + task->c64x_arg[2] = dst_pitch;
493 + task->c64x_arg[3] = source;
494 + task->c64x_arg[4] = src_pitch;
495 + task->c64x_arg[5] = width;
496 + task->c64x_arg[6] = height;
498 + task->c64x_function = C64X_DITHER_ARGB | C64X_FLAG_TODO;
500 + tasks->num_tasks++;
504 +davinci_c64x_dither_argb( DavinciC64x *c64x,
505 + unsigned long dst_rgb,
506 + unsigned long dst_alpha,
508 + unsigned long source,
513 + c64xTask *task = c64x_get_task( c64x );
515 + task->c64x_arg[0] = dst_rgb;
516 + task->c64x_arg[1] = dst_alpha;
517 + task->c64x_arg[2] = dst_pitch;
518 + task->c64x_arg[3] = source;
519 + task->c64x_arg[4] = src_pitch;
520 + task->c64x_arg[5] = width;
521 + task->c64x_arg[6] = height;
523 + task->c64x_function = C64X_DITHER_ARGB | C64X_FLAG_TODO;
525 + c64x_submit_task( c64x, task );
529 +davinci_c64x_fill_16__L( DavinciC64xTasks *tasks,
530 + unsigned long dest,
536 + c64xTask *task = &tasks->tasks[tasks->num_tasks];
538 + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
540 + task->c64x_arg[0] = dest;
541 + task->c64x_arg[1] = pitch;
542 + task->c64x_arg[2] = width;
543 + task->c64x_arg[3] = height;
544 + task->c64x_arg[4] = value;
546 + task->c64x_function = C64X_FILL_16 | C64X_FLAG_TODO;
548 + tasks->num_tasks++;
552 +davinci_c64x_fill_16( DavinciC64x *c64x,
553 + unsigned long dest,
559 + c64xTask *task = c64x_get_task( c64x );
561 + task->c64x_arg[0] = dest;
562 + task->c64x_arg[1] = pitch;
563 + task->c64x_arg[2] = width;
564 + task->c64x_arg[3] = height;
565 + task->c64x_arg[4] = value;
567 + task->c64x_function = C64X_FILL_16 | C64X_FLAG_TODO;
569 + c64x_submit_task( c64x, task );
573 +davinci_c64x_fill_32__L( DavinciC64xTasks *tasks,
574 + unsigned long dest,
580 + c64xTask *task = &tasks->tasks[tasks->num_tasks];
582 + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
584 + task->c64x_arg[0] = dest;
585 + task->c64x_arg[1] = pitch;
586 + task->c64x_arg[2] = width;
587 + task->c64x_arg[3] = height;
588 + task->c64x_arg[4] = value;
590 + task->c64x_function = C64X_FILL_32 | C64X_FLAG_TODO;
592 + tasks->num_tasks++;
596 +davinci_c64x_fill_32( DavinciC64x *c64x,
597 + unsigned long dest,
603 + c64xTask *task = c64x_get_task( c64x );
605 + task->c64x_arg[0] = dest;
606 + task->c64x_arg[1] = pitch;
607 + task->c64x_arg[2] = width;
608 + task->c64x_arg[3] = height;
609 + task->c64x_arg[4] = value;
611 + task->c64x_function = C64X_FILL_32 | C64X_FLAG_TODO;
613 + c64x_submit_task( c64x, task );
617 +davinci_c64x_blit_16__L( DavinciC64xTasks *tasks,
618 + unsigned long dest,
625 + c64xTask *task = &tasks->tasks[tasks->num_tasks];
627 + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
629 + task->c64x_arg[0] = dest;
630 + task->c64x_arg[1] = dpitch;
631 + task->c64x_arg[2] = src;
632 + task->c64x_arg[3] = spitch;
633 + task->c64x_arg[4] = width;
634 + task->c64x_arg[5] = height;
636 + task->c64x_function = C64X_COPY_16 | C64X_FLAG_TODO;
638 + tasks->num_tasks++;
642 +davinci_c64x_blit_16( DavinciC64x *c64x,
643 + unsigned long dest,
650 + c64xTask *task = c64x_get_task( c64x );
652 + task->c64x_arg[0] = dest;
653 + task->c64x_arg[1] = dpitch;
654 + task->c64x_arg[2] = src;
655 + task->c64x_arg[3] = spitch;
656 + task->c64x_arg[4] = width;
657 + task->c64x_arg[5] = height;
659 + task->c64x_function = C64X_COPY_16 | C64X_FLAG_TODO;
661 + c64x_submit_task( c64x, task );
665 +davinci_c64x_blit_32__L( DavinciC64xTasks *tasks,
666 + unsigned long dest,
673 + c64xTask *task = &tasks->tasks[tasks->num_tasks];
675 + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
677 + task->c64x_arg[0] = dest;
678 + task->c64x_arg[1] = dpitch;
679 + task->c64x_arg[2] = src;
680 + task->c64x_arg[3] = spitch;
681 + task->c64x_arg[4] = width;
682 + task->c64x_arg[5] = height;
684 + task->c64x_function = C64X_COPY_32 | C64X_FLAG_TODO;
686 + tasks->num_tasks++;
690 +davinci_c64x_blit_32( DavinciC64x *c64x,
691 + unsigned long dest,
698 + c64xTask *task = c64x_get_task( c64x );
700 + task->c64x_arg[0] = dest;
701 + task->c64x_arg[1] = dpitch;
702 + task->c64x_arg[2] = src;
703 + task->c64x_arg[3] = spitch;
704 + task->c64x_arg[4] = width;
705 + task->c64x_arg[5] = height;
707 + task->c64x_function = C64X_COPY_32 | C64X_FLAG_TODO;
709 + c64x_submit_task( c64x, task );
713 +davinci_c64x_stretch_32__L( DavinciC64xTasks *tasks,
714 + unsigned long dest,
722 + const DFBRegion *clip )
724 + c64xTask *task = &tasks->tasks[tasks->num_tasks];
726 + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
728 + task->c64x_arg[0] = dest;
729 + task->c64x_arg[1] = src;
730 + task->c64x_arg[2] = dpitch | (spitch << 16);
731 + task->c64x_arg[3] = dh | (dw << 16);
732 + task->c64x_arg[4] = sh | (sw << 16);
733 + task->c64x_arg[5] = clip->x2 | (clip->y2 << 16);
734 + task->c64x_arg[6] = clip->x1 | (clip->y1 << 16);
736 + if (sw > dw && sh > dh)
737 + task->c64x_function = C64X_STRETCH_32_down | C64X_FLAG_TODO;
739 + task->c64x_function = C64X_STRETCH_32_up | C64X_FLAG_TODO;
741 + tasks->num_tasks++;
745 +davinci_c64x_stretch_32( DavinciC64x *c64x,
746 + unsigned long dest,
754 + const DFBRegion *clip )
756 + c64xTask *task = c64x_get_task( c64x );
758 + task->c64x_arg[0] = dest;
759 + task->c64x_arg[1] = src;
760 + task->c64x_arg[2] = dpitch | (spitch << 16);
761 + task->c64x_arg[3] = dh | (dw << 16);
762 + task->c64x_arg[4] = sh | (sw << 16);
763 + task->c64x_arg[5] = clip->x2 | (clip->y2 << 16);
764 + task->c64x_arg[6] = clip->x1 | (clip->y1 << 16);
766 + if (sw > dw && sh > dh)
767 + task->c64x_function = C64X_STRETCH_32_down | C64X_FLAG_TODO;
769 + task->c64x_function = C64X_STRETCH_32_up | C64X_FLAG_TODO;
771 + c64x_submit_task( c64x, task );
775 +davinci_c64x_blit_blend_32__L( DavinciC64xTasks *tasks,
777 + unsigned long dest,
786 + c64xTask *task = &tasks->tasks[tasks->num_tasks];
788 + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
790 + task->c64x_arg[0] = dest;
791 + task->c64x_arg[1] = dpitch;
792 + task->c64x_arg[2] = src;
793 + task->c64x_arg[3] = spitch;
794 + task->c64x_arg[4] = width | (height << 16);
795 + task->c64x_arg[5] = argb;
796 + task->c64x_arg[6] = alpha;
798 + task->c64x_function = (sub_func << 16) | C64X_BLEND_32 | C64X_FLAG_TODO;
800 + tasks->num_tasks++;
804 +davinci_c64x_blit_blend_32( DavinciC64x *c64x,
806 + unsigned long dest,
815 + c64xTask *task = c64x_get_task( c64x );
817 + task->c64x_arg[0] = dest;
818 + task->c64x_arg[1] = dpitch;
819 + task->c64x_arg[2] = src;
820 + task->c64x_arg[3] = spitch;
821 + task->c64x_arg[4] = width | (height << 16);
822 + task->c64x_arg[5] = argb;
823 + task->c64x_arg[6] = alpha;
825 + task->c64x_function = (sub_func << 16) | C64X_BLEND_32 | C64X_FLAG_TODO;
827 + c64x_submit_task( c64x, task );
831 +davinci_c64x_blit_keyed_16__L( DavinciC64xTasks *tasks,
832 + unsigned long dest,
841 + c64xTask *task = &tasks->tasks[tasks->num_tasks];
843 + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
845 + task->c64x_arg[0] = dest;
846 + task->c64x_arg[1] = (dpitch << 16) | (spitch & 0xffff);
847 + task->c64x_arg[2] = src;
848 + task->c64x_arg[3] = width;
849 + task->c64x_arg[4] = height;
850 + task->c64x_arg[5] = key;
851 + task->c64x_arg[6] = mask;
853 + task->c64x_function = C64X_COPY_KEYED_16 | C64X_FLAG_TODO;
855 + tasks->num_tasks++;
859 +davinci_c64x_blit_keyed_16( DavinciC64x *c64x,
860 + unsigned long dest,
869 + c64xTask *task = c64x_get_task( c64x );
871 + task->c64x_arg[0] = dest;
872 + task->c64x_arg[1] = (dpitch << 16) | (spitch & 0xffff);
873 + task->c64x_arg[2] = src;
874 + task->c64x_arg[3] = width;
875 + task->c64x_arg[4] = height;
876 + task->c64x_arg[5] = key;
877 + task->c64x_arg[6] = mask;
879 + task->c64x_function = C64X_COPY_KEYED_16 | C64X_FLAG_TODO;
881 + c64x_submit_task( c64x, task );
885 +davinci_c64x_blit_keyed_32__L( DavinciC64xTasks *tasks,
886 + unsigned long dest,
895 + c64xTask *task = &tasks->tasks[tasks->num_tasks];
897 + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
899 + task->c64x_arg[0] = dest;
900 + task->c64x_arg[1] = (dpitch << 16) | (spitch & 0xffff);
901 + task->c64x_arg[2] = src;
902 + task->c64x_arg[3] = width;
903 + task->c64x_arg[4] = height;
904 + task->c64x_arg[5] = key;
905 + task->c64x_arg[6] = mask;
907 + task->c64x_function = C64X_COPY_KEYED_32 | C64X_FLAG_TODO;
909 + tasks->num_tasks++;
913 +davinci_c64x_blit_keyed_32( DavinciC64x *c64x,
914 + unsigned long dest,
923 + c64xTask *task = c64x_get_task( c64x );
925 + task->c64x_arg[0] = dest;
926 + task->c64x_arg[1] = (dpitch << 16) | (spitch & 0xffff);
927 + task->c64x_arg[2] = src;
928 + task->c64x_arg[3] = width;
929 + task->c64x_arg[4] = height;
930 + task->c64x_arg[5] = key;
931 + task->c64x_arg[6] = mask;
933 + task->c64x_function = C64X_COPY_KEYED_32 | C64X_FLAG_TODO;
935 + c64x_submit_task( c64x, task );
940 diff -urNp DirectFB-1.5.3_orig/gfxdrivers/davinci/davincifb.h DirectFB-1.5.3/gfxdrivers/davinci/davincifb.h
941 --- DirectFB-1.5.3_orig/gfxdrivers/davinci/davincifb.h 1969-12-31 19:00:00.000000000 -0500
942 +++ DirectFB-1.5.3/gfxdrivers/davinci/davincifb.h 2012-05-09 02:20:07.271230380 -0400
945 + * Copyright (C) 2006 Texas Instruments Inc
947 + * This program is free software; you can redistribute it and/or modify
948 + * it under the terms of the GNU General Public License as published by
949 + * the Free Software Foundation; either version 2 of the License, or
950 + * (at your option)any later version.
952 + * This program is distributed in the hope that it will be useful,
953 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
954 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
955 + * GNU General Public License for more details.
957 + * You should have received a copy of the GNU General Public License
958 + * along with this program; if not, write to the Free Software
959 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
961 + * File: davincifb.h
964 +#ifndef DAVINVI_VPBE_H
965 +#define DAVINVI_VPBE_H
967 +/* include Linux files */
968 +#include <linux/fb.h>
970 +/* define the custom FBIO_WAITFORVSYNC ioctl */
971 +#define FBIO_WAITFORVSYNC _IOW('F', 0x20, u_int32_t)
972 +#define FBIO_SETATTRIBUTE _IOW('F', 0x21, struct fb_fillrect)
974 +/* Backported IOCTLS. */
975 +#define FBIO_SETPOSX _IOW('F', 0x22, u_int32_t)
976 +#define FBIO_SETPOSY _IOW('F', 0x23, u_int32_t)
977 +#define FBIO_SETZOOM _IOW('F', 0x24, struct zoom_params)
978 +#define FBIO_GETSTD _IOR('F', 0x25, u_int32_t)
979 +#define FBIO_RESIZER _IOW('F', 0x26, struct vpfe_resizer_params)
980 +#define FBIO_SYNC _IOW('F', 0x27, u_int32_t)
982 +typedef struct zoom_params {
983 + u_int32_t window_id;
988 +typedef struct vpfe_resizer_params
990 + u_int32_t rsz_cnt; //busy-lock
991 + u_int32_t out_size; //busy-lock
992 + u_int32_t in_start; //busy-lock
993 + u_int32_t in_size; //busy-lock
994 + u_int32_t sdr_inadd; //shadowed
995 + u_int32_t sdr_inoff; //shadowed
996 + u_int32_t sdr_outadd; //shadowed
997 + u_int32_t sdr_outoff; //shadowed
998 + u_int32_t hfilt[16]; //busy-lock
999 + u_int32_t vfilt[16]; //busy-lock
1000 + u_int32_t yenh; //busy-lock
1001 +} vpfe_resizer_params_t;
1003 +typedef struct fb_set_start {
1004 + int offset; /* offset from smem_start */
1005 + unsigned long physical; /* absolute physical address when offset < 0 */
1007 + u_int64_t sync; /* input: target sync counter for change or 0 for no sync at all,
1008 + output: sync counter of actual change or 0 if still pending */
1012 +#ifdef _IOC_TYPECHECK
1013 +#undef _IOC_TYPECHECK
1014 +#define _IOC_TYPECHECK(x) (sizeof(x))
1017 +#define RAM_CLUT_SIZE 256*3
1018 +#define FBIO_ENABLE_DISABLE_WIN \
1019 + _IOW('F', 0x30, unsigned char)
1020 +#define FBIO_SET_BITMAP_BLEND_FACTOR \
1021 + _IOW('F', 0x31, vpbe_bitmap_blend_params_t)
1022 +#define FBIO_SET_BITMAP_WIN_RAM_CLUT \
1023 + _IOW('F', 0x32, unsigned char)*RAM_CLUT_SIZE)
1024 +#define FBIO_ENABLE_DISABLE_ATTRIBUTE_WIN \
1025 + _IOW('F', 0x33, unsigned int)
1026 +#define FBIO_GET_BLINK_INTERVAL \
1027 + _IOR('F', 0x34, vpbe_blink_option_t)
1028 +#define FBIO_SET_BLINK_INTERVAL \
1029 + _IOW('F', 0x35, vpbe_blink_option_t)
1030 +#define FBIO_GET_VIDEO_CONFIG_PARAMS \
1031 + _IOR('F', 0x36, vpbe_video_config_params_t)
1032 +#define FBIO_SET_VIDEO_CONFIG_PARAMS \
1033 + _IOW('F', 0x37, vpbe_video_config_params_t)
1034 +#define FBIO_GET_BITMAP_CONFIG_PARAMS \
1035 + _IOR('F', 0x38, vpbe_bitmap_config_params_t)
1036 +#define FBIO_SET_BITMAP_CONFIG_PARAMS \
1037 + _IOW('F', 0x39, vpbe_bitmap_config_params_t)
1038 +#define FBIO_SET_DCLK \
1039 + _IOW('F', 0x40, vpbe_dclk_t)
1040 +#define FBIO_SET_INTERFACE \
1041 + _IOW('F', 0x41, unsigned char)
1042 +#define FBIO_GET_INTERFACE \
1043 + _IOR('F', 0x42, unsigned char)
1044 +#define FBIO_QUERY_TIMING \
1045 + _IOWR('F', 0x43, struct vpbe_mode_info)
1046 +#define FBIO_SET_TIMING \
1047 + _IOW('F', 0x44, struct vpbe_fb_videomode)
1048 +#define FBIO_GET_TIMING \
1049 + _IOR('F', 0x45, struct vpbe_fb_videomode)
1050 +#define FBIO_SET_VENC_CLK_SOURCE \
1051 + _IOW('F', 0x46, unsigned char)
1052 +#define FBIO_SET_BACKG_COLOR \
1053 + _IOW('F', 0x47, vpbe_backg_color_t)
1054 +#define FBIO_ENABLE_DISPLAY \
1055 + _IOW('F', 0x48, unsigned char)
1056 +#define FBIO_SETPOS \
1057 + _IOW('F', 0x49, u_int32_t)
1058 +#define FBIO_SET_CURSOR \
1059 + _IOW('F', 0x50, struct fb_cursor)
1060 +#define FBIO_SET_START \
1061 + _IOW('F', 0x66, struct fb_set_start)
1064 + * Defines and Constants
1067 +#define DAVINCIFB_DEVICE "davincifb"
1068 +#define DAVINCIFB_DRIVER "davincifb"
1070 +#define MULTIPLE_BUFFERING 1
1072 +#ifdef MULTIPLE_BUFFERING
1073 +#define DOUBLE_BUF 2
1074 +#define TRIPLE_BUF 3
1076 +#define DOUBLE_BUF 1
1077 +#define TRIPLE_BUF 1
1080 +/* usage: if (is_win(info->fix.id, OSD0)) ... */
1081 +#define is_win(name, x) ((strcmp(name, x ## _FBNAME) == 0) ? 1 : 0)
1084 + * display controller register I/O routines
1086 +u32 dispc_reg_in(u32 offset);
1087 +u32 dispc_reg_out(u32 offset, u32 val);
1088 +u32 dispc_reg_merge(u32 offset, u32 val, u32 mask);
1090 +#endif /*__KERNEL__*/
1092 +/* Error return codes */
1093 +#define VPBE_INVALID_PARA_VALUE 700
1094 +#define VPBE_WRONG_WINDOW_ID 701
1095 +#define VPBE_CURRENTLY_IN_REQUIRED_MODE 702
1096 +#define VPBE_INSUFFICIENT_CLUT_VALUES 703
1097 +#define VPBE_CLUT_WRITE_TIMEOUT 704
1098 +#define VPBE_VID0_BUF_ADR_NULL 705
1099 +#define VPBE_WINDOW_NOT_DISABLED 706
1100 +#define VPBE_WINDOW_NOT_ENABLED 707
1103 +/* Window ID definations */
1110 +/* There are 4 framebuffers, each represented by an fb_info and
1111 + * a dm_win_info structure */
1112 +#define OSD0_FBNAME "dm_osd0_fb"
1113 +#define OSD1_FBNAME "dm_osd1_fb"
1114 +#define VID0_FBNAME "dm_vid0_fb"
1115 +#define VID1_FBNAME "dm_vid1_fb"
1117 +/* FIXME: Digital LCD RGB matrix coefficients */
1118 +#define DLCD_DGY_VAL 0
1119 +#define DLCD_DRV_VAL 0
1120 +#define DLCD_DGU_VAL 0
1121 +#define DLCD_DBU_VAL 0
1123 +/* Defines for bitmap format */
1124 +#define VPBE_BITMAP_BIT_1 1
1125 +#define VPBE_BITMAP_BIT_2 2
1126 +#define VPBE_BITMAP_BIT_4 4
1127 +#define VPBE_BITMAP_BIT_8 8
1128 +#define VPBE_BITMAP_RGB565 16
1129 +#define VPBE_VIDEO_YUV422 16
1130 +#define VPBE_VIDEO_RGB888 24
1132 +/* Defines foe cursor parameter validation*/
1133 +#define MAX_CURSOR_WIDTH 0x3FF
1134 +#define MAX_CURSOR_HEIGHT 0x1FF
1135 +#define MAX_CURSOR_LINEWIDTH 7
1139 +#define BASEX_DLCD 0x59
1140 +#define BASEY_DLCD 0x22
1145 +/* Enum for blending factor */
1146 +typedef enum vpbe_blend_factor {
1147 + OSD_CONTRIBUTION_ZERO = 0,
1148 + OSD_CONTRIBUTION_1_BY_8 = 1,
1149 + OSD_CONTRIBUTION_2_BY_8 = 2,
1150 + OSD_CONTRIBUTION_3_BY_8 = 3,
1151 + OSD_CONTRIBUTION_4_BY_8 = 4,
1152 + OSD_CONTRIBUTION_5_BY_8 = 5,
1153 + OSD_CONTRIBUTION_6_BY_8 = 6,
1154 + OSD_CONTRIBUTION_ONE = 7
1155 +} vpbe_blend_factor_t;
1157 +/* Enum for Boolean variables */
1161 +} CB_CR_ORDER, ATTRIBUTE, ROM_RAM_CLUT;
1163 +/* Defines for Display Interface */
1165 +#define COMPOSITE 1
1167 +#define COMPONENT 3
1176 +#define VPBE_MAX_INTERFACES 12
1178 +/* Defines for Display Mode */
1185 +#define DEFAULT_MODE 0
1189 +#define NON_EXISTING_MODE 255
1190 +/* Enable/Disable enum */
1194 +} ATTENUATION, TRANSPARENCY, EXPANSION, BLINKING;
1196 +typedef enum clk_source {
1197 + CLK_SOURCE_CLK27 = 0,
1198 + CLK_SOURCE_CLK54 = 1,
1199 + CLK_SOURCE_VPBECLK = 2
1203 + * Structures and Union Definitions
1206 +/* Structure for transparency and the blending factor for the bitmap window */
1207 +typedef struct vpbe_bitmap_blend_params {
1208 + unsigned int colorkey; /* color key to be blend */
1209 + unsigned int enable_colorkeying; /* enable color keying */
1210 + unsigned int bf; /* valid range from 0 to 7 only. */
1211 +} vpbe_bitmap_blend_params_t;
1213 +/* Structure for window expansion */
1214 +typedef struct vpbe_win_expansion {
1215 + EXPANSION horizontal;
1216 + EXPANSION vertical; /* 1: Enable 0:disable */
1217 +} vpbe_win_expansion_t;
1219 +/* Structure for OSD window blinking options */
1220 +typedef struct vpbe_blink_option {
1221 + BLINKING blinking; /* 1: Enable blinking 0: Disable */
1222 + unsigned int interval; /* Valid only if blinking is 1 */
1223 +} vpbe_blink_option_t;
1225 +/* Structure for DCLK parameters */
1226 +typedef struct vpbe_dclk {
1227 + unsigned char dclk_pattern_width;
1228 + unsigned int dclk_pattern0;
1229 + unsigned int dclk_pattern1;
1230 + unsigned int dclk_pattern2;
1231 + unsigned int dclk_pattern3;
1234 +/* Structure for display format */
1235 +typedef struct vpbe_display_format {
1236 + unsigned char interface; /* Output interface type */
1237 + unsigned char mode; /* output mode */
1238 +} vpbe_display_format_t;
1240 +/* Structure for background color */
1241 +typedef struct vpbe_backg_color {
1242 + unsigned char clut_select; /* 2: RAM CLUT 1:ROM1 CLUT 0:ROM0 CLUT */
1243 + unsigned char color_offset; /* index of color */
1244 +} vpbe_backg_color_t;
1246 +/* Structure for Video window configurable parameters */
1247 +typedef struct vpbe_video_config_params {
1248 + CB_CR_ORDER cb_cr_order; /*Cb/Cr order in input data for a pixel. */
1249 + /* 0: cb cr 1: cr cb */
1250 + vpbe_win_expansion_t exp_info; /* HZ/VT Expansion enable disable */
1251 +} vpbe_video_config_params_t;
1253 +/*Union of structures giving the CLUT index for the 1, 2, 4 bit bitmap values.*/
1254 +typedef union vpbe_clut_idx {
1255 + struct _for_4bit_bimap {
1256 + unsigned char bitmap_val_0;
1257 + unsigned char bitmap_val_1;
1258 + unsigned char bitmap_val_2;
1259 + unsigned char bitmap_val_3;
1260 + unsigned char bitmap_val_4;
1261 + unsigned char bitmap_val_5;
1262 + unsigned char bitmap_val_6;
1263 + unsigned char bitmap_val_7;
1264 + unsigned char bitmap_val_8;
1265 + unsigned char bitmap_val_9;
1266 + unsigned char bitmap_val_10;
1267 + unsigned char bitmap_val_11;
1268 + unsigned char bitmap_val_12;
1269 + unsigned char bitmap_val_13;
1270 + unsigned char bitmap_val_14;
1271 + unsigned char bitmap_val_15;
1273 + struct _for_2bit_bimap {
1274 + unsigned char bitmap_val_0;
1275 + unsigned char dummy0[4];
1276 + unsigned char bitmap_val_1;
1277 + unsigned char dummy1[4];
1278 + unsigned char bitmap_val_2;
1279 + unsigned char dummy2[4];
1280 + unsigned char bitmap_val_3;
1282 + struct _for_1bit_bimap {
1283 + unsigned char bitmap_val_0;
1284 + unsigned char dummy0[14];
1285 + unsigned char bitmap_val_1;
1289 +/* Structure for bitmap window configurable parameters */
1290 +typedef struct vpbe_bitmap_config_params {
1291 + /* Only for bitmap width = 1,2,4 bits */
1292 + vpbe_clut_idx_t clut_idx;
1293 + /* Attenuation value for YUV o/p for bitmap window */
1294 + unsigned char attenuation_enable;
1295 + /* 0: ROM DM270, 1:ROM DM320, 2:RAM CLUT */
1296 + unsigned char clut_select;
1297 +} vpbe_bitmap_config_params_t;
1299 +/* Unioun for video/OSD configuration parameters */
1300 +typedef union vpbe_conf_params {
1302 + struct vpbe_video_params {
1303 + CB_CR_ORDER cb_cr_order;
1304 + /* HZ/VT Expansion enable disable */
1305 + vpbe_win_expansion_t exp_info;
1308 + struct vpbe_bitmap_params {
1309 + /* Attenuation value for YUV o/p */
1310 + ATTENUATION attenuation_enable;
1311 + /* 0: ROM DM270, 1: ROM DM320, 2:RAM CLUT */
1312 + unsigned char clut_select;
1313 + /* Only for bitmap width = 1,2,4 bits */
1314 + vpbe_clut_idx_t clut_idx;
1315 + /* 0: OSD window is bitmap window */
1316 + /* 1: OSD window is attribute window */
1317 + ATTRIBUTE enable_attribute;
1318 + /* To hold bps value.
1319 + Used to switch back from attribute to bitmap. */
1320 + unsigned int stored_bits_per_pixel;
1321 + /* Blending information */
1322 + vpbe_bitmap_blend_params_t blend_info;
1323 + /* OSD Blinking information */
1324 + vpbe_blink_option_t blink_info;
1327 +} vpbe_conf_params_t;
1329 +typedef struct vpbe_video_params vpbe_video_params_t;
1330 +typedef struct vpbe_bitmap_params vpbe_bitmap_params_t;
1332 +/* Structure to hold window position */
1333 +typedef struct vpbe_window_position {
1334 + unsigned int xpos; /* X position of the window */
1335 + unsigned int ypos; /* Y position of the window */
1336 +} vpbe_window_position_t;
1339 +/* Structure for each window */
1340 +typedef struct vpbe_dm_win_info {
1341 + struct fb_info info;
1342 + vpbe_window_position_t win_pos; /* X,Y position of window */
1343 + /* Size of window is already there in var_info structure. */
1345 + dma_addr_t fb_base_phys; /*framebuffer area */
1346 + unsigned int fb_base; /*window memory pointer */
1347 + unsigned int fb_size; /*memory size */
1348 + unsigned int pseudo_palette[17];
1350 + /*flag to identify if framebuffer area is fixed or not */
1351 + unsigned long sdram_address;
1352 + struct vpbe_dm_info *dm;
1353 + unsigned char window_enable; /*Additions for all windows */
1354 + zoom_params_t zoom; /*Zooming parameters */
1355 + unsigned char field_frame_select; /*To select Field or frame */
1356 + unsigned char numbufs; /*Number of buffers valid 2 or 3 */
1357 + vpbe_conf_params_t conf_params;
1358 + /*window configuration parameter union pointer */
1359 +} vpbe_dm_win_info_t;
1360 +#endif /*__KERNEL__*/
1363 + * Videmode structure for display interface and mode settings
1365 +typedef struct vpbe_fb_videomode {
1366 + unsigned char name[10]; /* Mode name ( NTSC , PAL) */
1367 + unsigned int vmode; /* FB_MODE_INTERLACED or FB_MODE_NON_INTERLACED */
1368 + unsigned int xres; /* X Resolution of the display */
1369 + unsigned int yres; /* Y Resolution of the display */
1370 + unsigned int fps; /* frames per second */
1371 + /* Timing Parameters applicable for std = 0 only */
1372 + unsigned int left_margin;
1373 + unsigned int right_margin;
1374 + unsigned int upper_margin;
1375 + unsigned int lower_margin;
1376 + unsigned int hsync_len;
1377 + unsigned int vsync_len;
1378 + unsigned int sync; /* 0: hsync -ve/vsync -ve */
1379 + /*1: hsync -ve/vsync +ve */
1380 + /*2: hsync +ve/vsync -ve */
1381 + /*3: hsync +ve/vsync +ve */
1382 + unsigned int basepx; /* Display x,y start position */
1383 + unsigned int basepy;
1384 +/* 1= Mode s available in modelist 0=Mode is not available in modelist */
1386 +} vpbe_fb_videomode_t;
1388 +/* Structure to interface videomode to application*/
1389 +typedef struct vpbe_mode_info {
1390 + vpbe_fb_videomode_t vid_mode;
1391 + unsigned char interface;
1392 + unsigned char mode_idx;
1393 +} vpbe_mode_info_t;
1397 + * Structure for the driver holding information of windows,
1398 + * memory base addresses etc.
1400 +typedef struct vpbe_dm_info {
1401 + vpbe_dm_win_info_t *osd0;
1402 + vpbe_dm_win_info_t *osd1;
1403 + vpbe_dm_win_info_t *vid0;
1404 + vpbe_dm_win_info_t *vid1;
1406 +/* to map the registers */
1407 + dma_addr_t mmio_base_phys;
1408 + unsigned int mmio_base;
1409 + unsigned int mmio_size;
1411 + wait_queue_head_t vsync_wait;
1412 + unsigned int vsync_cnt;
1415 + /* this is the function that configures the output device (NTSC/PAL/LCD)
1416 + * for the required output format (composite/s-video/component/rgb)
1418 + void (*output_device_config) (void);
1420 + struct device *dev;
1422 + vpbe_backg_color_t backg; /* background color */
1423 + vpbe_dclk_t dclk; /*DCLK parameters */
1424 + vpbe_display_format_t display; /*Display interface and mode */
1425 + vpbe_fb_videomode_t videomode; /*Cuurent videomode */
1426 + char ram_clut[256][3]; /*RAM CLUT array */
1427 + struct fb_cursor cursor; /* cursor config params from fb.h */
1428 +/*Flag that indicates whether any of the display is enabled or not*/
1429 + int display_enable;
1433 + * Functions Definitions for 'davincifb' module
1435 +int vpbe_mem_alloc_window_buf(vpbe_dm_win_info_t *);
1436 +int vpbe_mem_release_window_buf(vpbe_dm_win_info_t *);
1437 +void init_display_function(vpbe_display_format_t *);
1438 +int vpbe_mem_alloc_struct(vpbe_dm_win_info_t **);
1439 +void set_vid0_default_conf(void);
1440 +void set_vid1_default_conf(void);
1441 +void set_osd0_default_conf(void);
1442 +void set_osd1_default_conf(void);
1443 +void set_cursor_default_conf(void);
1444 +void set_dm_default_conf(void);
1445 +void set_win_enable(char *, unsigned int);
1446 +int within_vid0_limits(u32, u32, u32, u32);
1447 +void vpbe_set_display_default(void);
1449 +void set_win_position(char *, u32, u32, u32, u32);
1450 +void change_win_param(int);
1451 +void set_interlaced(char *, unsigned int);
1452 +#endif /* __KERNEL__ */
1455 + * Function definations for 'osd' module
1458 +int vpbe_enable_window(vpbe_dm_win_info_t *);
1459 +int vpbe_disable_window(vpbe_dm_win_info_t *);
1460 +int vpbe_vid_osd_select_field_frame(u8 *, u8);
1461 +int vpbe_bitmap_set_blend_factor(u8 *, vpbe_bitmap_blend_params_t *);
1462 +int vpbe_bitmap_set_ram_clut(void);
1463 +int vpbe_enable_disable_attribute_window(u32);
1464 +int vpbe_get_blinking(u8 *, vpbe_blink_option_t *);
1465 +int vpbe_set_blinking(u8 *, vpbe_blink_option_t *);
1466 +int vpbe_set_vid_params(u8 *, vpbe_video_config_params_t *);
1467 +int vpbe_get_vid_params(u8 *, vpbe_video_config_params_t *);
1468 +int vpbe_bitmap_get_params(u8 *, vpbe_bitmap_config_params_t *);
1469 +int vpbe_bitmap_set_params(u8 *, vpbe_bitmap_config_params_t *);
1470 +int vpbe_set_cursor_params(struct fb_cursor *);
1471 +int vpbe_set_vid_expansion(vpbe_win_expansion_t *);
1472 +int vpbe_set_dclk(vpbe_dclk_t *);
1473 +int vpbe_set_display_format(vpbe_display_format_t *);
1474 +int vpbe_set_backg_color(vpbe_backg_color_t *);
1475 +int vpbe_set_interface(u8);
1476 +int vpbe_query_mode(vpbe_mode_info_t *);
1477 +int vpbe_set_mode(struct vpbe_fb_videomode *);
1478 +int vpbe_set_venc_clk_source(u8);
1479 +void set_vid0_default_conf(void);
1480 +void set_osd0_default_conf(void);
1481 +void set_vid1_default_conf(void);
1482 +void set_osd1_default_conf(void);
1483 +void set_cursor_default_conf(void);
1484 +void set_dm_default_conf(void);
1486 + * Function definations for 'venc' module
1489 +void davincifb_ntsc_composite_config(void);
1490 +void davincifb_ntsc_svideo_config(void);
1491 +void davincifb_ntsc_component_config(void);
1492 +void davincifb_pal_composite_config(void);
1493 +void davincifb_pal_svideo_config(void);
1494 +void davincifb_pal_component_config(void);
1496 +void vpbe_davincifb_ntsc_rgb_config(void);
1497 +void vpbe_davincifb_pal_rgb_config(void);
1498 +void vpbe_davincifb_525p_component_config(void);
1499 +void vpbe_davincifb_625p_component_config(void);
1501 +void vpbe_enable_venc(int);
1502 +void vpbe_enable_dacs(int);
1504 + * Function definations for 'dlcd' module
1506 +void vpbe_davincifb_480p_prgb_config(void);
1507 +void vpbe_davincifb_400p_prgb_config(void);
1508 +void vpbe_davincifb_350p_prgb_config(void);
1509 +void vpbe_set_display_timing(struct vpbe_fb_videomode *);
1511 +void vpbe_enable_lcd(int);
1513 + * Following functions are not implemented
1515 +void vpbe_davincifb_default_ycc16_config(void);
1516 +void vpbe_davincifb_default_ycc8_config(void);
1517 +void vpbe_davincifb_default_srgb_config(void);
1518 +void vpbe_davincifb_default_epson_config(void);
1519 +void vpbe_davincifb_default_casio_config(void);
1520 +void vpbe_davincifb_default_UDISP_config(void);
1521 +void vpbe_davincifb_default_STN_config(void);
1522 +#endif /*__KERNEL__*/
1524 +#endif /* End of #ifndef DAVINCI_VPBE_H */
1525 diff -urNp DirectFB-1.5.3_orig/gfxdrivers/davinci/davinci_gfxdriver.h DirectFB-1.5.3/gfxdrivers/davinci/davinci_gfxdriver.h
1526 --- DirectFB-1.5.3_orig/gfxdrivers/davinci/davinci_gfxdriver.h 1969-12-31 19:00:00.000000000 -0500
1527 +++ DirectFB-1.5.3/gfxdrivers/davinci/davinci_gfxdriver.h 2012-05-09 02:19:40.797421031 -0400
1530 + TI Davinci driver - Graphics Driver
1532 + (c) Copyright 2007 Telio AG
1534 + Written by Denis Oliver Kropp <dok@directfb.org>
1536 + Code is derived from VMWare driver.
1538 + (c) Copyright 2001-2009 The world wide DirectFB Open Source Community (directfb.org)
1539 + (c) Copyright 2000-2004 Convergence (integrated media) GmbH
1541 + All rights reserved.
1543 + This library is free software; you can redistribute it and/or
1544 + modify it under the terms of the GNU Lesser General Public
1545 + License as published by the Free Software Foundation; either
1546 + version 2 of the License, or (at your option) any later version.
1548 + This library is distributed in the hope that it will be useful,
1549 + but WITHOUT ANY WARRANTY; without even the implied warranty of
1550 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1551 + Lesser General Public License for more details.
1553 + You should have received a copy of the GNU Lesser General Public
1554 + License along with this library; if not, write to the
1555 + Free Software Foundation, Inc., 59 Temple Place - Suite 330,
1556 + Boston, MA 02111-1307, USA.
1559 +#ifndef __DAVINCI_GFXDRIVER_H__
1560 +#define __DAVINCI_GFXDRIVER_H__
1562 +#include <sys/ioctl.h>
1563 +#include <davincifb.h>
1565 +#include <core/surface_buffer.h>
1567 +#include "davincifb.h"
1569 +#include "davinci_c64x.h"
1573 + /* validation flags */
1576 + /* cached/computed values */
1578 + unsigned long dst_phys;
1579 + unsigned int dst_size;
1580 + unsigned long dst_pitch;
1581 + DFBSurfacePixelFormat dst_format;
1582 + unsigned long dst_bpp;
1585 + unsigned long src_phys;
1586 + unsigned long src_pitch;
1587 + DFBSurfacePixelFormat src_format;
1588 + unsigned long src_bpp;
1590 + unsigned long source_mult;
1592 + unsigned long fillcolor;
1594 + int blit_blend_sub_function;
1595 + int draw_blend_sub_function;
1598 + unsigned long color_argb;
1599 + unsigned long colorkey;
1601 + DFBSurfaceBlittingFlags blitting_flags;
1605 + /** Add shared data here... **/
1606 + struct fb_fix_screeninfo fix[4];
1608 + CoreSurfacePool *osd_pool;
1609 + CoreSurfacePool *video_pool;
1612 +} DavinciDeviceData;
1623 + DavinciDeviceData *ddev;
1627 + CoreScreen *screen;
1634 + bool c64x_present;
1636 + DavinciC64xTasks tasks;
1637 +} DavinciDriverData;
1640 +static inline DFBResult
1641 +davincifb_pan_display( const DavinciFB *fb,
1642 + struct fb_var_screeninfo *var,
1643 + const CoreSurfaceBufferLock *lock,
1644 + DFBSurfaceFlipFlags flags,
1651 +#ifdef FBIO_SET_START
1652 + CoreSurfaceBuffer *buffer = lock->buffer;
1653 + struct fb_set_start set_start;
1655 + /* physical mode */
1656 + set_start.offset = -1;
1657 + set_start.sync = (flags & DSFLIP_ONSYNC) ? 1 : 0;
1659 + /* life's so easy */
1660 + set_start.physical = lock->phys + DFB_BYTES_PER_LINE( buffer->format, x ) + y * lock->pitch;
1662 + ret = ioctl( fb->fd, FBIO_SET_START, &set_start );
1664 + D_DEBUG( "FBIO_SET_START (0x%08lx, sync %llu) failed!\n",
1665 + set_start.physical, set_start.sync );
1668 + if (flags & DSFLIP_WAIT)
1669 + ioctl( fb->fd, FBIO_WAITFORVSYNC );
1676 + var->xoffset = x; /* poor version */
1677 + var->yoffset = y + lock->offset / lock->pitch;
1684 + var->activate = /*(flags & DSFLIP_ONSYNC) ? FB_ACTIVATE_VBL :*/ FB_ACTIVATE_NOW;
1686 + ret = ioctl( fb->fd, FBIOPAN_DISPLAY, var );
1688 + D_PERROR( "Davinci/FB: FBIOPAN_DISPLAY (fb%d - %d,%d) failed!\n",
1689 + fb->num, var->xoffset, var->yoffset );
1691 + if (flags & DSFLIP_WAIT)
1692 + ioctl( fb->fd, FBIO_WAITFORVSYNC );