@@ -38,7 +38,6 @@
#include <drm/radeon_drm.h>
#include <linux/seq_file.h>
#include <linux/slab.h>
-#include <linux/swiotlb.h>
#include <linux/swap.h>
#include <linux/pagemap.h>
#include <linux/debugfs.h>
@@ -742,11 +741,9 @@ static int radeon_ttm_tt_populate(struct ttm_tt *ttm)
}
#endif
-#ifdef CONFIG_SWIOTLB
- if (swiotlb_nr_tbl()) {
+ if (swiotlb_in_use(rdev->dev)) {
return ttm_dma_populate(>t->ttm, rdev->dev);
}
-#endif
r = ttm_pool_populate(ttm);
if (r) {
@@ -794,12 +791,10 @@ static void radeon_ttm_tt_unpopulate(struct ttm_tt *ttm)
}
#endif
-#ifdef CONFIG_SWIOTLB
- if (swiotlb_nr_tbl()) {
+ if (swiotlb_in_use(rdev->dev)) {
ttm_dma_unpopulate(>t->ttm, rdev->dev);
return;
}
-#endif
for (i = 0; i < ttm->num_pages; i++) {
if (gtt->ttm.dma_address[i]) {
@@ -1169,10 +1164,8 @@ static int radeon_ttm_debugfs_init(struct radeon_device *rdev)
count = ARRAY_SIZE(radeon_ttm_debugfs_list);
-#ifdef CONFIG_SWIOTLB
- if (!swiotlb_nr_tbl())
+ if (!swiotlb_in_use(rdev->dev))
--count;
-#endif
return radeon_debugfs_add_files(rdev, radeon_ttm_debugfs_list, count);
#else