diff --git a/arch/arm64/boot/dts/apple/t8132-j604.dts b/arch/arm64/boot/dts/apple/t8132-j604.dts index b9d4c870e71cd..8c86b23bf92ef 100644 --- a/arch/arm64/boot/dts/apple/t8132-j604.dts +++ b/arch/arm64/boot/dts/apple/t8132-j604.dts @@ -74,6 +74,12 @@ }; }; +/* The full 3024x1964 panel including the notch rows, 254 ppi. */ +&dcp { + apple,panel-width-mm = <302>; + apple,panel-height-mm = <196>; +}; + &sound_jack { compatible = "apple,j604-macaudio-jack", "apple,macaudio"; model = "MacBook Pro J604 Jack"; diff --git a/arch/arm64/boot/dts/apple/t8132-j713-j715.dtsi b/arch/arm64/boot/dts/apple/t8132-j713-j715.dtsi index 1f54a7cfb0166..47c224586dffa 100644 --- a/arch/arm64/boot/dts/apple/t8132-j713-j715.dtsi +++ b/arch/arm64/boot/dts/apple/t8132-j713-j715.dtsi @@ -13,12 +13,6 @@ #include "t8132-j713-pmgr.dtsi" #include -/ { - aliases { - disp0_piodma = &disp0_piodma; - }; -}; - /* The J713 loader tree has these placeholders. */ &gpu_ttbs { reg = <0 0 0 0>; @@ -137,25 +131,10 @@ status = "okay"; }; -/* - * Internal display: the loader enables disp0_dart, piodma and the display - * subsystem once it has validated the inherited frontend mappings. - */ -&dcp_mbox { - status = "okay"; -}; - -&dcp_dart { - status = "okay"; -}; - +/* The J713's full 2560x1664 panel including the notch rows, 224 ppi. */ &dcp { - apple,j713-native-piodma; - apple,j713-native-scanout; - /* Full 2560x1664 panel including the notch rows, 224 ppi. */ apple,panel-width-mm = <290>; apple,panel-height-mm = <188>; - status = "okay"; }; /* External displays: both pipes, routed to either USB-C port. */ diff --git a/arch/arm64/boot/dts/apple/t8132-laptop.dtsi b/arch/arm64/boot/dts/apple/t8132-laptop.dtsi index e056ba40f5a28..cfb8d81d321b6 100644 --- a/arch/arm64/boot/dts/apple/t8132-laptop.dtsi +++ b/arch/arm64/boot/dts/apple/t8132-laptop.dtsi @@ -19,6 +19,7 @@ aliases { keyboard = &keyboard; + disp0_piodma = &disp0_piodma; }; chosen { @@ -74,6 +75,25 @@ panel = <&fb_panel>; }; +/* + * Internal display: the loader enables disp0_dart, piodma and the display + * subsystem once it has validated the inherited frontend mappings. Each + * board gives its panel's physical size. + */ +&dcp_mbox { + status = "okay"; +}; + +&dcp_dart { + status = "okay"; +}; + +&dcp { + apple,j713-native-piodma; + apple,j713-native-scanout; + status = "okay"; +}; + &aop_audio { /* Microphones on LEAP; speakers and sense on TX0/RX0; the jack on TX2/RX2. */ dmas = <&admac0 1>, <&admac1 0>, <&admac1 1>, <&admac1 4>, <&admac1 5>; diff --git a/drivers/gpu/drm/apple/dcp-m4-profile.h b/drivers/gpu/drm/apple/dcp-m4-profile.h index 82485a3048b2e..88900add94724 100644 --- a/drivers/gpu/drm/apple/dcp-m4-profile.h +++ b/drivers/gpu/drm/apple/dcp-m4-profile.h @@ -9,6 +9,7 @@ struct dcp_m4_profile { const char *name; const char *machine; /* machine compatible */ u32 panel_width, panel_height; + u32 notch_rows; /* rows the boot loader may hide */ u32 boot_stride; /* D101: inherited framebuffer stride */ u32 swap_size; /* A407 input */ u32 swap_surface; /* plane-0 surface */ @@ -40,7 +41,8 @@ static const u32 dcp_m4_timing_j713[2][8] = { static const struct dcp_m4_profile dcp_m4_profile_j713 = { .name = "J713", .machine = "apple,j713", - .panel_width = 2560, .panel_height = 1664, .boot_stride = 10240, + .panel_width = 2560, .panel_height = 1664, .notch_rows = 64, + .boot_stride = 10240, .swap_size = 0x1bd8, .swap_surface = 0x588, .swap_dva = 0xe38, .swap_nullable = 0x1bcb, .swap_tail = 0x1bd6, .swap_nits = 0x35e, .swap_intent = 0x17c, @@ -60,7 +62,8 @@ static const u32 dcp_m4_timing_j715[2][8] = { /* The J715: the same firmware ABI with a 2880x1864 panel. */ static const struct dcp_m4_profile dcp_m4_profile_j715 = { .name = "J715", .machine = "apple,j715", - .panel_width = 2880, .panel_height = 1864, .boot_stride = 11520, + .panel_width = 2880, .panel_height = 1864, .notch_rows = 64, + .boot_stride = 11520, .swap_size = 0x1bd8, .swap_surface = 0x588, .swap_dva = 0xe38, .swap_nullable = 0x1bcb, .swap_tail = 0x1bd6, .swap_nits = 0x35e, .swap_intent = 0x17c, @@ -83,7 +86,8 @@ static const u32 dcp_m4_timing_j604[2][8] = { */ static const struct dcp_m4_profile dcp_m4_profile_j604 = { .name = "J604", .machine = "apple,j604", - .panel_width = 3024, .panel_height = 1964, .boot_stride = 12096, + .panel_width = 3024, .panel_height = 1964, .notch_rows = 74, + .boot_stride = 12096, .swap_size = 0x1bd8, .swap_surface = 0x588, .swap_dva = 0xe38, .swap_nullable = 0x1bcb, .swap_tail = 0x1bd6, .swap_nits = 0x35e, .swap_intent = 0x17c, diff --git a/drivers/gpu/drm/apple/iomfb_m4.c b/drivers/gpu/drm/apple/iomfb_m4.c index 2ffde863b8fac..53c7db440fa88 100644 --- a/drivers/gpu/drm/apple/iomfb_m4.c +++ b/drivers/gpu/drm/apple/iomfb_m4.c @@ -2270,17 +2270,16 @@ static int dcp_m4_boot_framebuffer_check(void) if (!of_device_is_available(np)) continue; found++; - /* The inherited console may exclude the notch (64 lines on J713). */ + /* The inherited console may exclude the panel's notch rows. */ if (of_property_read_u32(np, "width", &width) || of_property_read_u32(np, "height", &height) || of_property_read_u32(np, "stride", &stride) || width != dcp_m4_pf->panel_width || stride != dcp_m4_pf->boot_stride || (height != dcp_m4_pf->panel_height && - height != dcp_m4_pf->panel_height - 64)) { + height != dcp_m4_pf->panel_height - dcp_m4_pf->notch_rows)) { of_node_put(np); return -EINVAL; } - /* The inherited console can exclude the 64-line notch region. */ ret = 0; } return found > 1 ? -EINVAL : ret; diff --git a/drivers/iommu/apple-dart.c b/drivers/iommu/apple-dart.c index 4acc60c4875e2..8efb8f32ce0ff 100644 --- a/drivers/iommu/apple-dart.c +++ b/drivers/iommu/apple-dart.c @@ -4133,6 +4133,17 @@ static int apple_dart_probe(struct platform_device *pdev) of_machine_is_compatible("apple,t8132") && of_device_is_compatible(dev->of_node, "apple,t8132-dart") && res->start == 0x490000000ULL; + /* + * Off the qualified firmware nothing hands the internal display DARTs + * over, but the running DCP still uses them: never reset them. + */ + if (res && !tunneled && !apple_t8132_firmware_path() && + of_machine_is_compatible("apple,t8132") && + of_device_is_compatible(dev->of_node, "apple,t8132-dart") && + (res->start == 0x30a300000ULL || res->start == 0x30a340000ULL)) { + dev_info(dev, "Leaving inherited display DART untouched off the qualified firmware\n"); + return -ENODEV; + } if (j713_display && !IS_ENABLED(CONFIG_APPLE_DART_J713_DCP)) return dev_err_probe(dev, -EOPNOTSUPP, "retained J713 display requires CONFIG_APPLE_DART_J713_DCP=y\n");