diff options
author | Dave Airlie <airlied@redhat.com> | 2022-10-25 09:37:01 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2022-10-25 09:50:05 +1000 |
commit | 6be95d5e52818808565790c5ee3fd5569263bd36 (patch) | |
tree | 329bc6d7ce63e5c3cda00f1430ba3dcea688c2be | |
parent | e2f99e8a961f4065ae86594ee63ee088340ca1e8 (diff) |
hacks for the no iommu case01.01-gsp-rm
-rw-r--r-- | drivers/gpu/drm/nouveau/include/nvkm/core/device.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/mmu/tu102.c | 1 |
3 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/device.h b/drivers/gpu/drm/nouveau/include/nvkm/core/device.h index f65b5009acf7..7319efbdd31b 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/device.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/device.h @@ -30,6 +30,8 @@ struct nvkm_device { u32 debug; + u32 dma_bits; + const struct nvkm_device_chip *chip; enum { NV_04 = 0x04, diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c index abccb2bb68a6..8748803bd037 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c @@ -1689,8 +1689,10 @@ nvkm_device_pci_new(struct pci_dev *pci_dev, const char *cfg, const char *dbg, /* Set DMA mask based on capabilities reported by the MMU subdev. */ if (pdev->device.mmu && !pdev->device.pci->agp.bridge) bits = pdev->device.mmu->dma_bits; + else if (pdev->device.dma_bits) + bits = pdev->device.dma_bits; else - bits = 32; + bits = 47; ret = dma_set_mask_and_coherent(&pci_dev->dev, DMA_BIT_MASK(bits)); if (ret && bits != 32) { diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/tu102.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/tu102.c index d1fafba6ef3b..5a2a5464228f 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/tu102.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/tu102.c @@ -55,5 +55,6 @@ int tu102_mmu_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_mmu **pmmu) { + device->dma_bits = tu102_mmu.dma_bits; return nvkm_mmu_new_(&tu102_mmu, device, type, inst, pmmu); } |