Rev 2338 | Rev 2342 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2338 | Rev 2340 | ||
---|---|---|---|
Line 10... | Line 10... | ||
10 | #include |
10 | #include |
11 | #include |
11 | #include |
12 | #include |
12 | #include |
13 | #include |
13 | #include |
Line -... | Line 14... | ||
- | 14 | ||
- | 15 | typedef struct bitmap bitmap_t; |
|
- | 16 | ||
14 | 17 | void parse_cmdline(char *cmdline, char *log); |
|
15 | int _stdcall display_handler(ioctl_t *io); |
18 | int _stdcall display_handler(ioctl_t *io); |
Line -... | Line 19... | ||
- | 19 | int init_agp(void); |
|
- | 20 | ||
- | 21 | int create_video(int width, int height, u32_t *outp); |
|
- | 22 | int create_bitmap(bitmap_t **pbitmap, int width, int height); |
|
- | 23 | int video_blit(uint64_t src_offset, int x, int y, |
|
16 | int init_agp(void); |
24 | int w, int h, int pitch); |
Line 17... | Line 25... | ||
17 | 25 | ||
Line 18... | Line 26... | ||
18 | static char log[256]; |
26 | static char log[256]; |
Line 29... | Line 37... | ||
29 | return 0; |
37 | return 0; |
Line 30... | Line 38... | ||
30 | 38 | ||
31 | if( GetService("DISPLAY") != 0 ) |
39 | if( GetService("DISPLAY") != 0 ) |
Line 32... | Line 40... | ||
32 | return 0; |
40 | return 0; |
33 | 41 | ||
Line 34... | Line 42... | ||
34 | // if( cmdline && *cmdline ) |
42 | if( cmdline && *cmdline ) |
35 | // parse_cmdline(cmdline, &usermode, log, &radeon_modeset); |
43 | parse_cmdline(cmdline, log); |
36 | 44 | ||
Line 37... | Line 45... | ||
37 | if(!dbg_open(log)) |
45 | if(!dbg_open(log)) |
38 | { |
46 | { |
39 | strcpy(log, "/HD1/2/i915.log"); |
47 | strcpy(log, "/RD/1/DRIVERS/i915.log"); |
40 | 48 | ||
41 | if(!dbg_open(log)) |
49 | if(!dbg_open(log)) |
42 | { |
50 | { |
43 | printf("Can't open %s\nExit\n", log); |
51 | printf("Can't open %s\nExit\n", log); |
Line 44... | Line 52... | ||
44 | return 0; |
52 | return 0; |
Line 45... | Line 53... | ||
45 | }; |
53 | }; |
Line 100... | Line 108... | ||
100 | break; |
108 | break; |
Line 101... | Line 109... | ||
101 | 109 | ||
102 | case SRV_ENUM_MODES: |
110 | case SRV_ENUM_MODES: |
103 | dbgprintf("SRV_ENUM_MODES inp %x inp_size %x out_size %x\n", |
111 | dbgprintf("SRV_ENUM_MODES inp %x inp_size %x out_size %x\n", |
104 | inp, io->inp_size, io->out_size ); |
112 | inp, io->inp_size, io->out_size ); |
105 | // check_output(4); |
113 | check_output(4); |
106 | // check_input(*outp * sizeof(videomode_t)); |
114 | // check_input(*outp * sizeof(videomode_t)); |
107 | if( i915_modeset) |
115 | if( i915_modeset) |
108 | retval = get_videomodes((videomode_t*)inp, outp); |
116 | retval = get_videomodes((videomode_t*)inp, outp); |
Line 114... | Line 122... | ||
114 | check_input(sizeof(videomode_t)); |
122 | check_input(sizeof(videomode_t)); |
115 | if( i915_modeset ) |
123 | if( i915_modeset ) |
116 | retval = set_user_mode((videomode_t*)inp); |
124 | retval = set_user_mode((videomode_t*)inp); |
117 | break; |
125 | break; |
Line 118... | Line -... | ||
118 | - | ||
119 | /* |
126 | |
- | 127 | case SRV_CREATE_VIDEO: |
|
- | 128 | check_input(2); |
|
120 | case SRV_CREATE_VIDEO: |
129 | check_output(4); |
121 | retval = r600_create_video(inp[0], inp[1], outp); |
130 | retval = create_video(inp[0], inp[1], outp); |
Line 122... | Line 131... | ||
122 | break; |
131 | break; |
123 | 132 | ||
124 | case SRV_BLIT_VIDEO: |
133 | case SRV_BLIT_VIDEO: |
Line 125... | Line 134... | ||
125 | r600_video_blit( ((uint64_t*)inp)[0], inp[2], inp[3], |
134 | video_blit( ((uint64_t*)inp)[0], inp[2], inp[3], |
126 | inp[4], inp[5], inp[6]); |
135 | inp[4], inp[5], inp[6]); |
Line 127... | Line 136... | ||
127 | 136 | ||
128 | retval = 0; |
137 | retval = 0; |
129 | break; |
138 | break; |
130 | 139 | ||
131 | case SRV_CREATE_BITMAP: |
140 | case SRV_CREATE_BITMAP: |
132 | check_input(8); |
141 | check_input(8); |
133 | check_output(4); |
142 | check_output(4); |
Line 134... | Line 143... | ||
134 | retval = create_bitmap(outp, inp[0], inp[1]); |
143 | retval = create_bitmap((bitmap_t**)outp, inp[0], inp[1]); |
135 | break; |
144 | break; |
Line 164... | Line 173... | ||
164 | (class == PCI_CLASS_BRIDGE_ISA)) |
173 | (class == PCI_CLASS_BRIDGE_ISA)) |
165 | ret = 1; |
174 | ret = 1; |
166 | } |
175 | } |
167 | return ret; |
176 | return ret; |
168 | }; |
177 | }; |
- | 178 | ||
- | 179 | ||
- | 180 | static char* parse_path(char *p, char *log) |
|
- | 181 | { |
|
- | 182 | char c; |
|
- | 183 | ||
- | 184 | while( (c = *p++) == ' '); |
|
- | 185 | p--; |
|
- | 186 | while( (c = *log++ = *p++) && (c != ' ')); |
|
- | 187 | *log = 0; |
|
- | 188 | ||
- | 189 | return p; |
|
- | 190 | }; |
|
- | 191 | ||
- | 192 | void parse_cmdline(char *cmdline, char *log) |
|
- | 193 | { |
|
- | 194 | char *p = cmdline; |
|
- | 195 | ||
- | 196 | char c = *p++; |
|
- | 197 | ||
- | 198 | while( c ) |
|
- | 199 | { |
|
- | 200 | if( c == '-') |
|
- | 201 | { |
|
- | 202 | switch(*p++) |
|
- | 203 | { |
|
- | 204 | case 'l': |
|
- | 205 | p = parse_path(p, log); |
|
- | 206 | break; |
|
- | 207 | }; |
|
- | 208 | }; |
|
- | 209 | c = *p++; |
|
- | 210 | }; |
|
- | 211 | }; |
|
- | 212 |