Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2176 | serge | 1 | |
2 | #include |
||
3 | #include "radeon_drm.h" |
||
4 | #include "../radeon.h" |
||
5 | #include "../display.h" |
||
6 | |||
7 | |||
8 | |||
9 | |||
10 | { |
||
11 | kobj_t header; |
||
12 | |||
13 | |||
14 | int height; |
||
15 | int stride; |
||
16 | uint64_t gaddr; |
||
17 | void *uaddr; |
||
18 | struct radeon_bo *robj; |
||
19 | }bitmap_t; |
||
20 | |||
21 | |||
22 | { |
||
23 | size_t size; |
||
24 | size_t pitch; |
||
25 | bitmap_t *bitmap; |
||
26 | uint64_t gaddr; |
||
27 | void *uaddr; |
||
28 | |||
29 | |||
30 | struct radeon_bo *sobj = NULL; |
||
31 | |||
32 | |||
33 | |||
34 | |||
35 | if( bitmap == NULL) |
||
36 | { |
||
37 | *pbitmap = NULL; |
||
38 | return -1; |
||
39 | } |
||
40 | |||
41 | |||
42 | |||
43 | |||
44 | |||
45 | |||
46 | RADEON_GEM_DOMAIN_GTT, &sobj); |
||
47 | if (r) { |
||
48 | goto fail; |
||
49 | } |
||
50 | r = radeon_bo_reserve(sobj, false); |
||
51 | if (unlikely(r != 0)) |
||
52 | goto fail; |
||
53 | r = radeon_bo_pin(sobj, RADEON_GEM_DOMAIN_GTT, &gaddr); |
||
54 | if (r) { |
||
55 | goto fail; |
||
56 | } |
||
57 | |||
58 | |||
59 | if (r) { |
||
60 | goto fail; |
||
61 | } |
||
62 | |||
63 | |||
64 | bitmap->height = height; |
||
65 | bitmap->stride = pitch; |
||
66 | bitmap->gaddr = gaddr; |
||
67 | bitmap->uaddr = uaddr; |
||
68 | bitmap->robj = sobj; |
||
69 | |||
70 | |||
71 | return 0; |
||
72 | |||
73 | |||
74 | |||
75 | |||
76 | return -1; |
||
77 | |||
78 | |||
79 |