Commit 7eded018 authored by Alex Deucher's avatar Alex Deucher
Browse files

drm/amdgpu: fix regression in vbios reservation handling on headless



We need to move the check under the non-headless case, otherwise
we always reserve the VGA save size.

Fixes: 157fe68d ("drm/amdgpu: fix size calculation with stolen vga memory")
Reviewed-by: default avatarGuchun Chen <guchun.chen@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 3aa883ac
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -496,13 +496,14 @@ void amdgpu_gmc_get_vbios_allocations(struct amdgpu_device *adev)
		break;
	}

	if (!amdgpu_device_ip_get_ip_block(adev, AMD_IP_BLOCK_TYPE_DCE))
	if (!amdgpu_device_ip_get_ip_block(adev, AMD_IP_BLOCK_TYPE_DCE)) {
		size = 0;
	else
	} else {
		size = amdgpu_gmc_get_vbios_fb_size(adev);

		if (adev->mman.keep_stolen_vga_memory)
			size = max(size, (unsigned)AMDGPU_VBIOS_VGA_ALLOCATION);
	}

	/* set to 0 if the pre-OS buffer uses up most of vram */
	if ((adev->gmc.real_vram_size - size) < (8 * 1024 * 1024))