Skip to contentSkip to conversation

drm/ttm: Add dummy *populate_and_*map_pages() functions

PATCH In review Tom St Denis 3 participants 5 messages Aug 24, 2017 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/ttm: Add dummy *populate_and_*map_pages() functions

On non IOTLB/IOMMU builds these functions would be undefined.

---
 include/drm/ttm/ttm_page_alloc.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
include/drm/ttm/ttm_page_alloc.h +10 -0
index 8695918ea629..4400c08169cd 100644
@@ -116,6 +116,16 @@ static inline void ttm_dma_unpopulate(struct ttm_dma_tt *ttm_dma,
 				      struct device *dev)
 {
 }
+
+static inline int ttm_populate_and_map_pages(struct device *dev, struct ttm_dma_tt *tt)
+{
+	return 0;
+}
+
+static inline void ttm_unmap_and_unpopulate_pages(struct device *dev, struct ttm_dma_tt *tt)
+{
+}
+
 #endif
 
 #endif
Signature · 6 lines
2.12.0

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

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

PATCH 2/2 drm/ttm: Remove needless 'extern' on functions in header.

Minor tidy up.

---
 include/drm/ttm/ttm_page_alloc.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
include/drm/ttm/ttm_page_alloc.h +6 -6
index 4400c08169cd..19bdd907613c 100644
@@ -47,7 +47,7 @@ void ttm_page_alloc_fini(void);
  *
  * Add backing pages to all of @ttm
  */
-extern int ttm_pool_populate(struct ttm_tt *ttm);
+int ttm_pool_populate(struct ttm_tt *ttm);
 
 /**
  * ttm_pool_unpopulate:
@@ -56,12 +56,12 @@ extern int ttm_pool_populate(struct ttm_tt *ttm);
  *
  * Free all pages of @ttm
  */
-extern void ttm_pool_unpopulate(struct ttm_tt *ttm);
+void ttm_pool_unpopulate(struct ttm_tt *ttm);
 
 /**
  * Output the state of pools to debugfs file
  */
-extern int ttm_page_alloc_debugfs(struct seq_file *m, void *data);
+int ttm_page_alloc_debugfs(struct seq_file *m, void *data);
 
 
 #if defined(CONFIG_SWIOTLB) || defined(CONFIG_INTEL_IOMMU)
@@ -78,10 +78,10 @@ void ttm_dma_page_alloc_fini(void);
 /**
  * Output the state of pools to debugfs file
  */
-extern int ttm_dma_page_alloc_debugfs(struct seq_file *m, void *data);
+int ttm_dma_page_alloc_debugfs(struct seq_file *m, void *data);
 
-extern int ttm_dma_populate(struct ttm_dma_tt *ttm_dma, struct device *dev);
-extern void ttm_dma_unpopulate(struct ttm_dma_tt *ttm_dma, struct device *dev);
+int ttm_dma_populate(struct ttm_dma_tt *ttm_dma, struct device *dev);
+void ttm_dma_unpopulate(struct ttm_dma_tt *ttm_dma, struct device *dev);
 
 
 /**
Signature · 6 lines
2.12.0

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

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

Re: [PATCH 2/2] drm/ttm: Remove needless 'extern' on functions in header.

Am 24.08.2017 um 12:48 schrieb Tom St Denis:

Quoted 3 lines

Minor tidy up.

Thanks and sorry that I thought you added this, I really need more sleep.

Patch is Reviewed-by: Christian König <[email protected]>.

Christian.

Quoted 36 lines
---
  include/drm/ttm/ttm_page_alloc.h | 12 ++++++------
  1 file changed, 6 insertions(+), 6 deletions(-)
include/drm/ttm/ttm_page_alloc.h +3 -3
index 4400c08169cd..19bdd907613c 100644
@@ -47,7 +47,7 @@ void ttm_page_alloc_fini(void);
   *
   * Add backing pages to all of @ttm
   */
