Skip to content

Commit 1da8438

Browse files
committed
drm: apple: Fix DPTX hotplug handling
- Do not trigger an hotplug event from disconnect. DCP/iomfb notices that itself. - Check HPD status before disconnecting DPTX in the crtc disable path. - disconnect on suspend to allow an orderly re-connect on resume Signed-off-by: Janne Grunau <j@jannau.net>
1 parent a7bed8e commit 1da8438

1 file changed

Lines changed: 8 additions & 11 deletions

File tree

  • drivers/gpu/drm/apple

drivers/gpu/drm/apple/dcp.c

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -292,16 +292,9 @@ static int dcp_dptx_connect(struct apple_dcp *dcp, u32 port)
292292

293293
static int dcp_dptx_disconnect(struct apple_dcp *dcp, u32 port)
294294
{
295-
struct apple_connector *connector = dcp->connector;
296295
dev_info(dcp->dev, "%s(port=%d)\n", __func__, port);
297296

298297
mutex_lock(&dcp->hpd_mutex);
299-
300-
if (connector && connector->connected) {
301-
dcp->valid_mode = false;
302-
schedule_work(&connector->hotplug_wq);
303-
}
304-
305298
if (dcp->dptxport[port].enabled && dcp->dptxport[port].connected) {
306299
dptxport_release_display(dcp->dptxport[port].service);
307300
dcp->dptxport[port].connected = false;
@@ -478,9 +471,11 @@ void dcp_poweroff(struct platform_device *pdev)
478471
break;
479472
}
480473

481-
if (dcp->phy)
482-
dcp_dptx_disconnect(dcp, 0);
483-
474+
if (dcp->hdmi_hpd) {
475+
bool connected = gpiod_get_value_cansleep(dcp->hdmi_hpd);
476+
if (!connected)
477+
dcp_dptx_disconnect(dcp, 0);
478+
}
484479
}
485480
EXPORT_SYMBOL(dcp_poweroff);
486481

@@ -1017,8 +1012,10 @@ static int dcp_platform_suspend(struct device *dev)
10171012
{
10181013
struct apple_dcp *dcp = dev_get_drvdata(dev);
10191014

1020-
if (dcp->hdmi_hpd_irq)
1015+
if (dcp->hdmi_hpd_irq) {
10211016
disable_irq(dcp->hdmi_hpd_irq);
1017+
dcp_dptx_disconnect(dcp, 0);
1018+
}
10221019
/*
10231020
* Set the device as a wakeup device, which forces its power
10241021
* domains to stay on. We need this as we do not support full

0 commit comments

Comments
 (0)