diff options
author | Lyude Paul <lyude@redhat.com> | 2018-10-08 19:24:33 -0400 |
---|---|---|
committer | Lyude Paul <lyude@redhat.com> | 2018-10-09 11:12:23 -0400 |
commit | f67207d78ceaf98b7531bc22df6f21328559c8d4 (patch) | |
tree | cb3b75ebe054fab21e46622d6127f09244da0f39 /drivers/gpu/drm/i915/intel_dp_mst.c | |
parent | 6ed5bb1fbad34382c8cfe9a9bf737e9a43053df5 (diff) |
drm/i915: Skip vcpi allocation for MSTB ports that are gone
Since we need to be able to allow DPMS on->off prop changes after an MST
port has disappeared from the system, we need to be able to make sure we
can compute a config for the resulting atomic commit. Currently this is
impossible when the port has disappeared, since the VCPI slot searching
we try to do in intel_dp_mst_compute_config() will fail with -EINVAL.
Since the only commits we want to allow on no-longer-present MST ports
are ones that shut off display hardware, we already know that no VCPI
allocations are needed. So, hardcode the VCPI slot count to 0 when
intel_dp_mst_compute_config() is called on an MST port that's gone.
Changes since V4:
- Don't use mst_port_gone at all, just check whether or not the drm
connector is registered - Daniel Vetter
Signed-off-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: stable@vger.kernel.org
Link: https://patchwork.freedesktop.org/patch/msgid/20181008232437.5571-5-lyude@redhat.com
Diffstat (limited to 'drivers/gpu/drm/i915/intel_dp_mst.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp_mst.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c index aa21742d8634..0f14c0d1669c 100644 --- a/drivers/gpu/drm/i915/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/intel_dp_mst.c | |||
@@ -38,11 +38,11 @@ static bool intel_dp_mst_compute_config(struct intel_encoder *encoder, | |||
38 | struct intel_dp_mst_encoder *intel_mst = enc_to_mst(&encoder->base); | 38 | struct intel_dp_mst_encoder *intel_mst = enc_to_mst(&encoder->base); |
39 | struct intel_digital_port *intel_dig_port = intel_mst->primary; | 39 | struct intel_digital_port *intel_dig_port = intel_mst->primary; |
40 | struct intel_dp *intel_dp = &intel_dig_port->dp; | 40 | struct intel_dp *intel_dp = &intel_dig_port->dp; |
41 | struct intel_connector *connector = | 41 | struct drm_connector *connector = conn_state->connector; |
42 | to_intel_connector(conn_state->connector); | 42 | void *port = to_intel_connector(connector)->port; |
43 | struct drm_atomic_state *state = pipe_config->base.state; | 43 | struct drm_atomic_state *state = pipe_config->base.state; |
44 | int bpp; | 44 | int bpp; |
45 | int lane_count, slots; | 45 | int lane_count, slots = 0; |
46 | const struct drm_display_mode *adjusted_mode = &pipe_config->base.adjusted_mode; | 46 | const struct drm_display_mode *adjusted_mode = &pipe_config->base.adjusted_mode; |
47 | int mst_pbn; | 47 | int mst_pbn; |
48 | bool constant_n = drm_dp_has_quirk(&intel_dp->desc, | 48 | bool constant_n = drm_dp_has_quirk(&intel_dp->desc, |
@@ -70,17 +70,23 @@ static bool intel_dp_mst_compute_config(struct intel_encoder *encoder, | |||
70 | 70 | ||
71 | pipe_config->port_clock = intel_dp_max_link_rate(intel_dp); | 71 | pipe_config->port_clock = intel_dp_max_link_rate(intel_dp); |
72 | 72 | ||
73 | if (drm_dp_mst_port_has_audio(&intel_dp->mst_mgr, connector->port)) | 73 | if (drm_dp_mst_port_has_audio(&intel_dp->mst_mgr, port)) |
74 | pipe_config->has_audio = true; | 74 | pipe_config->has_audio = true; |
75 | 75 | ||
76 | mst_pbn = drm_dp_calc_pbn_mode(adjusted_mode->crtc_clock, bpp); | 76 | mst_pbn = drm_dp_calc_pbn_mode(adjusted_mode->crtc_clock, bpp); |
77 | pipe_config->pbn = mst_pbn; | 77 | pipe_config->pbn = mst_pbn; |
78 | 78 | ||
79 | slots = drm_dp_atomic_find_vcpi_slots(state, &intel_dp->mst_mgr, | 79 | /* Zombie connectors can't have VCPI slots */ |
80 | connector->port, mst_pbn); | 80 | if (READ_ONCE(connector->registered)) { |
81 | if (slots < 0) { | 81 | slots = drm_dp_atomic_find_vcpi_slots(state, |
82 | DRM_DEBUG_KMS("failed finding vcpi slots:%d\n", slots); | 82 | &intel_dp->mst_mgr, |
83 | return false; | 83 | port, |
84 | mst_pbn); | ||
85 | if (slots < 0) { | ||
86 | DRM_DEBUG_KMS("failed finding vcpi slots:%d\n", | ||
87 | slots); | ||
88 | return false; | ||
89 | } | ||
84 | } | 90 | } |
85 | 91 | ||
86 | intel_link_compute_m_n(bpp, lane_count, | 92 | intel_link_compute_m_n(bpp, lane_count, |