Skip to content

Commit 5f6fab2

Browse files
committed
drm/amdgpu: free the pre-OS console framebuffer after the first modeset
Rather than in late_init to avoid race conditions between freeing the buffers and the initial modeset. Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 35d3f41 commit 5f6fab2

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2026,10 +2026,6 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
20262026
*/
20272027
void amdgpu_ttm_late_init(struct amdgpu_device *adev)
20282028
{
2029-
/* return the VGA stolen memory (if any) back to VRAM */
2030-
if (!adev->mman.keep_stolen_vga_memory)
2031-
amdgpu_bo_free_kernel(&adev->mman.stolen_vga_memory, NULL, NULL);
2032-
amdgpu_bo_free_kernel(&adev->mman.stolen_extended_memory, NULL, NULL);
20332029
}
20342030

20352031
/*
@@ -2042,8 +2038,8 @@ void amdgpu_ttm_fini(struct amdgpu_device *adev)
20422038

20432039
amdgpu_ttm_training_reserve_vram_fini(adev);
20442040
/* return the stolen vga memory back to VRAM */
2045-
if (adev->mman.keep_stolen_vga_memory)
2046-
amdgpu_bo_free_kernel(&adev->mman.stolen_vga_memory, NULL, NULL);
2041+
amdgpu_bo_free_kernel(&adev->mman.stolen_vga_memory, NULL, NULL);
2042+
amdgpu_bo_free_kernel(&adev->mman.stolen_extended_memory, NULL, NULL);
20472043
/* return the IP Discovery TMR memory back to VRAM */
20482044
amdgpu_bo_free_kernel(&adev->mman.discovery_memory, NULL, NULL);
20492045
amdgpu_ttm_fw_reserve_vram_fini(adev);

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8462,6 +8462,11 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
84628462

84638463
drm_atomic_helper_cleanup_planes(dev, state);
84648464

8465+
/* return the stolen vga memory back to VRAM */
8466+
if (!adev->mman.keep_stolen_vga_memory)
8467+
amdgpu_bo_free_kernel(&adev->mman.stolen_vga_memory, NULL, NULL);
8468+
amdgpu_bo_free_kernel(&adev->mman.stolen_extended_memory, NULL, NULL);
8469+
84658470
/*
84668471
* Finally, drop a runtime PM reference for each newly disabled CRTC,
84678472
* so we can put the GPU into runtime suspend if we're not driving any

0 commit comments

Comments
 (0)