Commit 2f08b23d authored by Mahesh Kumar's avatar Mahesh Kumar Committed by Jani Nikula

drm/i915/icl: fix icl_unmap/map_plls_to_ports

All connectors may not have best_encoder attached, so don't dereference
encoder pointer for each connector.

Fixes: c27e917e ("drm/i915/icl: add basic support for the ICL clocks")
Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: default avatarMahesh Kumar <mahesh1.kumar@intel.com>
Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180525155238.7054-1-lucas.demarchi@intel.com
(cherry picked from commit c46ef57d)
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 47541443
...@@ -2453,12 +2453,13 @@ void icl_map_plls_to_ports(struct drm_crtc *crtc, ...@@ -2453,12 +2453,13 @@ void icl_map_plls_to_ports(struct drm_crtc *crtc,
for_each_new_connector_in_state(old_state, conn, conn_state, i) { for_each_new_connector_in_state(old_state, conn, conn_state, i) {
struct intel_encoder *encoder = struct intel_encoder *encoder =
to_intel_encoder(conn_state->best_encoder); to_intel_encoder(conn_state->best_encoder);
enum port port = encoder->port; enum port port;
uint32_t val; uint32_t val;
if (conn_state->crtc != crtc) if (conn_state->crtc != crtc)
continue; continue;
port = encoder->port;
mutex_lock(&dev_priv->dpll_lock); mutex_lock(&dev_priv->dpll_lock);
val = I915_READ(DPCLKA_CFGCR0_ICL); val = I915_READ(DPCLKA_CFGCR0_ICL);
...@@ -2490,11 +2491,12 @@ void icl_unmap_plls_to_ports(struct drm_crtc *crtc, ...@@ -2490,11 +2491,12 @@ void icl_unmap_plls_to_ports(struct drm_crtc *crtc,
for_each_old_connector_in_state(old_state, conn, old_conn_state, i) { for_each_old_connector_in_state(old_state, conn, old_conn_state, i) {
struct intel_encoder *encoder = struct intel_encoder *encoder =
to_intel_encoder(old_conn_state->best_encoder); to_intel_encoder(old_conn_state->best_encoder);
enum port port = encoder->port; enum port port;
if (old_conn_state->crtc != crtc) if (old_conn_state->crtc != crtc)
continue; continue;
port = encoder->port;
mutex_lock(&dev_priv->dpll_lock); mutex_lock(&dev_priv->dpll_lock);
I915_WRITE(DPCLKA_CFGCR0_ICL, I915_WRITE(DPCLKA_CFGCR0_ICL,
I915_READ(DPCLKA_CFGCR0_ICL) | I915_READ(DPCLKA_CFGCR0_ICL) |
......
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