Skip to contentSkip to conversation

drm/amdgpu: Properly allocate VM invalidate engine

PATCH In review Oak Zeng 4 participants 4 messages Nov 13, 2017 – Nov 14, 2017 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Oak Zeng

author
#0 lore raw

PATCH 1/1 drm/amdgpu: Properly allocate VM invalidate engine

From: ozeng <[email protected]>

Properly allocate TLB invalidation engine to avoid conflict. The latest engine allocation on gfx9 is:
Engine 0, 1: idle
Engine 2, 3: firmware
Engine 4~13: amdgpu ring, subject to change when ring number changes Engine 14~15: idle
Engine 16: kfd tlb invalidation
Engine 17: Gart flushes

Change-Id I9a32cbcb133c07d7efad1a7bd07c6e2098c747e7
---
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +3 -3
index 16bba97..c264391 100644
@@ -392,7 +392,7 @@ static int gmc_v9_0_early_init(void *handle)
 static int gmc_v9_0_late_init(void *handle)
 {
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
-	unsigned vm_inv_eng[AMDGPU_MAX_VMHUBS] = { 3, 3 };
+	unsigned vm_inv_eng[AMDGPU_MAX_VMHUBS] = { 4, 4 };
 	unsigned i;
 
 	for(i = 0; i < adev->num_rings; ++i) {
@@ -405,9 +405,9 @@ static int gmc_v9_0_late_init(void *handle)
 			 ring->funcs->vmhub);
 	}
 
-	/* Engine 17 is used for GART flushes */
+	/* Engine 16 is used for KFD and 17 for GART flushes */
 	for(i = 0; i < AMDGPU_MAX_VMHUBS; ++i)
-		BUG_ON(vm_inv_eng[i] > 17);
+		BUG_ON(vm_inv_eng[i] > 16);
 
 	return amdgpu_irq_get(adev, &adev->mc.vm_fault, 0);
 }
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): 1510589574-8288-1-git-send-email-Oak.Zeng-5C7GfCeVMHo@public.gmane.org

#2 lore raw

Am 13.11.2017 um 17:12 schrieb Oak Zeng:

Quoted 11 lines

From: ozeng <[email protected]>

Properly allocate TLB invalidation engine to avoid conflict. The latest engine allocation on gfx9 is:
Engine 0, 1: idle
Engine 2, 3: firmware
Engine 4~13: amdgpu ring, subject to change when ring number changes Engine 14~15: idle
Engine 16: kfd tlb invalidation
Engine 17: Gart flushes

Quoted 2 lines
Change-Id I9a32cbcb133c07d7efad1a7bd07c6e2098c747e7
Quoted 19 lines
---
  drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +1 -1
index 16bba97..c264391 100644
@@ -392,7 +392,7 @@ static int gmc_v9_0_early_init(void *handle)
  static int gmc_v9_0_late_init(void *handle)
  {
  	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
-	unsigned vm_inv_eng[AMDGPU_MAX_VMHUBS] = { 3, 3 };
+	unsigned vm_inv_eng[AMDGPU_MAX_VMHUBS] = { 4, 4 };
  	unsigned i;
 
  	for(i = 0; i < adev->num_rings; ++i) {
@@ -405,9 +405,9 @@ static int gmc_v9_0_late_init(void *handle)
  			 ring->funcs->vmhub);

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c static int gmc_v9_0_late_init(void *handle) · line 413

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +2 -2
  	}
 
-	/* Engine 17 is used for GART flushes */
+	/* Engine 16 is used for KFD and 17 for GART flushes */
  	for(i = 0; i < AMDGPU_MAX_VMHUBS; ++i)
-		BUG_ON(vm_inv_eng[i] > 17);
+		BUG_ON(vm_inv_eng[i] > 16);
 
  	return amdgpu_irq_get(adev, &adev->mc.vm_fault, 0);
  }

_______________________________________________
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): 4fff72f2-47e9-d862-2bcf-a592314b43e6-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#4 lore raw
Quoted 11 lines · Christian König

Am 13.11.2017 um 17:12 schrieb Oak Zeng:

Quoted 10 lines

From: ozeng <[email protected]>

