Am 01.02.21 um 16:33 schrieb Nirmoy Das:
Assign correct hw priority for compute ring. Also we assign ring priority at ring initialization and it remains unchanged, so we don't need ring->priority_mutex anymore. v2: remove ring->priority_mutex. Fixes: 33abcb1f5a17 ("drm/amdgpu: set compute queue priority at mqd_init") Signed-off-by: Nirmoy Das <nirmoy.das@xxxxxxx> --- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 3 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c index 1a612f51ecd9..c45d9a3f378e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c @@ -258,8 +258,7 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring, } ring->max_dw = max_dw; - ring->priority = DRM_SCHED_PRIORITY_NORMAL; - mutex_init(&ring->priority_mutex); + ring->priority = hw_prio; if (!ring->no_scheduler) { hw_ip = ring->funcs->type; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h index 7112137689db..a831003c2d53 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h @@ -244,8 +244,7 @@ struct amdgpu_ring { bool no_scheduler; atomic_t num_jobs[DRM_SCHED_PRIORITY_COUNT];
num_jobs can be removed as well.
- struct mutex priority_mutex; - /* protected by priority_mutex */ + int priority;
Maybe rename it to hw_prio and make it an unsigned int. With that fixed Reviewed-by: Christian König <christian.koenig@xxxxxxx> Christian.
#if defined(CONFIG_DEBUG_FS) -- 2.30.0
_______________________________________________ amd-gfx mailing list amd-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/amd-gfx