aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2017-08-01 04:51:43 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-08-17 15:46:07 -0400
commitec681545afe5a448b43a2fe5c206ee48e19dabb3 (patch)
treef69985a00503c64e886b83db2dbe2a9bc1994b6e /drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
parent4ab4016aaf82153d144fa678cd6b4b5b6f25ed70 (diff)
drm/amdgpu: separate bo_va structure
Split that into vm_bo_base and bo_va to allow other uses as well. 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.h14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
index 9b7b4fcb047b..a288fa6d72c8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
@@ -33,6 +33,7 @@
33 33
34#define AMDGPU_BO_INVALID_OFFSET LONG_MAX 34#define AMDGPU_BO_INVALID_OFFSET LONG_MAX
35 35
36/* bo virtual addresses in a vm */
36struct amdgpu_bo_va_mapping { 37struct amdgpu_bo_va_mapping {
37 struct list_head list; 38 struct list_head list;
38 struct rb_node rb; 39 struct rb_node rb;
@@ -43,26 +44,19 @@ struct amdgpu_bo_va_mapping {
43 uint64_t flags; 44 uint64_t flags;
44}; 45};
45 46
46/* bo virtual addresses in a specific vm */ 47/* User space allocated BO in a VM */
47struct amdgpu_bo_va { 48struct amdgpu_bo_va {
49 struct amdgpu_vm_bo_base base;
50
48 /* protected by bo being reserved */ 51 /* protected by bo being reserved */
49 struct list_head bo_list;
50 struct dma_fence *last_pt_update; 52 struct dma_fence *last_pt_update;
51 unsigned ref_count; 53 unsigned ref_count;
52 54
53 /* protected by vm mutex and spinlock */
54 struct list_head vm_status;
55
56 /* mappings for this bo_va */ 55 /* mappings for this bo_va */
57 struct list_head invalids; 56 struct list_head invalids;
58 struct list_head valids; 57 struct list_head valids;
59
60 /* constant after initialization */
61 struct amdgpu_vm *vm;
62 struct amdgpu_bo *bo;
63}; 58};
64 59
65
66struct amdgpu_bo { 60struct amdgpu_bo {
67 /* Protected by tbo.reserved */ 61 /* Protected by tbo.reserved */
68 u32 preferred_domains; 62 u32 preferred_domains;