aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/i915/intel_display.c38
1 files changed, 24 insertions, 14 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index ca3e7116438c..f900e30e8d7a 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -16985,7 +16985,8 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
16985 dev_priv->active_crtcs = 0; 16985 dev_priv->active_crtcs = 0;
16986 16986
16987 for_each_intel_crtc(dev, crtc) { 16987 for_each_intel_crtc(dev, crtc) {
16988 struct intel_crtc_state *crtc_state = crtc->config; 16988 struct intel_crtc_state *crtc_state =
16989 to_intel_crtc_state(crtc->base.state);
16989 16990
16990 __drm_atomic_helper_crtc_destroy_state(&crtc_state->base); 16991 __drm_atomic_helper_crtc_destroy_state(&crtc_state->base);
16991 memset(crtc_state, 0, sizeof(*crtc_state)); 16992 memset(crtc_state, 0, sizeof(*crtc_state));
@@ -17004,7 +17005,7 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
17004 17005
17005 DRM_DEBUG_KMS("[CRTC:%d:%s] hw state readout: %s\n", 17006 DRM_DEBUG_KMS("[CRTC:%d:%s] hw state readout: %s\n",
17006 crtc->base.base.id, crtc->base.name, 17007 crtc->base.base.id, crtc->base.name,
17007 enableddisabled(crtc->active)); 17008 enableddisabled(crtc_state->base.active));
17008 } 17009 }
17009 17010
17010 for (i = 0; i < dev_priv->num_shared_dpll; i++) { 17011 for (i = 0; i < dev_priv->num_shared_dpll; i++) {
@@ -17014,7 +17015,11 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
17014 &pll->state.hw_state); 17015 &pll->state.hw_state);
17015 pll->state.crtc_mask = 0; 17016 pll->state.crtc_mask = 0;
17016 for_each_intel_crtc(dev, crtc) { 17017 for_each_intel_crtc(dev, crtc) {
17017 if (crtc->active && crtc->config->shared_dpll == pll) 17018 struct intel_crtc_state *crtc_state =
17019 to_intel_crtc_state(crtc->base.state);
17020
17021 if (crtc_state->base.active &&
17022 crtc_state->shared_dpll == pll)
17018 pll->state.crtc_mask |= 1 << crtc->pipe; 17023 pll->state.crtc_mask |= 1 << crtc->pipe;
17019 } 17024 }
17020 pll->active_mask = pll->state.crtc_mask; 17025 pll->active_mask = pll->state.crtc_mask;
@@ -17027,11 +17032,14 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
17027 pipe = 0; 17032 pipe = 0;
17028 17033
17029 if (encoder->get_hw_state(encoder, &pipe)) { 17034 if (encoder->get_hw_state(encoder, &pipe)) {
17035 struct intel_crtc_state *crtc_state;
17036
17030 crtc = intel_get_crtc_for_pipe(dev_priv, pipe); 17037 crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
17038 crtc_state = to_intel_crtc_state(crtc->base.state);
17031 17039
17032 encoder->base.crtc = &crtc->base; 17040 encoder->base.crtc = &crtc->base;
17033 crtc->config->output_types |= 1 << encoder->type; 17041 crtc_state->output_types |= 1 << encoder->type;
17034 encoder->get_config(encoder, crtc->config); 17042 encoder->get_config(encoder, crtc_state);
17035 } else { 17043 } else {
17036 encoder->base.crtc = NULL; 17044 encoder->base.crtc = NULL;
17037 } 17045 }
@@ -17072,14 +17080,16 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
17072 } 17080 }
17073 17081
17074 for_each_intel_crtc(dev, crtc) { 17082 for_each_intel_crtc(dev, crtc) {
17083 struct intel_crtc_state *crtc_state =
17084 to_intel_crtc_state(crtc->base.state);
17075 int pixclk = 0; 17085 int pixclk = 0;
17076 17086
17077 crtc->base.hwmode = crtc->config->base.adjusted_mode; 17087 crtc->base.hwmode = crtc_state->base.adjusted_mode;
17078 17088
17079 memset(&crtc->base.mode, 0, sizeof(crtc->base.mode)); 17089 memset(&crtc->base.mode, 0, sizeof(crtc->base.mode));
17080 if (crtc->base.state->active) { 17090 if (crtc_state->base.active) {
17081 intel_mode_from_pipe_config(&crtc->base.mode, crtc->config); 17091 intel_mode_from_pipe_config(&crtc->base.mode, crtc_state);
17082 intel_mode_from_pipe_config(&crtc->base.state->adjusted_mode, crtc->config); 17092 intel_mode_from_pipe_config(&crtc_state->base.adjusted_mode, crtc_state);
17083 WARN_ON(drm_atomic_set_mode_for_crtc(crtc->base.state, &crtc->base.mode)); 17093 WARN_ON(drm_atomic_set_mode_for_crtc(crtc->base.state, &crtc->base.mode));
17084 17094
17085 /* 17095 /*
@@ -17091,17 +17101,17 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
17091 * set a flag to indicate that a full recalculation is 17101 * set a flag to indicate that a full recalculation is
17092 * needed on the next commit. 17102 * needed on the next commit.
17093 */ 17103 */
17094 crtc->base.state->mode.private_flags = I915_MODE_FLAG_INHERITED; 17104 crtc_state->base.mode.private_flags = I915_MODE_FLAG_INHERITED;
17095 17105
17096 if (INTEL_GEN(dev_priv) >= 9 || IS_BROADWELL(dev_priv)) 17106 if (INTEL_GEN(dev_priv) >= 9 || IS_BROADWELL(dev_priv))
17097 pixclk = ilk_pipe_pixel_rate(crtc->config); 17107 pixclk = ilk_pipe_pixel_rate(crtc_state);
17098 else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) 17108 else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
17099 pixclk = crtc->config->base.adjusted_mode.crtc_clock; 17109 pixclk = crtc_state->base.adjusted_mode.crtc_clock;
17100 else 17110 else
17101 WARN_ON(dev_priv->display.modeset_calc_cdclk); 17111 WARN_ON(dev_priv->display.modeset_calc_cdclk);
17102 17112
17103 /* pixel rate mustn't exceed 95% of cdclk with IPS on BDW */ 17113 /* pixel rate mustn't exceed 95% of cdclk with IPS on BDW */
17104 if (IS_BROADWELL(dev_priv) && crtc->config->ips_enabled) 17114 if (IS_BROADWELL(dev_priv) && crtc_state->ips_enabled)
17105 pixclk = DIV_ROUND_UP(pixclk * 100, 95); 17115 pixclk = DIV_ROUND_UP(pixclk * 100, 95);
17106 17116
17107 drm_calc_timestamping_constants(&crtc->base, &crtc->base.hwmode); 17117 drm_calc_timestamping_constants(&crtc->base, &crtc->base.hwmode);
@@ -17110,7 +17120,7 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
17110 17120
17111 dev_priv->min_pixclk[crtc->pipe] = pixclk; 17121 dev_priv->min_pixclk[crtc->pipe] = pixclk;
17112 17122
17113 intel_pipe_config_sanity_check(dev_priv, crtc->config); 17123 intel_pipe_config_sanity_check(dev_priv, crtc_state);
17114 } 17124 }
17115} 17125}
17116 17126