]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
drm/amdgpu/gmc9: set mc vm fb offset for raven
authorChunming Zhou <David1.Zhou@amd.com>
Thu, 15 Dec 2016 03:15:27 +0000 (11:15 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 24 May 2017 21:41:08 +0000 (17:41 -0400)
APU fb offset is set by sbios, which is different with DGPU.

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Ken Wang <Qingqing.Wang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.h
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c

index 005075ff00f704da4d4fe560c595989d4c959e15..bd1976a03c09ef8e7f064e1e9e6c858cb56b9c4b 100644 (file)
 
 #include "soc15_common.h"
 
+u64 gfxhub_v1_0_get_mc_fb_offset(struct amdgpu_device *adev)
+{
+       return (u64)RREG32(SOC15_REG_OFFSET(GC, 0, mmMC_VM_FB_OFFSET)) << 24;
+}
+
 int gfxhub_v1_0_gart_enable(struct amdgpu_device *adev)
 {
        u32 tmp;
index 5129a8ff093261289ef2d47547f35864b12b885e..15418489162325451982f36afdfa25764867fca1 100644 (file)
@@ -28,7 +28,7 @@ int gfxhub_v1_0_gart_enable(struct amdgpu_device *adev);
 void gfxhub_v1_0_gart_disable(struct amdgpu_device *adev);
 void gfxhub_v1_0_set_fault_enable_default(struct amdgpu_device *adev,
                                          bool value);
-
+u64 gfxhub_v1_0_get_mc_fb_offset(struct amdgpu_device *adev);
 extern const struct amd_ip_funcs gfxhub_v1_0_ip_funcs;
 extern const struct amdgpu_ip_block_version gfxhub_v1_0_ip_block;
 
index 4166a1451db42f3906bc8e143058e31a89691dec..a29a31f5b01218b5b8bf70333d96557d5a30653c 100644 (file)
@@ -548,8 +548,10 @@ static int gmc_v9_0_vm_init(struct amdgpu_device *adev)
        amdgpu_vm_manager_init(adev);
 
        /* base offset of vram pages */
-       /*XXX This value is not zero for APU*/
-       adev->vm_manager.vram_base_offset = 0;
+       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;
 
        return 0;
 }