drm/amdgpu: move stolen vga bo from amdgpu to amdgpu.gmc
authorAlex Deucher <alexander.deucher@amd.com>
Tue, 28 Jul 2020 21:46:00 +0000 (17:46 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 4 Aug 2020 21:29:28 +0000 (17:29 -0400)
Since that is where we store the other data related to
the stolen vga memory.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c

index 5d605e4..af51160 100644 (file)
@@ -769,7 +769,6 @@ struct amdgpu_device {
        bool                            is_atom_fw;
        uint8_t                         *bios;
        uint32_t                        bios_size;
-       struct amdgpu_bo                *stolen_vga_memory;
        uint32_t                        bios_scratch_reg_offset;
        uint32_t                        bios_scratch[AMDGPU_BIOS_NUM_SCRATCH];
 
index 9d58c56..ddb64be 100644 (file)
@@ -213,7 +213,8 @@ struct amdgpu_gmc {
        uint8_t                 vram_vendor;
        uint32_t                srbm_soft_reset;
        bool                    prt_warning;
-       uint64_t                stolen_size;
+       uint64_t                stolen_vga_size;
+       struct amdgpu_bo        *stolen_vga_memory;
        uint32_t                sdpif_register;
        /* apertures */
        u64                     shared_aperture_start;
index a188216..3978112 100644 (file)
@@ -1979,9 +1979,9 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
         * This is used for VGA emulation and pre-OS scanout buffers to
         * avoid display artifacts while transitioning between pre-OS
         * 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,
-                                      &adev->stolen_vga_memory,
+                                      &adev->gmc.stolen_vga_memory,
                                       &stolen_vga_buf);
        if (r)
                return r;
@@ -2043,7 +2043,7 @@ void amdgpu_ttm_late_init(struct amdgpu_device *adev)
 {
        void *stolen_vga_buf;
        /* 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);
 }
 
 /**
index 943773e..187c108 100644 (file)
@@ -860,7 +860,7 @@ static int gmc_v10_0_sw_init(void *handle)
        if (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 */
        r = amdgpu_bo_init(adev);
index 4de9968..28ddb41 100644 (file)
@@ -862,7 +862,7 @@ static int gmc_v6_0_sw_init(void *handle)
        if (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);
        if (r)
index 4113f2d..8b8ecbb 100644 (file)
@@ -1035,7 +1035,7 @@ static int gmc_v7_0_sw_init(void *handle)
        if (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 */
        r = amdgpu_bo_init(adev);
index f29ff9a..8e3763e 100644 (file)
@@ -1160,7 +1160,7 @@ static int gmc_v8_0_sw_init(void *handle)
        if (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 */
        r = amdgpu_bo_init(adev);
index ac15d76..b66c606 100644 (file)
@@ -1243,7 +1243,7 @@ static int gmc_v9_0_sw_init(void *handle)
        if (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 */
        r = amdgpu_bo_init(adev);
@@ -1282,7 +1282,7 @@ static int gmc_v9_0_sw_fini(void *handle)
        amdgpu_vm_manager_fini(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_bo_fini(adev);