Commit 50d091b6 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'topic/mst-fixes-2015-08-04' of git://anongit.freedesktop.org/drm-intel

Pull drm mst fixes from Daniel Vetter:
 "Special pull request for mst fixes since most of the patches touch
  code outside of i915 proper.  DRM parts have also been reviewed by
  Thierry (nvidia) since Dave's enjoying vacations"

* tag 'topic/mst-fixes-2015-08-04' of git://anongit.freedesktop.org/drm-intel:
  drm/atomic-helpers: Make encoder picking more robust
  drm/dp-mst: Remove debug WARN_ON
  drm/i915: Fixup dp mst encoder selection
  drm/atomic-helper: Add an atomice best_encoder callback
parents 1ddc6dd8 6ea76f3c
......@@ -196,6 +196,11 @@ update_connector_routing(struct drm_atomic_state *state, int conn_idx)
}
funcs = connector->helper_private;
if (funcs->atomic_best_encoder)
new_encoder = funcs->atomic_best_encoder(connector,
connector_state);
else
new_encoder = funcs->best_encoder(connector);
if (!new_encoder) {
......@@ -229,13 +234,14 @@ update_connector_routing(struct drm_atomic_state *state, int conn_idx)
}
}
if (WARN_ON(!connector_state->crtc))
return -EINVAL;
connector_state->best_encoder = new_encoder;
if (connector_state->crtc) {
idx = drm_crtc_index(connector_state->crtc);
crtc_state = state->crtc_states[idx];
crtc_state->mode_changed = true;
}
DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] using [ENCODER:%d:%s] on [CRTC:%d]\n",
connector->base.id,
......
......@@ -1294,7 +1294,6 @@ static int drm_dp_send_sideband_msg(struct drm_dp_mst_topology_mgr *mgr,
goto retry;
}
DRM_DEBUG_KMS("failed to dpcd write %d %d\n", tosend, ret);
WARN(1, "fail\n");
return -EIO;
}
......
......@@ -357,6 +357,16 @@ intel_dp_mst_mode_valid(struct drm_connector *connector,
return MODE_OK;
}
static struct drm_encoder *intel_mst_atomic_best_encoder(struct drm_connector *connector,
struct drm_connector_state *state)
{
struct intel_connector *intel_connector = to_intel_connector(connector);
struct intel_dp *intel_dp = intel_connector->mst_port;
struct intel_crtc *crtc = to_intel_crtc(state->crtc);
return &intel_dp->mst_encoders[crtc->pipe]->base.base;
}
static struct drm_encoder *intel_mst_best_encoder(struct drm_connector *connector)
{
struct intel_connector *intel_connector = to_intel_connector(connector);
......@@ -367,6 +377,7 @@ static struct drm_encoder *intel_mst_best_encoder(struct drm_connector *connecto
static const struct drm_connector_helper_funcs intel_dp_mst_connector_helper_funcs = {
.get_modes = intel_dp_mst_get_modes,
.mode_valid = intel_dp_mst_mode_valid,
.atomic_best_encoder = intel_mst_atomic_best_encoder,
.best_encoder = intel_mst_best_encoder,
};
......
......@@ -168,6 +168,7 @@ struct drm_encoder_helper_funcs {
* @get_modes: get mode list for this connector
* @mode_valid: is this mode valid on the given connector? (optional)
* @best_encoder: return the preferred encoder for this connector
* @atomic_best_encoder: atomic version of @best_encoder
*
* The helper operations are called by the mid-layer CRTC helper.
*/
......@@ -176,6 +177,8 @@ struct drm_connector_helper_funcs {
enum drm_mode_status (*mode_valid)(struct drm_connector *connector,
struct drm_display_mode *mode);
struct drm_encoder *(*best_encoder)(struct drm_connector *connector);
struct drm_encoder *(*atomic_best_encoder)(struct drm_connector *connector,
struct drm_connector_state *connector_state);
};
extern void drm_helper_disable_unused_functions(struct drm_device *dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment