Skip to contentSkip to conversation

drm/ttm: clean up ttm_trace_dma_map/ttm_trace_dma_unmap

PATCH Superseded Huang Rui 2 participants 4 messages Apr 7, 2020

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Huang Rui

author
#0 lore raw

PATCH 1/2 drm/ttm: clean up ttm_trace_dma_map/ttm_trace_dma_unmap

ttm_trace_dma_map/ttm_trace_dma_unmap is never used anymore. Move the pr_fmt prefix into this header.

---
 include/drm/ttm/ttm_debug.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/drm/ttm/ttm_debug.h +2 -2
index b5e460f..bd7cf37 100644
@@ -27,5 +27,5 @@
 /*
  * Authors: Tom St Denis <[email protected]>
  */
-extern void ttm_trace_dma_map(struct device *dev, struct ttm_dma_tt *tt);
-extern void ttm_trace_dma_unmap(struct device *dev, struct ttm_dma_tt *tt);
+
+#define pr_fmt(fmt) "[TTM] " fmt
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author
#1 lore raw

PATCH 2/2 drm/ttm: abstract all ttm prefix into ttm_debug header

Using the debug header instead of macro at the start of the files.

---
 drivers/gpu/drm/ttm/ttm_agp_backend.c    | 3 +--
 drivers/gpu/drm/ttm/ttm_bo.c             | 3 +--
 drivers/gpu/drm/ttm/ttm_bo_vm.c          | 3 +--
 drivers/gpu/drm/ttm/ttm_memory.c         | 3 +--
 drivers/gpu/drm/ttm/ttm_page_alloc.c     | 3 +--
 drivers/gpu/drm/ttm/ttm_page_alloc_dma.c | 3 +--
 drivers/gpu/drm/ttm/ttm_tt.c             | 3 +--
 drivers/gpu/drm/vmwgfx/ttm_object.c      | 3 +--
 8 files changed, 8 insertions(+), 16 deletions(-)
drivers/gpu/drm/ttm/ttm_agp_backend.c +1 -2
index 6050dc8..53fa96f 100644
@@ -30,8 +30,7 @@
  *          Keith Packard.
  */
 
-#define pr_fmt(fmt) "[TTM] " fmt
-
+#include <drm/ttm/ttm_debug.h>
 #include <drm/ttm/ttm_module.h>
 #include <drm/ttm/ttm_bo_driver.h>
 #include <drm/ttm/ttm_page_alloc.h>
drivers/gpu/drm/ttm/ttm_bo.c +1 -2
index ca5a8d0..469a3f1 100644
@@ -29,8 +29,7 @@
  * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
  */
 
-#define pr_fmt(fmt) "[TTM] " fmt
-
+#include <drm/ttm/ttm_debug.h>
 #include <drm/ttm/ttm_module.h>
 #include <drm/ttm/ttm_bo_driver.h>
 #include <drm/ttm/ttm_placement.h>
drivers/gpu/drm/ttm/ttm_bo_vm.c +1 -2
index eebb4c0..fa5e237 100644
@@ -29,8 +29,7 @@
  * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
  */
 
-#define pr_fmt(fmt) "[TTM] " fmt
-
+#include <drm/ttm/ttm_debug.h>
 #include <drm/ttm/ttm_module.h>
 #include <drm/ttm/ttm_bo_driver.h>
 #include <drm/ttm/ttm_placement.h>
drivers/gpu/drm/ttm/ttm_memory.c +1 -2
index acd63b7..f51d70f 100644
@@ -26,8 +26,7 @@
  *
  **************************************************************************/
 
-#define pr_fmt(fmt) "[TTM] " fmt
-
+#include <drm/ttm/ttm_debug.h>
 #include <drm/ttm/ttm_memory.h>
 #include <drm/ttm/ttm_module.h>
 #include <drm/ttm/ttm_page_alloc.h>
drivers/gpu/drm/ttm/ttm_page_alloc.c +1 -2
index b40a467..4363420 100644
@@ -31,8 +31,7 @@
  * - doesn't track currently in use pages
  */
 
-#define pr_fmt(fmt) "[TTM] " fmt
-
+#include <drm/ttm/ttm_debug.h>
 #include <linux/list.h>
 #include <linux/spinlock.h>
 #include <linux/highmem.h>
drivers/gpu/drm/ttm/ttm_page_alloc_dma.c +1 -2
index bf876fa..0017d6d 100644
@@ -33,8 +33,7 @@
  *   when freed).
  */
 
-#define pr_fmt(fmt) "[TTM] " fmt
-
+#include <drm/ttm/ttm_debug.h>
 #include <linux/dma-mapping.h>
 #include <linux/list.h>
 #include <linux/seq_file.h> /* for seq_printf */
drivers/gpu/drm/ttm/ttm_tt.c +1 -2
index 2ec448e..4fa8a51 100644
@@ -29,8 +29,7 @@
  * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
  */
 
-#define pr_fmt(fmt) "[TTM] " fmt
-
+#include <drm/ttm/ttm_debug.h>
 #include <linux/sched.h>
 #include <linux/pagemap.h>
 #include <linux/shmem_fs.h>
drivers/gpu/drm/vmwgfx/ttm_object.c +1 -2
index 1607778..cd77370 100644
@@ -57,8 +57,7 @@
  * for fast lookup of ref objects given a base object.
  */
 
-#define pr_fmt(fmt) "[TTM] " fmt
-
+#include <drm/ttm/ttm_debug.h>
 #include <drm/ttm/ttm_module.h>
 #include <linux/list.h>
 #include <linux/spinlock.h>
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw
In reply to Huang Rui

Am 07.04.20 um 08:44 schrieb Huang Rui:

Quoted 13 lines

ttm_trace_dma_map/ttm_trace_dma_unmap is never used anymore. Move the pr_fmt prefix into this header.

---
  include/drm/ttm/ttm_debug.h | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
include/drm/ttm/ttm_debug.h +0 -0
index b5e460f..bd7cf37 100644

include/drm/ttm/ttm_debug.h line 31

Quoted 5 lines
include/drm/ttm/ttm_debug.h +0 -2
@@ -27,5 +27,5 @@
  /*
   * Authors: Tom St Denis <[email protected]>
   */
-extern void ttm_trace_dma_map(struct device *dev, struct ttm_dma_tt *tt);
-extern void ttm_trace_dma_unmap(struct device *dev, struct ttm_dma_tt *tt);

I would just completely remove the file since it isn't used any more.

include/drm/ttm/ttm_debug.h line 31

Quoted 2 lines
include/drm/ttm/ttm_debug.h +2 -0
+
+#define pr_fmt(fmt) "[TTM] " fmt

Oh, that is most likely not a good idea. The pr_fmt define should be set for each file individually or otherwise we could accidentally include the file in a driver.

Regards,
Christian.
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

author
#3 lore raw
Quoted 22 lines · Christian

Am 07.04.20 um 08:44 schrieb Huang Rui:

Quoted 13 lines

ttm_trace_dma_map/ttm_trace_dma_unmap is never used anymore. Move the pr_fmt prefix into this header.

---
  include/drm/ttm/ttm_debug.h | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
include/drm/ttm/ttm_debug.h +0 -0
index b5e460f..bd7cf37 100644

include/drm/ttm/ttm_debug.h line 31

Quoted 5 lines
include/drm/ttm/ttm_debug.h +0 -2
@@ -27,5 +27,5 @@
  /*
   * Authors: Tom St Denis <[email protected]>
   */
-extern void ttm_trace_dma_map(struct device *dev, struct ttm_dma_tt *tt);
-extern void ttm_trace_dma_unmap(struct device *dev, struct ttm_dma_tt *tt);

I would just completely remove the file since it isn't used any more.

Quoted 7 lines

include/drm/ttm/ttm_debug.h line 31

Quoted 2 lines
include/drm/ttm/ttm_debug.h +2 -0
+
+#define pr_fmt(fmt) "[TTM] " fmt

Oh, that is most likely not a good idea. The pr_fmt define should be set for each file individually or otherwise we could accidentally include the file in a driver.

OK. I will modify the patch to remove the header completely.

Thanks,
Ray

Quoted 2 lines

Regards,
Christian.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel