diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index 7ef6c28a34d9..d1d94a14b089 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <drm/ttm/ttm_placement.h> | 34 | #include <drm/ttm/ttm_placement.h> |
35 | #include <drm/ttm/ttm_module.h> | 35 | #include <drm/ttm/ttm_module.h> |
36 | #include <drm/ttm/ttm_page_alloc.h> | 36 | #include <drm/ttm/ttm_page_alloc.h> |
37 | #include <drm/ttm/ttm_debug.h> | ||
37 | #include <drm/drmP.h> | 38 | #include <drm/drmP.h> |
38 | #include <drm/amdgpu_drm.h> | 39 | #include <drm/amdgpu_drm.h> |
39 | #include <linux/seq_file.h> | 40 | #include <linux/seq_file.h> |
@@ -667,32 +668,16 @@ static void amdgpu_trace_dma_map(struct ttm_tt *ttm) | |||
667 | { | 668 | { |
668 | struct amdgpu_device *adev = amdgpu_ttm_adev(ttm->bdev); | 669 | struct amdgpu_device *adev = amdgpu_ttm_adev(ttm->bdev); |
669 | struct amdgpu_ttm_tt *gtt = (void *)ttm; | 670 | struct amdgpu_ttm_tt *gtt = (void *)ttm; |
670 | unsigned i; | ||
671 | 671 | ||
672 | if (unlikely(trace_amdgpu_ttm_tt_populate_enabled())) { | 672 | ttm_trace_dma_map(adev->dev, >t->ttm); |
673 | for (i = 0; i < ttm->num_pages; i++) { | ||
674 | trace_amdgpu_ttm_tt_populate( | ||
675 | adev, | ||
676 | gtt->ttm.dma_address[i], | ||
677 | page_to_phys(ttm->pages[i])); | ||
678 | } | ||
679 | } | ||
680 | } | 673 | } |
681 | 674 | ||
682 | static void amdgpu_trace_dma_unmap(struct ttm_tt *ttm) | 675 | static void amdgpu_trace_dma_unmap(struct ttm_tt *ttm) |
683 | { | 676 | { |
684 | struct amdgpu_device *adev = amdgpu_ttm_adev(ttm->bdev); | 677 | struct amdgpu_device *adev = amdgpu_ttm_adev(ttm->bdev); |
685 | struct amdgpu_ttm_tt *gtt = (void *)ttm; | 678 | struct amdgpu_ttm_tt *gtt = (void *)ttm; |
686 | unsigned i; | ||
687 | 679 | ||
688 | if (unlikely(trace_amdgpu_ttm_tt_unpopulate_enabled())) { | 680 | ttm_trace_dma_unmap(adev->dev, >t->ttm); |
689 | for (i = 0; i < ttm->num_pages; i++) { | ||
690 | trace_amdgpu_ttm_tt_unpopulate( | ||
691 | adev, | ||
692 | gtt->ttm.dma_address[i], | ||
693 | page_to_phys(ttm->pages[i])); | ||
694 | } | ||
695 | } | ||
696 | } | 681 | } |
697 | 682 | ||
698 | /* prepare the sg table with the user pages */ | 683 | /* prepare the sg table with the user pages */ |