Skip to content
Merged
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
27 changes: 23 additions & 4 deletions drivers/gpu/drm/apple/iomfb_template.c
Original file line number Diff line number Diff line change
Expand Up @@ -2902,9 +2902,27 @@ void DCP_FW_NAME(iomfb_poweroff)(struct apple_dcp *dcp)
#endif

#if DCP_FW_H17(DCP_FW_VER)
/* H17P has no known safe pipe-off or surface-free transition. */
if (dcp->hw.iomfb_method_profile != DCP_IOMFB_METHODS_H17G)
return;
/*
* H17P has no known safe pipe-off or surface-free transition for
* its panel. An external pipe stops like the H17G one: otherwise
* DPMS off leaves it scanning out the last frame.
*/
if (dcp->hw.iomfb_method_profile != DCP_IOMFB_METHODS_H17G) {
if (dcp_has_panel(dcp))
return;
/*
* The firmware withdrew the mode (it is describing the display
* again after a hotplug, see dcp_mode_withdraw()): no scanout of
* ours is left to stop, and while it republishes the display it
* answers neither the clear swap nor setPowerState(0). Both then
* time out and leave the pipe unable to power on again.
*/
if (!READ_ONCE(dcp->mode_state.valid)) {
dev_dbg(dcp->dev, "%s: no valid mode, pipe left to the firmware\n",
__func__);
return;
}
}
#endif

#if DCP_FW_DESKTOP_26(DCP_FW_VER)
Expand All @@ -2925,7 +2943,8 @@ void DCP_FW_NAME(iomfb_poweroff)(struct apple_dcp *dcp)
kref_get(&cookie->refcount);

#if DCP_FW_H17(DCP_FW_VER)
if (dcp->hw.iomfb_method_profile == DCP_IOMFB_METHODS_H17G)
if (dcp->hw.iomfb_method_profile == DCP_IOMFB_METHODS_H17G ||
!dcp_has_panel(dcp))
dcp_prepare_clear_swap(dcp, swap);
#else
#if DCP_FW_DESKTOP_26(DCP_FW_VER)
Expand Down
Loading