git: 7f20404b9f91 - stable/14 - loader.efi: add stride & offset for MacBookPro3,1

From: Ahmad Khalifa <vexeduxr_at_FreeBSD.org>
Date: Mon, 12 Jan 2026 17:33:12 UTC
The branch stable/14 has been updated by vexeduxr:

URL: https://cgit.FreeBSD.org/src/commit/?id=7f20404b9f91557d655a50d8d43c77f87379d577

commit 7f20404b9f91557d655a50d8d43c77f87379d577
Author:     Frank Hilgendorf <frank.hilgendorf@posteo.de>
AuthorDate: 2025-01-27 21:18:39 +0000
Commit:     Ahmad Khalifa <vexeduxr@FreeBSD.org>
CommitDate: 2026-01-12 17:26:33 +0000

    loader.efi: add stride & offset for MacBookPro3,1
    
    Note that there are three variants of this MacBook. We only have the
    stride and offset values for the 17" 1680x1050 model.
    
    Reviewed by:    vexeduxr
    Pull Request:   https://github.com/freebsd/freebsd-src/pull/1584
    
    (cherry picked from commit be6ba97aaee762c2e5300834f1916ae5dfd5a0b9)
---
 stand/efi/loader/framebuffer.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/stand/efi/loader/framebuffer.c b/stand/efi/loader/framebuffer.c
index c97ba68b38da..a3b2df38cd68 100644
--- a/stand/efi/loader/framebuffer.c
+++ b/stand/efi/loader/framebuffer.c
@@ -387,6 +387,23 @@ efifb_from_uga(struct efi_fb *efifb)
 			/* These are the missing bits. */
 			offset = 0x0;
 			stride = 2048;
+		} else if (ev != NULL && !strcmp(ev, "MacBookPro3,1")) {
+			/*
+			 * Valid for MacBookPro 17" with standard resolution.
+			 * Other Models are:
+			 *   MacBookPro 15" with horiz=1440
+			 *   MacBookPro 17" with horiz=1920
+			 */
+
+			/* These are the expected values we should have. */
+			if (horiz == 1680) {
+				vert = 1050;
+				fbaddr = 0xc0000000;
+				/* These are the missing bits. */
+				stride = 2048;
+				/* 24 scan lines down */
+				offset = stride * 4 * 24;
+			}
 		}
 	}