]> Git Repo - linux.git/blobdiff - drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
drm/amdgpu: only enable swiotlb alloc when need v2
[linux.git] / drivers / gpu / drm / amd / amdgpu / gmc_v7_0.c
index 86e9d682c59e8760d0751d38908a4c072764e123..12e49bd8fd2da33ad608b1f56d5c2b5de941d9f7 100644 (file)
@@ -22,6 +22,7 @@
  */
 #include <linux/firmware.h>
 #include <drm/drmP.h>
+#include <drm/drm_cache.h>
 #include "amdgpu.h"
 #include "cikd.h"
 #include "cik.h"
@@ -999,6 +1000,7 @@ static int gmc_v7_0_sw_init(void *handle)
                pci_set_consistent_dma_mask(adev->pdev, DMA_BIT_MASK(32));
                pr_warn("amdgpu: No coherent DMA available\n");
        }
+       adev->need_swiotlb = drm_get_max_iomem() > ((u64)1 << dma_bits);
 
        r = gmc_v7_0_init_microcode(adev);
        if (r) {
This page took 0.039178 seconds and 4 git commands to generate.