drm/amdgpu: improve GTT BO alloc speed in OGL
Subsystems (2)
PATCH 1/1 drm/amdgpu: improve GTT BO alloc speed in OGL
From: "monk.liu" <[email protected]>
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.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 13 ------------- 1 file changed, 13 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0 -13
@@ -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 (>t->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 (>t->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],
Signature · 6 lines
2.5.5 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Am 12.09.2016 um 18:44 schrieb Alex Deucher:
Quoted 7 lines
From: "monk.liu" <[email protected]>
original we use
ttm_dmapath to allocate GTT bo, which is too much slower than the path ofttm_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.
Quoted 28 lines
Signed-off-by monk.liu <[email protected]>Reviewed-by Jammy Zhou <[email protected]>Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 13 ------------- 1 file changed, 13 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0
-6@@ -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 (>t->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);
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c static void amdgpu_ttm_tt_unpopulate(struct ttm_tt *ttm) · line 828
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0
-7-#ifdef CONFIG_SWIOTLB -if (swiotlb_nr_tbl ()) { -ttm_dma_unpopulate (>t->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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
A message that is not in the archive (sent off-list or not yet received): 579f1d1e-fd40-a670-08f9-172d2f596d62-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org
Quoted 11 lines · Christian König
Am 12.09.2016 um 18:44 schrieb Alex Deucher:
Quoted 8 lines
From: "monk.liu" <[email protected]>
original we use
ttm_dmapath to allocate GTT bo, which is too much slower than the path ofttm_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.
Quoted 5 lines
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
Quoted 33 lines
Christian.
Quoted 29 lines
Signed-off-by monk.liu <[email protected]>Reviewed-by Jammy Zhou <[email protected]>Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 13 ------------- 1 file changed, 13 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0
-7@@ -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 (>t->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 (>t->ttm, adev->dev);
Quoted 11 lines
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0
-4-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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 7 lines · Alex Deucher
From: "monk.liu" <[email protected]>
original we use
ttm_dmapath to allocate GTT bo, which is too much slower than the path ofttm_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?
Signature · 6 lines
Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
A message that is not in the archive (sent off-list or not yet received): ad77d18c-b74b-a73e-b412-2ce1bc06f9ff-otUistvHUpPR7s880joybQ@public.gmane.org
Quoted 11 lines · Michel Dänzer
Quoted 7 lines · Alex Deucher
From: "monk.liu" <[email protected]>
original we use
ttm_dmapath to allocate GTT bo, which is too much slower than the path ofttm_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
Quoted 5 lines
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx