diff options
author | Christian König <christian.koenig@amd.com> | 2015-07-07 11:24:49 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-08-17 16:50:14 -0400 |
commit | 21c16bf634e62cf9673946f509b469e7f0953ecf (patch) | |
tree | 91595b4cd4064a7867bbdd32cb37fc090c7ec37d /drivers/gpu/drm/amd/amdgpu/amdgpu.h | |
parent | 91e1a5207edec9e4f888e44478a9a254186e0ba8 (diff) |
drm/amdgpu: add user fence context map v2
This is a prerequisite for the GPU scheduler to make the order
of submission independent from the order of execution.
v2: properly implement the locking
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@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, 16 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index 70e783a849ed..0220d98ba8bf 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h | |||
@@ -415,6 +415,8 @@ struct amdgpu_user_fence { | |||
415 | struct amdgpu_bo *bo; | 415 | struct amdgpu_bo *bo; |
416 | /* write-back address offset to bo start */ | 416 | /* write-back address offset to bo start */ |
417 | uint32_t offset; | 417 | uint32_t offset; |
418 | /* resulting sequence number */ | ||
419 | uint64_t sequence; | ||
418 | }; | 420 | }; |
419 | 421 | ||
420 | int amdgpu_fence_driver_init(struct amdgpu_device *adev); | 422 | int amdgpu_fence_driver_init(struct amdgpu_device *adev); |
@@ -985,9 +987,18 @@ struct amdgpu_vm_manager { | |||
985 | * context related structures | 987 | * context related structures |
986 | */ | 988 | */ |
987 | 989 | ||
990 | #define AMDGPU_CTX_MAX_CS_PENDING 16 | ||
991 | |||
992 | struct amdgpu_ctx_ring { | ||
993 | uint64_t sequence; | ||
994 | struct fence *fences[AMDGPU_CTX_MAX_CS_PENDING]; | ||
995 | }; | ||
996 | |||
988 | struct amdgpu_ctx { | 997 | struct amdgpu_ctx { |
989 | struct kref refcount; | 998 | struct kref refcount; |
990 | unsigned reset_counter; | 999 | unsigned reset_counter; |
1000 | spinlock_t ring_lock; | ||
1001 | struct amdgpu_ctx_ring rings[AMDGPU_MAX_RINGS]; | ||
991 | }; | 1002 | }; |
992 | 1003 | ||
993 | struct amdgpu_ctx_mgr { | 1004 | struct amdgpu_ctx_mgr { |
@@ -1007,6 +1018,11 @@ void amdgpu_ctx_fini(struct amdgpu_fpriv *fpriv); | |||
1007 | struct amdgpu_ctx *amdgpu_ctx_get(struct amdgpu_fpriv *fpriv, uint32_t id); | 1018 | struct amdgpu_ctx *amdgpu_ctx_get(struct amdgpu_fpriv *fpriv, uint32_t id); |
1008 | int amdgpu_ctx_put(struct amdgpu_ctx *ctx); | 1019 | int amdgpu_ctx_put(struct amdgpu_ctx *ctx); |
1009 | 1020 | ||
1021 | uint64_t amdgpu_ctx_add_fence(struct amdgpu_ctx *ctx, struct amdgpu_ring *ring, | ||
1022 | struct fence *fence); | ||
1023 | struct fence *amdgpu_ctx_get_fence(struct amdgpu_ctx *ctx, | ||
1024 | struct amdgpu_ring *ring, uint64_t seq); | ||
1025 | |||
1010 | int amdgpu_ctx_ioctl(struct drm_device *dev, void *data, | 1026 | int amdgpu_ctx_ioctl(struct drm_device *dev, void *data, |
1011 | struct drm_file *filp); | 1027 | struct drm_file *filp); |
1012 | 1028 | ||