]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
drm/amdgpu: Fix hardcoded base offset of vram pages
authorFeifei Xu <Feifei.Xu@amd.com>
Tue, 6 Feb 2018 04:29:23 +0000 (12:29 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 17 May 2018 13:54:24 +0000 (08:54 -0500)
In gmc_v9_0_vram_gtt_location(),the vram_base_offset is hardcoded
to 0 in dGPU. Fix it by reading mmMC_VM_FB_OFFSET or return
zfb_phys_addr if ZFB is enabled.

Signed-off-by: Feifei Xu <Feifei.Xu@amd.com>
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c

index 6cccf0e0acd7b64258b2a12d51c424287b1302a4..734306902e4e573a8cac09167d18e3369cc8e1f6 100644 (file)
@@ -693,10 +693,7 @@ static void gmc_v9_0_vram_gtt_location(struct amdgpu_device *adev,
        amdgpu_device_vram_location(adev, &adev->gmc, base);
        amdgpu_device_gart_location(adev, mc);
        /* base offset of vram pages */
-       if (adev->flags & AMD_IS_APU)
-               adev->vm_manager.vram_base_offset = gfxhub_v1_0_get_mc_fb_offset(adev);
-       else
-               adev->vm_manager.vram_base_offset = 0;
+       adev->vm_manager.vram_base_offset = gfxhub_v1_0_get_mc_fb_offset(adev);
 }
 
 /**