Merge tag 'topic/mst-suspend-resume-reprobe-2019-10-29-2' of git://anongit.freedeskto...
authorDave Airlie <airlied@redhat.com>
Tue, 29 Oct 2019 23:01:28 +0000 (09:01 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 29 Oct 2019 23:51:03 +0000 (09:51 +1000)
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 <airlied@redhat.com>
From: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/a74c6446bc960190d195a751cb6d8a00a98f3974.camel@redhat.com
1  2 
drivers/gpu/drm/Kconfig
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
drivers/gpu/drm/drm_dp_mst_topology.c

Simple merge
@@@ -243,17 -229,29 +227,29 @@@ static int dm_dp_mst_get_modes(struct d
        return ret;
  }
  
 -static struct drm_encoder *dm_mst_best_encoder(struct drm_connector *connector)
 +static struct drm_encoder *
 +dm_mst_atomic_best_encoder(struct drm_connector *connector,
 +                         struct drm_connector_state *connector_state)
  {
 -      struct amdgpu_dm_connector *amdgpu_dm_connector = to_amdgpu_dm_connector(connector);
 -
 -      return &amdgpu_dm_connector->mst_encoder->base;
 +      return &to_amdgpu_dm_connector(connector)->mst_encoder->base;
  }
  
+ static int
+ dm_dp_mst_detect(struct drm_connector *connector,
+                struct drm_modeset_acquire_ctx *ctx, bool force)
+ {
+       struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector);
+       struct amdgpu_dm_connector *master = aconnector->mst_port;
+       return drm_dp_mst_detect_port(connector, ctx, &master->mst_mgr,
+                                     aconnector->port);
+ }
  static const struct drm_connector_helper_funcs dm_dp_mst_connector_helper_funcs = {
        .get_modes = dm_dp_mst_get_modes,
        .mode_valid = amdgpu_dm_connector_mode_valid,
 -      .best_encoder = dm_mst_best_encoder,
 +      .atomic_best_encoder = dm_mst_atomic_best_encoder,
+       .detect_ctx = dm_dp_mst_detect,
  };
  
  static void amdgpu_dm_encoder_destroy(struct drm_encoder *encoder)
Simple merge