aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2018-08-01 10:00:52 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-08-27 12:11:11 -0400
commit1b1f2fecb699bb4ccc3cb2fafe92950e9bdb39de (patch)
tree076c814bb4d51ba7bd3283a95cddbe10ac112352 /drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h
parenta245daf3d7a143fb2df16485ad200aa3298eac8c (diff)
drm/amdgpu: rework ctx entity creation
Use a fixed number of entities for each hardware IP. The number of compute entities is reduced to four, SDMA keeps it two entities and all other engines just expose one entity. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h30
1 files changed, 16 insertions, 14 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h
index 609f925b076c..d67c1d285a4f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h
@@ -29,26 +29,26 @@ struct drm_device;
29struct drm_file; 29struct drm_file;
30struct amdgpu_fpriv; 30struct amdgpu_fpriv;
31 31
32struct amdgpu_ctx_ring { 32struct amdgpu_ctx_entity {
33 uint64_t sequence; 33 uint64_t sequence;
34 struct dma_fence **fences; 34 struct dma_fence **fences;
35 struct drm_sched_entity entity; 35 struct drm_sched_entity entity;
36}; 36};
37 37
38struct amdgpu_ctx { 38struct amdgpu_ctx {
39 struct kref refcount; 39 struct kref refcount;
40 struct amdgpu_device *adev; 40 struct amdgpu_device *adev;
41 unsigned reset_counter; 41 unsigned reset_counter;
42 unsigned reset_counter_query; 42 unsigned reset_counter_query;
43 uint32_t vram_lost_counter; 43 uint32_t vram_lost_counter;
44 spinlock_t ring_lock; 44 spinlock_t ring_lock;
45 struct dma_fence **fences; 45 struct dma_fence **fences;
46 struct amdgpu_ctx_ring rings[AMDGPU_MAX_RINGS]; 46 struct amdgpu_ctx_entity *entities[AMDGPU_HW_IP_NUM];
47 bool preamble_presented; 47 bool preamble_presented;
48 enum drm_sched_priority init_priority; 48 enum drm_sched_priority init_priority;
49 enum drm_sched_priority override_priority; 49 enum drm_sched_priority override_priority;
50 struct mutex lock; 50 struct mutex lock;
51 atomic_t guilty; 51 atomic_t guilty;
52}; 52};
53 53
54struct amdgpu_ctx_mgr { 54struct amdgpu_ctx_mgr {
@@ -58,6 +58,8 @@ struct amdgpu_ctx_mgr {
58 struct idr ctx_handles; 58 struct idr ctx_handles;
59}; 59};
60 60
61extern const unsigned int amdgpu_ctx_num_entities[AMDGPU_HW_IP_NUM];
62
61struct amdgpu_ctx *amdgpu_ctx_get(struct amdgpu_fpriv *fpriv, uint32_t id); 63struct amdgpu_ctx *amdgpu_ctx_get(struct amdgpu_fpriv *fpriv, uint32_t id);
62int amdgpu_ctx_put(struct amdgpu_ctx *ctx); 64int amdgpu_ctx_put(struct amdgpu_ctx *ctx);
63 65