Skip to contentSkip to conversation

drm/amdgpu/ring: add no_scheduler flag

PATCH In review Alex Deucher 2 participants 4 messages Apr 10, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 drm/amdgpu/ring: add no_scheduler flag

This allows IPs to flag whether a specific ring requires a GPU scheduler or not. E.g., sometimes instances of an IP are asymmetric and have different capabilities.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 3 ++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +2 -1
index 5f36bd58202a..4863e91c5533 100644
@@ -261,7 +261,8 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,
 	mutex_init(&ring->priority_mutex);
 
 	if (ring->funcs->type >= AMDGPU_RING_TYPE_GFX &&
-	    ring->funcs->type <= AMDGPU_RING_TYPE_VCN_JPEG) {
+	    ring->funcs->type <= AMDGPU_RING_TYPE_VCN_JPEG &&
+	    !ring->no_scheduler) {
 		hw_ip = ring->funcs->type;
 		num_sched = &adev->gpu_sched[hw_ip][hw_prio].num_scheds;
 		adev->gpu_sched[hw_ip][hw_prio].sched[(*num_sched)++] =
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h +1 -0
index efd7627b3f69..f61664ee4940 100644
@@ -238,6 +238,7 @@ struct amdgpu_ring {
 	unsigned		vm_inv_eng;
 	struct dma_fence	*vmid_wait;
 	bool			has_compute_vm_bug;
+	bool			no_scheduler;
 
 	atomic_t		num_jobs[DRM_SCHED_PRIORITY_MAX];
 	struct mutex		priority_mutex;
Signature · 6 lines
2.25.2

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

PATCH 2/3 drm/amdgpu/kiq: add no_scheduler flag to KIQ

We don't want a GPU scheduler for this ring.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +1 -0
index 92f2e59056c9..ea576b4260a4 100644
@@ -318,6 +318,7 @@ int amdgpu_gfx_kiq_init_ring(struct amdgpu_device *adev,
 		return r;
 
 	ring->eop_gpu_addr = kiq->eop_gpu_addr;
+	ring->no_scheduler = true;
 	sprintf(ring->name, "kiq_%d.%d.%d", ring->me, ring->pipe, ring->queue);
 	r = amdgpu_ring_init(adev, ring, 1024,
 			     irq, AMDGPU_CP_KIQ_IRQ_DRIVER0,
Signature · 6 lines
2.25.2

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

PATCH 3/3 drm/amdgpu/ring: simplify scheduler setup logic

In reply to Alex Deucher

Set up a GPU scheduler based on the ring flag rather than the ring type.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +1 -3
index 4863e91c5533..13ea8ebc421c 100644
@@ -260,9 +260,7 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,
 	ring->priority = DRM_SCHED_PRIORITY_NORMAL;
 	mutex_init(&ring->priority_mutex);
 
-	if (ring->funcs->type >= AMDGPU_RING_TYPE_GFX &&
-	    ring->funcs->type <= AMDGPU_RING_TYPE_VCN_JPEG &&
-	    !ring->no_scheduler) {
+	if (!ring->no_scheduler) {
 		hw_ip = ring->funcs->type;
 		num_sched = &adev->gpu_sched[hw_ip][hw_prio].num_scheds;
 		adev->gpu_sched[hw_ip][hw_prio].sched[(*num_sched)++] =
Signature · 6 lines
2.25.2

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by on v1 1/3
#3 lore raw
In reply to Alex Deucher

Am 10.04.20 um 14:49 schrieb Alex Deucher:

Quoted 6 lines

This allows IPs to flag whether a specific ring requires a GPU scheduler or not. E.g., sometimes instances of an IP are asymmetric and have different capabilities.

Quoted 24 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 3 ++-
  drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 1 +
  2 files changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +2 -1
index 5f36bd58202a..4863e91c5533 100644
@@ -261,7 +261,8 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,
  	mutex_init(&ring->priority_mutex);
 
  	if (ring->funcs->type >= AMDGPU_RING_TYPE_GFX &&
-	    ring->funcs->type <= AMDGPU_RING_TYPE_VCN_JPEG) {
+	    ring->funcs->type <= AMDGPU_RING_TYPE_VCN_JPEG &&
+	    !ring->no_scheduler) {
  		hw_ip = ring->funcs->type;
  		num_sched = &adev->gpu_sched[hw_ip][hw_prio].num_scheds;
  		adev->gpu_sched[hw_ip][hw_prio].sched[(*num_sched)++] =
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h +0 -0
index efd7627b3f69..f61664ee4940 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h struct amdgpu_ring { · line 244

Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h +1 -0
@@ -238,6 +238,7 @@ struct amdgpu_ring {
  	unsigned		vm_inv_eng;
  	struct dma_fence	*vmid_wait;
  	bool			has_compute_vm_bug;
+	bool			no_scheduler;
 
  	atomic_t		num_jobs[DRM_SCHED_PRIORITY_MAX];
  	struct mutex		priority_mutex;

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