This source file includes following definitions.
- amdgpu_bo_list_array_entry
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 #ifndef __AMDGPU_BO_LIST_H__
24 #define __AMDGPU_BO_LIST_H__
25
26 #include <drm/ttm/ttm_execbuf_util.h>
27 #include <drm/amdgpu_drm.h>
28
29 struct amdgpu_device;
30 struct amdgpu_bo;
31 struct amdgpu_bo_va;
32 struct amdgpu_fpriv;
33
34 struct amdgpu_bo_list_entry {
35 struct ttm_validate_buffer tv;
36 struct amdgpu_bo_va *bo_va;
37 uint32_t priority;
38 struct page **user_pages;
39 bool user_invalidated;
40 };
41
42 struct amdgpu_bo_list {
43 struct rcu_head rhead;
44 struct kref refcount;
45 struct amdgpu_bo *gds_obj;
46 struct amdgpu_bo *gws_obj;
47 struct amdgpu_bo *oa_obj;
48 unsigned first_userptr;
49 unsigned num_entries;
50 };
51
52 int amdgpu_bo_list_get(struct amdgpu_fpriv *fpriv, int id,
53 struct amdgpu_bo_list **result);
54 void amdgpu_bo_list_get_list(struct amdgpu_bo_list *list,
55 struct list_head *validated);
56 void amdgpu_bo_list_put(struct amdgpu_bo_list *list);
57 int amdgpu_bo_create_list_entry_array(struct drm_amdgpu_bo_list_in *in,
58 struct drm_amdgpu_bo_list_entry **info_param);
59
60 int amdgpu_bo_list_create(struct amdgpu_device *adev,
61 struct drm_file *filp,
62 struct drm_amdgpu_bo_list_entry *info,
63 unsigned num_entries,
64 struct amdgpu_bo_list **list);
65
66 static inline struct amdgpu_bo_list_entry *
67 amdgpu_bo_list_array_entry(struct amdgpu_bo_list *list, unsigned index)
68 {
69 struct amdgpu_bo_list_entry *array = (void *)&list[1];
70
71 return &array[index];
72 }
73
74 #define amdgpu_bo_list_for_each_entry(e, list) \
75 for (e = amdgpu_bo_list_array_entry(list, 0); \
76 e != amdgpu_bo_list_array_entry(list, (list)->num_entries); \
77 ++e)
78
79 #define amdgpu_bo_list_for_each_userptr_entry(e, list) \
80 for (e = amdgpu_bo_list_array_entry(list, (list)->first_userptr); \
81 e != amdgpu_bo_list_array_entry(list, (list)->num_entries); \
82 ++e)
83
84 #endif