]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/amdgpu: add coreboot workaround for KV/KB
authorChristian König <christian.koenig@amd.com>
Thu, 16 Jan 2020 13:06:59 +0000 (14:06 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 27 Jan 2020 21:46:45 +0000 (16:46 -0500)
Coreboot seems to have a problem correctly setting up access to the stolen VRAM
on KV/KB. Use the direct access only when necessary.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reported-and-tested-by: Fredrik Bruhn <fredrik.bruhn@unibap.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c

index 19d5b133e1d7e7cabddf4693834397130ed72294..9da9596a36388d31e4c2cc5fb106df3c962dcd2f 100644 (file)
@@ -381,7 +381,8 @@ static int gmc_v7_0_mc_init(struct amdgpu_device *adev)
        adev->gmc.aper_size = pci_resource_len(adev->pdev, 0);
 
 #ifdef CONFIG_X86_64
-       if (adev->flags & AMD_IS_APU) {
+       if (adev->flags & AMD_IS_APU &&
+           adev->gmc.real_vram_size > adev->gmc.aper_size) {
                adev->gmc.aper_base = ((u64)RREG32(mmMC_VM_FB_OFFSET)) << 22;
                adev->gmc.aper_size = adev->gmc.real_vram_size;
        }