forked from Minki/linux
drm/amd/amdgpu: remove usage of ttm trace
Signed-off-by: Tom St Denis <tom.stdenis@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
38290b2c45
commit
79ba280066
@ -34,7 +34,6 @@
|
|||||||
#include <drm/ttm/ttm_placement.h>
|
#include <drm/ttm/ttm_placement.h>
|
||||||
#include <drm/ttm/ttm_module.h>
|
#include <drm/ttm/ttm_module.h>
|
||||||
#include <drm/ttm/ttm_page_alloc.h>
|
#include <drm/ttm/ttm_page_alloc.h>
|
||||||
#include <drm/ttm/ttm_debug.h>
|
|
||||||
#include <drm/drmP.h>
|
#include <drm/drmP.h>
|
||||||
#include <drm/amdgpu_drm.h>
|
#include <drm/amdgpu_drm.h>
|
||||||
#include <linux/seq_file.h>
|
#include <linux/seq_file.h>
|
||||||
@ -704,22 +703,6 @@ void amdgpu_ttm_tt_mark_user_pages(struct ttm_tt *ttm)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void amdgpu_trace_dma_map(struct ttm_tt *ttm)
|
|
||||||
{
|
|
||||||
struct amdgpu_device *adev = amdgpu_ttm_adev(ttm->bdev);
|
|
||||||
struct amdgpu_ttm_tt *gtt = (void *)ttm;
|
|
||||||
|
|
||||||
ttm_trace_dma_map(adev->dev, >t->ttm);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void amdgpu_trace_dma_unmap(struct ttm_tt *ttm)
|
|
||||||
{
|
|
||||||
struct amdgpu_device *adev = amdgpu_ttm_adev(ttm->bdev);
|
|
||||||
struct amdgpu_ttm_tt *gtt = (void *)ttm;
|
|
||||||
|
|
||||||
ttm_trace_dma_unmap(adev->dev, >t->ttm);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* prepare the sg table with the user pages */
|
/* prepare the sg table with the user pages */
|
||||||
static int amdgpu_ttm_tt_pin_userptr(struct ttm_tt *ttm)
|
static int amdgpu_ttm_tt_pin_userptr(struct ttm_tt *ttm)
|
||||||
{
|
{
|
||||||
@ -746,8 +729,6 @@ static int amdgpu_ttm_tt_pin_userptr(struct ttm_tt *ttm)
|
|||||||
drm_prime_sg_to_page_addr_arrays(ttm->sg, ttm->pages,
|
drm_prime_sg_to_page_addr_arrays(ttm->sg, ttm->pages,
|
||||||
gtt->ttm.dma_address, ttm->num_pages);
|
gtt->ttm.dma_address, ttm->num_pages);
|
||||||
|
|
||||||
amdgpu_trace_dma_map(ttm);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
release_sg:
|
release_sg:
|
||||||
@ -773,8 +754,6 @@ static void amdgpu_ttm_tt_unpin_userptr(struct ttm_tt *ttm)
|
|||||||
|
|
||||||
amdgpu_ttm_tt_mark_user_pages(ttm);
|
amdgpu_ttm_tt_mark_user_pages(ttm);
|
||||||
|
|
||||||
amdgpu_trace_dma_unmap(ttm);
|
|
||||||
|
|
||||||
sg_free_table(ttm->sg);
|
sg_free_table(ttm->sg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -958,7 +937,6 @@ static int amdgpu_ttm_tt_populate(struct ttm_tt *ttm)
|
|||||||
{
|
{
|
||||||
struct amdgpu_device *adev = amdgpu_ttm_adev(ttm->bdev);
|
struct amdgpu_device *adev = amdgpu_ttm_adev(ttm->bdev);
|
||||||
struct amdgpu_ttm_tt *gtt = (void *)ttm;
|
struct amdgpu_ttm_tt *gtt = (void *)ttm;
|
||||||
int r;
|
|
||||||
bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG);
|
bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG);
|
||||||
|
|
||||||
if (ttm->state != tt_unpopulated)
|
if (ttm->state != tt_unpopulated)
|
||||||
@ -978,22 +956,16 @@ static int amdgpu_ttm_tt_populate(struct ttm_tt *ttm)
|
|||||||
drm_prime_sg_to_page_addr_arrays(ttm->sg, ttm->pages,
|
drm_prime_sg_to_page_addr_arrays(ttm->sg, ttm->pages,
|
||||||
gtt->ttm.dma_address, ttm->num_pages);
|
gtt->ttm.dma_address, ttm->num_pages);
|
||||||
ttm->state = tt_unbound;
|
ttm->state = tt_unbound;
|
||||||
r = 0;
|
return 0;
|
||||||
goto trace_mappings;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_SWIOTLB
|
#ifdef CONFIG_SWIOTLB
|
||||||
if (swiotlb_nr_tbl()) {
|
if (swiotlb_nr_tbl()) {
|
||||||
r = ttm_dma_populate(>t->ttm, adev->dev);
|
return ttm_dma_populate(>t->ttm, adev->dev);
|
||||||
goto trace_mappings;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
r = ttm_populate_and_map_pages(adev->dev, >t->ttm);
|
return ttm_populate_and_map_pages(adev->dev, >t->ttm);
|
||||||
trace_mappings:
|
|
||||||
if (likely(!r))
|
|
||||||
amdgpu_trace_dma_map(ttm);
|
|
||||||
return r;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void amdgpu_ttm_tt_unpopulate(struct ttm_tt *ttm)
|
static void amdgpu_ttm_tt_unpopulate(struct ttm_tt *ttm)
|
||||||
@ -1014,8 +986,6 @@ static void amdgpu_ttm_tt_unpopulate(struct ttm_tt *ttm)
|
|||||||
|
|
||||||
adev = amdgpu_ttm_adev(ttm->bdev);
|
adev = amdgpu_ttm_adev(ttm->bdev);
|
||||||
|
|
||||||
amdgpu_trace_dma_unmap(ttm);
|
|
||||||
|
|
||||||
#ifdef CONFIG_SWIOTLB
|
#ifdef CONFIG_SWIOTLB
|
||||||
if (swiotlb_nr_tbl()) {
|
if (swiotlb_nr_tbl()) {
|
||||||
ttm_dma_unpopulate(>t->ttm, adev->dev);
|
ttm_dma_unpopulate(>t->ttm, adev->dev);
|
||||||
|
Loading…
Reference in New Issue
Block a user