Skip to contentSkip to conversation

drm/amdgpu: limit the number of enabled gfx queues

PATCH In review Lang Yu 1 participant 2 messages Jul 14, 2022 – Jul 19, 2022

Subsystems (2)
lore
Share & tools
lore

Lang Yu

author
#0 lore raw

PATCH 1/1 drm/amdgpu: limit the number of enabled gfx queues

The driver can only support AMDGPU_MAX_GFX_RINGS gfx queues at the moment. Once enabled gfx queues exceed the limit, we will run into problems when setting up gfx rings in gfx_xxx_sw_init().

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +3 -2
index 222d3d7ea076..ae3fe1d0df04 100644
@@ -229,8 +229,9 @@ void amdgpu_gfx_graphics_queue_acquire(struct amdgpu_device *adev)
 {
 	int i, queue, pipe;
 	bool multipipe_policy = amdgpu_gfx_is_graphics_multipipe_capable(adev);
-	int max_queues_per_me = adev->gfx.me.num_pipe_per_me *
-					adev->gfx.me.num_queue_per_pipe;
+	int max_queues_per_me = min(adev->gfx.me.num_pipe_per_me *
+				    adev->gfx.me.num_queue_per_pipe,
+				    adev->gfx.num_gfx_rings);
 
 	if (multipipe_policy) {
 		/* policy: amdgpu owns the first queue per pipe at this stage
Signature · 1 line
2.25.1
author
#1 lore raw

ping.

Quoted 29 lines · Lang Yu

The driver can only support AMDGPU_MAX_GFX_RINGS gfx queues at the moment. Once enabled gfx queues exceed the limit, we will run into problems when setting up gfx rings in gfx_xxx_sw_init().

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +3 -2
index 222d3d7ea076..ae3fe1d0df04 100644
@@ -229,8 +229,9 @@ void amdgpu_gfx_graphics_queue_acquire(struct amdgpu_device *adev)
 {
 	int i, queue, pipe;
 	bool multipipe_policy = amdgpu_gfx_is_graphics_multipipe_capable(adev);
-	int max_queues_per_me = adev->gfx.me.num_pipe_per_me *
-					adev->gfx.me.num_queue_per_pipe;
+	int max_queues_per_me = min(adev->gfx.me.num_pipe_per_me *
+				    adev->gfx.me.num_queue_per_pipe,
+				    adev->gfx.num_gfx_rings);
 
 	if (multipipe_policy) {
 		/* policy: amdgpu owns the first queue per pipe at this stage
Signature · 1 line
2.25.1