Commit 524883bb authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Ben Skeggs

drm/nouveau/ttm: convert to DMA API

The pci_dma_* functions are now superseeded in the kernel by the DMA
API. Make the conversion to this more generic API.
Signed-off-by: default avatarAlexandre Courbot <acourbot@nvidia.com>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 68b56653
...@@ -338,7 +338,7 @@ nouveau_ttm_init(struct nouveau_drm *drm) ...@@ -338,7 +338,7 @@ nouveau_ttm_init(struct nouveau_drm *drm)
struct nvkm_device *device = nvxx_device(&drm->device); struct nvkm_device *device = nvxx_device(&drm->device);
struct nvkm_pci *pci = device->pci; struct nvkm_pci *pci = device->pci;
struct drm_device *dev = drm->dev; struct drm_device *dev = drm->dev;
u32 bits; u8 bits;
int ret; int ret;
if (pci && pci->agp.bridge) { if (pci && pci->agp.bridge) {
...@@ -351,18 +351,16 @@ nouveau_ttm_init(struct nouveau_drm *drm) ...@@ -351,18 +351,16 @@ nouveau_ttm_init(struct nouveau_drm *drm)
bits = nvxx_mmu(&drm->device)->dma_bits; bits = nvxx_mmu(&drm->device)->dma_bits;
if (nvxx_device(&drm->device)->func->pci) { if (nvxx_device(&drm->device)->func->pci) {
if (drm->agp.bridge || if (drm->agp.bridge ||
!pci_dma_supported(dev->pdev, DMA_BIT_MASK(bits))) !dma_supported(dev->dev, DMA_BIT_MASK(bits)))
bits = 32; bits = 32;
ret = pci_set_dma_mask(dev->pdev, DMA_BIT_MASK(bits)); ret = dma_set_mask(dev->dev, DMA_BIT_MASK(bits));
if (ret) if (ret)
return ret; return ret;
ret = pci_set_consistent_dma_mask(dev->pdev, ret = dma_set_coherent_mask(dev->dev, DMA_BIT_MASK(bits));
DMA_BIT_MASK(bits));
if (ret) if (ret)
pci_set_consistent_dma_mask(dev->pdev, dma_set_coherent_mask(dev->dev, DMA_BIT_MASK(32));
DMA_BIT_MASK(32));
} }
ret = nouveau_ttm_global_init(drm); ret = nouveau_ttm_global_init(drm);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment