All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: improve GTT BO alloc speed in OGL
@ 2016-09-12 16:44 Alex Deucher
  2016-09-12 18:26 ` Christian König
  2016-09-13  1:17 ` Michel Dänzer
  0 siblings, 2 replies; 5+ messages in thread
From: Alex Deucher @ 2016-09-12 16:44 UTC (permalink / raw)
  To: amd-gfx, dri-devel; +Cc: Alex Deucher, monk.liu

From: "monk.liu" <monk.liu@amd.com>

original we use ttm_dma path to allocate GTT bo, which is too much
slower than the path of ttm_pool, in most cases.

The swiotlb checks don't seem to work and we always end up in the
slow path even when an IOMMU is available.

Signed-off-by: monk.liu <Monk.Liu@amd.com>
Reviewed-by: Jammy Zhou <jammy.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 3beb10b..e2fcd39 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -783,12 +783,6 @@ static int amdgpu_ttm_tt_populate(struct ttm_tt *ttm)
 
 	adev = amdgpu_get_adev(ttm->bdev);
 
-#ifdef CONFIG_SWIOTLB
-	if (swiotlb_nr_tbl()) {
-		return ttm_dma_populate(&gtt->ttm, adev->dev);
-	}
-#endif
-
 	r = ttm_pool_populate(ttm);
 	if (r) {
 		return r;
@@ -829,13 +823,6 @@ static void amdgpu_ttm_tt_unpopulate(struct ttm_tt *ttm)
 
 	adev = amdgpu_get_adev(ttm->bdev);
 
-#ifdef CONFIG_SWIOTLB
-	if (swiotlb_nr_tbl()) {
-		ttm_dma_unpopulate(&gtt->ttm, adev->dev);
-		return;
-	}
-#endif
-
 	for (i = 0; i < ttm->num_pages; i++) {
 		if (gtt->ttm.dma_address[i]) {
 			pci_unmap_page(adev->pdev, gtt->ttm.dma_address[i],
-- 
2.5.5

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/amdgpu: improve GTT BO alloc speed in OGL
  2016-09-12 16:44 [PATCH] drm/amdgpu: improve GTT BO alloc speed in OGL Alex Deucher
@ 2016-09-12 18:26 ` Christian König
       [not found]   ` <579f1d1e-fd40-a670-08f9-172d2f596d62-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
  2016-09-13  1:17 ` Michel Dänzer
  1 sibling, 1 reply; 5+ messages in thread
From: Christian König @ 2016-09-12 18:26 UTC (permalink / raw)
  To: Alex Deucher, amd-gfx, dri-devel; +Cc: Alex Deucher, monk.liu

Am 12.09.2016 um 18:44 schrieb Alex Deucher:
> From: "monk.liu" <monk.liu@amd.com>
>
> original we use ttm_dma path to allocate GTT bo, which is too much
> slower than the path of ttm_pool, in most cases.
>
> The swiotlb checks don't seem to work and we always end up in the
> slow path even when an IOMMU is available.

While the check is clearly not correct. Simply always using the direct 
mapping and not checking the fallback path can break as well.

So this patch is clearly not a good idea and needs to be fixed before it 
is pushed.

Christian.

> Signed-off-by: monk.liu <Monk.Liu@amd.com>
> Reviewed-by: Jammy Zhou <jammy.zhou@amd.com>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 13 -------------
>   1 file changed, 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index 3beb10b..e2fcd39 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -783,12 +783,6 @@ static int amdgpu_ttm_tt_populate(struct ttm_tt *ttm)
>   
>   	adev = amdgpu_get_adev(ttm->bdev);
>   
> -#ifdef CONFIG_SWIOTLB
> -	if (swiotlb_nr_tbl()) {
> -		return ttm_dma_populate(&gtt->ttm, adev->dev);
> -	}
> -#endif
> -
>   	r = ttm_pool_populate(ttm);
>   	if (r) {
>   		return r;
> @@ -829,13 +823,6 @@ static void amdgpu_ttm_tt_unpopulate(struct ttm_tt *ttm)
>   
>   	adev = amdgpu_get_adev(ttm->bdev);
>   
> -#ifdef CONFIG_SWIOTLB
> -	if (swiotlb_nr_tbl()) {
> -		ttm_dma_unpopulate(&gtt->ttm, adev->dev);
> -		return;
> -	}
> -#endif
> -
>   	for (i = 0; i < ttm->num_pages; i++) {
>   		if (gtt->ttm.dma_address[i]) {
>   			pci_unmap_page(adev->pdev, gtt->ttm.dma_address[i],


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/amdgpu: improve GTT BO alloc speed in OGL
       [not found]   ` <579f1d1e-fd40-a670-08f9-172d2f596d62-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
@ 2016-09-12 19:04     ` Alex Deucher
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Deucher @ 2016-09-12 19:04 UTC (permalink / raw)
  To: Christian König
  Cc: Alex Deucher, monk.liu, Maling list - DRI developers, amd-gfx list

On Mon, Sep 12, 2016 at 2:26 PM, Christian König
<deathsimple@vodafone.de> wrote:
> Am 12.09.2016 um 18:44 schrieb Alex Deucher:
>>
>> From: "monk.liu" <monk.liu@amd.com>
>>
>> original we use ttm_dma path to allocate GTT bo, which is too much
>> slower than the path of ttm_pool, in most cases.
>>
>> The swiotlb checks don't seem to work and we always end up in the
>> slow path even when an IOMMU is available.
>
>
> While the check is clearly not correct. Simply always using the direct
> mapping and not checking the fallback path can break as well.
>
> So this patch is clearly not a good idea and needs to be fixed before it is
> pushed.

Jerome looked into it when Monk first debugged this, but I don't think
anything ever came of it:
https://patchwork.kernel.org/patch/7079521/

Alex

>
> Christian.
>
>
>> Signed-off-by: monk.liu <Monk.Liu@amd.com>
>> Reviewed-by: Jammy Zhou <jammy.zhou@amd.com>
>> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 13 -------------
>>   1 file changed, 13 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> index 3beb10b..e2fcd39 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> @@ -783,12 +783,6 @@ static int amdgpu_ttm_tt_populate(struct ttm_tt *ttm)
>>         adev = amdgpu_get_adev(ttm->bdev);
>>   -#ifdef CONFIG_SWIOTLB
>> -       if (swiotlb_nr_tbl()) {
>> -               return ttm_dma_populate(&gtt->ttm, adev->dev);
>> -       }
>> -#endif
>> -
>>         r = ttm_pool_populate(ttm);
>>         if (r) {
>>                 return r;
>> @@ -829,13 +823,6 @@ static void amdgpu_ttm_tt_unpopulate(struct ttm_tt
>> *ttm)
>>         adev = amdgpu_get_adev(ttm->bdev);
>>   -#ifdef CONFIG_SWIOTLB
>> -       if (swiotlb_nr_tbl()) {
>> -               ttm_dma_unpopulate(&gtt->ttm, adev->dev);
>> -               return;
>> -       }
>> -#endif
>> -
>>         for (i = 0; i < ttm->num_pages; i++) {
>>                 if (gtt->ttm.dma_address[i]) {
>>                         pci_unmap_page(adev->pdev,
>> gtt->ttm.dma_address[i],
>
>
>
_______________________________________________
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: improve GTT BO alloc speed in OGL
  2016-09-12 16:44 [PATCH] drm/amdgpu: improve GTT BO alloc speed in OGL Alex Deucher
  2016-09-12 18:26 ` Christian König
@ 2016-09-13  1:17 ` Michel Dänzer
       [not found]   ` <ad77d18c-b74b-a73e-b412-2ce1bc06f9ff-otUistvHUpPR7s880joybQ@public.gmane.org>
  1 sibling, 1 reply; 5+ messages in thread
From: Michel Dänzer @ 2016-09-13  1:17 UTC (permalink / raw)
  To: Alex Deucher; +Cc: Alex Deucher, monk.liu, dri-devel, amd-gfx

On 13/09/16 01:44 AM, Alex Deucher wrote:
> From: "monk.liu" <monk.liu@amd.com>
> 
> original we use ttm_dma path to allocate GTT bo, which is too much
> slower than the path of ttm_pool, in most cases.
> 
> The swiotlb checks don't seem to work and we always end up in the
> slow path even when an IOMMU is available.

This change will break any cases where SWIOTLB is actually necessary
though, won't it?


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/amdgpu: improve GTT BO alloc speed in OGL
       [not found]   ` <ad77d18c-b74b-a73e-b412-2ce1bc06f9ff-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2016-09-13  2:53     ` Alex Deucher
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Deucher @ 2016-09-13  2:53 UTC (permalink / raw)
  To: Michel Dänzer
  Cc: Alex Deucher, monk.liu, Maling list - DRI developers, amd-gfx list

On Mon, Sep 12, 2016 at 9:17 PM, Michel Dänzer <michel@daenzer.net> wrote:
> On 13/09/16 01:44 AM, Alex Deucher wrote:
>> From: "monk.liu" <monk.liu@amd.com>
>>
>> original we use ttm_dma path to allocate GTT bo, which is too much
>> slower than the path of ttm_pool, in most cases.
>>
>> The swiotlb checks don't seem to work and we always end up in the
>> slow path even when an IOMMU is available.
>
> This change will break any cases where SWIOTLB is actually necessary
> though, won't it?

Yes, theoretically.

Alex

>
>
> --
> Earthling Michel Dänzer               |               http://www.amd.com
> Libre software enthusiast             |             Mesa and X developer
_______________________________________________
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:[~2016-09-13  2:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-12 16:44 [PATCH] drm/amdgpu: improve GTT BO alloc speed in OGL Alex Deucher
2016-09-12 18:26 ` Christian König
     [not found]   ` <579f1d1e-fd40-a670-08f9-172d2f596d62-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2016-09-12 19:04     ` Alex Deucher
2016-09-13  1:17 ` Michel Dänzer
     [not found]   ` <ad77d18c-b74b-a73e-b412-2ce1bc06f9ff-otUistvHUpPR7s880joybQ@public.gmane.org>
2016-09-13  2:53     ` Alex Deucher

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.