Properly allocate TLB invalidation engine to avoid conflict. The latest engine allocation on gfx9 is:
Engine 0, 1: idle
Engine 2, 3: firmware
Engine 4~13: amdgpu ring, subject to change when ring number changes Engine 14~15: idle
Engine 16: kfd tlb invalidation
Engine 17: Gart flushes

Moving these comments to code file will be better.

Regards,
David Zhou

Quoted 30 lines
Quoted 3 lines
Change-Id I9a32cbcb133c07d7efad1a7bd07c6e2098c747e7
Quoted 24 lines

---
  drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 6 +++---

  1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +1 -1
index 16bba97..c264391 100644
@@ -392,7 +392,7 @@ static int gmc_v9_0_early_init(void *handle)
   static int gmc_v9_0_late_init(void *handle)
   {
       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
-    unsigned vm_inv_eng[AMDGPU_MAX_VMHUBS] = { 3, 3 };
+    unsigned vm_inv_eng[AMDGPU_MAX_VMHUBS] = { 4, 4 };
       unsigned i;
         for(i = 0; i < adev->num_rings; ++i) {
@@ -405,9 +405,9 @@ static int gmc_v9_0_late_init(void *handle)
                ring->funcs->vmhub);
       }

  -    /* Engine 17 is used for GART flushes */
+    /* Engine 16 is used for KFD and 17 for GART flushes */ for(i = 0; i < AMDGPU_MAX_VMHUBS; ++i)
-        BUG_ON(vm_inv_eng[i] > 17);
+        BUG_ON(vm_inv_eng[i] > 16);

Quoted 8 lines
Quoted 2 lines

        return amdgpu_irq_get(adev, &adev->mc.vm_fault, 0); }

_______________________________________________
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

A message that is not in the archive (sent off-list or not yet received): 1c97fa3a-17cf-9a32-4445-010d424b673e-5C7GfCeVMHo@public.gmane.org

#6 lore raw

Am 14.11.2017 um 03:30 schrieb Chunming Zhou:

Quoted 14 lines · Christian König
Quoted 11 lines

Am 13.11.2017 um 17:12 schrieb Oak Zeng:

Quoted 10 lines

From: ozeng <[email protected]>

Properly allocate TLB invalidation engine to avoid conflict. The latest engine allocation on gfx9 is:
Engine 0, 1: idle
Engine 2, 3: firmware
Engine 4~13: amdgpu ring, subject to change when ring number changes Engine 14~15: idle
Engine 16: kfd tlb invalidation
Engine 17: Gart flushes

Quoted 1 line

Moving these comments to code file will be better.

Good point. Oak please take care of documenting this in the code.

Just another patch adding this as comment above "unsigned vm_inv_eng[AMDGPU_MAX_VMHUBS] = { 4, 4 }; " should be fine.

Regards,
Christian.

Quoted 42 lines

Regards,
David Zhou

Quoted 38 lines
Quoted 3 lines
Change-Id I9a32cbcb133c07d7efad1a7bd07c6e2098c747e7
Quoted 19 lines

---
  drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 6 +++---

  1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +1 -1
index 16bba97..c264391 100644
@@ -392,7 +392,7 @@ static int gmc_v9_0_early_init(void *handle)
   static int gmc_v9_0_late_init(void *handle)
   {
       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
-    unsigned vm_inv_eng[AMDGPU_MAX_VMHUBS] = { 3, 3 };
+    unsigned vm_inv_eng[AMDGPU_MAX_VMHUBS] = { 4, 4 };
       unsigned i;
         for(i = 0; i < adev->num_rings; ++i) {
@@ -405,9 +405,9 @@ static int gmc_v9_0_late_init(void *handle)
                ring->funcs->vmhub);
       }
Quoted 7 lines

  -    /* Engine 17 is used for GART flushes */
+    /* Engine 16 is used for KFD and 17 for GART flushes */ for(i = 0; i < AMDGPU_MAX_VMHUBS; ++i)
-        BUG_ON(vm_inv_eng[i] > 17);
+        BUG_ON(vm_inv_eng[i] > 16);
        return amdgpu_irq_get(adev, &adev->mc.vm_fault, 0); }

_______________________________________________
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