Rev 3243 | Rev 3260 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3243 | Rev 3255 | ||
---|---|---|---|
Line 11... | Line 11... | ||
11 | #include |
11 | #include |
12 | #include |
12 | #include |
Line 13... | Line 13... | ||
13 | 13 | ||
Line -... | Line 14... | ||
- | 14 | #include "bitmap.h" |
|
- | 15 | ||
- | 16 | struct pci_device { |
|
- | 17 | uint16_t domain; |
|
- | 18 | uint8_t bus; |
|
- | 19 | uint8_t dev; |
|
- | 20 | uint8_t func; |
|
- | 21 | uint16_t vendor_id; |
|
- | 22 | uint16_t device_id; |
|
- | 23 | uint16_t subvendor_id; |
|
- | 24 | uint16_t subdevice_id; |
|
- | 25 | uint32_t device_class; |
|
- | 26 | uint8_t revision; |
|
14 | #include "bitmap.h" |
27 | }; |
- | 28 | ||
Line 15... | Line 29... | ||
15 | 29 | extern struct drm_device *main_device; |
|
Line 16... | Line 30... | ||
16 | extern struct drm_device *main_device; |
30 | extern struct drm_file *drm_file_handlers[256]; |
17 | 31 | ||
Line 28... | Line 42... | ||
28 | int src_x, int src_y, u32 w, u32 h); |
42 | int src_x, int src_y, u32 w, u32 h); |
Line 29... | Line 43... | ||
29 | 43 | ||
30 | int blit_tex(u32 hbitmap, int dst_x, int dst_y, |
44 | int blit_tex(u32 hbitmap, int dst_x, int dst_y, |
Line -... | Line 45... | ||
- | 45 | int src_x, int src_y, u32 w, u32 h); |
|
- | 46 | ||
- | 47 | void get_pci_info(struct pci_device *dev); |
|
- | 48 | int gem_getparam(struct drm_device *dev, void *data); |
|
31 | int src_x, int src_y, u32 w, u32 h); |
49 | |
Line 32... | Line 50... | ||
32 | 50 | ||
Line 33... | Line 51... | ||
33 | static char log[256]; |
51 | static char log[256]; |
Line 34... | Line 52... | ||
34 | 52 | ||
35 | int x86_clflush_size; |
53 | int x86_clflush_size; |
36 | - | ||
Line 37... | Line 54... | ||
37 | int i915_modeset = 1; |
54 | |
Line 38... | Line 55... | ||
38 | 55 | int i915_modeset = 1; |
|
39 | u32_t drvEntry(int action, char *cmdline) |
56 | |
Line 103... | Line 120... | ||
103 | #define SRV_RESIZE_SURFACE 14 |
120 | #define SRV_RESIZE_SURFACE 14 |
104 | #define SRV_BLIT_BITMAP 15 |
121 | #define SRV_BLIT_BITMAP 15 |
105 | #define SRV_BLIT_TEXTURE 16 |
122 | #define SRV_BLIT_TEXTURE 16 |
106 | #define SRV_BLIT_VIDEO 17 |
123 | #define SRV_BLIT_VIDEO 17 |
Line -... | Line 124... | ||
- | 124 | ||
- | 125 | #define SRV_PCI_INFO 20 |
|
- | 126 | #define SRV_GET_PARAM 21 |
|
- | 127 | #define SRV_I915_GEM_CREATE 22 |
|
- | 128 | #define SRV_DRM_GEM_CLOSE 23 |
|
- | 129 | #define SRV_I915_GEM_PIN 24 |
|
107 | 130 | ||
108 | #define check_input(size) \ |
131 | #define check_input(size) \ |
109 | if( unlikely((inp==NULL)||(io->inp_size != (size))) ) \ |
132 | if( unlikely((inp==NULL)||(io->inp_size != (size))) ) \ |
Line 110... | Line 133... | ||
110 | break; |
133 | break; |
111 | 134 | ||
112 | #define check_output(size) \ |
135 | #define check_output(size) \ |
Line 113... | Line 136... | ||
113 | if( unlikely((outp==NULL)||(io->out_size != (size))) ) \ |
136 | if( unlikely((outp==NULL)||(io->out_size != (size))) ) \ |
114 | break; |
137 | break; |
- | 138 | ||
- | 139 | int _stdcall display_handler(ioctl_t *io) |
|
115 | 140 | { |
|
116 | int _stdcall display_handler(ioctl_t *io) |
141 | struct drm_file *file; |
117 | { |
142 | |
Line 118... | Line 143... | ||
118 | int retval = -1; |
143 | int retval = -1; |
119 | u32_t *inp; |
144 | u32_t *inp; |
Line -... | Line 145... | ||
- | 145 | u32_t *outp; |
|
- | 146 | ||
120 | u32_t *outp; |
147 | inp = io->input; |
121 | 148 | outp = io->output; |
|
122 | inp = io->input; |
149 | |
123 | outp = io->output; |
150 | file = drm_file_handlers[0]; |
124 | 151 | ||
Line 162... | Line 189... | ||
162 | 189 | ||
163 | case SRV_RESIZE_SURFACE: |
190 | case SRV_RESIZE_SURFACE: |
164 | // retval = resize_surface((struct io_call_14*)inp); |
191 | // retval = resize_surface((struct io_call_14*)inp); |
Line 165... | Line 192... | ||
165 | break; |
192 | break; |
166 | 193 | ||
167 | // case SRV_BLIT_BITMAP: |
194 | case SRV_BLIT_BITMAP: |
Line 168... | Line 195... | ||
168 | // srv_blit_bitmap( inp[0], inp[1], inp[2], |
195 | // srv_blit_bitmap( inp[0], inp[1], inp[2], |
169 | // inp[3], inp[4], inp[5], inp[6]); |
196 | // inp[3], inp[4], inp[5], inp[6]); |
Line -... | Line 197... | ||
- | 197 | ||
Line -... | Line 198... | ||
- | 198 | // blit_tex( inp[0], inp[1], inp[2], |
|
- | 199 | // inp[3], inp[4], inp[5], inp[6]); |
|
170 | 200 | ||
171 | // blit_tex( inp[0], inp[1], inp[2], |
201 | break; |
Line -... | Line 202... | ||
- | 202 | ||
- | 203 | case SRV_PCI_INFO: |
|
- | 204 | get_pci_info((struct pci_device *)inp); |
|
- | 205 | retval = 0; |
|
- | 206 | break; |
|
- | 207 | ||
- | 208 | case SRV_GET_PARAM: |
|
- | 209 | retval = gem_getparam(main_device, inp); |
|
- | 210 | break; |
|
- | 211 | ||
- | 212 | case SRV_I915_GEM_CREATE: |
|
- | 213 | retval = i915_gem_create_ioctl(main_device, inp, file); |
|
- | 214 | break; |
|
- | 215 | ||
- | 216 | case SRV_DRM_GEM_CLOSE: |
|
172 | // inp[3], inp[4], inp[5], inp[6]); |
217 | retval = drm_gem_close_ioctl(main_device, inp, file); |
Line 173... | Line 218... | ||
173 | 218 | break; |
|
174 | 219 | ||
Line 300... | Line 345... | ||
300 | }; |
345 | }; |
301 | caps->idx = 1; |
346 | caps->idx = 1; |
302 | return ret; |
347 | return ret; |
303 | }19)) |
348 | } |
Line -... | Line 349... | ||
- | 349 | ||
- | 350 | ||
- | 351 | void get_pci_info(struct pci_device *dev) |
|
- | 352 | { |
|
- | 353 | struct pci_dev *pdev = main_device->pdev; |
|
- | 354 | ||
- | 355 | memset(dev, sizeof(*dev), 0); |
|
- | 356 | ||
- | 357 | dev->domain = 0; |
|
- | 358 | dev->bus = pdev->busnr; |
|
- | 359 | dev->dev = pdev->devfn >> 3; |
|
- | 360 | dev->func = pdev->devfn & 7; |
|
- | 361 | dev->vendor_id = pdev->vendor; |
|
- | 362 | dev->device_id = pdev->device; |
|
- | 363 | dev->revision = pdev->revision; |