Skip to contentSkip to conversation

drm/amdgpu: use queue 0 for kiq ring

PATCH In review Huang Rui 4 participants 6 messages Jan 22, 2018 – Jan 23, 2018 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Huang Rui

author
#0 lore raw

PATCH 1/1 drm/amdgpu: use queue 0 for kiq ring

It must use queue id 0, because CGPG_IDLE/SAVE/LOAD/RUN only can be issued on queue 0.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +6 -2
index ef04336..0cfb939 100644
@@ -179,8 +179,12 @@ static int amdgpu_gfx_kiq_acquire(struct amdgpu_device *adev,
 
 		amdgpu_gfx_bit_to_queue(adev, queue_bit, &mec, &pipe, &queue);
 
-		/* Using pipes 2/3 from MEC 2 seems cause problems */
-		if (mec == 1 && pipe > 1)
+		/*
+		 * 1. Using pipes 2/3 from MEC 2 seems cause problems.
+		 * 2. It must use queue id 0, because CGPG_IDLE/SAVE/LOAD/RUN
+		 * only can be issued on queue 0.
+		 */
+		if ((mec == 1 && pipe > 1) || queue != 0)
 			continue;
 
 		ring->me = mec + 1;
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1516628738-16083-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#2 lore raw
Quoted 6 lines · Huang Rui

It must use queue id 0, because CGPG_IDLE/SAVE/LOAD/RUN only can be issued on queue 0.

Quoted 26 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +6 -3
index ef04336..0cfb939 100644
@@ -179,8 +179,12 @@ static int amdgpu_gfx_kiq_acquire(struct amdgpu_device *adev,
 
                amdgpu_gfx_bit_to_queue(adev, queue_bit, &mec, &pipe, &queue);
 
-               /* Using pipes 2/3 from MEC 2 seems cause problems */
-               if (mec == 1 && pipe > 1)
+               /*
+                * 1. Using pipes 2/3 from MEC 2 seems cause problems.
+                * 2. It must use queue id 0, because CGPG_IDLE/SAVE/LOAD/RUN
+                * only can be issued on queue 0.
+                */
+               if ((mec == 1 && pipe > 1) || queue != 0)
                        continue;
 
                ring->me = mec + 1;
--

2.7.4

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#3 lore raw
In reply to a message not in the archive
Quoted 15 lines · Huang Rui

It must use queue id 0, because CGPG_IDLE/SAVE/LOAD/RUN only can be issued on queue 0.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 8 ++++++--
  1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +0 -0
index ef04336..0cfb939 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c static int amdgpu_gfx_kiq_acquire(struct amdgpu_device *adev, · line 183

Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +2 -2
@@ -179,8 +179,12 @@ static int amdgpu_gfx_kiq_acquire(struct amdgpu_device *adev,
 
  		amdgpu_gfx_bit_to_queue(adev, queue_bit, &mec, &pipe, &queue);
 
-		/* Using pipes 2/3 from MEC 2 seems cause problems */
-		if (mec == 1 && pipe > 1)
+		/*
+		 * 1. Using pipes 2/3 from MEC 2 seems cause problems.'

Could this have been related to #2? Should we just simplify this by guaranteeing KIQ MEC[0] PIPE[0] QUEUE[0]?

Regards,
Andres

drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c static int amdgpu_gfx_kiq_acquire(struct amdgpu_device *adev, · line 190

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +4 -0
+		 * 2. It must use queue id 0, because CGPG_IDLE/SAVE/LOAD/RUN
+		 * only can be issued on queue 0.
+		 */
+		if ((mec == 1 && pipe > 1) || queue != 0)
  			continue;
 
  		ring->me = mec + 1;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): aaf8651b-6165-19b5-5508-4f3cba3f1e85-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#5 lore raw
Quoted 24 lines · Andres Rodriguez
Quoted 21 lines · Huang Rui

It must use queue id 0, because CGPG_IDLE/SAVE/LOAD/RUN only can be issued on
queue 0.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 8 ++++++--
  1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +0 -0
index ef04336..0cfb939 100644
@@ -179,8 +179,12 @@ static int amdgpu_gfx_kiq_acquire(struct
 amdgpu_device *adev,
                amdgpu_gfx_bit_to_queue(adev, queue_bit, &mec, &pipe,
 &queue);
Quoted 9 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c static int amdgpu_gfx_kiq_acquire(struct amdgpu_device *adev,

Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +2 -1
  -             /* Using pipes 2/3 from MEC 2 seems cause problems */
-               if (mec == 1 && pipe > 1)
+               /*
+                * 1. Using pipes 2/3 from MEC 2 seems cause problems.'

Could this have been related to #2? Should we just simplify this by guaranteeing KIQ MEC[0] PIPE[0] QUEUE[0]?

It's possible. Other OSes use a hardcoded config for KIQ so there may be corner cases we never validated when using a non-standard config.

Alex

Quoted 11 lines

Regards,
Andres

drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c static int amdgpu_gfx_kiq_acquire(struct amdgpu_device *adev, · line 190

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +1 -0
+                * 2. It must use queue id 0, because

CGPG_IDLE/SAVE/LOAD/RUN

drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +3 -0
+                * only can be issued on queue 0.
+                */
+               if ((mec == 1 && pipe > 1) || queue != 0)
                        continue;
                ring->me = mec + 1;
Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#6 lore raw
In reply to a message not in the archive

KFD currently hard-codes MEC2, Pipe0, Queue0 for the HIQ. (For some reason KFD numbers MECs starting from 1, not 0.)

So that narrows your choice for KIQ on MEC2 down to pipe == 1, queue == 0.

Regards,
  Felix

Quoted 19 lines · Huang Rui

It must use queue id 0, because CGPG_IDLE/SAVE/LOAD/RUN only can be issued on queue 0.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +0 -1
index ef04336..0cfb939 100644
@@ -179,8 +179,12 @@ static int amdgpu_gfx_kiq_acquire(struct amdgpu_device *adev,
 
 		amdgpu_gfx_bit_to_queue(adev, queue_bit, &mec, &pipe, &queue);
 
-		/* Using pipes 2/3 from MEC 2 seems cause problems */

drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c static int amdgpu_gfx_kiq_acquire(struct amdgpu_device *adev, · line 190

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +6 -1
-		if (mec == 1 && pipe > 1)
+		/*
+		 * 1. Using pipes 2/3 from MEC 2 seems cause problems.
+		 * 2. It must use queue id 0, because CGPG_IDLE/SAVE/LOAD/RUN
+		 * only can be issued on queue 0.
+		 */
+		if ((mec == 1 && pipe > 1) || queue != 0)
 			continue;
 
 		ring->me = mec + 1;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): ef29adff-9d94-9381-71ea-fcbda0ec48b5-5C7GfCeVMHo@public.gmane.org

author
#8 lore raw
Quoted 5 lines · Felix

KFD currently hard-codes MEC2, Pipe0, Queue0 for the HIQ. (For some reason KFD numbers MECs starting from 1, not 0.)

So that narrows your choice for KIQ on MEC2 down to pipe == 1, queue == 0.

Yes, actually, we use mec2 pipe1 queue0 for KIQ at current for this patch.

Thanks
Ray
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx