diff options
author | Christoph Hellwig <hch@lst.de> | 2015-11-10 17:45:39 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-11-10 19:32:11 -0500 |
commit | 0dcc4a59d5a9821ed6f6cf5e88c96ff4f25e55aa (patch) | |
tree | cffa0eb65e4d57df07cc1c4b0345e90401b3bda2 | |
parent | e806f75d527f7d0372fe838a80d3b7a6e1fde1b9 (diff) |
nouveau: don't call pci_dma_supported
Just try to set a 64-bit DMA mask first and retry with the smaller dma_mask
if dma_set_mask failed.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: David Airlie <airlied@linux.ie>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Alexandre Courbot <acourbot@nvidia.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Thierry Reding <treding@nvidia.com>
Cc: Dave Airlie <airlied@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_ttm.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c index 3f713c1b5dc1..d2e7d209f651 100644 --- a/drivers/gpu/drm/nouveau/nouveau_ttm.c +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c | |||
@@ -353,8 +353,7 @@ nouveau_ttm_init(struct nouveau_drm *drm) | |||
353 | 353 | ||
354 | bits = nvxx_mmu(&drm->device)->dma_bits; | 354 | bits = nvxx_mmu(&drm->device)->dma_bits; |
355 | if (nvxx_device(&drm->device)->func->pci) { | 355 | if (nvxx_device(&drm->device)->func->pci) { |
356 | if (drm->agp.bridge || | 356 | if (drm->agp.bridge) |
357 | !dma_supported(dev->dev, DMA_BIT_MASK(bits))) | ||
358 | bits = 32; | 357 | bits = 32; |
359 | } else if (device->func->tegra) { | 358 | } else if (device->func->tegra) { |
360 | struct nvkm_device_tegra *tegra = device->func->tegra(device); | 359 | struct nvkm_device_tegra *tegra = device->func->tegra(device); |
@@ -369,6 +368,10 @@ nouveau_ttm_init(struct nouveau_drm *drm) | |||
369 | } | 368 | } |
370 | 369 | ||
371 | ret = dma_set_mask(dev->dev, DMA_BIT_MASK(bits)); | 370 | ret = dma_set_mask(dev->dev, DMA_BIT_MASK(bits)); |
371 | if (ret && bits != 32) { | ||
372 | bits = 32; | ||
373 | ret = dma_set_mask(dev->dev, DMA_BIT_MASK(bits)); | ||
374 | } | ||
372 | if (ret) | 375 | if (ret) |
373 | return ret; | 376 | return ret; |
374 | 377 | ||