Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions drivers/gpu/drm/apple/dcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ bool dcp_h17p_external_ready(struct device_node *np)

static bool show_notch;
module_param(show_notch, bool, 0644);
MODULE_PARM_DESC(show_notch, "Use the full display height and shows the notch");
MODULE_PARM_DESC(show_notch, "Use the full display height and show the notch (also when /chosen/asahi,show-notch is \"1\")");

static bool dcpext_probe;
module_param(dcpext_probe, bool, 0444);
Expand Down Expand Up @@ -4839,6 +4839,19 @@ static bool dcp_external_is_idle(struct apple_dcp *dcp)
(status & APPLE_DCP_COPROC_CPU_STATUS_IDLE);
}

/*
* The boot loader keeps the notch rows in its framebuffer when the OS is to
* drive the full panel (aura: chosen.asahi,show-notch=1). Follow it, so the
* mode covers the same rows as the boot framebuffer did.
*/
static bool boot_show_notch(void)
{
const char *val;

return !of_property_read_string(of_chosen, "asahi,show-notch", &val) &&
!strcmp(val, "1");
}

/*
* The M3 internal displays (14.x and 26.6 IOMFB) also accept
* appledrm.t6030_show_notch=1, the switch existing J613/T6030 installs pass,
Expand All @@ -4847,10 +4860,12 @@ static bool dcp_external_is_idle(struct apple_dcp *dcp)
*/
static bool dcp_show_notch(struct apple_dcp *dcp)
{
bool show = show_notch || boot_show_notch();

if (dcp->fw_compat != DCP_FIRMWARE_V_14_7 &&
dcp->fw_compat != DCP_FIRMWARE_V_26_6)
return show_notch;
return show_notch || t6030_show_notch;
return show;
return show || t6030_show_notch;
}

/*
Expand Down