On Wed, Aug 26, 2015 at 2:52 PM, <jglisse@xxxxxxxxxx> wrote: > So this is only build tested as i am away from hardware right now. > Idea is to provide reliable way to check if swiotlb is in use for > a device or not. It seems swiotlb_nr_tbl() is no longer reliable > for that. > > Please test. Even with these patches applied, we are still ending up in the ttm_dma_populate() path in the amdgpu driver rather than ttm_pool_populate() even with a hw iommu enabled. Any idea? The attached patch gives us a 20% performance boost in some apps, but obviously has potential issues if a hw iommu is not present. Alex > > Cheers, > Jérôme Glisse > _______________________________________________ > dri-devel mailing list > dri-devel@xxxxxxxxxxxxxxxxxxxxx > http://lists.freedesktop.org/mailman/listinfo/dri-devel
From 054d47be0545ef13350222a5cbdbcbdc4a3d3609 Mon Sep 17 00:00:00 2001 From: "monk.liu" <monk.liu@xxxxxxx> Date: Fri, 21 Aug 2015 15:36:38 +0800 Subject: [PATCH 1/2] drm/amdgpu: use ttm_pool instead of ttm_dma ttm_dma_populate is very time costing, this could rasie around 20% fps of Nexuiz test. Signed-off-by: monk.liu <monk.liu@xxxxxxx> --- 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 2b6aa65..2346a6e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -699,12 +699,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; @@ -745,13 +739,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], -- 2.0.0
_______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/dri-devel