Skip to content

Commit 57c2af7

Browse files
committed
Merge tag 'topic/mst-suspend-resume-reprobe-2019-10-29-2' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
UAPI Changes: Cross-subsystem Changes: Core Changes: * Handle UP requests asynchronously in the DP MST helpers, fixing hotplug notifications and allowing us to implement suspend/resume reprobing * Add basic suspend/resume reprobing to the DP MST helpers * Improve locking for link address reprobing and connection status request handling in the DP MST helpers * Miscellaneous refactoring in the DP MST helpers * Add a Kconfig option to the DP MST helpers to enable tracking of gets/puts for topology references for debugging purposes Driver Changes: * nouveau: Resume hotplug interrupts earlier, so that sideband messages may be transmitted during resume and thus allow suspend/resume reprobing for DP MST to work * nouveau: Avoid grabbing runtime PM references when handling short DP pulses, so that handling sideband messages in resume codepaths with the DP MST helpers doesn't deadlock us * i915, nouveau, amdgpu, radeon: Use detect_ctx for probing MST connectors, so that we can grab the topology manager's atomic lock Note: there's some amdgpu patches that I didn't realize were pushed upstream already when creating this topic branch. When they fail to apply, you can just ignore and skip them. Signed-off-by: Dave Airlie <[email protected]> From: Lyude Paul <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 8c84b43 + 12a280c commit 57c2af7

File tree

11 files changed

+1125
-402
lines changed

11 files changed

+1125
-402
lines changed

drivers/gpu/drm/Kconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,20 @@ config DRM_KMS_FB_HELPER
9393
help
9494
FBDEV helpers for KMS drivers.
9595

96+
config DRM_DEBUG_DP_MST_TOPOLOGY_REFS
97+
bool "Enable refcount backtrace history in the DP MST helpers"
98+
select STACKDEPOT
99+
depends on DRM_KMS_HELPER
100+
depends on DEBUG_KERNEL
101+
depends on EXPERT
102+
help
103+
Enables debug tracing for topology refs in DRM's DP MST helpers. A
104+
history of each topology reference/dereference will be printed to the
105+
kernel log once a port or branch device's topology refcount reaches 0.
106+
107+
This has the potential to use a lot of memory and print some very
108+
large kernel messages. If in doubt, say "N".
109+
96110
config DRM_FBDEV_EMULATION
97111
bool "Enable legacy fbdev support for your modesetting driver"
98112
depends on DRM

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,7 @@ static void s3_handle_mst(struct drm_device *dev, bool suspend)
10281028
if (suspend) {
10291029
drm_dp_mst_topology_mgr_suspend(mgr);
10301030
} else {
1031-
ret = drm_dp_mst_topology_mgr_resume(mgr);
1031+
ret = drm_dp_mst_topology_mgr_resume(mgr, true);
10321032
if (ret < 0) {
10331033
drm_dp_mst_topology_mgr_set_mst(mgr, false);
10341034
need_hotplug = true;
@@ -1246,7 +1246,7 @@ static int dm_resume(void *handle)
12461246
*/
12471247
amdgpu_dm_irq_resume_early(adev);
12481248

1249-
/* On resume we need to rewrite the MSTM control bits to enable MST*/
1249+
/* On resume we need to rewrite the MSTM control bits to enable MST*/
12501250
s3_handle_mst(ddev, false);
12511251

12521252
/* Do detection*/

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -123,21 +123,6 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
123123
return result;
124124
}
125125

126-
static enum drm_connector_status
127-
dm_dp_mst_detect(struct drm_connector *connector, bool force)
128-
{
129-
struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector);
130-
struct amdgpu_dm_connector *master = aconnector->mst_port;
131-
132-
enum drm_connector_status status =
133-
drm_dp_mst_detect_port(
134-
connector,
135-
&master->mst_mgr,
136-
aconnector->port);
137-
138-
return status;
139-
}
140-
141126
static void
142127
dm_dp_mst_connector_destroy(struct drm_connector *connector)
143128
{
@@ -175,7 +160,6 @@ amdgpu_dm_mst_connector_early_unregister(struct drm_connector *connector)
175160
}
176161

177162
static const struct drm_connector_funcs dm_dp_mst_connector_funcs = {
178-
.detect = dm_dp_mst_detect,
179163
.fill_modes = drm_helper_probe_single_connector_modes,
180164
.destroy = dm_dp_mst_connector_destroy,
181165
.reset = amdgpu_dm_connector_funcs_reset,
@@ -250,10 +234,22 @@ dm_mst_atomic_best_encoder(struct drm_connector *connector,
250234
return &to_amdgpu_dm_connector(connector)->mst_encoder->base;
251235
}
252236

237+
static int
238+
dm_dp_mst_detect(struct drm_connector *connector,
239+
struct drm_modeset_acquire_ctx *ctx, bool force)
240+
{
241+
struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector);
242+
struct amdgpu_dm_connector *master = aconnector->mst_port;
243+
244+
return drm_dp_mst_detect_port(connector, ctx, &master->mst_mgr,
245+
aconnector->port);
246+
}
247+
253248
static const struct drm_connector_helper_funcs dm_dp_mst_connector_helper_funcs = {
254249
.get_modes = dm_dp_mst_get_modes,
255250
.mode_valid = amdgpu_dm_connector_mode_valid,
256251
.atomic_best_encoder = dm_mst_atomic_best_encoder,
252+
.detect_ctx = dm_dp_mst_detect,
257253
};
258254

259255
static void amdgpu_dm_encoder_destroy(struct drm_encoder *encoder)

0 commit comments

Comments
 (0)