Rev 2344 | Rev 2352 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2344 | Rev 2351 | ||
---|---|---|---|
Line 18... | Line 18... | ||
18 | 18 | ||
19 | void parse_cmdline(char *cmdline, char *log); |
19 | void parse_cmdline(char *cmdline, char *log); |
20 | int _stdcall display_handler(ioctl_t *io); |
20 | int _stdcall display_handler(ioctl_t *io); |
Line 21... | Line 21... | ||
21 | int init_agp(void); |
21 | int init_agp(void); |
- | 22 | ||
- | 23 | int blit_video(u32 hbitmap, int dst_x, int dst_y, |
|
22 | 24 | int src_x, int src_y, u32 w, u32 h); |
|
23 | int create_video(int width, int height, u32_t *outp); |
25 | |
Line 24... | Line 26... | ||
24 | int video_blit(uint64_t src_offset, int x, int y, |
26 | int blit_textured(u32 hbitmap, int dst_x, int dst_y, |
Line 25... | Line 27... | ||
25 | int w, int h, int pitch); |
27 | int src_x, int src_y, u32 w, u32 h); |
Line 45... | Line 47... | ||
45 | if( cmdline && *cmdline ) |
47 | if( cmdline && *cmdline ) |
46 | parse_cmdline(cmdline, log); |
48 | parse_cmdline(cmdline, log); |
Line 47... | Line 49... | ||
47 | 49 | ||
48 | if(!dbg_open(log)) |
50 | if(!dbg_open(log)) |
49 | { |
51 | { |
- | 52 | // strcpy(log, "/RD/1/DRIVERS/i915.log"); |
|
Line 50... | Line 53... | ||
50 | strcpy(log, "/RD/1/DRIVERS/i915.log"); |
53 | strcpy(log, "/HD1/2/i915.log"); |
51 | 54 | ||
52 | if(!dbg_open(log)) |
55 | if(!dbg_open(log)) |
53 | { |
56 | { |
54 | printf("Can't open %s\nExit\n", log); |
57 | printf("Can't open %s\nExit\n", log); |
55 | return 0; |
58 | return 0; |
56 | }; |
59 | }; |
Line -... | Line 60... | ||
- | 60 | } |
|
- | 61 | dbgprintf("i915 blitter preview\n cmdline: %s\n", cmdline); |
|
- | 62 | ||
57 | } |
63 | cpu_detect(); |
Line 58... | Line 64... | ||
58 | dbgprintf("i915 blitter preview\n cmdline: %s\n", cmdline); |
64 | dbgprintf("\ncache line size %d\n", x86_clflush_size); |
Line 59... | Line 65... | ||
59 | 65 | ||
Line 77... | Line 83... | ||
77 | 83 | ||
78 | #define CURRENT_API 0x0200 /* 2.00 */ |
84 | #define CURRENT_API 0x0200 /* 2.00 */ |
Line 79... | Line 85... | ||
79 | #define COMPATIBLE_API 0x0100 /* 1.00 */ |
85 | #define COMPATIBLE_API 0x0100 /* 1.00 */ |
80 | 86 | ||
Line 81... | Line 87... | ||
81 | #define API_VERSION (COMPATIBLE_API << 16) | CURRENT_API |
87 | #define API_VERSION (COMPATIBLE_API << 16) | CURRENT_API |
82 | #define DISPLAY_VERSION CURRENT_API |
88 | #define DISPLAY_VERSION API_VERSION |
83 | 89 | ||
- | 90 | ||
Line 84... | Line 91... | ||
84 | 91 | #define SRV_GETVERSION 0 |
|
Line 85... | Line 92... | ||
85 | #define SRV_GETVERSION 0 |
92 | #define SRV_ENUM_MODES 1 |
Line 130... | Line 137... | ||
130 | check_input(sizeof(videomode_t)); |
137 | check_input(sizeof(videomode_t)); |
131 | if( i915_modeset ) |
138 | if( i915_modeset ) |
132 | retval = set_user_mode((videomode_t*)inp); |
139 | retval = set_user_mode((videomode_t*)inp); |
133 | break; |
140 | break; |
Line -... | Line 141... | ||
- | 141 | ||
- | 142 | case SRV_GET_CAPS: |
|
- | 143 | retval = get_driver_caps((hwcaps_t*)inp); |
|
- | 144 | break; |
|
134 | 145 | ||
135 | case SRV_CREATE_SURFACE: |
146 | case SRV_CREATE_SURFACE: |
136 | // check_input(8); |
147 | // check_input(8); |
137 | retval = create_surface((struct io_call_10*)inp); |
148 | retval = create_surface((struct io_call_10*)inp); |
Line 138... | Line 149... | ||
138 | break; |
149 | break; |
139 | 150 | ||
- | 151 | ||
- | 152 | case SRV_BLIT_VIDEO: |
|
- | 153 | // blit_video( inp[0], inp[1], inp[2], |
|
140 | 154 | // inp[3], inp[4], inp[5], inp[6]); |
|
Line 141... | Line 155... | ||
141 | case SRV_BLIT_VIDEO: |
155 | |
142 | blit_video( inp[0], inp[1], inp[2], |
156 | blit_textured( inp[0], inp[1], inp[2], |
143 | inp[3], inp[4], inp[5], inp[6]); |
157 | inp[3], inp[4], inp[5], inp[6]); |
Line 209... | Line 223... | ||
209 | }; |
223 | }; |
210 | c = *p++; |
224 | c = *p++; |
211 | }; |
225 | }; |
212 | }; |
226 | }; |
Line -... | Line 227... | ||
- | 227 | ||
213 | 228 | ||
214 | static inline void __cpuid(unsigned int *eax, unsigned int *ebx, |
229 | static inline void __cpuid(unsigned int *eax, unsigned int *ebx, |
215 | unsigned int *ecx, unsigned int *edx) |
230 | unsigned int *ecx, unsigned int *edx) |
216 | { |
231 | { |
217 | /* ecx is often an input as well as an output. */ |
232 | /* ecx is often an input as well as an output. */ |
218 | asm volatile( |
- | |
219 | "cpuid" |
233 | asm volatile("cpuid" |
220 | : "=a" (*eax), |
234 | : "=a" (*eax), |
221 | "=b" (*ebx), |
235 | "=b" (*ebx), |
222 | "=c" (*ecx), |
236 | "=c" (*ecx), |
223 | "=d" (*edx) |
237 | "=d" (*edx) |
- | 238 | : "0" (*eax), "2" (*ecx) |
|
224 | : "" (*eax), "2" (*ecx)); |
239 | : "memory"); |
Line -... | Line 240... | ||
- | 240 | } |
|
- | 241 | ||
225 | } |
242 | |
226 | 243 | ||
227 | static inline void cpuid(unsigned int op, |
244 | static inline void cpuid(unsigned int op, |
228 | unsigned int *eax, unsigned int *ebx, |
245 | unsigned int *eax, unsigned int *ebx, |
229 | unsigned int *ecx, unsigned int *edx) |
246 | unsigned int *ecx, unsigned int *edx) |