[PATCH 13/14] drm/ttm: isolate dma data from ttm_tt V3

Konrad Rzeszutek Wilk konrad.wilk at oracle.com
Wed Nov 16 09:21:57 PST 2011


> >> -int ttm_dma_populate(struct ttm_tt *ttm, struct device *dev);
> >> -extern void ttm_dma_unpopulate(struct ttm_tt *ttm, struct device *dev);
> >> +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);
> >>
> >>  #else
> >>  static inline int ttm_dma_page_alloc_init(struct ttm_mem_global *glob,
> >
> > You are missing changes to the static implementations in case CONFIG_SWIOTLB is not set.
> >
> 
> Actually i don't think i miss anything
> ttm_dma_populate/ttm_dma_unpopulate is conditional on CONFIG_SWIOTLB
> in both radeon and nouveau. So i should be fine. Or did i miss
> something else ?

You are completlty right.  Somehow I had in my mind that this was present:


diff --git a/include/drm/ttm/ttm_page_alloc.h b/include/drm/ttm/ttm_page_alloc.h
index 5fe2740..bb006c7 100644
--- a/include/drm/ttm/ttm_page_alloc.h
+++ b/include/drm/ttm/ttm_page_alloc.h
@@ -94,6 +94,16 @@ static inline int ttm_dma_page_alloc_debugfs(struct seq_file *m, void *data)
 {
 	return 0;
 }
+static inline int ttm_dma_populate(struct ttm_tt *ttm,
+				   struct device *dev)
+{
+	return -ENODEV;
+}
+static inline void ttm_dma_unpopulate(struct ttm_tt *ttm,
+				      struct device *dev)
+{
+	return;
+}
 #endif
 
 #endif

But that does not make sense as the nouveau and radeon are both guarded by the
#ifdef CONFIG_SWIOTLB. So if "# CONFIG_SWIOTLB is not set" is present, well, nobody
will be referencing the ttm_dma_[un|]populate calls.


More information about the dri-devel mailing list