-extern int ttm_pool_populate(struct ttm_tt *ttm);
+int ttm_pool_populate(struct ttm_tt *ttm);
 
  /**
   * ttm_pool_unpopulate:
@@ -56,12 +56,12 @@ extern int ttm_pool_populate(struct ttm_tt *ttm);
   *
   * Free all pages of @ttm
   */
-extern void ttm_pool_unpopulate(struct ttm_tt *ttm);
+void ttm_pool_unpopulate(struct ttm_tt *ttm);
 
  /**
   * Output the state of pools to debugfs file
   */
-extern int ttm_page_alloc_debugfs(struct seq_file *m, void *data);
+int ttm_page_alloc_debugfs(struct seq_file *m, void *data);
 
 
  #if defined(CONFIG_SWIOTLB) || defined(CONFIG_INTEL_IOMMU)
@@ -78,10 +78,10 @@ void ttm_dma_page_alloc_fini(void);
  /**
   * Output the state of pools to debugfs file
   */

include/drm/ttm/ttm_page_alloc.h void ttm_dma_page_alloc_fini(void); · line 87

Quoted 10 lines
include/drm/ttm/ttm_page_alloc.h +3 -3
-extern int ttm_dma_page_alloc_debugfs(struct seq_file *m, void *data);
+int ttm_dma_page_alloc_debugfs(struct seq_file *m, void *data);
 
-extern int ttm_dma_populate(struct ttm_dma_tt *ttm_dma, struct device *dev);
-extern void ttm_dma_unpopulate(struct ttm_dma_tt *ttm_dma, struct device *dev);
+int ttm_dma_populate(struct ttm_dma_tt *ttm_dma, struct device *dev);
+void ttm_dma_unpopulate(struct ttm_dma_tt *ttm_dma, struct device *dev);
 
 
  /**

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

#5 lore raw

Re: [PATCH 2/2] drm/ttm: Remove needless 'extern' on functions in header.

Quoted 8 lines · Christian König

Am 24.08.2017 um 12:48 schrieb Tom St Denis:

Quoted 3 lines

Minor tidy up.

Thanks and sorry that I thought you added this, I really need more sleep.

Patch is Reviewed-by: Christian König <[email protected]>.

No worries. For a second there I thought I was writing patches too early for me :)

Should be an AMD rule that no patches before sun up in the summer... Alas in Winter here in Canada that'd cut productivity down to 20% hehehe.

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

#6 lore raw
In reply to a message not in the archive

Am 24.08.2017 um 12:48 schrieb Tom St Denis:

Quoted 12 lines

On non IOTLB/IOMMU builds these functions would be undefined.

---
  include/drm/ttm/ttm_page_alloc.h | 10 ++++++++++
  1 file changed, 10 insertions(+)
include/drm/ttm/ttm_page_alloc.h +0 -0
index 8695918ea629..4400c08169cd 100644

include/drm/ttm/ttm_page_alloc.h static inline void ttm_dma_unpopulate(struct ttm_dma_tt *ttm_dma, · line 122

Quoted 7 lines
include/drm/ttm/ttm_page_alloc.h +4 -0
@@ -116,6 +116,16 @@ static inline void ttm_dma_unpopulate(struct ttm_dma_tt *ttm_dma,
  				      struct device *dev)
  {
  }
+
+static inline int ttm_populate_and_map_pages(struct device *dev, struct ttm_dma_tt *tt)
+{
+	return 0;

We should probably return -ENOMEM here, just like the dummy ttm_dma_populate() does.

With that fixed the patch is Reviewed-by: Christian König <[email protected]>.

Regards,
Christian.

include/drm/ttm/ttm_page_alloc.h static inline void ttm_dma_unpopulate(struct ttm_dma_tt *ttm_dma, · line 131

Quoted 9 lines
include/drm/ttm/ttm_page_alloc.h +6 -0
+}
+
+static inline void ttm_unmap_and_unpopulate_pages(struct device *dev, struct ttm_dma_tt *tt)
+{
+}
+
  #endif
 
  #endif

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