15 static void print_tdfd_vid_cfg(tdfx_vid_config_t
* cfg
) {
16 printf("tdfx_vid version %d\n"
21 cfg
->screen_width
, cfg
->screen_height
);
25 int main(int argc
, char** argv
) {
27 unsigned char *mem
,*ptr
;
28 tdfx_vid_agp_move_t move
;
29 tdfx_vid_config_t cfg
;
32 fd
= open("/dev/tdfx_vid", O_RDWR
);
35 printf("Can't open /dev/tdfx_vid\n");
39 if(ioctl(fd
,TDFX_VID_GET_CONFIG
,&cfg
)) {
40 printf("Ioctl GET_CONFIG error\n");
45 print_tdfd_vid_cfg(&cfg
);
47 mem
= mmap( NULL
, 640*480*2, PROT_READ
| PROT_WRITE
, MAP_SHARED
,
50 if(mem
== MAP_FAILED
) {
51 printf("Memmap failed !!!!!\n");
55 /* for(ptr = mem, i = 0 ; i < 640*480 ; i++) { */
56 /* ptr[0] = i & 0xFF; */
57 /* ptr[1] = (i & 0xFF); */
61 memset(mem
,0xFF,640*480*2);
63 memset(&move
, 0, sizeof(tdfx_vid_agp_move_t
));
66 move
.src_stride
= 640;
67 move
.dst_stride
= 640*2;
69 if(ioctl(fd
,TDFX_VID_AGP_MOVE
,&move
)) {
70 printf("AGP Move failed !!!!\n");
74 printf("AGP Move ????\n");
78 blit
.src_stride
= 640*2;
79 blit
.src_x
= blit
.src_y
= 0;
82 blit
.src_format
= cfg
.screen_format
;
84 blit
.dst
= 240*640*2+320;
85 blit
.dst_stride
= 640*2;
86 blit
.dst_x
= blit
.dst_y
= 0;
89 blit
.dst_format
= cfg
.screen_format
;
91 if(ioctl(fd
,TDFX_VID_BLIT
,&blit
)) {
92 printf("Blit failed !!!!\n");