1 From: Sebastian Ramacher <sramacher@debian.org>
2 Date: Thu, 16 Mar 2017 20:53:09 +0100
3 Subject: Add missing files from upstream
7 gfxdrivers/davinci/davinci_c64x.h | 935 +++++++++++++++++++++++++++++++++
8 gfxdrivers/davinci/davinci_gfxdriver.h | 169 ++++++
9 gfxdrivers/davinci/davincifb.h | 581 ++++++++++++++++++++
10 3 files changed, 1685 insertions(+)
11 create mode 100644 gfxdrivers/davinci/davinci_c64x.h
12 create mode 100644 gfxdrivers/davinci/davinci_gfxdriver.h
13 create mode 100644 gfxdrivers/davinci/davincifb.h
15 diff --git a/gfxdrivers/davinci/davinci_c64x.h b/gfxdrivers/davinci/davinci_c64x.h
17 index 0000000..682da22
19 +++ b/gfxdrivers/davinci/davinci_c64x.h
22 + TI Davinci driver - C64X+ DSP Library
24 + (c) Copyright 2008 directfb.org
25 + (c) Copyright 2007 Telio AG
27 + Written by Denis Oliver Kropp <dok@directfb.org> and
28 + Olaf Dreesen <olaf@directfb.org>.
30 + All rights reserved.
32 + This library is free software; you can redistribute it and/or
33 + modify it under the terms of the GNU General Public License
34 + version 2 as published by the Free Software Foundation.
36 + This library is distributed in the hope that it will be useful,
37 + but WITHOUT ANY WARRANTY; without even the implied warranty of
38 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
39 + General Public License for more details.
41 + You should have received a copy of the GNU General Public
42 + License along with this library; if not, write to the
43 + Free Software Foundation, Inc., 59 Temple Place - Suite 330,
44 + Boston, MA 02111-1307, USA.
47 +#ifndef __DAVINCI_C64X_H__
48 +#define __DAVINCI_C64X_H__
52 +#include <directfb.h>
54 +#include <direct/messages.h>
55 +#include <direct/trace.h>
57 +#include <linux/c64x.h>
59 +#define mb() __asm__ __volatile__ ("" : : : "memory")
61 +/**********************************************************************************************************************/
67 + c64xTaskControl *ctl;
75 + unsigned int max_tasks;
76 + unsigned int num_tasks;
81 + C64X_TEF_NONE = 0x0000,
82 + C64X_TEF_RESET = 0x0001
83 +} DavinciC64xEmitFlags;
85 +/**********************************************************************************************************************/
87 +DFBResult davinci_c64x_open ( DavinciC64x *c64x );
89 +DFBResult davinci_c64x_close ( DavinciC64x *c64x );
91 +DFBResult davinci_c64x_wait_low( DavinciC64x *c64x );
93 +/**********************************************************************************************************************/
95 +DFBResult davinci_c64x_tasks_init ( DavinciC64xTasks *tasks,
96 + unsigned int size );
98 +DFBResult davinci_c64x_tasks_destroy( DavinciC64xTasks *tasks );
100 +/**********************************************************************************************************************/
102 +DFBResult davinci_c64x_emit_tasks( DavinciC64x *c64x,
103 + DavinciC64xTasks *tasks,
104 + DavinciC64xEmitFlags flags );
106 +/**********************************************************************************************************************/
108 +static const char *state_names[] = { "DONE", "ERROR", "TODO", "RUNNING" };
110 +static inline c64xTask *
111 +c64x_get_task( DavinciC64x *c64x )
113 + c64xTaskControl *ctl = c64x->ctl;
114 + uint32_t idx = ctl->QL_arm;
115 + uint32_t next = (idx + 1) & C64X_QUEUE_MASK;
116 + c64xTask *task = &c64x->QueueL[idx];
120 + /* Wait for the entry (and next) to be processed by the DSP (rare case). */
121 + while (task->c64x_flags & C64X_FLAG_TODO || ctl->QL_dsp == next) {
122 + if (loops > 666 || (idle && ctl->idlecounter - idle > 666)) {
123 + c64xTask *dsp_task = &c64x->QueueL[ctl->QL_dsp];
125 + D_PERROR( "Davinci/C64X+: Blocked! [DSP %d / %d (%s), ARM %d / %d (%s)]\n",
127 + (dsp_task->c64x_function >> 2) & 0x3fff,
128 + state_names[dsp_task->c64x_function & 3],
130 + (task->c64x_function >> 2) & 0x3fff,
131 + state_names[task->c64x_function & 3] );
136 + idle = ctl->idlecounter;
138 + /* Queue is full, waiting 10-20ms should not be too bad. */
147 +c64x_submit_task( DavinciC64x *c64x, c64xTask *task )
149 + c64xTaskControl *ctl = c64x->ctl;
150 + uint32_t idx = ctl->QL_arm;
151 + uint32_t next = (idx + 1) & C64X_QUEUE_MASK;
155 + ctl->QL_arm = next;
160 +/**********************************************************************************************************************/
163 +davinci_c64x_wb_inv_range( DavinciC64x *c64x,
164 + unsigned long start,
168 + c64xTask *task = c64x_get_task( c64x );
170 + task->c64x_arg[0] = start;
171 + task->c64x_arg[1] = length;
172 + task->c64x_arg[2] = func;
174 + task->c64x_function = C64X_WB_INV_RANGE | C64X_FLAG_TODO;
176 + c64x_submit_task( c64x, task );
180 +davinci_c64x_write_back_all( DavinciC64x *c64x )
182 + c64xTask *task = c64x_get_task( c64x );
184 + task->c64x_function = C64X_WRITE_BACK_ALL | C64X_FLAG_TODO;
186 + c64x_submit_task( c64x, task );
189 +/**********************************************************************************************************************/
192 +davinci_c64x_load_block__L( DavinciC64xTasks *tasks,
193 + unsigned long words,
197 + c64xTask *task = &tasks->tasks[tasks->num_tasks];
199 + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
201 + task->c64x_arg[0] = words;
202 + task->c64x_arg[1] = num;
203 + task->c64x_arg[2] = flags;
205 + task->c64x_function = C64X_LOAD_BLOCK | C64X_FLAG_TODO;
207 + tasks->num_tasks++;
211 +davinci_c64x_load_block( DavinciC64x *c64x,
212 + unsigned long words,
216 + c64xTask *task = c64x_get_task( c64x );
218 + task->c64x_arg[0] = words;
219 + task->c64x_arg[1] = num;
220 + task->c64x_arg[2] = flags;
222 + task->c64x_function = C64X_LOAD_BLOCK | C64X_FLAG_TODO;
224 + c64x_submit_task( c64x, task );
228 +davinci_c64x_fetch_uyvy( DavinciC64x *c64x,
229 + unsigned long dest,
230 + unsigned long source,
235 + c64xTask *task = c64x_get_task( c64x );
237 + task->c64x_arg[0] = dest;
238 + task->c64x_arg[1] = source;
239 + task->c64x_arg[2] = pitch;
240 + task->c64x_arg[3] = height;
241 + task->c64x_arg[4] = flags;
243 + task->c64x_function = C64X_FETCH_UYVY | C64X_FLAG_TODO;
245 + c64x_submit_task( c64x, task );
249 +davinci_c64x_mc( DavinciC64x *c64x,
250 + unsigned long dest,
252 + unsigned long source0,
253 + unsigned long source1,
258 + c64xTask *task = c64x_get_task( c64x );
260 + task->c64x_arg[0] = dest;
261 + task->c64x_arg[1] = dpitch;
262 + task->c64x_arg[2] = source0;
263 + task->c64x_arg[3] = source1;
264 + task->c64x_arg[4] = spitch;
265 + task->c64x_arg[5] = height;
267 + task->c64x_function = func | C64X_FLAG_TODO;
269 + c64x_submit_task( c64x, task );
273 +davinci_c64x_put_idct_uyvy_16x16__L( DavinciC64xTasks *tasks,
274 + unsigned long dest,
278 + c64xTask *task = &tasks->tasks[tasks->num_tasks];
280 + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
282 + task->c64x_arg[0] = dest;
283 + task->c64x_arg[1] = pitch;
284 + task->c64x_arg[2] = flags;
286 + task->c64x_function = C64X_PUT_IDCT_UYVY_16x16 | C64X_FLAG_TODO;
288 + tasks->num_tasks++;
292 +davinci_c64x_put_idct_uyvy_16x16( DavinciC64x *c64x,
293 + unsigned long dest,
297 + c64xTask *task = c64x_get_task( c64x );
299 + task->c64x_arg[0] = dest;
300 + task->c64x_arg[1] = pitch;
301 + task->c64x_arg[2] = flags;
303 + task->c64x_function = C64X_PUT_IDCT_UYVY_16x16 | C64X_FLAG_TODO;
305 + c64x_submit_task( c64x, task );
309 +davinci_c64x_put_mc_uyvy_16x16__L( DavinciC64xTasks *tasks,
310 + unsigned long dest,
314 + c64xTask *task = &tasks->tasks[tasks->num_tasks];
316 + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
318 + task->c64x_arg[0] = dest;
319 + task->c64x_arg[1] = pitch;
320 + task->c64x_arg[2] = flags;
322 + task->c64x_function = C64X_PUT_MC_UYVY_16x16 | C64X_FLAG_TODO;
324 + tasks->num_tasks++;
328 +davinci_c64x_put_mc_uyvy_16x16( DavinciC64x *c64x,
329 + unsigned long dest,
333 + c64xTask *task = c64x_get_task( c64x );
335 + task->c64x_arg[0] = dest;
336 + task->c64x_arg[1] = pitch;
337 + task->c64x_arg[2] = flags;
339 + task->c64x_function = C64X_PUT_MC_UYVY_16x16 | C64X_FLAG_TODO;
341 + c64x_submit_task( c64x, task );
345 +davinci_c64x_put_sum_uyvy_16x16__L( DavinciC64xTasks *tasks,
346 + unsigned long dest,
350 + c64xTask *task = &tasks->tasks[tasks->num_tasks];
352 + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
354 + task->c64x_arg[0] = dest;
355 + task->c64x_arg[1] = pitch;
356 + task->c64x_arg[2] = flags;
358 + task->c64x_function = C64X_PUT_SUM_UYVY_16x16 | C64X_FLAG_TODO;
360 + tasks->num_tasks++;
364 +davinci_c64x_put_sum_uyvy_16x16( DavinciC64x *c64x,
365 + unsigned long dest,
369 + c64xTask *task = c64x_get_task( c64x );
371 + task->c64x_arg[0] = dest;
372 + task->c64x_arg[1] = pitch;
373 + task->c64x_arg[2] = flags;
375 + task->c64x_function = C64X_PUT_SUM_UYVY_16x16 | C64X_FLAG_TODO;
377 + c64x_submit_task( c64x, task );
381 +davinci_c64x_dva_begin_frame__L( DavinciC64xTasks *tasks,
383 + unsigned long current,
384 + unsigned long past,
385 + unsigned long future,
388 + c64xTask *task = &tasks->tasks[tasks->num_tasks];
390 + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
392 + task->c64x_arg[0] = pitch;
393 + task->c64x_arg[1] = current;
394 + task->c64x_arg[2] = past;
395 + task->c64x_arg[3] = future;
396 + task->c64x_arg[4] = flags;
398 + task->c64x_function = C64X_DVA_BEGIN_FRAME | C64X_FLAG_TODO;
400 + tasks->num_tasks++;
404 +davinci_c64x_dva_begin_frame( DavinciC64x *c64x,
406 + unsigned long current,
407 + unsigned long past,
408 + unsigned long future,
411 + c64xTask *task = c64x_get_task( c64x );
413 + task->c64x_arg[0] = pitch;
414 + task->c64x_arg[1] = current;
415 + task->c64x_arg[2] = past;
416 + task->c64x_arg[3] = future;
417 + task->c64x_arg[4] = flags;
419 + task->c64x_function = C64X_DVA_BEGIN_FRAME | C64X_FLAG_TODO;
421 + c64x_submit_task( c64x, task );
425 +davinci_c64x_dva_motion_block__L( DavinciC64xTasks *tasks,
426 + unsigned long macroblock )
428 + c64xTask *task = &tasks->tasks[tasks->num_tasks];
430 + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
432 + task->c64x_arg[0] = macroblock;
434 + task->c64x_function = C64X_DVA_MOTION_BLOCK | C64X_FLAG_TODO;
436 + tasks->num_tasks++;
440 +davinci_c64x_dva_motion_block( DavinciC64x *c64x,
441 + unsigned long macroblock )
443 + c64xTask *task = c64x_get_task( c64x );
445 + task->c64x_arg[0] = macroblock;
447 + task->c64x_function = C64X_DVA_MOTION_BLOCK | C64X_FLAG_TODO;
449 + c64x_submit_task( c64x, task );
452 +/**********************************************************************************************************************/
455 +davinci_c64x_dva_idct( DavinciC64x *c64x,
456 + unsigned long dest,
458 + unsigned long source )
460 + c64xTask *task = c64x_get_task( c64x );
462 + task->c64x_arg[0] = dest;
463 + task->c64x_arg[1] = pitch;
464 + task->c64x_arg[2] = source;
466 + task->c64x_function = C64X_DVA_IDCT | C64X_FLAG_TODO;
468 + c64x_submit_task( c64x, task );
471 +/**********************************************************************************************************************/
474 +davinci_c64x_put_uyvy_16x16( DavinciC64x *c64x,
475 + unsigned long dest,
477 + unsigned long source,
480 + c64xTask *task = c64x_get_task( c64x );
482 + task->c64x_arg[0] = dest;
483 + task->c64x_arg[1] = pitch;
484 + task->c64x_arg[2] = source;
485 + task->c64x_arg[3] = flags;
487 + task->c64x_function = C64X_PUT_UYVY_16x16 | C64X_FLAG_TODO;
489 + c64x_submit_task( c64x, task );
493 +davinci_c64x_dither_argb__L( DavinciC64xTasks *tasks,
494 + unsigned long dst_rgb,
495 + unsigned long dst_alpha,
497 + unsigned long source,
502 + c64xTask *task = &tasks->tasks[tasks->num_tasks];
504 + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
506 + task->c64x_arg[0] = dst_rgb;
507 + task->c64x_arg[1] = dst_alpha;
508 + task->c64x_arg[2] = dst_pitch;
509 + task->c64x_arg[3] = source;
510 + task->c64x_arg[4] = src_pitch;
511 + task->c64x_arg[5] = width;
512 + task->c64x_arg[6] = height;
514 + task->c64x_function = C64X_DITHER_ARGB | C64X_FLAG_TODO;
516 + tasks->num_tasks++;
520 +davinci_c64x_dither_argb( DavinciC64x *c64x,
521 + unsigned long dst_rgb,
522 + unsigned long dst_alpha,
524 + unsigned long source,
529 + c64xTask *task = c64x_get_task( c64x );
531 + task->c64x_arg[0] = dst_rgb;
532 + task->c64x_arg[1] = dst_alpha;
533 + task->c64x_arg[2] = dst_pitch;
534 + task->c64x_arg[3] = source;
535 + task->c64x_arg[4] = src_pitch;
536 + task->c64x_arg[5] = width;
537 + task->c64x_arg[6] = height;
539 + task->c64x_function = C64X_DITHER_ARGB | C64X_FLAG_TODO;
541 + c64x_submit_task( c64x, task );
545 +davinci_c64x_fill_16__L( DavinciC64xTasks *tasks,
546 + unsigned long dest,
552 + c64xTask *task = &tasks->tasks[tasks->num_tasks];
554 + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
556 + task->c64x_arg[0] = dest;
557 + task->c64x_arg[1] = pitch;
558 + task->c64x_arg[2] = width;
559 + task->c64x_arg[3] = height;
560 + task->c64x_arg[4] = value;
562 + task->c64x_function = C64X_FILL_16 | C64X_FLAG_TODO;
564 + tasks->num_tasks++;
568 +davinci_c64x_fill_16( DavinciC64x *c64x,
569 + unsigned long dest,
575 + c64xTask *task = c64x_get_task( c64x );
577 + task->c64x_arg[0] = dest;
578 + task->c64x_arg[1] = pitch;
579 + task->c64x_arg[2] = width;
580 + task->c64x_arg[3] = height;
581 + task->c64x_arg[4] = value;
583 + task->c64x_function = C64X_FILL_16 | C64X_FLAG_TODO;
585 + c64x_submit_task( c64x, task );
589 +davinci_c64x_fill_32__L( DavinciC64xTasks *tasks,
590 + unsigned long dest,
596 + c64xTask *task = &tasks->tasks[tasks->num_tasks];
598 + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
600 + task->c64x_arg[0] = dest;
601 + task->c64x_arg[1] = pitch;
602 + task->c64x_arg[2] = width;
603 + task->c64x_arg[3] = height;
604 + task->c64x_arg[4] = value;
606 + task->c64x_function = C64X_FILL_32 | C64X_FLAG_TODO;
608 + tasks->num_tasks++;
612 +davinci_c64x_fill_32( DavinciC64x *c64x,
613 + unsigned long dest,
619 + c64xTask *task = c64x_get_task( c64x );
621 + task->c64x_arg[0] = dest;
622 + task->c64x_arg[1] = pitch;
623 + task->c64x_arg[2] = width;
624 + task->c64x_arg[3] = height;
625 + task->c64x_arg[4] = value;
627 + task->c64x_function = C64X_FILL_32 | C64X_FLAG_TODO;
629 + c64x_submit_task( c64x, task );
633 +davinci_c64x_blit_16__L( DavinciC64xTasks *tasks,
634 + unsigned long dest,
641 + c64xTask *task = &tasks->tasks[tasks->num_tasks];
643 + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
645 + task->c64x_arg[0] = dest;
646 + task->c64x_arg[1] = dpitch;
647 + task->c64x_arg[2] = src;
648 + task->c64x_arg[3] = spitch;
649 + task->c64x_arg[4] = width;
650 + task->c64x_arg[5] = height;
652 + task->c64x_function = C64X_COPY_16 | C64X_FLAG_TODO;
654 + tasks->num_tasks++;
658 +davinci_c64x_blit_16( DavinciC64x *c64x,
659 + unsigned long dest,
666 + c64xTask *task = c64x_get_task( c64x );
668 + task->c64x_arg[0] = dest;
669 + task->c64x_arg[1] = dpitch;
670 + task->c64x_arg[2] = src;
671 + task->c64x_arg[3] = spitch;
672 + task->c64x_arg[4] = width;
673 + task->c64x_arg[5] = height;
675 + task->c64x_function = C64X_COPY_16 | C64X_FLAG_TODO;
677 + c64x_submit_task( c64x, task );
681 +davinci_c64x_blit_32__L( DavinciC64xTasks *tasks,
682 + unsigned long dest,
689 + c64xTask *task = &tasks->tasks[tasks->num_tasks];
691 + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
693 + task->c64x_arg[0] = dest;
694 + task->c64x_arg[1] = dpitch;
695 + task->c64x_arg[2] = src;
696 + task->c64x_arg[3] = spitch;
697 + task->c64x_arg[4] = width;
698 + task->c64x_arg[5] = height;
700 + task->c64x_function = C64X_COPY_32 | C64X_FLAG_TODO;
702 + tasks->num_tasks++;
706 +davinci_c64x_blit_32( DavinciC64x *c64x,
707 + unsigned long dest,
714 + c64xTask *task = c64x_get_task( c64x );
716 + task->c64x_arg[0] = dest;
717 + task->c64x_arg[1] = dpitch;
718 + task->c64x_arg[2] = src;
719 + task->c64x_arg[3] = spitch;
720 + task->c64x_arg[4] = width;
721 + task->c64x_arg[5] = height;
723 + task->c64x_function = C64X_COPY_32 | C64X_FLAG_TODO;
725 + c64x_submit_task( c64x, task );
729 +davinci_c64x_stretch_32__L( DavinciC64xTasks *tasks,
730 + unsigned long dest,
738 + const DFBRegion *clip )
740 + c64xTask *task = &tasks->tasks[tasks->num_tasks];
742 + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
744 + task->c64x_arg[0] = dest;
745 + task->c64x_arg[1] = src;
746 + task->c64x_arg[2] = dpitch | (spitch << 16);
747 + task->c64x_arg[3] = dh | (dw << 16);
748 + task->c64x_arg[4] = sh | (sw << 16);
749 + task->c64x_arg[5] = clip->x2 | (clip->y2 << 16);
750 + task->c64x_arg[6] = clip->x1 | (clip->y1 << 16);
752 + if (sw > dw && sh > dh)
753 + task->c64x_function = C64X_STRETCH_32_down | C64X_FLAG_TODO;
755 + task->c64x_function = C64X_STRETCH_32_up | C64X_FLAG_TODO;
757 + tasks->num_tasks++;
761 +davinci_c64x_stretch_32( DavinciC64x *c64x,
762 + unsigned long dest,
770 + const DFBRegion *clip )
772 + c64xTask *task = c64x_get_task( c64x );
774 + task->c64x_arg[0] = dest;
775 + task->c64x_arg[1] = src;
776 + task->c64x_arg[2] = dpitch | (spitch << 16);
777 + task->c64x_arg[3] = dh | (dw << 16);
778 + task->c64x_arg[4] = sh | (sw << 16);
779 + task->c64x_arg[5] = clip->x2 | (clip->y2 << 16);
780 + task->c64x_arg[6] = clip->x1 | (clip->y1 << 16);
782 + if (sw > dw && sh > dh)
783 + task->c64x_function = C64X_STRETCH_32_down | C64X_FLAG_TODO;
785 + task->c64x_function = C64X_STRETCH_32_up | C64X_FLAG_TODO;
787 + c64x_submit_task( c64x, task );
791 +davinci_c64x_blit_blend_32__L( DavinciC64xTasks *tasks,
793 + unsigned long dest,
802 + c64xTask *task = &tasks->tasks[tasks->num_tasks];
804 + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
806 + task->c64x_arg[0] = dest;
807 + task->c64x_arg[1] = dpitch;
808 + task->c64x_arg[2] = src;
809 + task->c64x_arg[3] = spitch;
810 + task->c64x_arg[4] = width | (height << 16);
811 + task->c64x_arg[5] = argb;
812 + task->c64x_arg[6] = alpha;
814 + task->c64x_function = (sub_func << 16) | C64X_BLEND_32 | C64X_FLAG_TODO;
816 + tasks->num_tasks++;
820 +davinci_c64x_blit_blend_32( DavinciC64x *c64x,
822 + unsigned long dest,
831 + c64xTask *task = c64x_get_task( c64x );
833 + task->c64x_arg[0] = dest;
834 + task->c64x_arg[1] = dpitch;
835 + task->c64x_arg[2] = src;
836 + task->c64x_arg[3] = spitch;
837 + task->c64x_arg[4] = width | (height << 16);
838 + task->c64x_arg[5] = argb;
839 + task->c64x_arg[6] = alpha;
841 + task->c64x_function = (sub_func << 16) | C64X_BLEND_32 | C64X_FLAG_TODO;
843 + c64x_submit_task( c64x, task );
847 +davinci_c64x_blit_keyed_16__L( DavinciC64xTasks *tasks,
848 + unsigned long dest,
857 + c64xTask *task = &tasks->tasks[tasks->num_tasks];
859 + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
861 + task->c64x_arg[0] = dest;
862 + task->c64x_arg[1] = (dpitch << 16) | (spitch & 0xffff);
863 + task->c64x_arg[2] = src;
864 + task->c64x_arg[3] = width;
865 + task->c64x_arg[4] = height;
866 + task->c64x_arg[5] = key;
867 + task->c64x_arg[6] = mask;
869 + task->c64x_function = C64X_COPY_KEYED_16 | C64X_FLAG_TODO;
871 + tasks->num_tasks++;
875 +davinci_c64x_blit_keyed_16( DavinciC64x *c64x,
876 + unsigned long dest,
885 + c64xTask *task = c64x_get_task( c64x );
887 + task->c64x_arg[0] = dest;
888 + task->c64x_arg[1] = (dpitch << 16) | (spitch & 0xffff);
889 + task->c64x_arg[2] = src;
890 + task->c64x_arg[3] = width;
891 + task->c64x_arg[4] = height;
892 + task->c64x_arg[5] = key;
893 + task->c64x_arg[6] = mask;
895 + task->c64x_function = C64X_COPY_KEYED_16 | C64X_FLAG_TODO;
897 + c64x_submit_task( c64x, task );
901 +davinci_c64x_blit_keyed_32__L( DavinciC64xTasks *tasks,
902 + unsigned long dest,
911 + c64xTask *task = &tasks->tasks[tasks->num_tasks];
913 + D_ASSERT( tasks->num_tasks < tasks->max_tasks );
915 + task->c64x_arg[0] = dest;
916 + task->c64x_arg[1] = (dpitch << 16) | (spitch & 0xffff);
917 + task->c64x_arg[2] = src;
918 + task->c64x_arg[3] = width;
919 + task->c64x_arg[4] = height;
920 + task->c64x_arg[5] = key;
921 + task->c64x_arg[6] = mask;
923 + task->c64x_function = C64X_COPY_KEYED_32 | C64X_FLAG_TODO;
925 + tasks->num_tasks++;
929 +davinci_c64x_blit_keyed_32( DavinciC64x *c64x,
930 + unsigned long dest,
939 + c64xTask *task = c64x_get_task( c64x );
941 + task->c64x_arg[0] = dest;
942 + task->c64x_arg[1] = (dpitch << 16) | (spitch & 0xffff);
943 + task->c64x_arg[2] = src;
944 + task->c64x_arg[3] = width;
945 + task->c64x_arg[4] = height;
946 + task->c64x_arg[5] = key;
947 + task->c64x_arg[6] = mask;
949 + task->c64x_function = C64X_COPY_KEYED_32 | C64X_FLAG_TODO;
951 + c64x_submit_task( c64x, task );
956 diff --git a/gfxdrivers/davinci/davinci_gfxdriver.h b/gfxdrivers/davinci/davinci_gfxdriver.h
958 index 0000000..4ca79b3
960 +++ b/gfxdrivers/davinci/davinci_gfxdriver.h
963 + TI Davinci driver - Graphics Driver
965 + (c) Copyright 2007 Telio AG
967 + Written by Denis Oliver Kropp <dok@directfb.org>
969 + Code is derived from VMWare driver.
971 + (c) Copyright 2001-2009 The world wide DirectFB Open Source Community (directfb.org)
972 + (c) Copyright 2000-2004 Convergence (integrated media) GmbH
974 + All rights reserved.
976 + This library is free software; you can redistribute it and/or
977 + modify it under the terms of the GNU Lesser General Public
978 + License as published by the Free Software Foundation; either
979 + version 2 of the License, or (at your option) any later version.
981 + This library is distributed in the hope that it will be useful,
982 + but WITHOUT ANY WARRANTY; without even the implied warranty of
983 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
984 + Lesser General Public License for more details.
986 + You should have received a copy of the GNU Lesser General Public
987 + License along with this library; if not, write to the
988 + Free Software Foundation, Inc., 59 Temple Place - Suite 330,
989 + Boston, MA 02111-1307, USA.
992 +#ifndef __DAVINCI_GFXDRIVER_H__
993 +#define __DAVINCI_GFXDRIVER_H__
995 +#include <sys/ioctl.h>
996 +#include <davincifb.h>
998 +#include <core/surface_buffer.h>
1000 +#include "davincifb.h"
1002 +#include "davinci_c64x.h"
1006 + /* validation flags */
1009 + /* cached/computed values */
1011 + unsigned long dst_phys;
1012 + unsigned int dst_size;
1013 + unsigned long dst_pitch;
1014 + DFBSurfacePixelFormat dst_format;
1015 + unsigned long dst_bpp;
1018 + unsigned long src_phys;
1019 + unsigned long src_pitch;
1020 + DFBSurfacePixelFormat src_format;
1021 + unsigned long src_bpp;
1023 + unsigned long source_mult;
1025 + unsigned long fillcolor;
1027 + int blit_blend_sub_function;
1028 + int draw_blend_sub_function;
1031 + unsigned long color_argb;
1032 + unsigned long colorkey;
1034 + DFBSurfaceBlittingFlags blitting_flags;
1038 + /** Add shared data here... **/
1039 + struct fb_fix_screeninfo fix[4];
1041 + CoreSurfacePool *osd_pool;
1042 + CoreSurfacePool *video_pool;
1045 +} DavinciDeviceData;
1056 + DavinciDeviceData *ddev;
1060 + CoreScreen *screen;
1067 + bool c64x_present;
1069 + DavinciC64xTasks tasks;
1070 +} DavinciDriverData;
1073 +static inline DFBResult
1074 +davincifb_pan_display( const DavinciFB *fb,
1075 + struct fb_var_screeninfo *var,
1076 + const CoreSurfaceBufferLock *lock,
1077 + DFBSurfaceFlipFlags flags,
1084 +#ifdef FBIO_SET_START
1085 + CoreSurfaceBuffer *buffer = lock->buffer;
1086 + struct fb_set_start set_start;
1088 + /* physical mode */
1089 + set_start.offset = -1;
1090 + set_start.sync = (flags & DSFLIP_ONSYNC) ? 1 : 0;
1092 + /* life's so easy */
1093 + set_start.physical = lock->phys + DFB_BYTES_PER_LINE( buffer->format, x ) + y * lock->pitch;
1095 + ret = ioctl( fb->fd, FBIO_SET_START, &set_start );
1097 + D_DEBUG( "FBIO_SET_START (0x%08lx, sync %llu) failed!\n",
1098 + set_start.physical, set_start.sync );
1101 + if (flags & DSFLIP_WAIT)
1102 + ioctl( fb->fd, FBIO_WAITFORVSYNC );
1109 + var->xoffset = x; /* poor version */
1110 + var->yoffset = y + lock->offset / lock->pitch;
1117 + var->activate = /*(flags & DSFLIP_ONSYNC) ? FB_ACTIVATE_VBL :*/ FB_ACTIVATE_NOW;
1119 + ret = ioctl( fb->fd, FBIOPAN_DISPLAY, var );
1121 + D_PERROR( "Davinci/FB: FBIOPAN_DISPLAY (fb%d - %d,%d) failed!\n",
1122 + fb->num, var->xoffset, var->yoffset );
1124 + if (flags & DSFLIP_WAIT)
1125 + ioctl( fb->fd, FBIO_WAITFORVSYNC );
1131 diff --git a/gfxdrivers/davinci/davincifb.h b/gfxdrivers/davinci/davincifb.h
1132 new file mode 100644
1133 index 0000000..35eb169
1135 +++ b/gfxdrivers/davinci/davincifb.h
1138 + * Copyright (C) 2006 Texas Instruments Inc
1140 + * This program is free software; you can redistribute it and/or modify
1141 + * it under the terms of the GNU General Public License as published by
1142 + * the Free Software Foundation; either version 2 of the License, or
1143 + * (at your option)any later version.
1145 + * This program is distributed in the hope that it will be useful,
1146 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1147 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1148 + * GNU General Public License for more details.
1150 + * You should have received a copy of the GNU General Public License
1151 + * along with this program; if not, write to the Free Software
1152 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1154 + * File: davincifb.h
1157 +#ifndef DAVINVI_VPBE_H
1158 +#define DAVINVI_VPBE_H
1160 +/* include Linux files */
1161 +#include <linux/fb.h>
1163 +/* define the custom FBIO_WAITFORVSYNC ioctl */
1164 +#define FBIO_WAITFORVSYNC _IOW('F', 0x20, u_int32_t)
1165 +#define FBIO_SETATTRIBUTE _IOW('F', 0x21, struct fb_fillrect)
1167 +/* Backported IOCTLS. */
1168 +#define FBIO_SETPOSX _IOW('F', 0x22, u_int32_t)
1169 +#define FBIO_SETPOSY _IOW('F', 0x23, u_int32_t)
1170 +#define FBIO_SETZOOM _IOW('F', 0x24, struct zoom_params)
1171 +#define FBIO_GETSTD _IOR('F', 0x25, u_int32_t)
1172 +#define FBIO_RESIZER _IOW('F', 0x26, struct vpfe_resizer_params)
1173 +#define FBIO_SYNC _IOW('F', 0x27, u_int32_t)
1175 +typedef struct zoom_params {
1176 + u_int32_t window_id;
1181 +typedef struct vpfe_resizer_params
1183 + u_int32_t rsz_cnt; //busy-lock
1184 + u_int32_t out_size; //busy-lock
1185 + u_int32_t in_start; //busy-lock
1186 + u_int32_t in_size; //busy-lock
1187 + u_int32_t sdr_inadd; //shadowed
1188 + u_int32_t sdr_inoff; //shadowed
1189 + u_int32_t sdr_outadd; //shadowed
1190 + u_int32_t sdr_outoff; //shadowed
1191 + u_int32_t hfilt[16]; //busy-lock
1192 + u_int32_t vfilt[16]; //busy-lock
1193 + u_int32_t yenh; //busy-lock
1194 +} vpfe_resizer_params_t;
1196 +typedef struct fb_set_start {
1197 + int offset; /* offset from smem_start */
1198 + unsigned long physical; /* absolute physical address when offset < 0 */
1200 + u_int64_t sync; /* input: target sync counter for change or 0 for no sync at all,
1201 + output: sync counter of actual change or 0 if still pending */
1205 +#ifdef _IOC_TYPECHECK
1206 +#undef _IOC_TYPECHECK
1207 +#define _IOC_TYPECHECK(x) (sizeof(x))
1210 +#define RAM_CLUT_SIZE 256*3
1211 +#define FBIO_ENABLE_DISABLE_WIN \
1212 + _IOW('F', 0x30, unsigned char)
1213 +#define FBIO_SET_BITMAP_BLEND_FACTOR \
1214 + _IOW('F', 0x31, vpbe_bitmap_blend_params_t)
1215 +#define FBIO_SET_BITMAP_WIN_RAM_CLUT \
1216 + _IOW('F', 0x32, unsigned char)*RAM_CLUT_SIZE)
1217 +#define FBIO_ENABLE_DISABLE_ATTRIBUTE_WIN \
1218 + _IOW('F', 0x33, unsigned int)
1219 +#define FBIO_GET_BLINK_INTERVAL \
1220 + _IOR('F', 0x34, vpbe_blink_option_t)
1221 +#define FBIO_SET_BLINK_INTERVAL \
1222 + _IOW('F', 0x35, vpbe_blink_option_t)
1223 +#define FBIO_GET_VIDEO_CONFIG_PARAMS \
1224 + _IOR('F', 0x36, vpbe_video_config_params_t)
1225 +#define FBIO_SET_VIDEO_CONFIG_PARAMS \
1226 + _IOW('F', 0x37, vpbe_video_config_params_t)
1227 +#define FBIO_GET_BITMAP_CONFIG_PARAMS \
1228 + _IOR('F', 0x38, vpbe_bitmap_config_params_t)
1229 +#define FBIO_SET_BITMAP_CONFIG_PARAMS \
1230 + _IOW('F', 0x39, vpbe_bitmap_config_params_t)
1231 +#define FBIO_SET_DCLK \
1232 + _IOW('F', 0x40, vpbe_dclk_t)
1233 +#define FBIO_SET_INTERFACE \
1234 + _IOW('F', 0x41, unsigned char)
1235 +#define FBIO_GET_INTERFACE \
1236 + _IOR('F', 0x42, unsigned char)
1237 +#define FBIO_QUERY_TIMING \
1238 + _IOWR('F', 0x43, struct vpbe_mode_info)
1239 +#define FBIO_SET_TIMING \
1240 + _IOW('F', 0x44, struct vpbe_fb_videomode)
1241 +#define FBIO_GET_TIMING \
1242 + _IOR('F', 0x45, struct vpbe_fb_videomode)
1243 +#define FBIO_SET_VENC_CLK_SOURCE \
1244 + _IOW('F', 0x46, unsigned char)
1245 +#define FBIO_SET_BACKG_COLOR \
1246 + _IOW('F', 0x47, vpbe_backg_color_t)
1247 +#define FBIO_ENABLE_DISPLAY \
1248 + _IOW('F', 0x48, unsigned char)
1249 +#define FBIO_SETPOS \
1250 + _IOW('F', 0x49, u_int32_t)
1251 +#define FBIO_SET_CURSOR \
1252 + _IOW('F', 0x50, struct fb_cursor)
1253 +#define FBIO_SET_START \
1254 + _IOW('F', 0x66, struct fb_set_start)
1257 + * Defines and Constants
1260 +#define DAVINCIFB_DEVICE "davincifb"
1261 +#define DAVINCIFB_DRIVER "davincifb"
1263 +#define MULTIPLE_BUFFERING 1
1265 +#ifdef MULTIPLE_BUFFERING
1266 +#define DOUBLE_BUF 2
1267 +#define TRIPLE_BUF 3
1269 +#define DOUBLE_BUF 1
1270 +#define TRIPLE_BUF 1
1273 +/* usage: if (is_win(info->fix.id, OSD0)) ... */
1274 +#define is_win(name, x) ((strcmp(name, x ## _FBNAME) == 0) ? 1 : 0)
1277 + * display controller register I/O routines
1279 +u32 dispc_reg_in(u32 offset);
1280 +u32 dispc_reg_out(u32 offset, u32 val);
1281 +u32 dispc_reg_merge(u32 offset, u32 val, u32 mask);
1283 +#endif /*__KERNEL__*/
1285 +/* Error return codes */
1286 +#define VPBE_INVALID_PARA_VALUE 700
1287 +#define VPBE_WRONG_WINDOW_ID 701
1288 +#define VPBE_CURRENTLY_IN_REQUIRED_MODE 702
1289 +#define VPBE_INSUFFICIENT_CLUT_VALUES 703
1290 +#define VPBE_CLUT_WRITE_TIMEOUT 704
1291 +#define VPBE_VID0_BUF_ADR_NULL 705
1292 +#define VPBE_WINDOW_NOT_DISABLED 706
1293 +#define VPBE_WINDOW_NOT_ENABLED 707
1296 +/* Window ID definations */
1303 +/* There are 4 framebuffers, each represented by an fb_info and
1304 + * a dm_win_info structure */
1305 +#define OSD0_FBNAME "dm_osd0_fb"
1306 +#define OSD1_FBNAME "dm_osd1_fb"
1307 +#define VID0_FBNAME "dm_vid0_fb"
1308 +#define VID1_FBNAME "dm_vid1_fb"
1310 +/* FIXME: Digital LCD RGB matrix coefficients */
1311 +#define DLCD_DGY_VAL 0
1312 +#define DLCD_DRV_VAL 0
1313 +#define DLCD_DGU_VAL 0
1314 +#define DLCD_DBU_VAL 0
1316 +/* Defines for bitmap format */
1317 +#define VPBE_BITMAP_BIT_1 1
1318 +#define VPBE_BITMAP_BIT_2 2
1319 +#define VPBE_BITMAP_BIT_4 4
1320 +#define VPBE_BITMAP_BIT_8 8
1321 +#define VPBE_BITMAP_RGB565 16
1322 +#define VPBE_VIDEO_YUV422 16
1323 +#define VPBE_VIDEO_RGB888 24
1325 +/* Defines foe cursor parameter validation*/
1326 +#define MAX_CURSOR_WIDTH 0x3FF
1327 +#define MAX_CURSOR_HEIGHT 0x1FF
1328 +#define MAX_CURSOR_LINEWIDTH 7
1332 +#define BASEX_DLCD 0x59
1333 +#define BASEY_DLCD 0x22
1338 +/* Enum for blending factor */
1339 +typedef enum vpbe_blend_factor {
1340 + OSD_CONTRIBUTION_ZERO = 0,
1341 + OSD_CONTRIBUTION_1_BY_8 = 1,
1342 + OSD_CONTRIBUTION_2_BY_8 = 2,
1343 + OSD_CONTRIBUTION_3_BY_8 = 3,
1344 + OSD_CONTRIBUTION_4_BY_8 = 4,
1345 + OSD_CONTRIBUTION_5_BY_8 = 5,
1346 + OSD_CONTRIBUTION_6_BY_8 = 6,
1347 + OSD_CONTRIBUTION_ONE = 7
1348 +} vpbe_blend_factor_t;
1350 +/* Enum for Boolean variables */
1354 +} CB_CR_ORDER, ATTRIBUTE, ROM_RAM_CLUT;
1356 +/* Defines for Display Interface */
1358 +#define COMPOSITE 1
1360 +#define COMPONENT 3
1369 +#define VPBE_MAX_INTERFACES 12
1371 +/* Defines for Display Mode */
1378 +#define DEFAULT_MODE 0
1382 +#define NON_EXISTING_MODE 255
1383 +/* Enable/Disable enum */
1387 +} ATTENUATION, TRANSPARENCY, EXPANSION, BLINKING;
1389 +typedef enum clk_source {
1390 + CLK_SOURCE_CLK27 = 0,
1391 + CLK_SOURCE_CLK54 = 1,
1392 + CLK_SOURCE_VPBECLK = 2
1396 + * Structures and Union Definitions
1399 +/* Structure for transparency and the blending factor for the bitmap window */
1400 +typedef struct vpbe_bitmap_blend_params {
1401 + unsigned int colorkey; /* color key to be blend */
1402 + unsigned int enable_colorkeying; /* enable color keying */
1403 + unsigned int bf; /* valid range from 0 to 7 only. */
1404 +} vpbe_bitmap_blend_params_t;
1406 +/* Structure for window expansion */
1407 +typedef struct vpbe_win_expansion {
1408 + EXPANSION horizontal;
1409 + EXPANSION vertical; /* 1: Enable 0:disable */
1410 +} vpbe_win_expansion_t;
1412 +/* Structure for OSD window blinking options */
1413 +typedef struct vpbe_blink_option {
1414 + BLINKING blinking; /* 1: Enable blinking 0: Disable */
1415 + unsigned int interval; /* Valid only if blinking is 1 */
1416 +} vpbe_blink_option_t;
1418 +/* Structure for DCLK parameters */
1419 +typedef struct vpbe_dclk {
1420 + unsigned char dclk_pattern_width;
1421 + unsigned int dclk_pattern0;
1422 + unsigned int dclk_pattern1;
1423 + unsigned int dclk_pattern2;
1424 + unsigned int dclk_pattern3;
1427 +/* Structure for display format */
1428 +typedef struct vpbe_display_format {
1429 + unsigned char interface; /* Output interface type */
1430 + unsigned char mode; /* output mode */
1431 +} vpbe_display_format_t;
1433 +/* Structure for background color */
1434 +typedef struct vpbe_backg_color {
1435 + unsigned char clut_select; /* 2: RAM CLUT 1:ROM1 CLUT 0:ROM0 CLUT */
1436 + unsigned char color_offset; /* index of color */
1437 +} vpbe_backg_color_t;
1439 +/* Structure for Video window configurable parameters */
1440 +typedef struct vpbe_video_config_params {
1441 + CB_CR_ORDER cb_cr_order; /*Cb/Cr order in input data for a pixel. */
1442 + /* 0: cb cr 1: cr cb */
1443 + vpbe_win_expansion_t exp_info; /* HZ/VT Expansion enable disable */
1444 +} vpbe_video_config_params_t;
1446 +/*Union of structures giving the CLUT index for the 1, 2, 4 bit bitmap values.*/
1447 +typedef union vpbe_clut_idx {
1448 + struct _for_4bit_bimap {
1449 + unsigned char bitmap_val_0;
1450 + unsigned char bitmap_val_1;
1451 + unsigned char bitmap_val_2;
1452 + unsigned char bitmap_val_3;
1453 + unsigned char bitmap_val_4;
1454 + unsigned char bitmap_val_5;
1455 + unsigned char bitmap_val_6;
1456 + unsigned char bitmap_val_7;
1457 + unsigned char bitmap_val_8;
1458 + unsigned char bitmap_val_9;
1459 + unsigned char bitmap_val_10;
1460 + unsigned char bitmap_val_11;
1461 + unsigned char bitmap_val_12;
1462 + unsigned char bitmap_val_13;
1463 + unsigned char bitmap_val_14;
1464 + unsigned char bitmap_val_15;
1466 + struct _for_2bit_bimap {
1467 + unsigned char bitmap_val_0;
1468 + unsigned char dummy0[4];
1469 + unsigned char bitmap_val_1;
1470 + unsigned char dummy1[4];
1471 + unsigned char bitmap_val_2;
1472 + unsigned char dummy2[4];
1473 + unsigned char bitmap_val_3;
1475 + struct _for_1bit_bimap {
1476 + unsigned char bitmap_val_0;
1477 + unsigned char dummy0[14];
1478 + unsigned char bitmap_val_1;
1482 +/* Structure for bitmap window configurable parameters */
1483 +typedef struct vpbe_bitmap_config_params {
1484 + /* Only for bitmap width = 1,2,4 bits */
1485 + vpbe_clut_idx_t clut_idx;
1486 + /* Attenuation value for YUV o/p for bitmap window */
1487 + unsigned char attenuation_enable;
1488 + /* 0: ROM DM270, 1:ROM DM320, 2:RAM CLUT */
1489 + unsigned char clut_select;
1490 +} vpbe_bitmap_config_params_t;
1492 +/* Unioun for video/OSD configuration parameters */
1493 +typedef union vpbe_conf_params {
1495 + struct vpbe_video_params {
1496 + CB_CR_ORDER cb_cr_order;
1497 + /* HZ/VT Expansion enable disable */
1498 + vpbe_win_expansion_t exp_info;
1501 + struct vpbe_bitmap_params {
1502 + /* Attenuation value for YUV o/p */
1503 + ATTENUATION attenuation_enable;
1504 + /* 0: ROM DM270, 1: ROM DM320, 2:RAM CLUT */
1505 + unsigned char clut_select;
1506 + /* Only for bitmap width = 1,2,4 bits */
1507 + vpbe_clut_idx_t clut_idx;
1508 + /* 0: OSD window is bitmap window */
1509 + /* 1: OSD window is attribute window */
1510 + ATTRIBUTE enable_attribute;
1511 + /* To hold bps value.
1512 + Used to switch back from attribute to bitmap. */
1513 + unsigned int stored_bits_per_pixel;
1514 + /* Blending information */
1515 + vpbe_bitmap_blend_params_t blend_info;
1516 + /* OSD Blinking information */
1517 + vpbe_blink_option_t blink_info;
1520 +} vpbe_conf_params_t;
1522 +typedef struct vpbe_video_params vpbe_video_params_t;
1523 +typedef struct vpbe_bitmap_params vpbe_bitmap_params_t;
1525 +/* Structure to hold window position */
1526 +typedef struct vpbe_window_position {
1527 + unsigned int xpos; /* X position of the window */
1528 + unsigned int ypos; /* Y position of the window */
1529 +} vpbe_window_position_t;
1532 +/* Structure for each window */
1533 +typedef struct vpbe_dm_win_info {
1534 + struct fb_info info;
1535 + vpbe_window_position_t win_pos; /* X,Y position of window */
1536 + /* Size of window is already there in var_info structure. */
1538 + dma_addr_t fb_base_phys; /*framebuffer area */
1539 + unsigned int fb_base; /*window memory pointer */
1540 + unsigned int fb_size; /*memory size */
1541 + unsigned int pseudo_palette[17];
1543 + /*flag to identify if framebuffer area is fixed or not */
1544 + unsigned long sdram_address;
1545 + struct vpbe_dm_info *dm;
1546 + unsigned char window_enable; /*Additions for all windows */
1547 + zoom_params_t zoom; /*Zooming parameters */
1548 + unsigned char field_frame_select; /*To select Field or frame */
1549 + unsigned char numbufs; /*Number of buffers valid 2 or 3 */
1550 + vpbe_conf_params_t conf_params;
1551 + /*window configuration parameter union pointer */
1552 +} vpbe_dm_win_info_t;
1553 +#endif /*__KERNEL__*/
1556 + * Videmode structure for display interface and mode settings
1558 +typedef struct vpbe_fb_videomode {
1559 + unsigned char name[10]; /* Mode name ( NTSC , PAL) */
1560 + unsigned int vmode; /* FB_MODE_INTERLACED or FB_MODE_NON_INTERLACED */
1561 + unsigned int xres; /* X Resolution of the display */
1562 + unsigned int yres; /* Y Resolution of the display */
1563 + unsigned int fps; /* frames per second */
1564 + /* Timing Parameters applicable for std = 0 only */
1565 + unsigned int left_margin;
1566 + unsigned int right_margin;
1567 + unsigned int upper_margin;
1568 + unsigned int lower_margin;
1569 + unsigned int hsync_len;
1570 + unsigned int vsync_len;
1571 + unsigned int sync; /* 0: hsync -ve/vsync -ve */
1572 + /*1: hsync -ve/vsync +ve */
1573 + /*2: hsync +ve/vsync -ve */
1574 + /*3: hsync +ve/vsync +ve */
1575 + unsigned int basepx; /* Display x,y start position */
1576 + unsigned int basepy;
1577 +/* 1= Mode s available in modelist 0=Mode is not available in modelist */
1579 +} vpbe_fb_videomode_t;
1581 +/* Structure to interface videomode to application*/
1582 +typedef struct vpbe_mode_info {
1583 + vpbe_fb_videomode_t vid_mode;
1584 + unsigned char interface;
1585 + unsigned char mode_idx;
1586 +} vpbe_mode_info_t;
1590 + * Structure for the driver holding information of windows,
1591 + * memory base addresses etc.
1593 +typedef struct vpbe_dm_info {
1594 + vpbe_dm_win_info_t *osd0;
1595 + vpbe_dm_win_info_t *osd1;
1596 + vpbe_dm_win_info_t *vid0;
1597 + vpbe_dm_win_info_t *vid1;
1599 +/* to map the registers */
1600 + dma_addr_t mmio_base_phys;
1601 + unsigned int mmio_base;
1602 + unsigned int mmio_size;
1604 + wait_queue_head_t vsync_wait;
1605 + unsigned int vsync_cnt;
1608 + /* this is the function that configures the output device (NTSC/PAL/LCD)
1609 + * for the required output format (composite/s-video/component/rgb)
1611 + void (*output_device_config) (void);
1613 + struct device *dev;
1615 + vpbe_backg_color_t backg; /* background color */
1616 + vpbe_dclk_t dclk; /*DCLK parameters */
1617 + vpbe_display_format_t display; /*Display interface and mode */
1618 + vpbe_fb_videomode_t videomode; /*Cuurent videomode */
1619 + char ram_clut[256][3]; /*RAM CLUT array */
1620 + struct fb_cursor cursor; /* cursor config params from fb.h */
1621 +/*Flag that indicates whether any of the display is enabled or not*/
1622 + int display_enable;
1626 + * Functions Definitions for 'davincifb' module
1628 +int vpbe_mem_alloc_window_buf(vpbe_dm_win_info_t *);
1629 +int vpbe_mem_release_window_buf(vpbe_dm_win_info_t *);
1630 +void init_display_function(vpbe_display_format_t *);
1631 +int vpbe_mem_alloc_struct(vpbe_dm_win_info_t **);
1632 +void set_vid0_default_conf(void);
1633 +void set_vid1_default_conf(void);
1634 +void set_osd0_default_conf(void);
1635 +void set_osd1_default_conf(void);
1636 +void set_cursor_default_conf(void);
1637 +void set_dm_default_conf(void);
1638 +void set_win_enable(char *, unsigned int);
1639 +int within_vid0_limits(u32, u32, u32, u32);
1640 +void vpbe_set_display_default(void);
1642 +void set_win_position(char *, u32, u32, u32, u32);
1643 +void change_win_param(int);
1644 +void set_interlaced(char *, unsigned int);
1645 +#endif /* __KERNEL__ */
1648 + * Function definations for 'osd' module
1651 +int vpbe_enable_window(vpbe_dm_win_info_t *);
1652 +int vpbe_disable_window(vpbe_dm_win_info_t *);
1653 +int vpbe_vid_osd_select_field_frame(u8 *, u8);
1654 +int vpbe_bitmap_set_blend_factor(u8 *, vpbe_bitmap_blend_params_t *);
1655 +int vpbe_bitmap_set_ram_clut(void);
1656 +int vpbe_enable_disable_attribute_window(u32);
1657 +int vpbe_get_blinking(u8 *, vpbe_blink_option_t *);
1658 +int vpbe_set_blinking(u8 *, vpbe_blink_option_t *);
1659 +int vpbe_set_vid_params(u8 *, vpbe_video_config_params_t *);
1660 +int vpbe_get_vid_params(u8 *, vpbe_video_config_params_t *);
1661 +int vpbe_bitmap_get_params(u8 *, vpbe_bitmap_config_params_t *);
1662 +int vpbe_bitmap_set_params(u8 *, vpbe_bitmap_config_params_t *);
1663 +int vpbe_set_cursor_params(struct fb_cursor *);
1664 +int vpbe_set_vid_expansion(vpbe_win_expansion_t *);
1665 +int vpbe_set_dclk(vpbe_dclk_t *);
1666 +int vpbe_set_display_format(vpbe_display_format_t *);
1667 +int vpbe_set_backg_color(vpbe_backg_color_t *);
1668 +int vpbe_set_interface(u8);
1669 +int vpbe_query_mode(vpbe_mode_info_t *);
1670 +int vpbe_set_mode(struct vpbe_fb_videomode *);
1671 +int vpbe_set_venc_clk_source(u8);
1672 +void set_vid0_default_conf(void);
1673 +void set_osd0_default_conf(void);
1674 +void set_vid1_default_conf(void);
1675 +void set_osd1_default_conf(void);
1676 +void set_cursor_default_conf(void);
1677 +void set_dm_default_conf(void);
1679 + * Function definations for 'venc' module
1682 +void davincifb_ntsc_composite_config(void);
1683 +void davincifb_ntsc_svideo_config(void);
1684 +void davincifb_ntsc_component_config(void);
1685 +void davincifb_pal_composite_config(void);
1686 +void davincifb_pal_svideo_config(void);
1687 +void davincifb_pal_component_config(void);
1689 +void vpbe_davincifb_ntsc_rgb_config(void);
1690 +void vpbe_davincifb_pal_rgb_config(void);
1691 +void vpbe_davincifb_525p_component_config(void);
1692 +void vpbe_davincifb_625p_component_config(void);
1694 +void vpbe_enable_venc(int);
1695 +void vpbe_enable_dacs(int);
1697 + * Function definations for 'dlcd' module
1699 +void vpbe_davincifb_480p_prgb_config(void);
1700 +void vpbe_davincifb_400p_prgb_config(void);
1701 +void vpbe_davincifb_350p_prgb_config(void);
1702 +void vpbe_set_display_timing(struct vpbe_fb_videomode *);
1704 +void vpbe_enable_lcd(int);
1706 + * Following functions are not implemented
1708 +void vpbe_davincifb_default_ycc16_config(void);
1709 +void vpbe_davincifb_default_ycc8_config(void);
1710 +void vpbe_davincifb_default_srgb_config(void);
1711 +void vpbe_davincifb_default_epson_config(void);
1712 +void vpbe_davincifb_default_casio_config(void);
1713 +void vpbe_davincifb_default_UDISP_config(void);
1714 +void vpbe_davincifb_default_STN_config(void);
1715 +#endif /*__KERNEL__*/
1717 +#endif /* End of #ifndef DAVINCI_VPBE_H */