Skip to content
/ linux Public

Commit b1e034a

Browse files
alexdeucherSasha Levin
authored andcommitted
drm/amdgpu: keep vga memory on MacBooks with switchable graphics
[ Upstream commit 096bb75 ] On Intel MacBookPros with switchable graphics, when the iGPU is enabled, the address of VRAM gets put at 0 in the dGPU's virtual address space. This is non-standard and seems to cause issues with the cursor if it ends up at 0. We have the framework to reserve memory at 0 in the address space, so enable it here if the vram start address is 0. Reviewed-and-tested-by: Mario Kleiner <mario.kleiner.de@gmail.com> Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4302 Cc: stable@vger.kernel.org Cc: Mario Kleiner <mario.kleiner.de@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 832f430 commit b1e034a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,16 @@ void amdgpu_gmc_get_vbios_allocations(struct amdgpu_device *adev)
10131013
case CHIP_RENOIR:
10141014
adev->mman.keep_stolen_vga_memory = true;
10151015
break;
1016+
case CHIP_POLARIS10:
1017+
case CHIP_POLARIS11:
1018+
case CHIP_POLARIS12:
1019+
/* MacBookPros with switchable graphics put VRAM at 0 when
1020+
* the iGPU is enabled which results in cursor issues if
1021+
* the cursor ends up at 0. Reserve vram at 0 in that case.
1022+
*/
1023+
if (adev->gmc.vram_start == 0)
1024+
adev->mman.keep_stolen_vga_memory = true;
1025+
break;
10161026
default:
10171027
adev->mman.keep_stolen_vga_memory = false;
10181028
break;

0 commit comments

Comments
 (0)