aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2017-07-20 18:16:21 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-08-15 14:45:54 -0400
commit9124a3983bdee6e98cd1cfcbbfd9f65e69b97c6d (patch)
tree976ee74c2ebdda94bca0d78b0b65d7f2cc3c753a /drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
parent7ecc245a8ce32ffcaa6a3e5795e0b14db8e076fc (diff)
drm/amdgpu: move some defines around
Move amdgpu_bo and related structures into amdgpu_object.h. Move amdgpu_bo_list structures to the amdgpu_bo_list functions. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.h')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_object.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
index f53d53d7a0af..a401fe3bdd26 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
@@ -33,6 +33,64 @@
33 33
34#define AMDGPU_BO_INVALID_OFFSET LONG_MAX 34#define AMDGPU_BO_INVALID_OFFSET LONG_MAX
35 35
36struct amdgpu_bo_va_mapping {
37 struct list_head list;
38 struct rb_node rb;
39 uint64_t start;
40 uint64_t last;
41 uint64_t __subtree_last;
42 uint64_t offset;
43 uint64_t flags;
44};
45
46/* bo virtual addresses in a specific vm */
47struct amdgpu_bo_va {
48 /* protected by bo being reserved */
49 struct list_head bo_list;
50 struct dma_fence *last_pt_update;
51 unsigned ref_count;
52
53 /* protected by vm mutex and spinlock */
54 struct list_head vm_status;
55
56 /* mappings for this bo_va */
57 struct list_head invalids;
58 struct list_head valids;
59
60 /* constant after initialization */
61 struct amdgpu_vm *vm;
62 struct amdgpu_bo *bo;
63};
64
65
66struct amdgpu_bo {
67 /* Protected by tbo.reserved */
68 u32 prefered_domains;
69 u32 allowed_domains;
70 struct ttm_place placements[AMDGPU_GEM_DOMAIN_MAX + 1];
71 struct ttm_placement placement;
72 struct ttm_buffer_object tbo;
73 struct ttm_bo_kmap_obj kmap;
74 u64 flags;
75 unsigned pin_count;
76 u64 tiling_flags;
77 u64 metadata_flags;
78 void *metadata;
79 u32 metadata_size;
80 unsigned prime_shared_count;
81 /* list of all virtual address to which this bo is associated to */
82 struct list_head va;
83 /* Constant after initialization */
84 struct drm_gem_object gem_base;
85 struct amdgpu_bo *parent;
86 struct amdgpu_bo *shadow;
87
88 struct ttm_bo_kmap_obj dma_buf_vmap;
89 struct amdgpu_mn *mn;
90 struct list_head mn_list;
91 struct list_head shadow_list;
92};
93
36/** 94/**
37 * amdgpu_mem_type_to_domain - return domain corresponding to mem_type 95 * amdgpu_mem_type_to_domain - return domain corresponding to mem_type
38 * @mem_type: ttm memory type 96 * @mem_type: ttm memory type