annotate drivers/mga_vid_test.c @ 34068:c3b22e92a4ec

Don't needlessly set filename in GUI_PREPARE. The filename has already been set (by uiSetFileName()). For gui/win32/interface.c there is no need to set it in guiPlaylistInitialize() either.
author ib
date Thu, 29 Sep 2011 13:52:19 +0000
parents 0ad2da052b2e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1 /*
26003
a506a6ab14e1 Add standard license header and make copyright notices consistent.
diego
parents: 24287
diff changeset
2 * Copyright (C) 1999 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
3 *
27027
03f571138664 standard license headers for mga_vid
diego
parents: 26003
diff changeset
4 * This file is part of mga_vid.
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
5 *
27027
03f571138664 standard license headers for mga_vid
diego
parents: 26003
diff changeset
6 * mga_vid is free software; you can redistribute it and/or modify
26003
a506a6ab14e1 Add standard license header and make copyright notices consistent.
diego
parents: 24287
diff changeset
7 * it under the terms of the GNU General Public License as published by
a506a6ab14e1 Add standard license header and make copyright notices consistent.
diego
parents: 24287
diff changeset
8 * the Free Software Foundation; either version 2 of the License, or
a506a6ab14e1 Add standard license header and make copyright notices consistent.
diego
parents: 24287
diff changeset
9 * (at your option) any later version.
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
10 *
27027
03f571138664 standard license headers for mga_vid
diego
parents: 26003
diff changeset
11 * mga_vid is distributed in the hope that it will be useful,
26003
a506a6ab14e1 Add standard license header and make copyright notices consistent.
diego
parents: 24287
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
a506a6ab14e1 Add standard license header and make copyright notices consistent.
diego
parents: 24287
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
a506a6ab14e1 Add standard license header and make copyright notices consistent.
diego
parents: 24287
diff changeset
14 * GNU General Public License for more details.
a506a6ab14e1 Add standard license header and make copyright notices consistent.
diego
parents: 24287
diff changeset
15 *
a506a6ab14e1 Add standard license header and make copyright notices consistent.
diego
parents: 24287
diff changeset
16 * You should have received a copy of the GNU General Public License along
27027
03f571138664 standard license headers for mga_vid
diego
parents: 26003
diff changeset
17 * with mga_vid; if not, write to the Free Software Foundation, Inc.,
26003
a506a6ab14e1 Add standard license header and make copyright notices consistent.
diego
parents: 24287
diff changeset
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
19 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
20
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
21 //#include <stddef.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
22 #include <stdio.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
23 #include <stdlib.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
24 #include <sys/ioctl.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
25 #include <unistd.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
26 #include <fcntl.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
27 #include <sys/mman.h>
854
76ca00724e12 gcc warnings fixed - patch by Aelius aelius@wish.net
arpi_esp
parents: 76
diff changeset
28 #include <inttypes.h>
6245
aee789fa2d07 When compiling mga_vid_test.c, memcpy() is subject to an implicit
jaf
parents: 854
diff changeset
29 #include <string.h>
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
30 #include "mga_vid.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
31
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
32 mga_vid_config_t config;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
33 uint8_t *mga_vid_base;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
34 uint32_t is_g400;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
35
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
36 #define SRC_IMAGE_WIDTH 256
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
37 #define SRC_IMAGE_HEIGHT 256
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
38
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
39 uint8_t y_image[SRC_IMAGE_WIDTH * SRC_IMAGE_HEIGHT];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
40 uint8_t cr_image[SRC_IMAGE_WIDTH * SRC_IMAGE_HEIGHT];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
41 uint8_t cb_image[SRC_IMAGE_WIDTH * SRC_IMAGE_HEIGHT];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
42
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
43
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
44 void
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
45 write_frame_g200(uint8_t *y,uint8_t *cr, uint8_t *cb)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
46 {
30990
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
47 uint8_t *dest;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
48 uint32_t bespitch,h,w;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
49
30990
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
50 dest = mga_vid_base;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
51 bespitch = (config.src_width + 31) & ~31;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
52
30990
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
53 for(h=0; h < config.src_height; h++)
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
54 {
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
55 memcpy(dest, y, config.src_width);
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
56 y += config.src_width;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
57 dest += bespitch;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
58 }
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
59
30990
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
60 for(h=0; h < config.src_height/2; h++)
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
61 {
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
62 for(w=0; w < config.src_width/2; w++)
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
63 {
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
64 *dest++ = *cb++;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
65 *dest++ = *cr++;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
66 }
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
67 dest += bespitch - config.src_width;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
68 }
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
69 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
70
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
71 void
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
72 write_frame_g400(uint8_t *y,uint8_t *cr, uint8_t *cb)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
73 {
30990
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
74 uint8_t *dest;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
75 uint32_t bespitch,h;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
76
30990
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
77 dest = mga_vid_base;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
78 bespitch = (config.src_width + 31) & ~31;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
79
30990
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
80 for(h=0; h < config.src_height; h++)
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
81 {
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
82 memcpy(dest, y, config.src_width);
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
83 y += config.src_width;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
84 dest += bespitch;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
85 }
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
86
30990
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
87 for(h=0; h < config.src_height/2; h++)
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
88 {
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
89 memcpy(dest, cb, config.src_width/2);
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
90 cb += config.src_width/2;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
91 dest += bespitch/2;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
92 }
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
93
30990
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
94 for(h=0; h < config.src_height/2; h++)
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
95 {
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
96 memcpy(dest, cr, config.src_width/2);
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
97 cr += config.src_width/2;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
98 dest += bespitch/2;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
99 }
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
100 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
101
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
102 void write_frame(uint8_t *y,uint8_t *cr, uint8_t *cb)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
103 {
30990
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
104 if(is_g400)
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
105 write_frame_g400(y,cr,cb);
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
106 else
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
107 write_frame_g200(y,cr,cb);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
108 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
109
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
110 void
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
111 draw_cool_pattern(void)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
112 {
30990
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
113 int i,x,y;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
114
30990
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
115 i = 0;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
116 for (y=0; y<config.src_height; y++) {
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
117 for (x=0; x<config.src_width; x++) {
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
118 y_image[i++] = x*x/2 + y*y/2 - 128;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
119 }
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
120 }
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
121
30990
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
122 i = 0;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
123 for (y=0; y<config.src_height/2; y++)
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
124 for (x=0; x<config.src_width/2; x++)
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
125 {
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
126 cr_image[i++] = x - 128;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
127 }
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
128
30990
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
129 i = 0;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
130 for (y=0; y<config.src_height/2; y++)
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
131 for (x=0; x<config.src_width/2; x++)
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
132 {
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
133 cb_image[i++] = y - 128;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
134 }
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
135 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
136
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
137 void
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
138 draw_color_blend(void)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
139 {
30990
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
140 int i,x,y;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
141
30990
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
142 i = 0;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
143 for (y=0; y<config.src_height; y++) {
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
144 for (x=0; x<config.src_width; x++) {
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
145 y_image[i++] = 0;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
146 }
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
147 }
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
148
30990
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
149 i = 0;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
150 for (y=0; y<config.src_height/2; y++)
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
151 for (x=0; x<config.src_width/2; x++)
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
152 {
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
153 cr_image[i++] = x - 128;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
154 }
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
155
30990
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
156 i = 0;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
157 for (y=0; y<config.src_height/2; y++)
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
158 for (x=0; x<config.src_width/2; x++)
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
159 {
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
160 cb_image[i++] = y - 128;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
161 }
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
162 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
163
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
164
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27027
diff changeset
165 int
24287
6635801bbf1b warning fixes:
diego
parents: 6245
diff changeset
166 main(void)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
167 {
30990
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
168 int f;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
169
30990
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
170 f = open("/dev/mga_vid",O_RDWR);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
171
30990
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
172 if(f == -1)
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
173 {
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
174 fprintf(stderr,"Couldn't open driver\n");
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
175 exit(1);
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
176 }
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
177
30990
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
178 config.version = MGA_VID_VERSION;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
179 config.src_width = SRC_IMAGE_WIDTH;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
180 config.src_height= SRC_IMAGE_HEIGHT;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
181 config.dest_width = SRC_IMAGE_WIDTH;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
182 config.dest_height = SRC_IMAGE_HEIGHT;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
183 config.x_org= 10;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
184 config.y_org= 10;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
185 config.colkey_on = 0;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
186 config.format = MGA_VID_FORMAT_YV12;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
187 config.frame_size=SRC_IMAGE_WIDTH*SRC_IMAGE_HEIGHT*2;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
188 config.num_frames=1;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
189
30990
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
190 if (ioctl(f,MGA_VID_CONFIG,&config))
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
191 {
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
192 perror("Error in config ioctl");
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
193 }
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
194
30990
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
195 if (config.card_type == MGA_G200)
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
196 {
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
197 printf("Testing MGA G200 Backend Scaler with %d MB of RAM\n", config.ram_size);
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
198 is_g400 = 0;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
199 }
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
200 else
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
201 {
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
202 printf("Testing MGA G400 Backend Scaler with %d MB of RAM\n", config.ram_size);
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
203 is_g400 = 1;
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
204 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27027
diff changeset
205
30990
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
206 ioctl(f,MGA_VID_ON,0);
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
207 mga_vid_base = (uint8_t*)mmap(0,256 * 4096,PROT_WRITE,MAP_SHARED,f,0);
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
208 printf("mga_vid_base = %8p\n",mga_vid_base);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
209
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
210
30990
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
211 //memset(y_image,80,256 * 128);
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
212 //memset(cr_image,80,256/2 * 20);
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
213 //memset(cb_image,80,256/2 * 20);
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
214 write_frame(y_image,cr_image,cb_image);
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
215 printf("(1) There should be a green square, offset by 10 pixels from\n"
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
216 " the upper left corner displayed\n");
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
217 sleep(3);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
218
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
219
30990
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
220 draw_cool_pattern();
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
221 write_frame(y_image,cr_image,cb_image);
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
222 printf("(2) There should be a cool mosaic like pattern now.\n");
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
223 sleep(3);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
224
30990
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
225 draw_color_blend();
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
226 write_frame(y_image,cr_image,cb_image);
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
227 printf("(3) There should be a color blend with black, red, purple, blue\n"
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
228 " corners (starting top left going CW)\n");
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
229 sleep(3);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
230
30990
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
231 ioctl(f,MGA_VID_OFF,0);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
232
30990
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
233 close(f);
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29263
diff changeset
234 return 0;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
235 }