All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: enable paging queue doorbell support
@ 2018-11-15 16:08 Yang, Philip
       [not found] ` <20181115160803.21907-1-Philip.Yang-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Yang, Philip @ 2018-11-15 16:08 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Yang, Philip

paging queues doorbell index use existing assignment sDMA_HI_PRI_ENGINE0/1
index, and increase SDMA_DOORBELL_RANGE size from 2 dwords to 4 dwords to
enable the new doorbell index.

Change-Id: I9adb965f16ee4089d261d9a22231337739184e49
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c |  2 +-
 drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c |  2 +-
 drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 25 +++++++++++++++++--------
 3 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c b/drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c
index 6f9c54978cc1..0eb42c29ecac 100644
--- a/drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c
+++ b/drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c
@@ -80,7 +80,7 @@ static void nbio_v6_1_sdma_doorbell_range(struct amdgpu_device *adev, int instan
 
 	if (use_doorbell) {
 		doorbell_range = REG_SET_FIELD(doorbell_range, BIF_SDMA0_DOORBELL_RANGE, OFFSET, doorbell_index);
-		doorbell_range = REG_SET_FIELD(doorbell_range, BIF_SDMA0_DOORBELL_RANGE, SIZE, 2);
+		doorbell_range = REG_SET_FIELD(doorbell_range, BIF_SDMA0_DOORBELL_RANGE, SIZE, 4);
 	} else
 		doorbell_range = REG_SET_FIELD(doorbell_range, BIF_SDMA0_DOORBELL_RANGE, SIZE, 0);
 
diff --git a/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c b/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c
index f8cee95d61cc..9342ee03d7d4 100644
--- a/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c
+++ b/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c
@@ -76,7 +76,7 @@ static void nbio_v7_4_sdma_doorbell_range(struct amdgpu_device *adev, int instan
 
 	if (use_doorbell) {
 		doorbell_range = REG_SET_FIELD(doorbell_range, BIF_SDMA0_DOORBELL_RANGE, OFFSET, doorbell_index);
-		doorbell_range = REG_SET_FIELD(doorbell_range, BIF_SDMA0_DOORBELL_RANGE, SIZE, 2);
+		doorbell_range = REG_SET_FIELD(doorbell_range, BIF_SDMA0_DOORBELL_RANGE, SIZE, 4);
 	} else
 		doorbell_range = REG_SET_FIELD(doorbell_range, BIF_SDMA0_DOORBELL_RANGE, SIZE, 0);
 
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
index f4490cdd9804..96c9e83204b7 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
@@ -925,11 +925,9 @@ static void sdma_v4_0_page_resume(struct amdgpu_device *adev, unsigned int i)
 					OFFSET, ring->doorbell_index);
 	WREG32_SDMA(i, mmSDMA0_PAGE_DOORBELL, doorbell);
 	WREG32_SDMA(i, mmSDMA0_PAGE_DOORBELL_OFFSET, doorbell_offset);
-	/* TODO: enable doorbell support */
-	/*adev->nbio_funcs->sdma_doorbell_range(adev, i, ring->use_doorbell,
-					      ring->doorbell_index);*/
 
-	sdma_v4_0_ring_set_wptr(ring);
+	/* paging queue doorbell index is already enabled at sdma_v4_0_gfx_resume */
+	sdma_v4_0_page_ring_set_wptr(ring);
 
 	/* set minor_ptr_update to 0 after wptr programed */
 	WREG32_SDMA(i, mmSDMA0_PAGE_MINOR_PTR_UPDATE, 0);
@@ -1504,9 +1502,6 @@ static int sdma_v4_0_sw_init(void *handle)
 		ring->ring_obj = NULL;
 		ring->use_doorbell = true;
 
-		DRM_INFO("use_doorbell being set to: [%s]\n",
-				ring->use_doorbell?"true":"false");
-
 		if (adev->asic_type == CHIP_VEGA10)
 			ring->doorbell_index = (i == 0) ?
 				(AMDGPU_VEGA10_DOORBELL64_sDMA_ENGINE0 << 1) //get DWORD offset
@@ -1516,6 +1511,8 @@ static int sdma_v4_0_sw_init(void *handle)
 				(AMDGPU_DOORBELL64_sDMA_ENGINE0 << 1) //get DWORD offset
 				: (AMDGPU_DOORBELL64_sDMA_ENGINE1 << 1); // get DWORD offset
 
+		DRM_INFO("use_doorbell being set to: [%s] doorbell index %d\n",
+			ring->use_doorbell?"true":"false", ring->doorbell_index);
 
 		sprintf(ring->name, "sdma%d", i);
 		r = amdgpu_ring_init(adev, ring, 1024,
@@ -1529,7 +1526,19 @@ static int sdma_v4_0_sw_init(void *handle)
 		if (adev->sdma.has_page_queue) {
 			ring = &adev->sdma.instance[i].page;
 			ring->ring_obj = NULL;
-			ring->use_doorbell = false;
+			ring->use_doorbell = true;
+
+			if (adev->asic_type == CHIP_VEGA10)
+				ring->doorbell_index = (i == 0) ?
+					(AMDGPU_VEGA10_DOORBELL64_sDMA_HI_PRI_ENGINE0 << 1)
+					: (AMDGPU_VEGA10_DOORBELL64_sDMA_HI_PRI_ENGINE1 << 1);
+			else
+				ring->doorbell_index = (i == 0) ?
+					(AMDGPU_VEGA10_DOORBELL64_sDMA_HI_PRI_ENGINE0 << 1)
+					: (AMDGPU_VEGA10_DOORBELL64_sDMA_HI_PRI_ENGINE1 << 1);
+
+			DRM_INFO("paging queue doorbell being set to: [%s] doorbell index %d\n",
+				ring->use_doorbell?"true":"false", ring->doorbell_index);
 
 			sprintf(ring->name, "page%d", i);
 			r = amdgpu_ring_init(adev, ring, 1024,
-- 
2.17.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/amdgpu: enable paging queue doorbell support
       [not found] ` <20181115160803.21907-1-Philip.Yang-5C7GfCeVMHo@public.gmane.org>
