display: Make M2+ desktop disable hack more generic

This should work on the Mac Pro.

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2023-08-07 16:49:43 +09:00
parent 9b73944684
commit bb0e9ace57

View file

@ -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);