dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/ttm: Implement and export ttm_dma_page_alloc_enabled
@ 2019-01-25 13:05 Thomas Hellstrom
  2019-01-25 13:05 ` [PATCH 2/2] drm/vmwgfx: Use ttm_dma_page_alloc_enabled Thomas Hellstrom
  2019-01-28 12:21 ` [PATCH 1/2] drm/ttm: Implement and export ttm_dma_page_alloc_enabled Koenig, Christian
  0 siblings, 2 replies; 8+ messages in thread
From: Thomas Hellstrom @ 2019-01-25 13:05 UTC (permalink / raw)
  To: linux-graphics-maintainer, dri-devel; +Cc: Thomas Hellstrom, Koenig, Christian

The vmwgfx driver needs to know whether the dma page pool is enabled
to determine whether to refuse loading if the dma mode logic
requests coherent memory from the dma page pool.

Cc: "Koenig, Christian" <Christian.Koenig@amd.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
---
 drivers/gpu/drm/ttm/ttm_page_alloc_dma.c | 11 +++++++++++
 include/drm/ttm/ttm_page_alloc.h         |  4 ++++
 2 files changed, 15 insertions(+)

diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
index d594f7520b7b..adf8cc189ecc 100644
--- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
+++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
@@ -1235,4 +1235,15 @@ int ttm_dma_page_alloc_debugfs(struct seq_file *m, void *data)
 }
 EXPORT_SYMBOL_GPL(ttm_dma_page_alloc_debugfs);
 
+/**
+ * ttm_dma_page_alloc_enabled - Is the dma page pool enabled?
+ *
+ * Returns true if the dma page pool is enabled. false otherwise.
+ */
+bool ttm_dma_page_alloc_enabled(void)
+{
+	return !!_manager;
+}
+EXPORT_SYMBOL(ttm_dma_page_alloc_enabled);
+
 #endif
diff --git a/include/drm/ttm/ttm_page_alloc.h b/include/drm/ttm/ttm_page_alloc.h
index 4d9b019d253c..f810d389f5ad 100644
--- a/include/drm/ttm/ttm_page_alloc.h
+++ b/include/drm/ttm/ttm_page_alloc.h
@@ -94,6 +94,8 @@ int ttm_dma_populate(struct ttm_dma_tt *ttm_dma, struct device *dev,
 			struct ttm_operation_ctx *ctx);
 void ttm_dma_unpopulate(struct ttm_dma_tt *ttm_dma, struct device *dev);
 
+bool ttm_dma_page_alloc_enabled(void);
+
 #else
 static inline int ttm_dma_page_alloc_init(struct ttm_mem_global *glob,
 					  unsigned max_pages)
@@ -117,6 +119,8 @@ static inline void ttm_dma_unpopulate(struct ttm_dma_tt *ttm_dma,
 				      struct device *dev)
 {
 }
+
+static inline bool ttm_dma_page_alloc_enabled(void) { return false; }
 #endif
 
 #endif
-- 
2.19.0.rc1

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-01-30  8:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-25 13:05 [PATCH 1/2] drm/ttm: Implement and export ttm_dma_page_alloc_enabled Thomas Hellstrom
2019-01-25 13:05 ` [PATCH 2/2] drm/vmwgfx: Use ttm_dma_page_alloc_enabled Thomas Hellstrom
2019-01-25 18:22   ` Sam Ravnborg
2019-01-30  8:37     ` Thomas Hellstrom
2019-01-28 12:21 ` [PATCH 1/2] drm/ttm: Implement and export ttm_dma_page_alloc_enabled Koenig, Christian
2019-01-28 13:29   ` Thomas Hellstrom
2019-01-28 14:21     ` Thomas Hellstrom
2019-01-28 15:56       ` Koenig, Christian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox