Re: [PATCH 1/3] drm/amdgpu: reserve 64M stolen memory for Apple 5K iMac

From: Mario Limonciello

Date: Tue Oct 27 2026 - 09:16:42 EST




On 10/27/26 07:57, Alex Deucher wrote:
On Tue, Oct 27, 2026 at 8:21 AM Christian König
<christian.koenig@xxxxxxx> wrote:

On 10/26/26 23:46, Richard Lane wrote:
Apple 27" 5K iMacs report a single 2560x2880 tile (28.125 MiB) in
VIEWPORT_SIZE while scanning out up to 64 MiB across the relocated EFI
framebuffer.

Override the stolen VGA memory allocation size to 64 MiB when matching
PCI_VENDOR_ID_APPLE with a 2560x2880x4 viewport size to prevent
framebuffer corruption during boot handover.

Hacks like those are usually a big no-go.

Why is that framebuffer handling not working with DC out of the box?

The GMC IP code reserves the memory used by the display hardware from
the pre-OS console. The gmc get_vbios_fb_size() callback looks to see
what display viewport was set by the pre-OS environment. If the Macs
need a workaround, that's where it should go. Since these displays
require multiple display pipes, my guess is you need to double the
allocation in that case since the current code just checks the first
pipe.


Could this also be a logic error in that callback? Would it be worth double checking all the register values in that callback for this system?

I know for example there are a few different IP specific implementations in gmc_v9_0_get_vbios_fb_size().


Alex


Regards,
Christian.


Signed-off-by: Richard Lane <richardlanedev@xxxxxxxxx>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
index 4204c3c750a8..8b196fbfa724 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
@@ -1232,7 +1232,15 @@ void amdgpu_gmc_init_vga_resv_regions(struct amdgpu_device *adev)
} else {
size = amdgpu_gmc_get_vbios_fb_size(adev);

- if (adev->mman.keep_stolen_vga_memory)
+ /*
+ * Apple 5K iMacs report one 2560x2880 tile in VIEWPORT_SIZE
+ * while scanning out up to 64M across the relocated EFI
+ * framebuffer.
+ */
+ if (adev->pdev->subsystem_vendor == PCI_VENDOR_ID_APPLE &&
+ size == (2560 * 2880 * 4))
+ size = 64U * 1024 * 1024;
+ else if (adev->mman.keep_stolen_vga_memory)
size = max(size, (unsigned)AMDGPU_VBIOS_VGA_ALLOCATION);
}

--
2.55.0