diff options
author | Christian König <christian.koenig@amd.com> | 2016-02-26 10:18:26 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-02-29 11:33:46 -0500 |
commit | 4ff37a83f19dab4e67299325ee22e98346eee857 (patch) | |
tree | a8778a8fb2140caebf7cf8f2fd080e9828606c90 /drivers/gpu/drm/amd/amdgpu/amdgpu.h | |
parent | ce22c4bfdf70c03e9308751df5c2bf78b79a893f (diff) |
drm/amdgpu: fix VM faults caused by vm_grab_id() v4
The owner must be per ring as long as we don't
support sharing VMIDs per process. Also move the
assigned VMID and page directory address into the
IB structure.
v3: assign the VMID to all IBs, not just the first one.
v4: use correct pointer for owner
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Acked-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.h')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index f5bac97a438b..0c42a85ca5a5 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h | |||
@@ -769,8 +769,9 @@ struct amdgpu_ib { | |||
769 | uint32_t *ptr; | 769 | uint32_t *ptr; |
770 | struct amdgpu_fence *fence; | 770 | struct amdgpu_fence *fence; |
771 | struct amdgpu_user_fence *user; | 771 | struct amdgpu_user_fence *user; |
772 | bool grabbed_vmid; | ||
773 | struct amdgpu_vm *vm; | 772 | struct amdgpu_vm *vm; |
773 | unsigned vm_id; | ||
774 | uint64_t vm_pd_addr; | ||
774 | struct amdgpu_ctx *ctx; | 775 | struct amdgpu_ctx *ctx; |
775 | uint32_t gds_base, gds_size; | 776 | uint32_t gds_base, gds_size; |
776 | uint32_t gws_base, gws_size; | 777 | uint32_t gws_base, gws_size; |
@@ -877,10 +878,10 @@ struct amdgpu_vm_pt { | |||
877 | }; | 878 | }; |
878 | 879 | ||
879 | struct amdgpu_vm_id { | 880 | struct amdgpu_vm_id { |
880 | unsigned id; | 881 | struct amdgpu_vm_manager_id *mgr_id; |
881 | uint64_t pd_gpu_addr; | 882 | uint64_t pd_gpu_addr; |
882 | /* last flushed PD/PT update */ | 883 | /* last flushed PD/PT update */ |
883 | struct fence *flushed_updates; | 884 | struct fence *flushed_updates; |
884 | }; | 885 | }; |
885 | 886 | ||
886 | struct amdgpu_vm { | 887 | struct amdgpu_vm { |
@@ -954,10 +955,11 @@ void amdgpu_vm_get_pt_bos(struct amdgpu_vm *vm, struct list_head *duplicates); | |||
954 | void amdgpu_vm_move_pt_bos_in_lru(struct amdgpu_device *adev, | 955 | void amdgpu_vm_move_pt_bos_in_lru(struct amdgpu_device *adev, |
955 | struct amdgpu_vm *vm); | 956 | struct amdgpu_vm *vm); |
956 | int amdgpu_vm_grab_id(struct amdgpu_vm *vm, struct amdgpu_ring *ring, | 957 | int amdgpu_vm_grab_id(struct amdgpu_vm *vm, struct amdgpu_ring *ring, |
957 | struct amdgpu_sync *sync, struct fence *fence); | 958 | struct amdgpu_sync *sync, struct fence *fence, |
959 | unsigned *vm_id, uint64_t *vm_pd_addr); | ||
958 | void amdgpu_vm_flush(struct amdgpu_ring *ring, | 960 | void amdgpu_vm_flush(struct amdgpu_ring *ring, |
959 | struct amdgpu_vm *vm, | 961 | unsigned vmid, |
960 | struct fence *updates); | 962 | uint64_t pd_addr); |
961 | uint64_t amdgpu_vm_map_gart(const dma_addr_t *pages_addr, uint64_t addr); | 963 | uint64_t amdgpu_vm_map_gart(const dma_addr_t *pages_addr, uint64_t addr); |
962 | int amdgpu_vm_update_page_directory(struct amdgpu_device *adev, | 964 | int amdgpu_vm_update_page_directory(struct amdgpu_device *adev, |
963 | struct amdgpu_vm *vm); | 965 | struct amdgpu_vm *vm); |