Mercurial > mplayer.hg
annotate drivers/tdfx_vid_test.c @ 36425:e89214f37501
Remove unused definitions.
author | ib |
---|---|
date | Sun, 24 Nov 2013 00:44:44 +0000 |
parents | 0f1b5b68af32 |
children |
rev | line source |
---|---|
26003
a506a6ab14e1
Add standard license header and make copyright notices consistent.
diego
parents:
24287
diff
changeset
|
1 /* |
a506a6ab14e1
Add standard license header and make copyright notices consistent.
diego
parents:
24287
diff
changeset
|
2 * Copyright (C) 2003 Alban Bedel |
a506a6ab14e1
Add standard license header and make copyright notices consistent.
diego
parents:
24287
diff
changeset
|
3 * |
a506a6ab14e1
Add standard license header and make copyright notices consistent.
diego
parents:
24287
diff
changeset
|
4 * This file is part of MPlayer. |
a506a6ab14e1
Add standard license header and make copyright notices consistent.
diego
parents:
24287
diff
changeset
|
5 * |
a506a6ab14e1
Add standard license header and make copyright notices consistent.
diego
parents:
24287
diff
changeset
|
6 * MPlayer is free software; you can redistribute it and/or modify |
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. |
a506a6ab14e1
Add standard license header and make copyright notices consistent.
diego
parents:
24287
diff
changeset
|
10 * |
a506a6ab14e1
Add standard license header and make copyright notices consistent.
diego
parents:
24287
diff
changeset
|
11 * MPlayer is distributed in the hope that it will be useful, |
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 |
a506a6ab14e1
Add standard license header and make copyright notices consistent.
diego
parents:
24287
diff
changeset
|
17 * with MPlayer; if not, write to the Free Software Foundation, Inc., |
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. |
a506a6ab14e1
Add standard license header and make copyright notices consistent.
diego
parents:
24287
diff
changeset
|
19 */ |
22659 | 20 |
21 #include <stdlib.h> | |
22 #include <stdio.h> | |
24262 | 23 #include <string.h> |
22659 | 24 #include <sys/types.h> |
25 #include <sys/stat.h> | |
26 #include <fcntl.h> | |
27 #include <unistd.h> | |
28 #include <sys/mman.h> | |
29 #include <sys/ioctl.h> | |
30 #include <inttypes.h> | |
31 | |
32 #include "tdfx_vid.h" | |
33 | |
34 | |
35 static void print_tdfd_vid_cfg(tdfx_vid_config_t* cfg) { | |
36 printf("tdfx_vid version %d\n" | |
37 " Ram: %d\n" | |
38 " Screen: %d x %d\n", | |
39 cfg->version, | |
40 cfg->ram_size, | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26003
diff
changeset
|
41 cfg->screen_width, cfg->screen_height); |
22659 | 42 } |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26003
diff
changeset
|
43 |
22659 | 44 |
24287 | 45 int main(void) { |
24265 | 46 int fd; |
47 unsigned char *mem; | |
48 /* int i; */ | |
49 /* unsigned char *ptr; */ | |
22659 | 50 tdfx_vid_agp_move_t move; |
51 tdfx_vid_config_t cfg; | |
52 tdfx_vid_blit_t blit; | |
53 | |
54 fd = open("/dev/tdfx_vid", O_RDWR); | |
55 | |
56 if(fd <= 0) { | |
57 printf("Can't open /dev/tdfx_vid\n"); | |
58 return 1; | |
59 } | |
60 | |
61 if(ioctl(fd,TDFX_VID_GET_CONFIG,&cfg)) { | |
62 printf("Ioctl GET_CONFIG error\n"); | |
63 close(fd); | |
64 return 1; | |
65 } | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26003
diff
changeset
|
66 |
22659 | 67 print_tdfd_vid_cfg(&cfg); |
68 | |
69 mem = mmap( NULL, 640*480*2, PROT_READ | PROT_WRITE, MAP_SHARED, | |
70 fd, 0); | |
71 | |
72 if(mem == MAP_FAILED) { | |
73 printf("Memmap failed !!!!!\n"); | |
74 return 1; | |
75 } | |
76 | |
77 /* for(ptr = mem, i = 0 ; i < 640*480 ; i++) { */ | |
78 /* ptr[0] = i & 0xFF; */ | |
79 /* ptr[1] = (i & 0xFF); */ | |
80 /* ptr += 2; */ | |
81 /* } */ | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26003
diff
changeset
|
82 |
22659 | 83 memset(mem,0xFF,640*480*2); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26003
diff
changeset
|
84 |
22659 | 85 memset(&move, 0, sizeof(tdfx_vid_agp_move_t)); |
86 move.width = 640; | |
87 move.height = 240; | |
88 move.src_stride = 640; | |
89 move.dst_stride = 640*2; | |
90 | |
91 if(ioctl(fd,TDFX_VID_AGP_MOVE,&move)) { | |
92 printf("AGP Move failed !!!!\n"); | |
93 return 0; | |
94 } | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26003
diff
changeset
|
95 |
22659 | 96 printf("AGP Move ????\n"); |
97 sleep(1); | |
98 | |
99 blit.src = 0; | |
100 blit.src_stride = 640*2; | |
101 blit.src_x = blit.src_y = 0; | |
102 blit.src_w = 320; | |
103 blit.src_h = 240; | |
104 blit.src_format = cfg.screen_format; | |
105 | |
106 blit.dst = 240*640*2+320; | |
107 blit.dst_stride = 640*2; | |
108 blit.dst_x = blit.dst_y = 0; | |
109 blit.dst_w = 320; | |
110 blit.dst_h = 240; | |
111 blit.dst_format = cfg.screen_format; | |
112 | |
113 if(ioctl(fd,TDFX_VID_BLIT,&blit)) { | |
114 printf("Blit failed !!!!\n"); | |
115 return 0; | |
116 } | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26003
diff
changeset
|
117 |
22659 | 118 close(fd); |
119 return 1; | |
120 } |