Rev 5271 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5271 | Rev 5354 | ||
---|---|---|---|
Line 2... | Line 2... | ||
2 | #include |
2 | #include |
3 | #include "radeon.h" |
3 | #include "radeon.h" |
4 | #include "radeon_object.h" |
4 | #include "radeon_object.h" |
5 | #include "bitmap.h" |
5 | #include "bitmap.h" |
6 | #include "display.h" |
6 | #include |
7 | 7 | ||
Line 8... | Line 8... | ||
8 | #include "r100d.h" |
8 | #include "r100d.h" |
Line 9... | Line 9... | ||
9 | 9 | ||
Line 30... | Line 30... | ||
30 | 30 | ||
Line 31... | Line 31... | ||
31 | rdev = (struct radeon_device *)os_display->ddev->dev_private; |
31 | rdev = (struct radeon_device *)os_display->ddev->dev_private; |
Line 32... | Line 32... | ||
32 | 32 | ||
33 | r = radeon_bo_create(rdev, CURSOR_WIDTH*CURSOR_HEIGHT*4, |
33 | r = radeon_bo_create(rdev, CURSOR_WIDTH*CURSOR_HEIGHT*4, |
Line 34... | Line 34... | ||
34 | 4096, false, RADEON_GEM_DOMAIN_VRAM, 0, NULL, NULL, &cursor->robj); |
34 | 4096, false, RADEON_GEM_DOMAIN_VRAM, 0, NULL, NULL, (struct radeon_bo**)&cursor->cobj); |
35 | 35 | ||
Line 36... | Line 36... | ||
36 | if (unlikely(r != 0)) |
36 | if (unlikely(r != 0)) |
37 | return r; |
37 | return r; |
38 | 38 | ||
Line 39... | Line 39... | ||
39 | r = radeon_bo_reserve(cursor->robj, false); |
39 | r = radeon_bo_reserve(cursor->cobj, false); |
40 | if (unlikely(r != 0)) |
40 | if (unlikely(r != 0)) |
41 | return r; |
41 | return r; |
Line 42... | Line 42... | ||
42 | 42 | ||
43 | r = radeon_bo_pin(cursor->robj, RADEON_GEM_DOMAIN_VRAM, NULL); |
43 | r = radeon_bo_pin(cursor->cobj, RADEON_GEM_DOMAIN_VRAM, NULL); |
44 | if (unlikely(r != 0)) |
44 | if (unlikely(r != 0)) |
45 | return r; |
45 | return r; |
46 | 46 | ||
Line 61... | Line 61... | ||
61 | } |
61 | } |
62 | for(i = 0; i < CURSOR_WIDTH*(CURSOR_HEIGHT-32); i++) |
62 | for(i = 0; i < CURSOR_WIDTH*(CURSOR_HEIGHT-32); i++) |
63 | *bits++ = 0; |
63 | *bits++ = 0; |
64 | 64 | ||
Line 65... | Line 65... | ||
65 | radeon_bo_kunmap(cursor->robj); |
65 | radeon_bo_kunmap(cursor->cobj); |
Line 66... | Line 66... | ||
66 | 66 | ||
Line 67... | Line 67... | ||
67 | // cursor->header.destroy = destroy_cursor; |
67 | // cursor->header.destroy = destroy_cursor; |
68 | 68 | ||
Line 69... | Line 69... | ||
69 | return 0; |
69 | return 0; |
70 | }; |
70 | }; |
71 | 71 | ||
72 | void __attribute__((regparm(1))) destroy_cursor(cursor_t *cursor) |
72 | void __attribute__((regparm(1))) destroy_cursor(cursor_t *cursor) |
73 | { |
73 | { |
74 | list_del(&cursor->list); |
74 | list_del(&cursor->list); |
75 | radeon_bo_unpin(cursor->robj); |
75 | radeon_bo_unpin(cursor->cobj); |
Line 76... | Line 76... | ||
76 | KernelFree(cursor->data); |
76 | KernelFree(cursor->data); |
Line 108... | Line 108... | ||
108 | 108 | ||
Line 109... | Line 109... | ||
109 | old = os_display->cursor; |
109 | old = os_display->cursor; |
Line 110... | Line 110... | ||
110 | 110 | ||
111 | os_display->cursor = cursor; |
111 | os_display->cursor = cursor; |
Line 112... | Line 112... | ||
112 | gpu_addr = radeon_bo_gpu_offset(cursor->robj); |
112 | gpu_addr = radeon_bo_gpu_offset(cursor->cobj); |
113 | 113 | ||
114 | if (ASIC_IS_DCE4(rdev)) |
114 | if (ASIC_IS_DCE4(rdev)) |
115 | { |
115 | { |
Line 205... | Line 205... | ||
205 | (RADEON_CUR_LOCK | (xorg << 16) | yorg )); |
205 | (RADEON_CUR_LOCK | (xorg << 16) | yorg )); |
206 | WREG32(RADEON_CUR_HORZ_VERT_POSN, |
206 | WREG32(RADEON_CUR_HORZ_VERT_POSN, |
207 | (RADEON_CUR_LOCK | (x << 16) | y)); |
207 | (RADEON_CUR_LOCK | (x << 16) | y)); |
208 | 208 | ||
Line 209... | Line 209... | ||
209 | gpu_addr = radeon_bo_gpu_offset(cursor->robj); |
209 | gpu_addr = radeon_bo_gpu_offset(cursor->cobj); |
Line 210... | Line 210... | ||
210 | 210 | ||
211 | /* offset is from DISP(2)_BASE_ADDRESS */ |
211 | /* offset is from DISP(2)_BASE_ADDRESS */ |
212 | WREG32(RADEON_CUR_OFFSET, |
212 | WREG32(RADEON_CUR_OFFSET, |
213 | (gpu_addr - rdev->mc.vram_start + (yorg * 256))); |
213 | (gpu_addr - rdev->mc.vram_start + (yorg * 256))); |