Rev 2342 | Rev 2351 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2340 | Serge | 1 | |
2 | |||
3 | |||
2338 | Serge | 4 | #include "drm.h" |
5 | #include "i915_drm.h" |
||
6 | #include "i915_drv.h" |
||
7 | #include "intel_drv.h" |
||
8 | |||
9 | |||
10 | #include |
||
11 | #include |
||
12 | #include |
||
13 | #include |
||
14 | |||
15 | |||
16 | |||
17 | |||
2340 | Serge | 18 | |
2338 | Serge | 19 | |
20 | |||
21 | { |
||
22 | kobj_t header; |
||
23 | |||
24 | |||
25 | uint32_t hot_x; |
||
26 | uint32_t hot_y; |
||
27 | |||
28 | |||
29 | struct drm_i915_gem_object *cobj; |
||
30 | }cursor_t; |
||
31 | |||
32 | |||
33 | #define CURSOR_HEIGHT 64 |
||
34 | |||
35 | |||
36 | |||
37 | { |
||
38 | int x; |
||
39 | int y; |
||
40 | int width; |
||
41 | int height; |
||
42 | int bpp; |
||
43 | int vrefresh; |
||
44 | int pitch; |
||
45 | int lfb; |
||
46 | |||
47 | |||
48 | struct drm_device *ddev; |
||
49 | struct drm_connector *connector; |
||
50 | struct drm_crtc *crtc; |
||
51 | |||
52 | |||
53 | |||
54 | |||
55 | int (*init_cursor)(cursor_t*); |
||
56 | cursor_t* (__stdcall *select_cursor)(cursor_t*); |
||
57 | void (*show_cursor)(int show); |
||
58 | void (__stdcall *move_cursor)(cursor_t *cursor, int x, int y); |
||
59 | void (__stdcall *restore_cursor)(int x, int y); |
||
60 | void (*disable_mouse)(void); |
||
61 | }; |
||
62 | |||
63 | |||
64 | |||
65 | |||
66 | |||
2340 | Serge | 67 | u32_t cmd_offset; |
68 | |||
69 | |||
2338 | Serge | 70 | static cursor_t* __stdcall select_cursor_kms(cursor_t *cursor); |
71 | static void __stdcall move_cursor_kms(cursor_t *cursor, int x, int y); |
||
72 | |||
73 | |||
74 | {}; |
||
75 | |||
76 | |||
77 | {}; |
||
78 | |||
79 | |||
80 | { |
||
81 | struct drm_display_mode *mode; |
||
82 | int count = 0; |
||
83 | |||
84 | |||
85 | { |
||
86 | count++; |
||
87 | }; |
||
88 | return count; |
||
89 | }; |
||
90 | |||
91 | |||
92 | { |
||
93 | struct drm_connector *connector; |
||
94 | struct drm_connector_helper_funcs *connector_funcs; |
||
95 | struct drm_encoder *encoder; |
||
96 | struct drm_crtc *crtc = NULL; |
||
97 | struct drm_framebuffer *fb; |
||
98 | |||
99 | |||
100 | u32_t ifl; |
||
101 | |||
102 | |||
103 | |||
104 | |||
105 | { |
||
106 | if( connector->status != connector_status_connected) |
||
107 | continue; |
||
108 | |||
109 | |||
110 | encoder = connector_funcs->best_encoder(connector); |
||
111 | if( encoder == NULL) |
||
112 | { |
||
113 | dbgprintf("CONNECTOR %x ID: %d no active encoders\n", |
||
114 | connector, connector->base.id); |
||
115 | continue; |
||
116 | } |
||
117 | connector->encoder = encoder; |
||
118 | |||
119 | |||
120 | connector, connector->base.id, |
||
121 | connector->status, connector->encoder, |
||
122 | encoder->crtc); |
||
123 | |||
124 | |||
125 | break; |
||
126 | }; |
||
127 | |||
128 | |||
129 | { |
||
130 | dbgprintf("No active connectors!\n"); |
||
131 | return -1; |
||
132 | }; |
||
133 | |||
134 | |||
135 | { |
||
136 | struct drm_crtc *tmp_crtc; |
||
137 | int crtc_mask = 1; |
||
138 | |||
139 | |||
140 | { |
||
141 | if (encoder->possible_crtcs & crtc_mask) |
||
142 | { |
||
143 | crtc = tmp_crtc; |
||
144 | encoder->crtc = crtc; |
||
145 | break; |
||
146 | }; |
||
147 | crtc_mask <<= 1; |
||
148 | }; |
||
149 | }; |
||
150 | |||
151 | |||
152 | { |
||
153 | dbgprintf("No CRTC for encoder %d\n", encoder->base.id); |
||
154 | return -1; |
||
155 | }; |
||
156 | |||
157 | |||
158 | |||
159 | |||
160 | |||
161 | |||
162 | |||
163 | os_display->connector = connector; |
||
164 | os_display->crtc = crtc; |
||
165 | |||
166 | |||
167 | |||
168 | |||
169 | |||
170 | { |
||
171 | struct intel_crtc *intel_crtc = to_intel_crtc(os_display->crtc); |
||
172 | |||
173 | |||
174 | { |
||
175 | init_cursor(cursor); |
||
176 | }; |
||
177 | |||
178 | |||
179 | os_display->init_cursor = init_cursor; |
||
180 | os_display->select_cursor = select_cursor_kms; |
||
181 | os_display->show_cursor = NULL; |
||
182 | os_display->move_cursor = move_cursor_kms; |
||
183 | os_display->restore_cursor = restore_cursor; |
||
184 | os_display->disable_mouse = disable_mouse; |
||
185 | |||
186 | |||
187 | intel_crtc->cursor_y = os_display->height/2; |
||
188 | |||
189 | |||
190 | }; |
||
191 | safe_sti(ifl); |
||
192 | |||
193 | |||
2340 | Serge | 194 | #define BLT_WRITE_ALPHA (1<<21) |
195 | #define BLT_WRITE_RGB (1<<20) |
||
196 | |||
2338 | Serge | 197 | |
2342 | Serge | 198 | { |
199 | |||
200 | |||
2340 | Serge | 201 | struct drm_i915_gem_object *obj; |
202 | struct intel_ring_buffer *ring; |
||
203 | |||
204 | |||
205 | i915_gem_object_pin(obj, 4096, true); |
||
206 | |||
207 | |||
208 | cmd_offset = obj->gtt_offset; |
||
209 | }; |
||
2342 | Serge | 210 | #endif |
211 | |||
2340 | Serge | 212 | |
2342 | Serge | 213 | |
2340 | Serge | 214 | |
2342 | Serge | 215 | if( !err ) |
216 | { |
||
217 | printf("Initialize bitmap manager\n"); |
||
218 | }; |
||
2340 | Serge | 219 | |
220 | |||
2338 | Serge | 221 | |
222 | |||
223 | }; |
||
224 | |||
225 | |||
226 | |||
227 | videomode_t *reqmode, bool strict) |
||
228 | { |
||
229 | struct drm_display_mode *mode = NULL, *tmpmode; |
||
230 | drm_i915_private_t *dev_priv = dev->dev_private; |
||
231 | struct drm_fb_helper *fb_helper = &dev_priv->fbdev->helper; |
||
232 | |||
233 | |||
234 | |||
235 | |||
236 | |||
237 | |||
238 | reqmode->width, reqmode->height, reqmode->freq); |
||
239 | |||
240 | |||
241 | { |
||
242 | if( (drm_mode_width(tmpmode) == reqmode->width) && |
||
243 | (drm_mode_height(tmpmode) == reqmode->height) && |
||
244 | (drm_mode_vrefresh(tmpmode) == reqmode->freq) ) |
||
245 | { |
||
246 | mode = tmpmode; |
||
247 | goto do_set; |
||
248 | } |
||
249 | }; |
||
250 | |||
251 | |||
252 | { |
||
253 | list_for_each_entry(tmpmode, &connector->modes, head) |
||
254 | { |
||
255 | if( (drm_mode_width(tmpmode) == reqmode->width) && |
||
256 | (drm_mode_height(tmpmode) == reqmode->height) ) |
||
257 | { |
||
258 | mode = tmpmode; |
||
259 | goto do_set; |
||
260 | } |
||
261 | }; |
||
262 | }; |
||
263 | |||
264 | |||
265 | |||
266 | |||
267 | { |
||
268 | struct drm_framebuffer *fb; |
||
269 | struct drm_encoder *encoder; |
||
270 | struct drm_crtc *crtc; |
||
271 | |||
272 | |||
273 | char *enc_name; |
||
274 | |||
275 | |||
276 | crtc = encoder->crtc; |
||
277 | |||
278 | |||
279 | enc_name = drm_get_encoder_name(encoder); |
||
280 | |||
281 | |||
282 | reqmode->width, reqmode->height, con_name, enc_name); |
||
283 | |||
284 | |||
285 | |||
286 | |||
287 | fb->height = reqmode->height; |
||
288 | fb->pitches[0] = ALIGN(reqmode->width * 4, 64); |
||
2342 | Serge | 289 | fb->pitches[1] = ALIGN(reqmode->width * 4, 64); |
290 | fb->pitches[2] = ALIGN(reqmode->width * 4, 64); |
||
291 | fb->pitches[3] = ALIGN(reqmode->width * 4, 64); |
||
292 | |||
293 | |||
2338 | Serge | 294 | fb->depth == 24; |
295 | |||
296 | |||
297 | crtc->enabled = true; |
||
298 | os_display->crtc = crtc; |
||
299 | |||
300 | |||
301 | |||
302 | |||
303 | // radeon_show_cursor_kms(crtc); |
||
304 | |||
305 | |||
306 | { |
||
307 | os_display->width = fb->width; |
||
308 | os_display->height = fb->height; |
||
309 | os_display->pitch = fb->pitches[0]; |
||
2342 | Serge | 310 | os_display->vrefresh = drm_mode_vrefresh(mode); |
2338 | Serge | 311 | |
312 | |||
2342 | Serge | 313 | |
2338 | Serge | 314 | |
315 | fb->width, fb->height, fb->pitches[0]); |
||
2342 | Serge | 316 | } |
2338 | Serge | 317 | else |
318 | DRM_ERROR("failed to set mode %d_%d on crtc %p\n", |
||
319 | fb->width, fb->height, crtc); |
||
320 | } |
||
321 | |||
322 | |||
323 | return ret; |
||
324 | }; |
||
325 | |||
326 | |||
327 | |||
328 | |||
329 | { |
||
330 | int err = -1; |
||
331 | |||
332 | |||
333 | |||
334 | |||
335 | |||
336 | |||
337 | { |
||
338 | *count = os_display->supported_modes; |
||
339 | err = 0; |
||
340 | } |
||
341 | else if( mode != NULL ) |
||
342 | { |
||
343 | struct drm_display_mode *drmmode; |
||
344 | int i = 0; |
||
345 | |||
346 | |||
347 | *count = os_display->supported_modes; |
||
348 | |||
349 | |||
350 | { |
||
351 | if( i < *count) |
||
352 | { |
||
353 | mode->width = drm_mode_width(drmmode); |
||
354 | mode->height = drm_mode_height(drmmode); |
||
355 | mode->bpp = 32; |
||
356 | mode->freq = drm_mode_vrefresh(drmmode); |
||
357 | i++; |
||
358 | mode++; |
||
359 | } |
||
360 | else break; |
||
361 | }; |
||
362 | *count = i; |
||
363 | err = 0; |
||
364 | }; |
||
365 | LEAVE(); |
||
366 | return err; |
||
367 | }; |
||
368 | |||
369 | |||
370 | { |
||
371 | int err = -1; |
||
372 | |||
373 | |||
374 | |||
375 | |||
376 | mode->width, mode->height, mode->freq); |
||
377 | |||
378 | |||
379 | (mode->height != 0) && |
||
380 | (mode->freq != 0 ) && |
||
381 | ( (mode->width != os_display->width) || |
||
382 | (mode->height != os_display->height) || |
||
383 | (mode->freq != os_display->vrefresh) ) ) |
||
384 | { |
||
385 | if( set_mode(os_display->ddev, os_display->connector, mode, true) ) |
||
386 | err = 0; |
||
387 | }; |
||
388 | |||
389 | |||
390 | return err; |
||
391 | }; |
||
392 | |||
393 | |||
394 | { |
||
395 | /* FIXME synchronization */ |
||
2342 | Serge | 396 | |
397 | |||
2338 | Serge | 398 | // radeon_bo_unpin(cursor->robj); |
399 | // KernelFree(cursor->data); |
||
400 | __DestroyObject(cursor); |
||
401 | }; |
||
402 | |||
403 | |||
404 | { |
||
405 | struct drm_i915_private *dev_priv = os_display->ddev->dev_private; |
||
406 | struct drm_i915_gem_object *obj; |
||
407 | uint32_t *bits; |
||
408 | uint32_t *src; |
||
409 | |||
410 | |||
411 | int ret; |
||
412 | |||
413 | |||
414 | |||
415 | |||
416 | { |
||
417 | bits = (uint32_t*)KernelAlloc(CURSOR_WIDTH*CURSOR_HEIGHT*4); |
||
418 | if (unlikely(bits == NULL)) |
||
419 | return ENOMEM; |
||
420 | cursor->cobj = (struct drm_i915_gem_object *)GetPgAddr(bits); |
||
421 | } |
||
422 | else |
||
423 | { |
||
424 | obj = i915_gem_alloc_object(os_display->ddev, CURSOR_WIDTH*CURSOR_HEIGHT*4); |
||
425 | if (unlikely(obj == NULL)) |
||
426 | return -ENOMEM; |
||
427 | |||
428 | |||
429 | if (ret) { |
||
430 | drm_gem_object_unreference(&obj->base); |
||
2344 | Serge | 431 | return ret; |
2338 | Serge | 432 | } |
433 | |||
434 | |||
435 | * GTT space is continuous. I guarantee it. */ |
||
436 | |||
437 | |||
438 | CURSOR_WIDTH*CURSOR_HEIGHT*4, PG_SW); |
||
439 | |||
440 | |||
441 | { |
||
442 | i915_gem_object_unpin(obj); |
||
2344 | Serge | 443 | drm_gem_object_unreference(&obj->base); |
444 | return -ENOMEM; |
||
2338 | Serge | 445 | }; |
446 | cursor->cobj = obj; |
||
447 | }; |
||
448 | |||
449 | |||
450 | |||
451 | |||
452 | { |
||
453 | for(j = 0; j < 32; j++) |
||
454 | *bits++ = *src++; |
||
455 | for(j = 32; j < CURSOR_WIDTH; j++) |
||
456 | *bits++ = 0; |
||
457 | } |
||
458 | for(i = 0; i < CURSOR_WIDTH*(CURSOR_HEIGHT-32); i++) |
||
459 | *bits++ = 0; |
||
460 | |||
461 | |||
462 | |||
463 | |||
2340 | Serge | 464 | |
2338 | Serge | 465 | |
466 | |||
467 | |||
468 | LEAVE(); |
||
469 | |||
470 | |||
471 | } |
||
472 | |||
473 | |||
474 | |||
475 | { |
||
476 | struct drm_device *dev = crtc->dev; |
||
477 | struct drm_i915_private *dev_priv = dev->dev_private; |
||
478 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
||
479 | int pipe = intel_crtc->pipe; |
||
480 | bool visible = base != 0; |
||
481 | |||
482 | |||
483 | uint32_t cntl = I915_READ(CURCNTR(pipe)); |
||
484 | if (base) { |
||
485 | cntl &= ~(CURSOR_MODE | MCURSOR_PIPE_SELECT); |
||
486 | cntl |= CURSOR_MODE_64_ARGB_AX | MCURSOR_GAMMA_ENABLE; |
||
487 | cntl |= pipe << 28; /* Connect to correct pipe */ |
||
488 | } else { |
||
489 | cntl &= ~(CURSOR_MODE | MCURSOR_GAMMA_ENABLE); |
||
490 | cntl |= CURSOR_MODE_DISABLE; |
||
491 | } |
||
492 | I915_WRITE(CURCNTR(pipe), cntl); |
||
493 | |||
494 | |||
495 | } |
||
496 | /* and commit changes on next vblank */ |
||
497 | I915_WRITE(CURBASE(pipe), base); |
||
498 | } |
||
499 | |||
500 | |||
501 | { |
||
502 | struct drm_i915_private *dev_priv = os_display->ddev->dev_private; |
||
503 | struct intel_crtc *intel_crtc = to_intel_crtc(os_display->crtc); |
||
504 | u32 base, pos; |
||
505 | bool visible; |
||
506 | |||
507 | |||
508 | |||
509 | |||
510 | intel_crtc->cursor_y = y; |
||
511 | |||
512 | |||
513 | y = y - cursor->hot_y; |
||
514 | |||
515 | |||
516 | |||
517 | |||
518 | |||
519 | if (x >= os_display->width) |
||
520 | base = 0; |
||
521 | |||
522 | |||
523 | base = 0; |
||
524 | |||
525 | |||
526 | { |
||
527 | if (x + intel_crtc->cursor_width < 0) |
||
528 | base = 0; |
||
529 | |||
530 | |||
531 | x = -x; |
||
532 | } |
||
533 | pos |= x << CURSOR_X_SHIFT; |
||
534 | |||
535 | |||
536 | { |
||
537 | if (y + intel_crtc->cursor_height < 0) |
||
538 | base = 0; |
||
539 | |||
540 | |||
541 | y = -y; |
||
542 | } |
||
543 | pos |= y << CURSOR_Y_SHIFT; |
||
544 | |||
545 | |||
546 | if (!visible && !intel_crtc->cursor_visible) |
||
547 | return; |
||
548 | |||
549 | |||
550 | // if (IS_845G(dev) || IS_I865G(dev)) |
||
551 | // i845_update_cursor(crtc, base); |
||
552 | // else |
||
553 | i9xx_update_cursor(os_display->crtc, base); |
||
554 | |||
555 | |||
556 | |||
557 | |||
558 | |||
559 | { |
||
560 | struct drm_i915_private *dev_priv = os_display->ddev->dev_private; |
||
561 | struct intel_crtc *intel_crtc = to_intel_crtc(os_display->crtc); |
||
562 | cursor_t *old; |
||
563 | |||
564 | |||
565 | os_display->cursor = cursor; |
||
566 | |||
567 | |||
568 | intel_crtc->cursor_addr = cursor->cobj->gtt_offset; |
||
569 | else |
||
570 | intel_crtc->cursor_addr = cursor->cobj; |
||
571 | |||
572 | |||
573 | intel_crtc->cursor_height = 32; |
||
574 | |||
575 | |||
576 | return old; |
||
577 | }; |
||
578 | |||
579 | |||
2340 | Serge | 580 | |
581 | |||
582 | |||
583 | |||
2342 | Serge | 584 | |
585 | { |
||
2338 | Serge | 586 | int left; |
2342 | Serge | 587 | int top; |
588 | int right; |
||
589 | int bottom; |
||
590 | }rect_t; |
||
591 | |||
2338 | Serge | 592 | |
2342 | Serge | 593 | |
594 | |||
595 | |||
596 | |||
597 | |||
598 | |||
599 | |||
600 | { |
||
601 | u32_t addr; |
||
602 | |||
603 | |||
604 | addr+= sizeof(display_t); /* shoot me */ |
||
605 | return *(u32_t*)addr; |
||
606 | } |
||
607 | |||
608 | |||
609 | #define ROP_COPY_SRC 0xCC |
||
610 | #define FORMAT8888 3 |
||
611 | |||
612 | |||
613 | |||
614 | |||
615 | |||
616 | int src_x, int src_y, u32 w, u32 h) |
||
617 | { |
||
618 | drm_i915_private_t *dev_priv = main_device->dev_private; |
||
2340 | Serge | 619 | struct intel_ring_buffer *ring; |
620 | |||
2338 | Serge | 621 | |
2342 | Serge | 622 | rect_t winrc; |
623 | clip_t dst_clip; |
||
624 | clip_t src_clip; |
||
625 | u32_t width; |
||
626 | u32_t height; |
||
627 | |||
2338 | Serge | 628 | |
2342 | Serge | 629 | u32_t offset; |
630 | u8 slot; |
||
631 | int n=0; |
||
2340 | Serge | 632 | |
2338 | Serge | 633 | |
2342 | Serge | 634 | return -1; |
635 | |||
2338 | Serge | 636 | |
2342 | Serge | 637 | |
2338 | Serge | 638 | |
2342 | Serge | 639 | return -1; |
640 | |||
2338 | Serge | 641 | |
642 | |||
2342 | Serge | 643 | |
2338 | Serge | 644 | |
2342 | Serge | 645 | dst_clip.ymin = 0; |
646 | dst_clip.xmax = winrc.right-winrc.left-1; |
||
647 | dst_clip.ymax = winrc.bottom -winrc.top -1; |
||
648 | |||
2338 | Serge | 649 | |
2342 | Serge | 650 | src_clip.ymin = 0; |
651 | src_clip.xmax = bitmap->width - 1; |
||
652 | src_clip.ymax = bitmap->height - 1; |
||
653 | |||
2338 | Serge | 654 | |
2342 | Serge | 655 | height = h; |
656 | |||
2338 | Serge | 657 | |
2342 | Serge | 658 | &src_clip, &src_x, &src_y, |
659 | &width, &height) ) |
||
660 | return 0; |
||
661 | |||
2340 | Serge | 662 | |
2342 | Serge | 663 | dst_y+= winrc.top; |
664 | |||
2340 | Serge | 665 | |
2342 | Serge | 666 | |
2340 | Serge | 667 | |
2342 | Serge | 668 | |
2340 | Serge | 669 | |
2342 | Serge | 670 | #if 0 |
671 | static v4si write_mask = {0xFF000000, 0xFF000000, |
||
672 | 0xFF000000, 0xFF000000}; |
||
673 | |||
2340 | Serge | 674 | |
2342 | Serge | 675 | u8* dst_offset; |
676 | |||
2340 | Serge | 677 | |
2342 | Serge | 678 | src_offset += (u32)bitmap->uaddr; |
679 | |||
2340 | Serge | 680 | |
2342 | Serge | 681 | dst_offset+= get_display_map(); |
682 | |||
2340 | Serge | 683 | |
2342 | Serge | 684 | |
2340 | Serge | 685 | |
2342 | Serge | 686 | "movdqa %[write_mask], %%xmm7 \n" |
687 | "movd %[slot_mask], %%xmm6 \n" |
||
688 | "punpckldq %%xmm6, %%xmm6 \n" |
||
689 | "punpcklqdq %%xmm6, %%xmm6 \n" |
||
690 | :: [write_mask] "m" (write_mask), |
||
691 | [slot_mask] "g" (slot_mask) |
||
692 | :"xmm7", "xmm6"); |
||
693 | |||
2340 | Serge | 694 | |
2342 | Serge | 695 | { |
696 | u32_t tmp_w = width; |
||
697 | |||
2340 | Serge | 698 | |
2342 | Serge | 699 | u8* tmp_dst = dst_offset; |
700 | |||
2340 | Serge | 701 | |
2342 | Serge | 702 | dst_offset+= os_display->width; |
703 | |||
2340 | Serge | 704 | |
2342 | Serge | 705 | { |
706 | __asm__ __volatile__ ( |
||
707 | "movq (%0), %%xmm0 \n" |
||
708 | "punpcklbw %%xmm0, %%xmm0 \n" |
||
709 | "movdqa %%xmm0, %%xmm1 \n" |
||
710 | "punpcklwd %%xmm0, %%xmm0 \n" |
||
711 | "punpckhwd %%xmm1, %%xmm1 \n" |
||
712 | "pcmpeqb %%xmm6, %%xmm0 \n" |
||
713 | "pcmpeqb %%xmm6, %%xmm1 \n" |
||
714 | "maskmovdqu %%xmm7, %%xmm0 \n" |
||
715 | "addl $16, %%edi \n" |
||
716 | "maskmovdqu %%xmm7, %%xmm1 \n" |
||
717 | :: "r" (tmp_dst), "D" (tmp_src) |
||
718 | :"xmm0", "xmm1"); |
||
719 | __asm__ __volatile__ ("":::"edi"); |
||
720 | tmp_w -= 8; |
||
721 | tmp_src += 32; |
||
722 | tmp_dst += 8; |
||
723 | }; |
||
724 | |||
2340 | Serge | 725 | |
2342 | Serge | 726 | { |
727 | __asm__ __volatile__ ( |
||
728 | "movd (%0), %%xmm0 \n" |
||
729 | "punpcklbw %%xmm0, %%xmm0 \n" |
||
730 | "punpcklwd %%xmm0, %%xmm0 \n" |
||
731 | "pcmpeqb %%xmm6, %%xmm0 \n" |
||
732 | "maskmovdqu %%xmm7, %%xmm0 \n" |
||
733 | :: "r" (tmp_dst), "D" (tmp_src) |
||
734 | :"xmm0"); |
||
735 | tmp_w -= 4; |
||
736 | tmp_src += 16; |
||
737 | tmp_dst += 4; |
||
738 | }; |
||
739 | |||
2340 | Serge | 740 | |
2342 | Serge | 741 | { |
742 | *(tmp_src+3) = (*tmp_dst==slot)?0xFF:0x00; |
||
743 | tmp_src+=4; |
||
744 | tmp_dst++; |
||
745 | }; |
||
746 | }; |
||
747 | #else |
||
748 | u8* src_offset; |
||
749 | u8* dst_offset; |
||
750 | |||
2340 | Serge | 751 | |
2342 | Serge | 752 | src_offset += (u32)bitmap->uaddr; |
753 | |||
2340 | Serge | 754 | |
2342 | Serge | 755 | dst_offset+= get_display_map(); |
756 | |||
757 | |||
758 | |||
759 | |||
760 | { |
||
761 | u32_t tmp_w = width; |
||
762 | |||
763 | |||
764 | u8* tmp_dst = dst_offset; |
||
765 | |||
766 | |||
767 | dst_offset+= os_display->width; |
||
768 | |||
769 | |||
770 | { |
||
771 | *(tmp_src+3) = (*tmp_dst==slot)?0xFF:0x00; |
||
772 | tmp_src+=4; |
||
773 | tmp_dst++; |
||
774 | }; |
||
775 | }; |
||
776 | } |
||
777 | #endif |
||
778 | |||
779 | |||
780 | cmd_buffer&= 0xFFFFF000; |
||
781 | |||
782 | |||
783 | |||
784 | |||
785 | |||
786 | |||
787 | cmd |= 3 << 17; |
||
788 | |||
789 | |||
2340 | Serge | 790 | br13|= ROP_COPY_SRC << 16; |
2342 | Serge | 791 | br13|= FORMAT8888 << 24; |
792 | |||
2340 | Serge | 793 | |
794 | b[n++] = br13; |
||
795 | b[n++] = (dst_y << 16) | dst_x; // left, top |
||
2342 | Serge | 796 | b[n++] = ((dst_y+height-1)<< 16)|(dst_x+width-1); // bottom, right |
797 | b[n++] = 0; // destination |
||
798 | b[n++] = (src_y << 16) | src_x; // source left & top |
||
799 | b[n++] = bitmap->pitch; // source pitch |
||
800 | b[n++] = bitmap->gaddr; // source |
||
801 | |||
2340 | Serge | 802 | |
2342 | Serge | 803 | b[n++] = 0x00FFFFFF; // Transparency Color High |
804 | |||
2340 | Serge | 805 | |
806 | if( n & 1) |
||
807 | b[n++] = MI_NOOP; |
||
808 | |||
809 | |||
2344 | Serge | 810 | |
2340 | Serge | 811 | |
2342 | Serge | 812 | ring = &dev_priv->ring[BCS]; |
813 | else |
||
814 | ring = &dev_priv->ring[RCS]; |
||
815 | |||
816 | |||
2340 | Serge | 817 | |
818 | |||
2344 | Serge | 819 | |
2340 | Serge | 820 | |
2344 | Serge | 821 | if (ret) |
822 | return ret; |
||
823 | |||
824 | |||
2340 | Serge | 825 | intel_ring_emit(ring, 0); |
826 | intel_ring_emit(ring, 0); |
||
827 | intel_ring_emit(ring, MI_NOOP); |
||
828 | intel_ring_advance(ring); |
||
829 | |||
830 | |||
831 | fail: |
||
832 | return -1; |
||
833 | };><>><>><>><>><>><>24; |
||
834 |