From cdb6d41aa25005246b469ad38bf9b84dd40aa679 Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Tue, 17 Sep 2024 23:42:42 +0900 Subject: [PATCH] display: Add workaround for Sequoia DCP handoff bug Signed-off-by: Hector Martin --- src/display.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/display.c b/src/display.c index 69821ed1..0da2495d 100644 --- a/src/display.c +++ b/src/display.c @@ -8,6 +8,7 @@ #include "dcp.h" #include "dcp_iboot.h" #include "fb.h" +#include "firmware.h" #include "memory.h" #include "soc.h" #include "string.h" @@ -31,6 +32,7 @@ static u64 fb_dva; static u64 fb_size; bool display_is_external; bool display_is_dptx; +bool display_needs_power_cycle; static const display_config_t display_config_m1 = { .dcp = "/arm-io/dcp", @@ -401,6 +403,11 @@ int display_configure(const char *config) } if (!display_is_external) { + // Sequoia bug workaround: Force power cycle + if (display_needs_power_cycle) { + if ((ret = dcp_ib_set_power(iboot, false)) < 0) + printf("display: failed to set power off (continuing anyway)\n"); + } // Sonoma bug workaround: Power on internal panel early if ((ret = dcp_ib_set_power(iboot, true)) < 0) printf("display: failed to set power on (continuing anyway)\n"); @@ -615,6 +622,12 @@ int display_init(void) "reconfiguring\n"); fb_clear_direct(); // Old m1n1 stage1 ends up with an ugly logo situation, clear it. return display_configure(NULL); +#ifndef CHAINLOADING + } else if ((chip_id == T8103 || chip_id == T8112) && firmware_sfw_in_range(V15_0B1, FW_MAX)) { + printf("display: Internal display on t8103 or t8112 with Sequoia SFW, power cycling\n"); + display_needs_power_cycle = true; + return display_configure(NULL); +#endif } else { printf("display: Display is already initialized (%ldx%ld)\n", cur_boot_args.video.width, cur_boot_args.video.height);