Mercurial > mplayer.hg
comparison vidix/drivers/genfb_vid.c @ 4127:96d51d3c856b
just a dummy for now (for developement)
author | alex |
---|---|
date | Sun, 13 Jan 2002 00:26:46 +0000 |
parents | |
children | 62a6135d090e |
comparison
equal
deleted
inserted
replaced
4126:5ee0a20cc791 | 4127:96d51d3c856b |
---|---|
1 #include <errno.h> | |
2 #include <stdio.h> | |
3 #include <stdlib.h> | |
4 #include <string.h> | |
5 #include <math.h> | |
6 #include <inttypes.h> | |
7 #include <fcntl.h> | |
8 | |
9 #include "../vidix.h" | |
10 #include "../fourcc.h" | |
11 #include "../../libdha/libdha.h" | |
12 #include "../../libdha/pci_ids.h" | |
13 | |
14 static int fd; | |
15 | |
16 static void *mmio_base = 0; | |
17 static void *mem_base = 0; | |
18 static int32_t overlay_offset = 0; | |
19 static uint32_t ram_size = 0; | |
20 | |
21 static int probed = 0; | |
22 | |
23 /* VIDIX exports */ | |
24 | |
25 static vidix_capability_t genfb_cap = | |
26 { | |
27 "General Framebuffer", | |
28 TYPE_OUTPUT, | |
29 0, | |
30 1, | |
31 0, | |
32 0, | |
33 1024, | |
34 768, | |
35 4, | |
36 4, | |
37 -1, | |
38 FLAG_UPSCALER|FLAG_DOWNSCALER, | |
39 -1, | |
40 -1, | |
41 { 0, 0, 0, 0 } | |
42 }; | |
43 | |
44 unsigned int vixGetVersion(void) | |
45 { | |
46 return(VIDIX_VERSION); | |
47 } | |
48 | |
49 int vixProbe(int verbose) | |
50 { | |
51 int err = 0; | |
52 | |
53 printf("[genfb] probe\n"); | |
54 | |
55 fd = open("/dev/fb0", O_RDWR); | |
56 if (fd < 0) | |
57 { | |
58 printf("Error occured durint open: %s\n", strerror(errno)); | |
59 err = errno; | |
60 } | |
61 | |
62 probed = 1; | |
63 | |
64 return(err); | |
65 } | |
66 | |
67 int vixInit(void) | |
68 { | |
69 printf("[genfb] init\n"); | |
70 | |
71 if (!probed) | |
72 { | |
73 printf("Driver was not probed but is being initialized\n"); | |
74 return(EINTR); | |
75 } | |
76 | |
77 return(0); | |
78 } | |
79 | |
80 void vixDestroy(void) | |
81 { | |
82 printf("[genfb] destory\n"); | |
83 return; | |
84 } | |
85 | |
86 int vixGetCapability(vidix_capability_t *to) | |
87 { | |
88 memcpy(to, &genfb_cap, sizeof(vidix_capability_t)); | |
89 return(0); | |
90 } | |
91 | |
92 int vixQueryFourcc(vidix_fourcc_t *to) | |
93 { | |
94 printf("[genfb] query fourcc (%x)\n", to->fourcc); | |
95 | |
96 to->depth = VID_DEPTH_1BPP | VID_DEPTH_2BPP | | |
97 VID_DEPTH_4BPP | VID_DEPTH_8BPP | | |
98 VID_DEPTH_12BPP | VID_DEPTH_15BPP | | |
99 VID_DEPTH_16BPP | VID_DEPTH_24BPP | | |
100 VID_DEPTH_32BPP; | |
101 | |
102 to->flags = 0; | |
103 return(0); | |
104 } | |
105 | |
106 int vixConfigPlayback(vidix_playback_t *info) | |
107 { | |
108 printf("[genfb] config playback\n"); | |
109 | |
110 info->num_frames = 2; | |
111 info->frame_size = info->src.w*info->src.h+(info->src.w*info->src.h)/2; | |
112 info->dga_addr = malloc(info->num_frames*info->frame_size); | |
113 printf("[genfb] frame_size: %d, dga_addr: %x\n", | |
114 info->frame_size, info->dga_addr); | |
115 | |
116 return(0); | |
117 } | |
118 | |
119 int vixPlaybackOn(void) | |
120 { | |
121 printf("[genfb] playback on\n"); | |
122 return(0); | |
123 } | |
124 | |
125 int vixPlaybackOff(void) | |
126 { | |
127 printf("[genfb] playback off\n"); | |
128 return(0); | |
129 } | |
130 | |
131 int vixPlaybackFrameSelect(unsigned int frame) | |
132 { | |
133 return(0); | |
134 } |