diff options
author | Felix Kuehling <Felix.Kuehling@amd.com> | 2018-02-06 20:32:35 -0500 |
---|---|---|
committer | Oded Gabbay <oded.gabbay@gmail.com> | 2018-02-06 20:32:35 -0500 |
commit | d8d019ccffb838bb0dd98e583b5c25ccc0bc6ece (patch) | |
tree | 660d1ea42b915579fc4b12ad717bcbcaf49254f6 /drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | |
parent | 1029a3f33678afb8978285209ec5cfe153fe44ef (diff) |
drm/amdgpu: Add KFD eviction fence
This fence is used by KFD to keep memory resident while user mode
queues are enabled. Trying to evict memory will trigger the
enable_signaling callback, which starts a KFD eviction, which
involves preempting user mode queues before signaling the fence.
There is one such fence per process.
v2:
* Grab a reference to mm_struct
* Dereference fence after NULL check
* Simplify fence release, no need to signal without anyone waiting
* Added signed-off-by Harish, who is the original author of this code
v3:
* update MAINTAINERS file
* change amd_kfd_ prefix to amdkfd_
* remove useless initialization of variable to NULL
v4:
* set amdkfd_fence_ops to be static
* Suggested by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h index 06436c3ebd2b..1a5911882657 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | |||
@@ -36,8 +36,9 @@ | |||
36 | #define AMDGPU_MAX_UVD_ENC_RINGS 2 | 36 | #define AMDGPU_MAX_UVD_ENC_RINGS 2 |
37 | 37 | ||
38 | /* some special values for the owner field */ | 38 | /* some special values for the owner field */ |
39 | #define AMDGPU_FENCE_OWNER_UNDEFINED ((void*)0ul) | 39 | #define AMDGPU_FENCE_OWNER_UNDEFINED ((void *)0ul) |
40 | #define AMDGPU_FENCE_OWNER_VM ((void*)1ul) | 40 | #define AMDGPU_FENCE_OWNER_VM ((void *)1ul) |
41 | #define AMDGPU_FENCE_OWNER_KFD ((void *)2ul) | ||
41 | 42 | ||
42 | #define AMDGPU_FENCE_FLAG_64BIT (1 << 0) | 43 | #define AMDGPU_FENCE_FLAG_64BIT (1 << 0) |
43 | #define AMDGPU_FENCE_FLAG_INT (1 << 1) | 44 | #define AMDGPU_FENCE_FLAG_INT (1 << 1) |