[PATCH v2 1/4] drm/amdgpu: cleanup ring priority assignment

Nirmoy Das nirmoy.das at amd.com
Mon Feb 1 15:33:18 UTC 2021


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 at amd.com>
---
 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];
-	struct mutex		priority_mutex;
-	/* protected by priority_mutex */
+
 	int			priority;

 #if defined(CONFIG_DEBUG_FS)
--
2.30.0



More information about the amd-gfx mailing list