drm/amdgpu: skip BAR resizing if the bios already did it
authorAlex Deucher <alexander.deucher@amd.com>
Mon, 8 Jun 2020 19:39:33 +0000 (15:39 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 1 Jul 2020 05:59:17 +0000 (01:59 -0400)
No need to do it again.

Acked-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

index 668ad0e..7f2a1c7 100644 (file)
@@ -909,6 +909,11 @@ int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev)
        if (amdgpu_sriov_vf(adev))
                return 0;
 
+       /* skip if the bios has already enabled large BAR */
+       if (adev->gmc.real_vram_size &&
+           (pci_resource_len(adev->pdev, 0) >= adev->gmc.real_vram_size))
+               return 0;
+
        /* Check if the root BUS has 64bit memory resources */
        root = adev->pdev->bus;
        while (root->parent)