2 * Copyright (C) 2003 Alban Bedel
4 * This file is part of MPlayer.
6 * MPlayer is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * MPlayer is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 #include <sys/types.h>
29 #include <sys/ioctl.h>
35 static void print_tdfd_vid_cfg(tdfx_vid_config_t
* cfg
) {
36 printf("tdfx_vid version %d\n"
41 cfg
->screen_width
, cfg
->screen_height
);
49 /* unsigned char *ptr; */
50 tdfx_vid_agp_move_t move
;
51 tdfx_vid_config_t cfg
;
54 fd
= open("/dev/tdfx_vid", O_RDWR
);
57 printf("Can't open /dev/tdfx_vid\n");
61 if(ioctl(fd
,TDFX_VID_GET_CONFIG
,&cfg
)) {
62 printf("Ioctl GET_CONFIG error\n");
67 print_tdfd_vid_cfg(&cfg
);
69 mem
= mmap( NULL
, 640*480*2, PROT_READ
| PROT_WRITE
, MAP_SHARED
,
72 if(mem
== MAP_FAILED
) {
73 printf("Memmap failed !!!!!\n");
77 /* for(ptr = mem, i = 0 ; i < 640*480 ; i++) { */
78 /* ptr[0] = i & 0xFF; */
79 /* ptr[1] = (i & 0xFF); */
83 memset(mem
,0xFF,640*480*2);
85 memset(&move
, 0, sizeof(tdfx_vid_agp_move_t
));
88 move
.src_stride
= 640;
89 move
.dst_stride
= 640*2;
91 if(ioctl(fd
,TDFX_VID_AGP_MOVE
,&move
)) {
92 printf("AGP Move failed !!!!\n");
96 printf("AGP Move ????\n");
100 blit
.src_stride
= 640*2;
101 blit
.src_x
= blit
.src_y
= 0;
104 blit
.src_format
= cfg
.screen_format
;
106 blit
.dst
= 240*640*2+320;
107 blit
.dst_stride
= 640*2;
108 blit
.dst_x
= blit
.dst_y
= 0;
111 blit
.dst_format
= cfg
.screen_format
;
113 if(ioctl(fd
,TDFX_VID_BLIT
,&blit
)) {
114 printf("Blit failed !!!!\n");