Commit 71755699 authored by Alex Deucher's avatar Alex Deucher

drm/amdgpu/gmc7: switch to using amdgpu_gmc_get_vbios_allocations

The new helper centralizes the logic in one place.
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 422fe8d2
...@@ -977,9 +977,7 @@ static unsigned gmc_v7_0_get_vbios_fb_size(struct amdgpu_device *adev) ...@@ -977,9 +977,7 @@ static unsigned gmc_v7_0_get_vbios_fb_size(struct amdgpu_device *adev)
REG_GET_FIELD(viewport, VIEWPORT_SIZE, VIEWPORT_WIDTH) * REG_GET_FIELD(viewport, VIEWPORT_SIZE, VIEWPORT_WIDTH) *
4); 4);
} }
/* return 0 if the pre-OS buffer uses up most of vram */
if ((adev->gmc.real_vram_size - size) < (8 * 1024 * 1024))
return 0;
return size; return size;
} }
...@@ -1035,7 +1033,7 @@ static int gmc_v7_0_sw_init(void *handle) ...@@ -1035,7 +1033,7 @@ static int gmc_v7_0_sw_init(void *handle)
if (r) if (r)
return r; return r;
adev->gmc.stolen_vga_size = gmc_v7_0_get_vbios_fb_size(adev); amdgpu_gmc_get_vbios_allocations(adev);
/* Memory manager */ /* Memory manager */
r = amdgpu_bo_init(adev); r = amdgpu_bo_init(adev);
...@@ -1372,7 +1370,8 @@ static const struct amdgpu_gmc_funcs gmc_v7_0_gmc_funcs = { ...@@ -1372,7 +1370,8 @@ static const struct amdgpu_gmc_funcs gmc_v7_0_gmc_funcs = {
.emit_pasid_mapping = gmc_v7_0_emit_pasid_mapping, .emit_pasid_mapping = gmc_v7_0_emit_pasid_mapping,
.set_prt = gmc_v7_0_set_prt, .set_prt = gmc_v7_0_set_prt,
.get_vm_pde = gmc_v7_0_get_vm_pde, .get_vm_pde = gmc_v7_0_get_vm_pde,
.get_vm_pte = gmc_v7_0_get_vm_pte .get_vm_pte = gmc_v7_0_get_vm_pte,
.get_vbios_fb_size = gmc_v7_0_get_vbios_fb_size,
}; };
static const struct amdgpu_irq_src_funcs gmc_v7_0_irq_funcs = { static const struct amdgpu_irq_src_funcs gmc_v7_0_irq_funcs = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment