Commit fcbc92e2 authored by Alex Deucher's avatar Alex Deucher

drm/amdgpu: move stolen vga bo from amdgpu to amdgpu.gmc

Since that is where we store the other data related to
the stolen vga memory.
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 81b54fb7
...@@ -769,7 +769,6 @@ struct amdgpu_device { ...@@ -769,7 +769,6 @@ struct amdgpu_device {
bool is_atom_fw; bool is_atom_fw;
uint8_t *bios; uint8_t *bios;
uint32_t bios_size; uint32_t bios_size;
struct amdgpu_bo *stolen_vga_memory;
uint32_t bios_scratch_reg_offset; uint32_t bios_scratch_reg_offset;
uint32_t bios_scratch[AMDGPU_BIOS_NUM_SCRATCH]; uint32_t bios_scratch[AMDGPU_BIOS_NUM_SCRATCH];
......
...@@ -213,7 +213,8 @@ struct amdgpu_gmc { ...@@ -213,7 +213,8 @@ struct amdgpu_gmc {
uint8_t vram_vendor; uint8_t vram_vendor;
uint32_t srbm_soft_reset; uint32_t srbm_soft_reset;
bool prt_warning; bool prt_warning;
uint64_t stolen_size; uint64_t stolen_vga_size;
struct amdgpu_bo *stolen_vga_memory;
uint32_t sdpif_register; uint32_t sdpif_register;
/* apertures */ /* apertures */
u64 shared_aperture_start; u64 shared_aperture_start;
......
...@@ -1979,9 +1979,9 @@ int amdgpu_ttm_init(struct amdgpu_device *adev) ...@@ -1979,9 +1979,9 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
* This is used for VGA emulation and pre-OS scanout buffers to * This is used for VGA emulation and pre-OS scanout buffers to
* avoid display artifacts while transitioning between pre-OS * avoid display artifacts while transitioning between pre-OS
* and driver. */ * and driver. */
r = amdgpu_bo_create_kernel_at(adev, 0, adev->gmc.stolen_size, r = amdgpu_bo_create_kernel_at(adev, 0, adev->gmc.stolen_vga_size,
AMDGPU_GEM_DOMAIN_VRAM, AMDGPU_GEM_DOMAIN_VRAM,
&adev->stolen_vga_memory, &adev->gmc.stolen_vga_memory,
&stolen_vga_buf); &stolen_vga_buf);
if (r) if (r)
return r; return r;
...@@ -2043,7 +2043,7 @@ void amdgpu_ttm_late_init(struct amdgpu_device *adev) ...@@ -2043,7 +2043,7 @@ void amdgpu_ttm_late_init(struct amdgpu_device *adev)
{ {
void *stolen_vga_buf; void *stolen_vga_buf;
/* return the VGA stolen memory (if any) back to VRAM */ /* return the VGA stolen memory (if any) back to VRAM */
amdgpu_bo_free_kernel(&adev->stolen_vga_memory, NULL, &stolen_vga_buf); amdgpu_bo_free_kernel(&adev->gmc.stolen_vga_memory, NULL, &stolen_vga_buf);
} }
/** /**
......
...@@ -860,7 +860,7 @@ static int gmc_v10_0_sw_init(void *handle) ...@@ -860,7 +860,7 @@ static int gmc_v10_0_sw_init(void *handle)
if (r) if (r)
return r; return r;
adev->gmc.stolen_size = gmc_v10_0_get_vbios_fb_size(adev); adev->gmc.stolen_vga_size = gmc_v10_0_get_vbios_fb_size(adev);
/* Memory manager */ /* Memory manager */
r = amdgpu_bo_init(adev); r = amdgpu_bo_init(adev);
......
...@@ -862,7 +862,7 @@ static int gmc_v6_0_sw_init(void *handle) ...@@ -862,7 +862,7 @@ static int gmc_v6_0_sw_init(void *handle)
if (r) if (r)
return r; return r;
adev->gmc.stolen_size = gmc_v6_0_get_vbios_fb_size(adev); adev->gmc.stolen_vga_size = gmc_v6_0_get_vbios_fb_size(adev);
r = amdgpu_bo_init(adev); r = amdgpu_bo_init(adev);
if (r) if (r)
......
...@@ -1035,7 +1035,7 @@ static int gmc_v7_0_sw_init(void *handle) ...@@ -1035,7 +1035,7 @@ static int gmc_v7_0_sw_init(void *handle)
if (r) if (r)
return r; return r;
adev->gmc.stolen_size = gmc_v7_0_get_vbios_fb_size(adev); adev->gmc.stolen_vga_size = gmc_v7_0_get_vbios_fb_size(adev);
/* Memory manager */ /* Memory manager */
r = amdgpu_bo_init(adev); r = amdgpu_bo_init(adev);
......
...@@ -1160,7 +1160,7 @@ static int gmc_v8_0_sw_init(void *handle) ...@@ -1160,7 +1160,7 @@ static int gmc_v8_0_sw_init(void *handle)
if (r) if (r)
return r; return r;
adev->gmc.stolen_size = gmc_v8_0_get_vbios_fb_size(adev); adev->gmc.stolen_vga_size = gmc_v8_0_get_vbios_fb_size(adev);
/* Memory manager */ /* Memory manager */
r = amdgpu_bo_init(adev); r = amdgpu_bo_init(adev);
......
...@@ -1243,7 +1243,7 @@ static int gmc_v9_0_sw_init(void *handle) ...@@ -1243,7 +1243,7 @@ static int gmc_v9_0_sw_init(void *handle)
if (r) if (r)
return r; return r;
adev->gmc.stolen_size = gmc_v9_0_get_vbios_fb_size(adev); adev->gmc.stolen_vga_size = gmc_v9_0_get_vbios_fb_size(adev);
/* Memory manager */ /* Memory manager */
r = amdgpu_bo_init(adev); r = amdgpu_bo_init(adev);
...@@ -1282,7 +1282,7 @@ static int gmc_v9_0_sw_fini(void *handle) ...@@ -1282,7 +1282,7 @@ static int gmc_v9_0_sw_fini(void *handle)
amdgpu_vm_manager_fini(adev); amdgpu_vm_manager_fini(adev);
if (gmc_v9_0_keep_stolen_memory(adev)) if (gmc_v9_0_keep_stolen_memory(adev))
amdgpu_bo_free_kernel(&adev->stolen_vga_memory, NULL, &stolen_vga_buf); amdgpu_bo_free_kernel(&adev->gmc.stolen_vga_memory, NULL, &stolen_vga_buf);
amdgpu_gart_table_vram_free(adev); amdgpu_gart_table_vram_free(adev);
amdgpu_bo_fini(adev); amdgpu_bo_fini(adev);
......
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