* [PATCH] drm/amdgpu: Properly allocate VM invalidate eng v2
@ 2017-11-14 15:22 Oak Zeng
[not found] ` <1510672966-6400-1-git-send-email-Oak.Zeng-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Oak Zeng @ 2017-11-14 15:22 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Oak Zeng
From: ozeng <oak.zeng@amd.com>
v1: Properly allocate TLB invalidation engine to avoid conflict.
v2: Added comments to codes
Change-Id: I9a32cbcb133c07d7efad1a7bd07c6e2098c747e7
Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
---
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
index 16bba97..b067b46 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
@@ -392,7 +392,16 @@ 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 };
+ /*
+ * 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
+ */
+ unsigned vm_inv_eng[AMDGPU_MAX_VMHUBS] = { 4, 4 };
unsigned i;
for(i = 0; i < adev->num_rings; ++i) {
@@ -405,9 +414,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);
}
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/amdgpu: Properly allocate VM invalidate eng v2
[not found] ` <1510672966-6400-1-git-send-email-Oak.Zeng-5C7GfCeVMHo@public.gmane.org>
@ 2017-11-14 15:34 ` Alex Deucher
2017-11-14 15:47 ` Christian König
1 sibling, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2017-11-14 15:34 UTC (permalink / raw)
To: Oak Zeng; +Cc: Oak Zeng, amd-gfx list
On Tue, Nov 14, 2017 at 10:22 AM, Oak Zeng <zengshanjun@gmail.com> wrote:
> From: ozeng <oak.zeng@amd.com>
>
> v1: Properly allocate TLB invalidation engine to avoid conflict.
> v2: Added comments to codes
>
> Change-Id: I9a32cbcb133c07d7efad1a7bd07c6e2098c747e7
> Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 15 ++++++++++++---
> 1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> index 16bba97..b067b46 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> @@ -392,7 +392,16 @@ 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 };
> + /*
> + * 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
> + */
> + unsigned vm_inv_eng[AMDGPU_MAX_VMHUBS] = { 4, 4 };
> unsigned i;
>
> for(i = 0; i < adev->num_rings; ++i) {
> @@ -405,9 +414,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);
> }
> --
> 2.7.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/amdgpu: Properly allocate VM invalidate eng v2
[not found] ` <1510672966-6400-1-git-send-email-Oak.Zeng-5C7GfCeVMHo@public.gmane.org>
2017-11-14 15:34 ` Alex Deucher
@ 2017-11-14 15:47 ` Christian König
1 sibling, 0 replies; 3+ messages in thread
From: Christian König @ 2017-11-14 15:47 UTC (permalink / raw)
To: Oak Zeng, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Oak Zeng
Am 14.11.2017 um 16:22 schrieb Oak Zeng:
> From: ozeng <oak.zeng@amd.com>
>
> v1: Properly allocate TLB invalidation engine to avoid conflict.
> v2: Added comments to codes
>
> Change-Id: I9a32cbcb133c07d7efad1a7bd07c6e2098c747e7
> Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 15 ++++++++++++---
> 1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> index 16bba97..b067b46 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> @@ -392,7 +392,16 @@ 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 };
> + /*
> + * 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
> + */
> + unsigned vm_inv_eng[AMDGPU_MAX_VMHUBS] = { 4, 4 };
> unsigned i;
>
> for(i = 0; i < adev->num_rings; ++i) {
> @@ -405,9 +414,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);
> }
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-11-14 15:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-14 15:22 [PATCH] drm/amdgpu: Properly allocate VM invalidate eng v2 Oak Zeng
[not found] ` <1510672966-6400-1-git-send-email-Oak.Zeng-5C7GfCeVMHo@public.gmane.org>
2017-11-14 15:34 ` Alex Deucher
2017-11-14 15:47 ` Christian König
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.