annotate libvo/vo_fsdga.c @ 6719:5291d74a60c9

xv support under cygwin - patch by Sycotic Smith <sycotic at linuxmail.org>
author alex
date Fri, 12 Jul 2002 17:09:53 +0000
parents 2001affedb75
children eca7dbad0166
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
1
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
2 /*
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
3 * video_out_dga.c, X11 interface
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
4 *
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
5 *
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
6 * Copyright ( C ) 2001, Andreas Ackermann. All Rights Reserved.
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
7 *
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
8 * <acki@acki-netz.de>
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
9 *
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
10 * note well:
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
11 *
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
12 * o this is alpha
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
13 * o covers only common video card formats
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
14 * o works only on intel architectures
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
15 *
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
16 */
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
17
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
18
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
19
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
20 #include <stdio.h>
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
21 #include <stdlib.h>
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
22 #include <string.h>
4737
32e1f5042f65 I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents: 4596
diff changeset
23 #include <errno.h>
38
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
24
354
7de9e48c83a5 memcpy() moved mmx.h -> fastmemcpy.h
arpi_esp
parents: 38
diff changeset
25 //#include "fastmemcpy.h"
38
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
26
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
27 #include "linux/keycodes.h"
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
28 #include "config.h"
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
29 #include "video_out.h"
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
30 #include "video_out_internal.h"
2732
ae79207a3055 Move yuv2rgb to postprocess
nick
parents: 1501
diff changeset
31 #include "../postproc/rgb2rgb.h"
38
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
32
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
33 LIBVO_EXTERN( fsdga )
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
34
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
35 #include <X11/Xlib.h>
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
36 #include <X11/extensions/xf86dga.h>
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
37
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
38 #include "x11_common.h"
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
39
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
40 static vo_info_t vo_info =
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
41 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
42 "FullScreen DGA ( Direct Graphic Access )",
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
43 "fsdga",
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
44 "A'rpi/ESP-team & Andreas Ackermann <acki@acki-netz.de>",
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
45 ""
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
46 };
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
47
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
48 static int vo_dga_width; // bytes per line in framebuffer
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
49 static int vo_dga_vp_width; // visible pixels per line in framebuffer
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
50 static int vo_dga_vp_height; // visible lines in framebuffer
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
51 static int vo_dga_is_running = 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
52 static int vo_dga_src_width; // width of video in pixels
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
53 static int vo_dga_src_height; // height of video in pixels
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
54 static int vo_dga_bpp; // bytes per pixel in framebuffer
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
55 static int vo_dga_src_offset=0; // offset in src
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
56 static int vo_dga_vp_offset=0; // offset in dest
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
57 static int vo_dga_bytes_per_line; // longwords per line to copy
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
58 static int vo_dga_src_skip; // bytes to skip after copying one line
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
59 // (not supported yet) in src
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
60 static int vo_dga_vp_skip; // dto. for dest
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
61 static int vo_dga_lines; // num of lines to copy
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
62 static int vo_dga_src_format;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
63
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
64 static unsigned char *vo_dga_base;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
65 static Display *vo_dga_dpy;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
66
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
67
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
68 #if defined (HAVE_SSE) || defined (HAVE_3DNOW)
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
69 #define movntq "movntq" // use this for processors that have SSE or 3Dnow
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
70 #else
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
71 #define movntq "movq" // for MMX-only processors
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
72 #endif
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
73
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
74
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
75 #define rep_movsl(dest, src, numwords, d_add, count) \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
76 __asm__ __volatile__( \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
77 " \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
78 xfer: \n\t\
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
79 movl %%edx, %%ecx \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
80 cld\n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
81 rep\n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
82 movsl \n\t\
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
83 add %%eax, %%edi \n\t\
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
84 dec %%ebx \n\t\
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
85 jnz xfer \n\t\
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
86 " \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
87 : \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
88 : "a" (d_add), "b" (count), "S" (src), "D" (dest), "d" (numwords) \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
89 : "memory" )
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
90
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
91 #if 0
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
92 : "S" (src), "D" (dest), "c" (numwords) \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
93 movq (%%eax), %%mm0 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
94 add $64, %%edx \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
95 movq 8(%%eax), %%mm1 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
96 add $64, %%eax \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
97 movq -48(%%eax), %%mm2 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
98 movq %%mm0, -64(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
99 movq -40(%%eax), %%mm3 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
100 movq %%mm1, -56(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
101 movq -32(%%eax), %%mm4 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
102 movq %%mm2, -48(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
103 movq -24(%%eax), %%mm5 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
104 movq %%mm3, -40(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
105 movq -16(%%eax), %%mm6 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
106 movq %%mm4, -32(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
107 movq -8(%%eax), %%mm7 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
108 movq %%mm5, -24(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
109 movq %%mm6, -16(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
110 dec %%ecx \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
111 movq %%mm7, -8(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
112 jnz xfer \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
113
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
114 #endif
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
115
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
116 #define mmx_movsl(dest, src, numwords) \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
117 __asm__ __volatile__( \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
118 " \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
119 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
120 xfer: \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
121 movq (%%eax), %%mm0 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
122 add $64, %%edx \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
123 movq 8(%%eax), %%mm1 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
124 add $64, %%eax \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
125 movq -48(%%eax), %%mm2 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
126 movq %%mm0, -64(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
127 movq -40(%%eax), %%mm3 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
128 movq %%mm1, -56(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
129 movq -32(%%eax), %%mm4 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
130 movq %%mm2, -48(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
131 movq -24(%%eax), %%mm5 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
132 movq %%mm3, -40(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
133 movq -16(%%eax), %%mm6 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
134 movq %%mm4, -32(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
135 movq -8(%%eax), %%mm7 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
136 movq %%mm5, -24(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
137 movq %%mm6, -16(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
138 dec %%ecx \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
139 movq %%mm7, -8(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
140 jnz xfer \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
141 \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
142 " \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
143 : \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
144 : "a" (src), "d" (dest), "c" (numwords) \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
145 : "memory" )
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
146
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
147 // src <= eax
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
148 // dst <= edx
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
149 // num <= ecx
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
150
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
151 static uint32_t draw_frame( uint8_t *src[] ){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
152
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
153 int vp_skip = vo_dga_vp_skip;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
154 int lpl = vo_dga_bytes_per_line >> 2;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
155 int numlines = vo_dga_lines;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
156
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
157 char *s, *d;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
158
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
159 if( vo_dga_src_format==IMGFMT_YV12 ){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
160 // We'll never reach this point, because YV12 codecs always calls draw_slice
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
161 printf("vo_dga: draw_frame() doesn't support IMGFMT_YV12 (yet?)\n");
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
162 }else{
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
163 s = *src;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
164 d = (&((char *)vo_dga_base)[vo_dga_vp_offset]);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
165 rep_movsl(d, s, lpl, vo_dga_vp_skip, numlines );
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
166 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
167
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
168 return 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
169 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
170
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
171 static void check_events(void)
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
172 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
173 int e=vo_x11_check_events(vo_dga_dpy);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
174 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
175
1501
d40f2b686846 changes according to -utf8 option, draw_osd() function added
atlka
parents: 612
diff changeset
176 static void draw_osd(void)
d40f2b686846 changes according to -utf8 option, draw_osd() function added
atlka
parents: 612
diff changeset
177 {
d40f2b686846 changes according to -utf8 option, draw_osd() function added
atlka
parents: 612
diff changeset
178 }
d40f2b686846 changes according to -utf8 option, draw_osd() function added
atlka
parents: 612
diff changeset
179
38
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
180 static void flip_page( void ){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
181 // printf("vo_dga: In flippage\n");
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
182 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
183
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
184 static unsigned int pix_buf_y[4][2048];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
185 static unsigned int pix_buf_uv[2][2048*2];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
186 static int dga_srcypos=0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
187 static int dga_ypos=0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
188 static int dga_last_ypos=-1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
189 static unsigned int dga_xinc,dga_yinc,dga_xinc2;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
190
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
191 static unsigned char clip_table[768];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
192
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
193 static int yuvtab_2568[256];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
194 static int yuvtab_3343[256];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
195 static int yuvtab_0c92[256];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
196 static int yuvtab_1a1e[256];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
197 static int yuvtab_40cf[256];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
198
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
199
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
200 static uint32_t draw_slice( uint8_t *srcptr[],int stride[],
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
201 int w,int h,int x,int y )
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
202 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
203
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
204 if(y==0){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
205 dga_srcypos=-2*dga_yinc;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
206 dga_ypos=-2;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
207 dga_last_ypos=-2;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
208 } // reset counters
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
209
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
210 while(1){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
211 unsigned char *dest=vo_dga_base+(vo_dga_width * dga_ypos)*vo_dga_bpp;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
212 int y0=2+(dga_srcypos>>16);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
213 int y1=1+(dga_srcypos>>17);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
214 int yalpha=(dga_srcypos&0xFFFF)>>8;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
215 int yalpha1=yalpha^255;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
216 int uvalpha=((dga_srcypos>>1)&0xFFFF)>>8;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
217 int uvalpha1=uvalpha^255;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
218 unsigned int *buf0=pix_buf_y[y0&3];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
219 unsigned int *buf1=pix_buf_y[((y0+1)&3)];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
220 unsigned int *uvbuf0=pix_buf_uv[y1&1];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
221 unsigned int *uvbuf1=pix_buf_uv[(y1&1)^1];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
222 int i;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
223
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
224 if(y0>=y+h) break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
225
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
226 dga_ypos++; dga_srcypos+=dga_yinc;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
227
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
228 if(dga_last_ypos!=y0){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
229 unsigned char *src=srcptr[0]+(y0-y)*stride[0];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
230 unsigned int xpos=0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
231 dga_last_ypos=y0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
232 // this loop should be rewritten in MMX assembly!!!!
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
233 for(i=0;i<vo_dga_vp_width;i++){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
234 register unsigned int xx=xpos>>8;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
235 register unsigned int xalpha=xpos&0xFF;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
236 buf1[i]=(src[xx]*(xalpha^255)+src[xx+1]*xalpha);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
237 xpos+=dga_xinc;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
238 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
239 if(!(y0&1)){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
240 unsigned char *src1=srcptr[1]+(y1-y/2)*stride[1];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
241 unsigned char *src2=srcptr[2]+(y1-y/2)*stride[2];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
242 xpos=0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
243 // this loop should be rewritten in MMX assembly!!!!
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
244 for(i=0;i<vo_dga_vp_width;i++){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
245 register unsigned int xx=xpos>>8;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
246 register unsigned int xalpha=xpos&0xFF;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
247 uvbuf1[i]=(src1[xx]*(xalpha^255)+src1[xx+1]*xalpha);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
248 uvbuf1[i+2048]=(src2[xx]*(xalpha^255)+src2[xx+1]*xalpha);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
249 xpos+=dga_xinc2;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
250 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
251 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
252 if(!y0) continue;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
253 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
254
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
255 // this loop should be rewritten in MMX assembly!!!!
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
256 for(i=0;i<vo_dga_vp_width;i++){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
257 // linear interpolation && yuv2rgb in a single step:
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
258 int Y=yuvtab_2568[((buf0[i]*yalpha1+buf1[i]*yalpha)>>16)];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
259 int U=((uvbuf0[i]*uvalpha1+uvbuf1[i]*uvalpha)>>16);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
260 int V=((uvbuf0[i+2048]*uvalpha1+uvbuf1[i+2048]*uvalpha)>>16);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
261 dest[0]=clip_table[((Y + yuvtab_3343[U]) >>13)];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
262 dest[1]=clip_table[((Y + yuvtab_0c92[V] + yuvtab_1a1e[U]) >>13)];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
263 dest[2]=clip_table[((Y + yuvtab_40cf[V]) >>13)];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
264 dest+=vo_dga_bpp;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
265 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
266
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
267 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
268
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
269
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
270 return 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
271 };
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
272
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
273 static const vo_info_t* get_info( void )
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
274 { return &vo_info; }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
275
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
276 static uint32_t query_format( uint32_t format )
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
277 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
278 printf("vo_dga: query_format\n");
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
279
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
280 if( !vo_init() ) return 0; // Can't open X11
612
77e0094f0cce some warnings killed
szabii
parents: 354
diff changeset
281 printf("Format: %lx\n", (unsigned long) format);
38
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
282
6212
2001affedb75 query_format revised
alex
parents: 4737
diff changeset
283 if( format==IMGFMT_YV12 ) return VFCAP_CSP_SUPPORTED;
38
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
284 if( ( format&IMGFMT_BGR_MASK )==IMGFMT_BGR &&
6212
2001affedb75 query_format revised
alex
parents: 4737
diff changeset
285 ( format&0xFF )==vo_depthonscreen ) return VFCAP_CSP_SUPPORTED|VFCAP_CSP_SUPPORTED_BY_HW;
38
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
286 return 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
287 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
288
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
289
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
290 static void
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
291 uninit(void)
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
292 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
293 vo_dga_is_running = 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
294 XUngrabPointer (vo_dga_dpy, CurrentTime);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
295 XUngrabKeyboard (vo_dga_dpy, CurrentTime);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
296 XF86DGADirectVideo (vo_dga_dpy, XDefaultScreen(vo_dga_dpy), 0);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
297 XCloseDisplay(vo_dga_dpy);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
298 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
299
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
300
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
301
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
302
4433
df8e0f71cc3c new info for tuning
nick
parents: 4352
diff changeset
303 static uint32_t config( uint32_t width, uint32_t height,
38
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
304 uint32_t d_width,uint32_t d_height,
4433
df8e0f71cc3c new info for tuning
nick
parents: 4352
diff changeset
305 uint32_t fullscreen,char *title,uint32_t format,const vo_tune_info_t *info )
38
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
306 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
307
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
308 int bank, ram;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
309 int x_off, y_off;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
310
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
311 if( vo_dga_is_running )return -1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
312
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
313 if( !vo_init() ){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
314 printf("vo_dga: vo_init() failed!\n");
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
315 return 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
316 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
317
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
318 if((vo_dga_dpy = XOpenDisplay(0))==NULL)
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
319 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
320 printf ("vo_dga: Can't open display\n");
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
321 return 1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
322 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
323
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
324 XF86DGAGetVideo (vo_dga_dpy, XDefaultScreen(vo_dga_dpy),
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
325 (char **)&vo_dga_base, &vo_dga_width, &bank, &ram);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
326 XF86DGAGetViewPortSize (vo_dga_dpy, XDefaultScreen (vo_dga_dpy),
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
327 &vo_dga_vp_width, &vo_dga_vp_height);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
328
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
329
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
330 // do some more checkings here ...
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
331 if( format==IMGFMT_YV12 )
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
332 yuv2rgb_init( vo_depthonscreen, MODE_RGB );
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
333
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
334 vo_dga_src_format = format;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
335 vo_dga_src_width = width;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
336 vo_dga_src_height = height;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
337 vo_dga_bpp = (vo_depthonscreen+7) >> 3;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
338
612
77e0094f0cce some warnings killed
szabii
parents: 354
diff changeset
339 printf("vo_dga: bytes/line: %d, screen res: %dx%d, depth: %d, base: %p, bpp: %d\n",
38
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
340 vo_dga_width, vo_dga_vp_width,
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
341 vo_dga_vp_height, vo_depthonscreen, vo_dga_base,
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
342 vo_dga_bpp);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
343 printf("vo_dga: video res: %dx%d\n", vo_dga_src_width, vo_dga_src_height);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
344
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
345 if(vo_dga_src_width > vo_dga_vp_width ||
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
346 vo_dga_src_height > vo_dga_vp_height){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
347 printf("vo_dga: Sorry, video larger than viewport is not yet supported!\n");
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
348 // ugly, do something nicer in the future ...
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
349 return 1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
350 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
351
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
352 x_off = (vo_dga_vp_width - vo_dga_src_width)>>1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
353 y_off = (vo_dga_vp_height - vo_dga_src_height)>>1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
354
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
355 vo_dga_bytes_per_line = vo_dga_src_width * vo_dga_bpp; // todo
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
356 vo_dga_lines = vo_dga_src_height; // todo
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
357
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
358
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
359 vo_dga_src_offset = 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
360 vo_dga_vp_offset = (y_off * vo_dga_width + x_off ) * vo_dga_bpp;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
361
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
362 vo_dga_vp_skip = (vo_dga_width - vo_dga_src_width) * vo_dga_bpp; // todo
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
363
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
364 printf("vo_dga: vp_off=%d, vp_skip=%d, bpl=%d\n",
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
365 vo_dga_vp_offset, vo_dga_vp_skip, vo_dga_bytes_per_line);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
366
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
367
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
368
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
369 XF86DGASetViewPort (vo_dga_dpy, XDefaultScreen(vo_dga_dpy), 0, 0);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
370 XF86DGADirectVideo (vo_dga_dpy, XDefaultScreen(vo_dga_dpy),
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
371 XF86DGADirectGraphics | XF86DGADirectMouse |
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
372 XF86DGADirectKeyb);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
373
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
374 XGrabKeyboard (vo_dga_dpy, DefaultRootWindow(vo_dga_dpy), True,
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
375 GrabModeAsync,GrabModeAsync, CurrentTime);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
376 XGrabPointer (vo_dga_dpy, DefaultRootWindow(vo_dga_dpy), True,
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
377 ButtonPressMask,GrabModeAsync, GrabModeAsync,
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
378 None, None, CurrentTime);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
379
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
380 // now clear screen
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
381
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
382 memset(vo_dga_base, 0, vo_dga_width * vo_dga_vp_height * vo_dga_bpp);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
383
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
384 dga_yinc=(vo_dga_src_height<<16)/vo_dga_vp_height;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
385 dga_xinc=(vo_dga_src_width<<8)/vo_dga_vp_width;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
386 dga_xinc2=dga_xinc>>1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
387
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
388 { int i;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
389 for(i=0;i<256;i++){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
390 clip_table[i]=0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
391 clip_table[i+256]=i;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
392 clip_table[i+512]=255;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
393 yuvtab_2568[i]=(0x2568*(i-16))+(256<<13);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
394 yuvtab_3343[i]=0x3343*(i-128);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
395 yuvtab_0c92[i]=-0x0c92*(i-128);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
396 yuvtab_1a1e[i]=-0x1a1e*(i-128);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
397 yuvtab_40cf[i]=0x40cf*(i-128);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
398 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
399 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
400
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
401 vo_dga_is_running = 1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
402 return 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
403 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
404
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
405 #if 0
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
406 int vo_dga_query_event(void){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
407
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
408 XEvent myevent;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
409 char text[10];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
410 KeySym mykey;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
411 int retval = 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
412 int i;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
413
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
414 if( vo_dga_is_running ){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
415 if(XPending(vo_dga_dpy)>0)
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
416 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
417 XNextEvent(vo_dga_dpy, &myevent);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
418 switch (myevent.type)
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
419 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
420 case ButtonPress:
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
421 /* Reaktion auf Knopfdruck ---> Textausgabe an der
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
422 Mauscursorposition */
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
423
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
424 retval = 'q';
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
425 break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
426 case KeyPress:
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
427 /* Reaktion auf Tastendruck --> Testen ob Taste == "q",
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
428 falls ja: Programmende */
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
429 i=XLookupString(&myevent, text, 10, &mykey, 0);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
430
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
431 if (mykey&0xff00 != 0) mykey=mykey&0x00ff + 256;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
432
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
433 switch ( mykey )
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
434 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
435 case wsLeft: retval=KEY_LEFT; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
436 case wsRight: retval=KEY_RIGHT; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
437 case wsUp: retval=KEY_UP; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
438 case wsDown: retval=KEY_DOWN; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
439 case wsSpace: retval=' '; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
440 case wsEscape: retval=KEY_ESC; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
441 case wsEnter: retval=KEY_ENTER; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
442 case wsq:
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
443 case wsQ: retval='q'; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
444 case wsp:
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
445 case wsP: retval='p'; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
446 case wsMinus:
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
447 case wsGrayMinus: retval='-'; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
448 case wsPlus:
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
449 case wsGrayPlus: retval='+'; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
450 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
451 break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
452 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
453 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
454 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
455 return retval;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
456 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
457 #endif
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
458
4352
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 2732
diff changeset
459 static uint32_t preinit(const char *arg)
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 2732
diff changeset
460 {
4737
32e1f5042f65 I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents: 4596
diff changeset
461 if(arg)
32e1f5042f65 I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents: 4596
diff changeset
462 {
32e1f5042f65 I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents: 4596
diff changeset
463 printf("vo_fsdga: Unknown subdevice: %s\n",arg);
32e1f5042f65 I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents: 4596
diff changeset
464 return ENOSYS;
32e1f5042f65 I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents: 4596
diff changeset
465 }
32e1f5042f65 I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents: 4596
diff changeset
466 return 0;
4352
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 2732
diff changeset
467 }
38
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
468
4596
c35d7ce151b3 10000hl to Holm... control MUST BE static...
arpi
parents: 4592
diff changeset
469 static uint32_t control(uint32_t request, void *data, ...)
4352
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 2732
diff changeset
470 {
4592
5fbfd8545c3b query_ stuff replaced by new control() - patch by David Holm
arpi
parents: 4439
diff changeset
471 switch (request) {
5fbfd8545c3b query_ stuff replaced by new control() - patch by David Holm
arpi
parents: 4439
diff changeset
472 case VOCTRL_QUERY_FORMAT:
5fbfd8545c3b query_ stuff replaced by new control() - patch by David Holm
arpi
parents: 4439
diff changeset
473 return query_format(*((uint32_t*)data));
5fbfd8545c3b query_ stuff replaced by new control() - patch by David Holm
arpi
parents: 4439
diff changeset
474 }
5fbfd8545c3b query_ stuff replaced by new control() - patch by David Holm
arpi
parents: 4439
diff changeset
475 return VO_NOTIMPL;
4352
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 2732
diff changeset
476 }