From bb0e9ace57ab9180ede422502a78fdfd3c8c4ade Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Mon, 7 Aug 2023 16:49:43 +0900 Subject: [PATCH] display: Make M2+ desktop disable hack more generic This should work on the Mac Pro. Signed-off-by: Hector Martin --- src/display.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/display.c b/src/display.c index 2b2d1298..fd7bc0dd 100644 --- a/src/display.c +++ b/src/display.c @@ -7,6 +7,7 @@ #include "dcp_iboot.h" #include "fb.h" #include "memory.h" +#include "soc.h" #include "string.h" #include "utils.h" #include "xnuboot.h" @@ -462,14 +463,6 @@ int display_configure(const char *config) int display_init(void) { - // HACK: disable non-working display config on j473/j474s - int model_node = adt_path_offset(adt, "/"); - if (model_node >= 0 && (adt_is_compatible(adt, model_node, "J473AP") || - adt_is_compatible(adt, model_node, "J474sAP"))) { - printf("display: skipping init on non-supported j473/j474s\n"); - return 0; - } - int node = adt_path_offset(adt, "/arm-io/disp0"); if (node < 0) { @@ -483,6 +476,17 @@ int display_init(void) else printf("display: Display is internal\n"); + // HACK: disable non-working display config on j473/j474s/etc + if (display_is_external) { + switch (chip_id) { + case T8112: + case T6020 ... T6022: + printf("display: skipping init on non-supported M2+ platform\n"); + return 0; + break; + } + } + if (cur_boot_args.video.width == 640 && cur_boot_args.video.height == 1136) { printf("display: Dummy framebuffer found, initializing display\n"); return display_configure(NULL);