Skip to content

Commit

Permalink
display: Exclude j413 from Sequoia workaround by changing the logic
Browse files Browse the repository at this point in the history
It seems this model does not need it *and* it somehow causes
nondeterministic problems.

Also add a delay to the poweroff/on sequence to be more conservative.

Fixes: #406
Signed-off-by: Hector Martin <[email protected]>
  • Loading branch information
marcan committed Sep 28, 2024
1 parent 9d445d8 commit 277e8e7
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ int display_configure(const char *config)
if (display_needs_power_cycle) {
if ((ret = dcp_ib_set_power(iboot, false)) < 0)
printf("display: failed to set power off (continuing anyway)\n");
mdelay(100);
}
// Sonoma bug workaround: Power on internal panel early
if ((ret = dcp_ib_set_power(iboot, true)) < 0)
Expand Down Expand Up @@ -599,6 +600,16 @@ int display_init(void)
else
disp_path = "/arm-io/disp0";

bool has_notch = false;
int product = adt_path_offset(adt, "/product");
if (product < 0) {
printf("/product node not found!\n");
} else {
u32 val = 0;
ADT_GETPROP(adt, product, "partially-occluded-display", &val);
has_notch = !!val;
}

int node = adt_path_offset(adt, disp_path);
if (node < 0) {
printf("%s node not found!\n", disp_path);
Expand All @@ -623,7 +634,8 @@ int display_init(void)
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)) {
} else if (!has_notch && firmware_sfw_in_range(V15_0B1, FW_MAX) &&
os_firmware.version < V15_0B1) {
printf("display: Internal display on t8103 or t8112 with Sequoia SFW, power cycling\n");
display_needs_power_cycle = true;
return display_configure(NULL);
Expand Down

0 comments on commit 277e8e7

Please sign in to comment.