diff options
| author | Philip Yang <[email protected]> | 2024-06-20 16:31:36 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2024-07-23 21:42:54 +0000 |
| commit | 834368eab36922595a402b9e76470f8efa2fac7f (patch) | |
| tree | 51d83dba64bc1d07dc6141c8422040df547f39a5 /drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | |
| parent | drm/amdgpu/gfx9.4.3: implement wave kill for compute queues (diff) | |
| download | kernel-834368eab36922595a402b9e76470f8efa2fac7f.tar.gz kernel-834368eab36922595a402b9e76470f8efa2fac7f.zip | |
drm/amdkfd: Ensure user queue buffers residency
Add atomic queue_refcount to struct bo_va, return -EBUSY to fail unmap
BO from the GPU if the bo_va queue_refcount is not zero.
Create queue to increase the bo_va queue_refcount, destroy queue to
decrease the bo_va queue_refcount, to ensure the queue buffers mapped on
the GPU when queue is active.
Signed-off-by: Philip Yang <[email protected]>
Reviewed-by: Felix Kuehling <[email protected]>
Acked-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.h')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h index bc42ccbde659..d7e27957013f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h @@ -90,6 +90,12 @@ struct amdgpu_bo_va { bool cleared; bool is_xgmi; + + /* + * protected by vm reservation lock + * if non-zero, cannot unmap from GPU because user queues may still access it + */ + unsigned int queue_refcount; }; struct amdgpu_bo { |
