From 7c6a1f7c6785e35623950132337fa343aa7092d2 Mon Sep 17 00:00:00 2001 From: Satya Benson Date: Sat, 31 Oct 2026 02:29:47 -0400 Subject: [PATCH] drm/asahi: admit opted-in J615 on the shared 26.6.2 profile The 26.6.2 (25G83) IPSW ships the same GPU, DCP and PMP firmware for the 13-inch (J613) and 15-inch (J615) M3 Air, and the J615 ADT matches J613's in every node this path uses. Allow J615 onto the extended profile, but only with the same exact opt-in m1n1 and the DCP code already require (chosen asahi,j615-25g83-experimental = "1"), and only when the board identity is unambiguous. J613 behaviour is unchanged. This has not been qualified on J615 hardware. Signed-off-by: Satya Benson --- drivers/gpu/drm/asahi/m3/t8122_admission.rs | 35 +++++++++++++++++---- 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/asahi/m3/t8122_admission.rs b/drivers/gpu/drm/asahi/m3/t8122_admission.rs index fb280ebcde520..13569a0c76e64 100644 --- a/drivers/gpu/drm/asahi/m3/t8122_admission.rs +++ b/drivers/gpu/drm/asahi/m3/t8122_admission.rs @@ -53,11 +53,17 @@ pub(crate) fn validate_identity_for( }) } +/// Same mutually exclusive board identities and exact string opt-in as m1n1/DCP. +/// J615 shares the 25G83 GPU/ADT profile, but has no hardware qualification here. +pub(crate) fn extended_board(j613: bool, j615: bool, optin: Option<&[u8]>) -> bool { + (j613 && !j615) || (!j613 && j615 && optin == Some(b"1\0")) +} + /// Firmware-interface selection is exact and does not change physical GPU encodings. -pub(crate) fn profile_for(compat:&[u32],j613:bool)->Option { +pub(crate) fn profile_for(compat:&[u32],air:bool)->Option { match compat { [14,8,3]=>Some(Profile::Legacy), - [26,6,2] if j613=>Some(Profile::Extended), + [26,6,2] if air=>Some(Profile::Extended), _=>None, } } @@ -69,10 +75,17 @@ pub(crate) fn loaded_profile(pdev:&kernel::platform::Device=node.get_property(c_str!("apple,firmware-compat"))?; #[cfg(CONFIG_DRM_ASAHI_M3_T8122)] - let j613 = super::m3_board::board_is(b"apple,j613"); + let air = { + let j613 = super::m3_board::board_is(b"apple,j613"); + let j615 = super::m3_board::board_is(b"apple,j615"); + let optin = kernel::of::chosen().and_then(|chosen| { + chosen.get_property::>(c_str!("asahi,j615-25g83-experimental")).ok() + }); + extended_board(j613, j615, optin.as_deref()) + }; #[cfg(not(CONFIG_DRM_ASAHI_M3_T8122))] - let j613 = false; - profile_for(&compat, j613).ok_or(ENODEV) + let air = false; + profile_for(&compat, air).ok_or(ENODEV) } /// Shape of the voltage-sorted running-state tables: one entry per distinct millivolt, @@ -326,7 +339,17 @@ mod tests { #[cfg(test)] mod selection_tests { use super::*; - #[test] fn extended_admission_requires_exact_firmware_and_j613() { + #[test] + fn j615_requires_exact_optin_and_unambiguous_board() { + for optin in [None, Some(&b""[..]), Some(&b"1"[..]), Some(&b"0\0"[..]), + Some(&b"1\0extra"[..]), Some(&[0, 0, 0, 1][..]), Some(&b"1\0"[..])] { + assert!(extended_board(true, false, optin)); + assert!(!extended_board(false, false, optin)); + assert!(!extended_board(true, true, optin)); + assert_eq!(extended_board(false, true, optin), optin == Some(&b"1\0"[..])); + } + } + #[test] fn extended_admission_requires_exact_firmware_and_air() { for board in [false,true] { assert_eq!(profile_for(&[14,8,3],board),Some(Profile::Legacy)); assert_eq!(profile_for(&[26,6,2],board),if board{Some(Profile::Extended)}else{None});