|
24 | 24 | */
|
25 | 25 |
|
26 | 26 | #include <linux/limits.h>
|
27 |
| -#include <linux/swiotlb.h> |
28 | 27 |
|
29 | 28 | #include <drm/ttm/ttm_range_manager.h>
|
| 29 | +#include <drm/drm_cache.h> |
30 | 30 |
|
31 | 31 | #include "nouveau_drv.h"
|
32 | 32 | #include "nouveau_gem.h"
|
@@ -265,7 +265,6 @@ nouveau_ttm_init(struct nouveau_drm *drm)
|
265 | 265 | struct nvkm_pci *pci = device->pci;
|
266 | 266 | struct nvif_mmu *mmu = &drm->client.mmu;
|
267 | 267 | struct drm_device *dev = drm->dev;
|
268 |
| - bool need_swiotlb = false; |
269 | 268 | int typei, ret;
|
270 | 269 |
|
271 | 270 | ret = nouveau_ttm_init_host(drm, 0);
|
@@ -300,13 +299,10 @@ nouveau_ttm_init(struct nouveau_drm *drm)
|
300 | 299 | drm->agp.cma = pci->agp.cma;
|
301 | 300 | }
|
302 | 301 |
|
303 |
| -#if IS_ENABLED(CONFIG_SWIOTLB) && IS_ENABLED(CONFIG_X86) |
304 |
| - need_swiotlb = is_swiotlb_active(dev->dev); |
305 |
| -#endif |
306 |
| - |
307 | 302 | ret = ttm_device_init(&drm->ttm.bdev, &nouveau_bo_driver, drm->dev->dev,
|
308 | 303 | dev->anon_inode->i_mapping,
|
309 |
| - dev->vma_offset_manager, need_swiotlb, |
| 304 | + dev->vma_offset_manager, |
| 305 | + drm_need_swiotlb(drm->client.mmu.dmabits), |
310 | 306 | drm->client.mmu.dmabits <= 32);
|
311 | 307 | if (ret) {
|
312 | 308 | NV_ERROR(drm, "error initialising bo driver, %d\n", ret);
|
|
0 commit comments