aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
diff options
context:
space:
mode:
authorTom St Denis <tom.stdenis@amd.com>2017-08-23 15:33:40 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-08-29 15:27:51 -0400
commitca3670aa370e3cd01020decb308a0a5ddf193183 (patch)
treea759c32fc084eba289723637fcf6e79fd64b6aa7 /drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
parenta92e145059cb883155a24a2d3ac33296d33d9df7 (diff)
drm/amd/amdgpu: Remove AMDGPU tracepoint and use new TTM tracepoint (v2)
Switches the AMDGPU driver over to the TTM tracepoint and removes our old one. Now you can enable traces before loading the module and trace all mappings. 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> (v2): Use struct device instead of pci in trace.
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c21
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, &gtt->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
682static void amdgpu_trace_dma_unmap(struct ttm_tt *ttm) 675static 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, &gtt->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 */