drm/amdgpu/gmc9: change fb offset sequence so that used wider
authorChunming Zhou <David1.Zhou@amd.com>
Mon, 16 Jan 2017 02:45:50 +0000 (10:45 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 24 May 2017 21:41:09 +0000 (17:41 -0400)
Initialize the values earlier.

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-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 a29a31f5b01218b5b8bf70333d96557d5a30653c..787d20b5bbb9c2a702376ccaf9c8581cbe7d236c 100644 (file)
@@ -415,6 +415,11 @@ static void gmc_v9_0_vram_gtt_location(struct amdgpu_device *adev,
        amdgpu_vram_location(adev, &adev->mc, base);
        adev->mc.gtt_base_align = 0;
        amdgpu_gtt_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;
 }
 
 /**
@@ -547,12 +552,6 @@ static int gmc_v9_0_vm_init(struct amdgpu_device *adev)
                adev->vm_manager.num_level = 3;
        amdgpu_vm_manager_init(adev);
 
-       /* 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;
-
        return 0;
 }