Skip to content

Commit bd13585

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 5fc0933 commit bd13585

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,16 @@ void amdgpu_gmc_get_vbios_allocations(struct amdgpu_device *adev)
974974
case CHIP_RENOIR:
975975
adev->mman.keep_stolen_vga_memory = true;
976976
break;
977+
case CHIP_POLARIS10:
978+
case CHIP_POLARIS11:
979+
case CHIP_POLARIS12:
980+
/* MacBookPros with switchable graphics put VRAM at 0 when
981+
* the iGPU is enabled which results in cursor issues if
982+
* the cursor ends up at 0. Reserve vram at 0 in that case.
983+
*/
984+
if (adev->gmc.vram_start == 0)
985+
adev->mman.keep_stolen_vga_memory = true;
986+
break;
977987
default:
978988
adev->mman.keep_stolen_vga_memory = false;
979989
break;

0 commit comments

Comments
 (0)