AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tom St Denis <tom.stdenis@amd.com>
To: amd-gfx@lists.freedesktop.org
Cc: Tom St Denis <tom.stdenis@amd.com>, dri-devel@lists.freedesktop.org
Subject: [PATCH 3/4] drm/amd/amdgpu: remove usage of ttm trace
Date: Mon, 18 Sep 2017 08:35:27 -0400	[thread overview]
Message-ID: <20170918123528.26629-4-tom.stdenis@amd.com> (raw)
In-Reply-To: <20170918123528.26629-1-tom.stdenis@amd.com>

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 36 +++------------------------------
 1 file changed, 3 insertions(+), 33 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index b4c298925e2a..e0c37fe4d043 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -34,7 +34,6 @@
 #include <drm/ttm/ttm_placement.h>
 #include <drm/ttm/ttm_module.h>
 #include <drm/ttm/ttm_page_alloc.h>
-#include <drm/ttm/ttm_debug.h>
 #include <drm/drmP.h>
 #include <drm/amdgpu_drm.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, &gtt->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, &gtt->ttm);
-}
-
 /* prepare the sg table with the user pages */
 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,
 					 gtt->ttm.dma_address, ttm->num_pages);
 
-	amdgpu_trace_dma_map(ttm);
-
 	return 0;
 
 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_trace_dma_unmap(ttm);
-
 	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_ttm_tt *gtt = (void *)ttm;
-	int r;
 	bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG);
 
 	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,
 						 gtt->ttm.dma_address, ttm->num_pages);
 		ttm->state = tt_unbound;
-		r = 0;
-		goto trace_mappings;
+		return 0;
 	}
 
 #ifdef CONFIG_SWIOTLB
 	if (swiotlb_nr_tbl()) {
-		r = ttm_dma_populate(&gtt->ttm, adev->dev);
-		goto trace_mappings;
+		return ttm_dma_populate(&gtt->ttm, adev->dev);
 	}
 #endif
 
-	r = ttm_populate_and_map_pages(adev->dev, &gtt->ttm);
-trace_mappings:
-	if (likely(!r))
-		amdgpu_trace_dma_map(ttm);
-	return r;
+	return ttm_populate_and_map_pages(adev->dev, &gtt->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);
 
-	amdgpu_trace_dma_unmap(ttm);
-
 #ifdef CONFIG_SWIOTLB
 	if (swiotlb_nr_tbl()) {
 		ttm_dma_unpopulate(&gtt->ttm, adev->dev);
-- 
2.12.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2017-09-18 12:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-18 12:35 Remove TTM trace and use proper IOMMU api Tom St Denis
2017-09-18 12:35 ` [PATCH 1/4] drm/amd/amdgpu: Fold TTM debugfs entries into array Tom St Denis
     [not found]   ` <20170918123528.26629-2-tom.stdenis-5C7GfCeVMHo@public.gmane.org>
2017-09-18 12:48     ` Christian König
     [not found]       ` <049ebf9c-5293-f121-f005-a49ffeb65508-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-09-18 13:01         ` Tom St Denis
     [not found]           ` <350a7d1b-7548-1347-b7bc-533acb47b1b7-5C7GfCeVMHo@public.gmane.org>
2017-09-18 13:03             ` Christian König
2017-09-18 12:35 ` Tom St Denis [this message]
     [not found] ` <20170918123528.26629-1-tom.stdenis-5C7GfCeVMHo@public.gmane.org>
2017-09-18 12:35   ` [PATCH 2/4] drm/amd/amdgpu: add support for iova_to_phys to replace TTM trace Tom St Denis
2017-09-18 12:52     ` Christian König
     [not found]       ` <927ae529-10cf-5cc9-fb96-76db8cfc0936-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-09-18 12:56         ` Tom St Denis
2017-09-18 12:35   ` [PATCH 4/4] drm/ttm: Remove TTM dma tracepoint since it's not required anymore Tom St Denis
  -- strict thread matches above, loose matches on Subject: below --
2017-09-18 17:33 remove ttm trace and add iova debugfs (v2) Tom St Denis
     [not found] ` <20170918173350.9543-1-tom.stdenis-5C7GfCeVMHo@public.gmane.org>
2017-09-18 17:33   ` [PATCH 3/4] drm/amd/amdgpu: remove usage of ttm trace Tom St Denis
2017-09-19 11:12     ` Christian König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170918123528.26629-4-tom.stdenis@amd.com \
    --to=tom.stdenis@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox