Skip to content

Commit a93247b

Browse files
Thomas ZimmermannMaarten Lankhorst
authored andcommitted
drm/client: Send pending hotplug events after resume
If a hotplug event arrives while the client has been suspended, DRM's client code will deliver the event after resuming. The functionality has been taken form i915, where it can be removed by a later commit. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Maarten Lankhorst <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Maarten Lankhorst <[email protected]>
1 parent 603cc82 commit a93247b

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

drivers/gpu/drm/drm_client_event.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ static void drm_client_hotplug(struct drm_client_dev *client)
6060
if (client->hotplug_failed)
6161
return;
6262

63+
if (client->suspended) {
64+
client->hotplug_pending = true;
65+
return;
66+
}
67+
68+
client->hotplug_pending = false;
6369
ret = client->funcs->hotplug(client);
6470
drm_dbg_kms(dev, "%s: ret=%d\n", client->name, ret);
6571
if (ret)
@@ -159,6 +165,9 @@ static int drm_client_resume(struct drm_client_dev *client, bool holds_console_l
159165

160166
client->suspended = false;
161167

168+
if (client->hotplug_pending)
169+
drm_client_hotplug(client);
170+
162171
return ret;
163172
}
164173

include/drm/drm_client.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,14 @@ struct drm_client_dev {
142142
*/
143143
bool suspended;
144144

145+
/**
146+
* @hotplug_pending:
147+
*
148+
* A hotplug event has been received while the client was suspended.
149+
* Try again on resume.
150+
*/
151+
bool hotplug_pending;
152+
145153
/**
146154
* @hotplug_failed:
147155
*

0 commit comments

Comments
 (0)