@ 2018-11-15 16:43   ` Alex Deucher
       [not found]     ` <CADnq5_NjEQa2E-pXtLn-rDK3TmuMb+9Ye=3jbmchrqif_M3eVw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Deucher @ 2018-11-15 16:43 UTC (permalink / raw)
  To: Philip.Yang-5C7GfCeVMHo; +Cc: amd-gfx list

On Thu, Nov 15, 2018 at 11:08 AM Yang, Philip <Philip.Yang@amd.com> wrote:
>
> paging queues doorbell index use existing assignment sDMA_HI_PRI_ENGINE0/1
> index, and increase SDMA_DOORBELL_RANGE size from 2 dwords to 4 dwords to
> enable the new doorbell index.
>
> Change-Id: I9adb965f16ee4089d261d9a22231337739184e49
> Signed-off-by: Philip Yang <Philip.Yang@amd.com>

Is there a specific fw version requirement for this?  If so, we need
to add a check.  Also will this break SR-IOV due to the doorbell
mapping requirements for other OSes?  Have we resolved that yet?

> ---
>  drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c |  2 +-
>  drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c |  2 +-
>  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 25 +++++++++++++++++--------
>  3 files changed, 19 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c b/drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c
> index 6f9c54978cc1..0eb42c29ecac 100644
> --- a/drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c
> +++ b/drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c
> @@ -80,7 +80,7 @@ static void nbio_v6_1_sdma_doorbell_range(struct amdgpu_device *adev, int instan
>
>         if (use_doorbell) {
>                 doorbell_range = REG_SET_FIELD(doorbell_range, BIF_SDMA0_DOORBELL_RANGE, OFFSET, doorbell_index);
> -               doorbell_range = REG_SET_FIELD(doorbell_range, BIF_SDMA0_DOORBELL_RANGE, SIZE, 2);
> +               doorbell_range = REG_SET_FIELD(doorbell_range, BIF_SDMA0_DOORBELL_RANGE, SIZE, 4);
>         } else
>                 doorbell_range = REG_SET_FIELD(doorbell_range, BIF_SDMA0_DOORBELL_RANGE, SIZE, 0);
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c b/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c
> index f8cee95d61cc..9342ee03d7d4 100644
> --- a/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c
> +++ b/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c
> @@ -76,7 +76,7 @@ static void nbio_v7_4_sdma_doorbell_range(struct amdgpu_device *adev, int instan
>
>         if (use_doorbell) {
>                 doorbell_range = REG_SET_FIELD(doorbell_range, BIF_SDMA0_DOORBELL_RANGE, OFFSET, doorbell_index);
> -               doorbell_range = REG_SET_FIELD(doorbell_range, BIF_SDMA0_DOORBELL_RANGE, SIZE, 2);
> +               doorbell_range = REG_SET_FIELD(doorbell_range, BIF_SDMA0_DOORBELL_RANGE, SIZE, 4);
>         } else
>                 doorbell_range = REG_SET_FIELD(doorbell_range, BIF_SDMA0_DOORBELL_RANGE, SIZE, 0);
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> index f4490cdd9804..96c9e83204b7 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> @@ -925,11 +925,9 @@ static void sdma_v4_0_page_resume(struct amdgpu_device *adev, unsigned int i)
>                                         OFFSET, ring->doorbell_index);
>         WREG32_SDMA(i, mmSDMA0_PAGE_DOORBELL, doorbell);
>         WREG32_SDMA(i, mmSDMA0_PAGE_DOORBELL_OFFSET, doorbell_offset);
> -       /* TODO: enable doorbell support */
> -       /*adev->nbio_funcs->sdma_doorbell_range(adev, i, ring->use_doorbell,
> -                                             ring->doorbell_index);*/
>
> -       sdma_v4_0_ring_set_wptr(ring);
> +       /* paging queue doorbell index is already enabled at sdma_v4_0_gfx_resume */
> +       sdma_v4_0_page_ring_set_wptr(ring);
>
>         /* set minor_ptr_update to 0 after wptr programed */
>         WREG32_SDMA(i, mmSDMA0_PAGE_MINOR_PTR_UPDATE, 0);
> @@ -1504,9 +1502,6 @@ static int sdma_v4_0_sw_init(void *handle)
>                 ring->ring_obj = NULL;
>                 ring->use_doorbell = true;
>
> -               DRM_INFO("use_doorbell being set to: [%s]\n",
> -                               ring->use_doorbell?"true":"false");
> -
>                 if (adev->asic_type == CHIP_VEGA10)
>                         ring->doorbell_index = (i == 0) ?
>                                 (AMDGPU_VEGA10_DOORBELL64_sDMA_ENGINE0 << 1) //get DWORD offset
> @@ -1516,6 +1511,8 @@ static int sdma_v4_0_sw_init(void *handle)
>                                 (AMDGPU_DOORBELL64_sDMA_ENGINE0 << 1) //get DWORD offset
>                                 : (AMDGPU_DOORBELL64_sDMA_ENGINE1 << 1); // get DWORD offset
>
> +               DRM_INFO("use_doorbell being set to: [%s] doorbell index %d\n",
> +                       ring->use_doorbell?"true":"false", ring->doorbell_index);
>

I think we can drop these messages in general.  Looks like leftover
debugging output.

>                 sprintf(ring->name, "sdma%d", i);
>                 r = amdgpu_ring_init(adev, ring, 1024,
> @@ -1529,7 +1526,19 @@ static int sdma_v4_0_sw_init(void *handle)
>                 if (adev->sdma.has_page_queue) {
>                         ring = &adev->sdma.instance[i].page;
>                         ring->ring_obj = NULL;
> -                       ring->use_doorbell = false;
> +                       ring->use_doorbell = true;
> +
> +                       if (adev->asic_type == CHIP_VEGA10)
> +                               ring->doorbell_index = (i == 0) ?
> +                                       (AMDGPU_VEGA10_DOORBELL64_sDMA_HI_PRI_ENGINE0 << 1)
> +                                       : (AMDGPU_VEGA10_DOORBELL64_sDMA_HI_PRI_ENGINE1 << 1);
> +                       else
> +                               ring->doorbell_index = (i == 0) ?
> +                                       (AMDGPU_VEGA10_DOORBELL64_sDMA_HI_PRI_ENGINE0 << 1)
> +                                       : (AMDGPU_VEGA10_DOORBELL64_sDMA_HI_PRI_ENGINE1 << 1);
> +

Copy paste typo?  Seems like the if and else are the same.

Alex

> +                       DRM_INFO("paging queue doorbell being set to: [%s] doorbell index %d\n",
> +                               ring->use_doorbell?"true":"false", ring->doorbell_index);
>
>                         sprintf(ring->name, "page%d", i);
>                         r = amdgpu_ring_init(adev, ring, 1024,
> --
> 2.17.1
>
> _______________________________________________
> 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] 5+ messages in thread

* Re: [PATCH] drm/amdgpu: enable paging queue doorbell support
       [not found]     ` <CADnq5_NjEQa2E-pXtLn-rDK3TmuMb+9Ye=3jbmchrqif_M3eVw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2018-11-15 17:54       ` Yang, Philip
       [not found]         ` <47ddc0e2-6164-ac44-608e-24f6f219f782-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Yang, Philip @ 2018-11-15 17:54 UTC (permalink / raw)
  To: Alex Deucher; +Cc: amd-gfx list

On 2018-11-15 11:43 a.m., Alex Deucher wrote:
> On Thu, Nov 15, 2018 at 11:08 AM Yang, Philip <Philip.Yang@amd.com> wrote:
>> paging queues doorbell index use existing assignment sDMA_HI_PRI_ENGINE0/1
>> index, and increase SDMA_DOORBELL_RANGE size from 2 dwords to 4 dwords to
>> enable the new doorbell index.
>>
>> Change-Id: I9adb965f16ee4089d261d9a22231337739184e49
>> Signed-off-by: Philip Yang <Philip.Yang@amd.com>
> Is there a specific fw version requirement for this?  If so, we need
> to add a check.  Also will this break SR-IOV due to the doorbell
> mapping requirements for other OSes?  Have we resolved that yet?
>
Yes, new FW is required to enable paging queue, it's good idea to check 
FW version
when we enable paging queue later after new FW is checked in. paging 
queue is not enabled yet.
This change will not take effect until paging queue is enabled.

This does not change doorbell mapping so it will not break SR-IOV. My 
understanding is Doorbell
mapping is good for vega10/12/20, but need update for future chip.
>> ---
>>   drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c |  2 +-
>>   drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c |  2 +-
>>   drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 25 +++++++++++++++++--------
>>   3 files changed, 19 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c b/drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c
>> index 6f9c54978cc1..0eb42c29ecac 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c
>> @@ -80,7 +80,7 @@ static void nbio_v6_1_sdma_doorbell_range(struct amdgpu_device *adev, int instan
>>
>>          if (use_doorbell) {
>>                  doorbell_range = REG_SET_FIELD(doorbell_range, BIF_SDMA0_DOORBELL_RANGE, OFFSET, doorbell_index);
>> -               doorbell_range = REG_SET_FIELD(doorbell_range, BIF_SDMA0_DOORBELL_RANGE, SIZE, 2);
>> +               doorbell_range = REG_SET_FIELD(doorbell_range, BIF_SDMA0_DOORBELL_RANGE, SIZE, 4);
>>          } else
>>                  doorbell_range = REG_SET_FIELD(doorbell_range, BIF_SDMA0_DOORBELL_RANGE, SIZE, 0);
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c b/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c
>> index f8cee95d61cc..9342ee03d7d4 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c
>> @@ -76,7 +76,7 @@ static void nbio_v7_4_sdma_doorbell_range(struct amdgpu_device *adev, int instan
>>
>>          if (use_doorbell) {
>>                  doorbell_range = REG_SET_FIELD(doorbell_range, BIF_SDMA0_DOORBELL_RANGE, OFFSET, doorbell_index);
>> -               doorbell_range = REG_SET_FIELD(doorbell_range, BIF_SDMA0_DOORBELL_RANGE, SIZE, 2);
>> +               doorbell_range = REG_SET_FIELD(doorbell_range, BIF_SDMA0_DOORBELL_RANGE, SIZE, 4);
>>          } else
>>                  doorbell_range = REG_SET_FIELD(doorbell_range, BIF_SDMA0_DOORBELL_RANGE, SIZE, 0);
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
>> index f4490cdd9804..96c9e83204b7 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
>> @@ -925,11 +925,9 @@ static void sdma_v4_0_page_resume(struct amdgpu_device *adev, unsigned int i)
>>                                          OFFSET, ring->doorbell_index);
>>          WREG32_SDMA(i, mmSDMA0_PAGE_DOORBELL, doorbell);
>>          WREG32_SDMA(i, mmSDMA0_PAGE_DOORBELL_OFFSET, doorbell_offset);
>> -       /* TODO: enable doorbell support */
>> -       /*adev->nbio_funcs->sdma_doorbell_range(adev, i, ring->use_doorbell,
>> -                                             ring->doorbell_index);*/
>>
>> -       sdma_v4_0_ring_set_wptr(ring);
>> +       /* paging queue doorbell index is already enabled at sdma_v4_0_gfx_resume */
>> +       sdma_v4_0_page_ring_set_wptr(ring);
>>
>>          /* set minor_ptr_update to 0 after wptr programed */
>>          WREG32_SDMA(i, mmSDMA0_PAGE_MINOR_PTR_UPDATE, 0);
>> @@ -1504,9 +1502,6 @@ static int sdma_v4_0_sw_init(void *handle)
>>                  ring->ring_obj = NULL;
>>                  ring->use_doorbell = true;
>>
>> -               DRM_INFO("use_doorbell being set to: [%s]\n",
>> -                               ring->use_doorbell?"true":"false");
>> -
>>                  if (adev->asic_type == CHIP_VEGA10)
>>                          ring->doorbell_index = (i == 0) ?
>>                                  (AMDGPU_VEGA10_DOORBELL64_sDMA_ENGINE0 << 1) //get DWORD offset
>> @@ -1516,6 +1511,8 @@ static int sdma_v4_0_sw_init(void *handle)
>>                                  (AMDGPU_DOORBELL64_sDMA_ENGINE0 << 1) //get DWORD offset
>>                                  : (AMDGPU_DOORBELL64_sDMA_ENGINE1 << 1); // get DWORD offset
>>
>> +               DRM_INFO("use_doorbell being set to: [%s] doorbell index %d\n",
>> +                       ring->use_doorbell?"true":"false", ring->doorbell_index);
>>
> I think we can drop these messages in general.  Looks like leftover
> debugging output.
>
Ok, change it to DRM_DEBUG
>>                  sprintf(ring->name, "sdma%d", i);
>>                  r = amdgpu_ring_init(adev, ring, 1024,
>> @@ -1529,7 +1526,19 @@ static int sdma_v4_0_sw_init(void *handle)
>>                  if (adev->sdma.has_page_queue) {
>>                          ring = &adev->sdma.instance[i].page;
>>                          ring->ring_obj = NULL;
>> -                       ring->use_doorbell = false;
>> +                       ring->use_doorbell = true;
>> +
>> +                       if (adev->asic_type == CHIP_VEGA10)
>> +                               ring->doorbell_index = (i == 0) ?
>> +                                       (AMDGPU_VEGA10_DOORBELL64_sDMA_HI_PRI_ENGINE0 << 1)
>> +                                       : (AMDGPU_VEGA10_DOORBELL64_sDMA_HI_PRI_ENGINE1 << 1);
>> +                       else
>> +                               ring->doorbell_index = (i == 0) ?
>> +                                       (AMDGPU_VEGA10_DOORBELL64_sDMA_HI_PRI_ENGINE0 << 1)
>> +                                       : (AMDGPU_VEGA10_DOORBELL64_sDMA_HI_PRI_ENGINE1 << 1);
>> +
> Copy paste typo?  Seems like the if and else are the same.
>
> Alex
Yes, copy paste error. Thanks
>
>> +                       DRM_INFO("paging queue doorbell being set to: [%s] doorbell index %d\n",
>> +                               ring->use_doorbell?"true":"false", ring->doorbell_index);
>>
>>                          sprintf(ring->name, "page%d", i);
>>                          r = amdgpu_ring_init(adev, ring, 1024,
>> --
>> 2.17.1
>>
>> _______________________________________________
>> 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] 5+ messages in thread

* RE: [PATCH] drm/amdgpu: enable paging queue doorbell support
       [not found]         ` <47ddc0e2-6164-ac44-608e-24f6f219f782-5C7GfCeVMHo@public.gmane.org>
@ 2018-11-15 18:01           ` Kuehling, Felix
       [not found]             ` <DM5PR12MB170795FFAFFF461CA6E3D96592DC0-2J9CzHegvk9TCtO+SvGBKwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Kuehling, Felix @ 2018-11-15 18:01 UTC (permalink / raw)
  To: Yang, Philip, Alex Deucher; +Cc: amd-gfx list

You changed the doorbell routing in NBIO. I think that won't work for SR-IOV, because it's not controlled by the guest OS there. We may need to disable paging queue doorbell on Vega10 and Vega12 with SRIOV. For Vega20 we plan to change the doorbell layout before it goes to production (Oak started working on that). So on Vega20 we should be able to enable the doorbell for the paging queue.

Regards,
  Felix

-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Yang, Philip
Sent: Thursday, November 15, 2018 12:54 PM
To: Alex Deucher <alexdeucher@gmail.com>
Cc: amd-gfx list <amd-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/amdgpu: enable paging queue doorbell support

On 2018-11-15 11:43 a.m., Alex Deucher wrote:
> On Thu, Nov 15, 2018 at 11:08 AM Yang, Philip <Philip.Yang@amd.com> wrote:
>> paging queues doorbell index use existing assignment 
>> sDMA_HI_PRI_ENGINE0/1 index, and increase SDMA_DOORBELL_RANGE size 
>> from 2 dwords to 4 dwords to enable the new doorbell index.
>>
>> Change-Id: I9adb965f16ee4089d261d9a22231337739184e49
>> Signed-off-by: Philip Yang <Philip.Yang@amd.com>
> Is there a specific fw version requirement for this?  If so, we need 
> to add a check.  Also will this break SR-IOV due to the doorbell 
> mapping requirements for other OSes?  Have we resolved that yet?
>
Yes, new FW is required to enable paging queue, it's good idea to check FW version when we enable paging queue later after new FW is checked in. paging queue is not enabled yet.
This change will not take effect until paging queue is enabled.

This does not change doorbell mapping so it will not break SR-IOV. My understanding is Doorbell mapping is good for vega10/12/20, but need update for future chip.
>> ---
>>   drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c |  2 +-
>>   drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c |  2 +-
>>   drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 25 +++++++++++++++++--------
>>   3 files changed, 19 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c 
>> b/drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c
>> index 6f9c54978cc1..0eb42c29ecac 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c
>> @@ -80,7 +80,7 @@ static void nbio_v6_1_sdma_doorbell_range(struct 
>> amdgpu_device *adev, int instan
>>
>>          if (use_doorbell) {
>>                  doorbell_range = REG_SET_FIELD(doorbell_range, BIF_SDMA0_DOORBELL_RANGE, OFFSET, doorbell_index);
>> -               doorbell_range = REG_SET_FIELD(doorbell_range, BIF_SDMA0_DOORBELL_RANGE, SIZE, 2);
>> +               doorbell_range = REG_SET_FIELD(doorbell_range, 
>> + BIF_SDMA0_DOORBELL_RANGE, SIZE, 4);
>>          } else
>>                  doorbell_range = REG_SET_FIELD(doorbell_range, 
>> BIF_SDMA0_DOORBELL_RANGE, SIZE, 0);
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c 
>> b/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c
>> index f8cee95d61cc..9342ee03d7d4 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c
>> @@ -76,7 +76,7 @@ static void nbio_v7_4_sdma_doorbell_range(struct 
>> amdgpu_device *adev, int instan
>>
>>          if (use_doorbell) {
>>                  doorbell_range = REG_SET_FIELD(doorbell_range, BIF_SDMA0_DOORBELL_RANGE, OFFSET, doorbell_index);
>> -               doorbell_range = REG_SET_FIELD(doorbell_range, BIF_SDMA0_DOORBELL_RANGE, SIZE, 2);
>> +               doorbell_range = REG_SET_FIELD(doorbell_range, 
>> + BIF_SDMA0_DOORBELL_RANGE, SIZE, 4);
>>          } else
>>                  doorbell_range = REG_SET_FIELD(doorbell_range, 
>> BIF_SDMA0_DOORBELL_RANGE, SIZE, 0);
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c 
>> b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
>> index f4490cdd9804..96c9e83204b7 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
>> @@ -925,11 +925,9 @@ static void sdma_v4_0_page_resume(struct amdgpu_device *adev, unsigned int i)
>>                                          OFFSET, ring->doorbell_index);
>>          WREG32_SDMA(i, mmSDMA0_PAGE_DOORBELL, doorbell);
>>          WREG32_SDMA(i, mmSDMA0_PAGE_DOORBELL_OFFSET, doorbell_offset);
>> -       /* TODO: enable doorbell support */
>> -       /*adev->nbio_funcs->sdma_doorbell_range(adev, i, ring->use_doorbell,
>> -                                             ring->doorbell_index);*/
>>
>> -       sdma_v4_0_ring_set_wptr(ring);
>> +       /* paging queue doorbell index is already enabled at sdma_v4_0_gfx_resume */
>> +       sdma_v4_0_page_ring_set_wptr(ring);
>>
>>          /* set minor_ptr_update to 0 after wptr programed */
>>          WREG32_SDMA(i, mmSDMA0_PAGE_MINOR_PTR_UPDATE, 0); @@ -1504,9 
>> +1502,6 @@ static int sdma_v4_0_sw_init(void *handle)
>>                  ring->ring_obj = NULL;
>>                  ring->use_doorbell = true;
>>
>> -               DRM_INFO("use_doorbell being set to: [%s]\n",
>> -                               ring->use_doorbell?"true":"false");
>> -
>>                  if (adev->asic_type == CHIP_VEGA10)
>>                          ring->doorbell_index = (i == 0) ?
>>                                  
>> (AMDGPU_VEGA10_DOORBELL64_sDMA_ENGINE0 << 1) //get DWORD offset @@ -1516,6 +1511,8 @@ static int sdma_v4_0_sw_init(void *handle)
>>                                  (AMDGPU_DOORBELL64_sDMA_ENGINE0 << 1) //get DWORD offset
>>                                  : (AMDGPU_DOORBELL64_sDMA_ENGINE1 << 
>> 1); // get DWORD offset
>>
>> +               DRM_INFO("use_doorbell being set to: [%s] doorbell index %d\n",
>> +                       ring->use_doorbell?"true":"false", 
>> + ring->doorbell_index);
>>
> I think we can drop these messages in general.  Looks like leftover 
> debugging output.
>
Ok, change it to DRM_DEBUG
>>                  sprintf(ring->name, "sdma%d", i);
>>                  r = amdgpu_ring_init(adev, ring, 1024, @@ -1529,7 
>> +1526,19 @@ static int sdma_v4_0_sw_init(void *handle)
>>                  if (adev->sdma.has_page_queue) {
>>                          ring = &adev->sdma.instance[i].page;
>>                          ring->ring_obj = NULL;
>> -                       ring->use_doorbell = false;
>> +                       ring->use_doorbell = true;
>> +
>> +                       if (adev->asic_type == CHIP_VEGA10)
>> +                               ring->doorbell_index = (i == 0) ?
>> +                                       (AMDGPU_VEGA10_DOORBELL64_sDMA_HI_PRI_ENGINE0 << 1)
>> +                                       : (AMDGPU_VEGA10_DOORBELL64_sDMA_HI_PRI_ENGINE1 << 1);
>> +                       else
>> +                               ring->doorbell_index = (i == 0) ?
>> +                                       (AMDGPU_VEGA10_DOORBELL64_sDMA_HI_PRI_ENGINE0 << 1)
>> +                                       : 
>> + (AMDGPU_VEGA10_DOORBELL64_sDMA_HI_PRI_ENGINE1 << 1);
>> +
> Copy paste typo?  Seems like the if and else are the same.
>
> Alex
Yes, copy paste error. Thanks
>
>> +                       DRM_INFO("paging queue doorbell being set to: [%s] doorbell index %d\n",
>> +                               ring->use_doorbell?"true":"false", 
>> + ring->doorbell_index);
>>
>>                          sprintf(ring->name, "page%d", i);
>>                          r = amdgpu_ring_init(adev, ring, 1024,
>> --
>> 2.17.1
>>
>> _______________________________________________
>> 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
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/amdgpu: enable paging queue doorbell support
       [not found]             ` <DM5PR12MB170795FFAFFF461CA6E3D96592DC0-2J9CzHegvk9TCtO+SvGBKwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2018-11-15 19:00               ` Yang, Philip
  0 siblings, 0 replies; 5+ messages in thread
From: Yang, Philip @ 2018-11-15 19:00 UTC (permalink / raw)
  To: Kuehling, Felix, Alex Deucher; +Cc: amd-gfx list

Thanks, I will disable paging queue doorbell on Vega10 and Vega12 with 
SRIOV.

Philip

On 2018-11-15 1:01 p.m., Kuehling, Felix wrote:
> You changed the doorbell routing in NBIO. I think that won't work for SR-IOV, because it's not controlled by the guest OS there. We may need to disable paging queue doorbell on Vega10 and Vega12 with SRIOV. For Vega20 we plan to change the doorbell layout before it goes to production (Oak started working on that). So on Vega20 we should be able to enable the doorbell for the paging queue.
>
> Regards,
>    Felix
>
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Yang, Philip
> Sent: Thursday, November 15, 2018 12:54 PM
> To: Alex Deucher <alexdeucher@gmail.com>
> Cc: amd-gfx list <amd-gfx@lists.freedesktop.org>
> Subject: Re: [PATCH] drm/amdgpu: enable paging queue doorbell support
>
> On 2018-11-15 11:43 a.m., Alex Deucher wrote:
>> On Thu, Nov 15, 2018 at 11:08 AM Yang, Philip <Philip.Yang@amd.com> wrote:
>>> paging queues doorbell index use existing assignment
>>> sDMA_HI_PRI_ENGINE0/1 index, and increase SDMA_DOORBELL_RANGE size
>>> from 2 dwords to 4 dwords to enable the new doorbell index.
>>>
>>> Change-Id: I9adb965f16ee4089d261d9a22231337739184e49
>>> Signed-off-by: Philip Yang <Philip.Yang@amd.com>
>> Is there a specific fw version requirement for this?  If so, we need
>> to add a check.  Also will this break SR-IOV due to the doorbell
>> mapping requirements for other OSes?  Have we resolved that yet?
>>
> Yes, new FW is required to enable paging queue, it's good idea to check FW version when we enable paging queue later after new FW is checked in. paging queue is not enabled yet.
> This change will not take effect until paging queue is enabled.
>
> This does not change doorbell mapping so it will not break SR-IOV. My understanding is Doorbell mapping is good for vega10/12/20, but need update for future chip.
>>> ---
>>>    drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c |  2 +-
>>>    drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c |  2 +-
>>>    drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 25 +++++++++++++++++--------
>>>    3 files changed, 19 insertions(+), 10 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c
>>> b/drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c
>>> index 6f9c54978cc1..0eb42c29ecac 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c
>>> @@ -80,7 +80,7 @@ static void nbio_v6_1_sdma_doorbell_range(struct
>>> amdgpu_device *adev, int instan
>>>
>>>           if (use_doorbell) {
>>>                   doorbell_range = REG_SET_FIELD(doorbell_range, BIF_SDMA0_DOORBELL_RANGE, OFFSET, doorbell_index);
>>> -               doorbell_range = REG_SET_FIELD(doorbell_range, BIF_SDMA0_DOORBELL_RANGE, SIZE, 2);
>>> +               doorbell_range = REG_SET_FIELD(doorbell_range,
>>> + BIF_SDMA0_DOORBELL_RANGE, SIZE, 4);
>>>           } else
>>>                   doorbell_range = REG_SET_FIELD(doorbell_range,
>>> BIF_SDMA0_DOORBELL_RANGE, SIZE, 0);
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c
>>> b/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c
>>> index f8cee95d61cc..9342ee03d7d4 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c
>>> @@ -76,7 +76,7 @@ static void nbio_v7_4_sdma_doorbell_range(struct
>>> amdgpu_device *adev, int instan
>>>
>>>           if (use_doorbell) {
>>>                   doorbell_range = REG_SET_FIELD(doorbell_range, BIF_SDMA0_DOORBELL_RANGE, OFFSET, doorbell_index);
>>> -               doorbell_range = REG_SET_FIELD(doorbell_range, BIF_SDMA0_DOORBELL_RANGE, SIZE, 2);
>>> +               doorbell_range = REG_SET_FIELD(doorbell_range,
>>> + BIF_SDMA0_DOORBELL_RANGE, SIZE, 4);
>>>           } else
>>>                   doorbell_range = REG_SET_FIELD(doorbell_range,
>>> BIF_SDMA0_DOORBELL_RANGE, SIZE, 0);
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
>>> b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
>>> index f4490cdd9804..96c9e83204b7 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
>>> @@ -925,11 +925,9 @@ static void sdma_v4_0_page_resume(struct amdgpu_device *adev, unsigned int i)
>>>                                           OFFSET, ring->doorbell_index);
>>>           WREG32_SDMA(i, mmSDMA0_PAGE_DOORBELL, doorbell);
>>>           WREG32_SDMA(i, mmSDMA0_PAGE_DOORBELL_OFFSET, doorbell_offset);
>>> -       /* TODO: enable doorbell support */
>>> -       /*adev->nbio_funcs->sdma_doorbell_range(adev, i, ring->use_doorbell,
>>> -                                             ring->doorbell_index);*/
>>>
>>> -       sdma_v4_0_ring_set_wptr(ring);
>>> +       /* paging queue doorbell index is already enabled at sdma_v4_0_gfx_resume */
>>> +       sdma_v4_0_page_ring_set_wptr(ring);
>>>
>>>           /* set minor_ptr_update to 0 after wptr programed */
>>>           WREG32_SDMA(i, mmSDMA0_PAGE_MINOR_PTR_UPDATE, 0); @@ -1504,9
>>> +1502,6 @@ static int sdma_v4_0_sw_init(void *handle)
>>>                   ring->ring_obj = NULL;
>>>                   ring->use_doorbell = true;
>>>
>>> -               DRM_INFO("use_doorbell being set to: [%s]\n",
>>> -                               ring->use_doorbell?"true":"false");
>>> -
>>>                   if (adev->asic_type == CHIP_VEGA10)
>>>                           ring->doorbell_index = (i == 0) ?
>>>                                   
>>> (AMDGPU_VEGA10_DOORBELL64_sDMA_ENGINE0 << 1) //get DWORD offset @@ -1516,6 +1511,8 @@ static int sdma_v4_0_sw_init(void *handle)
>>>                                   (AMDGPU_DOORBELL64_sDMA_ENGINE0 << 1) //get DWORD offset
>>>                                   : (AMDGPU_DOORBELL64_sDMA_ENGINE1 <<
>>> 1); // get DWORD offset
>>>
>>> +               DRM_INFO("use_doorbell being set to: [%s] doorbell index %d\n",
>>> +                       ring->use_doorbell?"true":"false",
>>> + ring->doorbell_index);
>>>
>> I think we can drop these messages in general.  Looks like leftover
>> debugging output.
>>
> Ok, change it to DRM_DEBUG
>>>                   sprintf(ring->name, "sdma%d", i);
>>>                   r = amdgpu_ring_init(adev, ring, 1024, @@ -1529,7
>>> +1526,19 @@ static int sdma_v4_0_sw_init(void *handle)
>>>                   if (adev->sdma.has_page_queue) {
>>>                           ring = &adev->sdma.instance[i].page;
>>>                           ring->ring_obj = NULL;
>>> -                       ring->use_doorbell = false;
>>> +                       ring->use_doorbell = true;
>>> +
>>> +                       if (adev->asic_type == CHIP_VEGA10)
>>> +                               ring->doorbell_index = (i == 0) ?
>>> +                                       (AMDGPU_VEGA10_DOORBELL64_sDMA_HI_PRI_ENGINE0 << 1)
>>> +                                       : (AMDGPU_VEGA10_DOORBELL64_sDMA_HI_PRI_ENGINE1 << 1);
>>> +                       else
>>> +                               ring->doorbell_index = (i == 0) ?
>>> +                                       (AMDGPU_VEGA10_DOORBELL64_sDMA_HI_PRI_ENGINE0 << 1)
>>> +                                       :
>>> + (AMDGPU_VEGA10_DOORBELL64_sDMA_HI_PRI_ENGINE1 << 1);
>>> +
>> Copy paste typo?  Seems like the if and else are the same.
>>
>> Alex
> Yes, copy paste error. Thanks
>>> +                       DRM_INFO("paging queue doorbell being set to: [%s] doorbell index %d\n",
>>> +                               ring->use_doorbell?"true":"false",
>>> + ring->doorbell_index);
>>>
>>>                           sprintf(ring->name, "page%d", i);
>>>                           r = amdgpu_ring_init(adev, ring, 1024,
>>> --
>>> 2.17.1
>>>
>>> _______________________________________________
>>> 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

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-11-15 19:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-15 16:08 [PATCH] drm/amdgpu: enable paging queue doorbell support Yang, Philip
     [not found] ` <20181115160803.21907-1-Philip.Yang-5C7GfCeVMHo@public.gmane.org>
2018-11-15 16:43   ` Alex Deucher
     [not found]     ` <CADnq5_NjEQa2E-pXtLn-rDK3TmuMb+9Ye=3jbmchrqif_M3eVw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-11-15 17:54       ` Yang, Philip
     [not found]         ` <47ddc0e2-6164-ac44-608e-24f6f219f782-5C7GfCeVMHo@public.gmane.org>
2018-11-15 18:01           ` Kuehling, Felix
     [not found]             ` <DM5PR12MB170795FFAFFF461CA6E3D96592DC0-2J9CzHegvk9TCtO+SvGBKwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-11-15 19:00               ` Yang, Philip

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.