diff options
| -rw-r--r-- | drivers/gpu/drm/i915/intel_pm.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index 496a911e5668..70dcf8d35568 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c | |||
| @@ -4109,6 +4109,24 @@ skl_compute_ddb(struct drm_atomic_state *state) | |||
| 4109 | return 0; | 4109 | return 0; |
| 4110 | } | 4110 | } |
| 4111 | 4111 | ||
| 4112 | static void | ||
| 4113 | skl_copy_wm_for_pipe(struct skl_wm_values *dst, | ||
| 4114 | struct skl_wm_values *src, | ||
| 4115 | enum pipe pipe) | ||
| 4116 | { | ||
| 4117 | dst->wm_linetime[pipe] = src->wm_linetime[pipe]; | ||
| 4118 | memcpy(dst->plane[pipe], src->plane[pipe], | ||
| 4119 | sizeof(dst->plane[pipe])); | ||
| 4120 | memcpy(dst->plane_trans[pipe], src->plane_trans[pipe], | ||
| 4121 | sizeof(dst->plane_trans[pipe])); | ||
| 4122 | |||
| 4123 | dst->ddb.pipe[pipe] = src->ddb.pipe[pipe]; | ||
| 4124 | memcpy(dst->ddb.y_plane[pipe], src->ddb.y_plane[pipe], | ||
| 4125 | sizeof(dst->ddb.y_plane[pipe])); | ||
| 4126 | memcpy(dst->ddb.plane[pipe], src->ddb.plane[pipe], | ||
| 4127 | sizeof(dst->ddb.plane[pipe])); | ||
| 4128 | } | ||
| 4129 | |||
| 4112 | static int | 4130 | static int |
| 4113 | skl_compute_wm(struct drm_atomic_state *state) | 4131 | skl_compute_wm(struct drm_atomic_state *state) |
| 4114 | { | 4132 | { |
| @@ -4181,8 +4199,10 @@ static void skl_update_wm(struct drm_crtc *crtc) | |||
| 4181 | struct drm_device *dev = crtc->dev; | 4199 | struct drm_device *dev = crtc->dev; |
| 4182 | struct drm_i915_private *dev_priv = to_i915(dev); | 4200 | struct drm_i915_private *dev_priv = to_i915(dev); |
| 4183 | struct skl_wm_values *results = &dev_priv->wm.skl_results; | 4201 | struct skl_wm_values *results = &dev_priv->wm.skl_results; |
| 4202 | struct skl_wm_values *hw_vals = &dev_priv->wm.skl_hw; | ||
| 4184 | struct intel_crtc_state *cstate = to_intel_crtc_state(crtc->state); | 4203 | struct intel_crtc_state *cstate = to_intel_crtc_state(crtc->state); |
| 4185 | struct skl_pipe_wm *pipe_wm = &cstate->wm.skl.optimal; | 4204 | struct skl_pipe_wm *pipe_wm = &cstate->wm.skl.optimal; |
| 4205 | int pipe; | ||
| 4186 | 4206 | ||
| 4187 | if ((results->dirty_pipes & drm_crtc_mask(crtc)) == 0) | 4207 | if ((results->dirty_pipes & drm_crtc_mask(crtc)) == 0) |
| 4188 | return; | 4208 | return; |
| @@ -4194,8 +4214,12 @@ static void skl_update_wm(struct drm_crtc *crtc) | |||
| 4194 | skl_write_wm_values(dev_priv, results); | 4214 | skl_write_wm_values(dev_priv, results); |
| 4195 | skl_flush_wm_values(dev_priv, results); | 4215 | skl_flush_wm_values(dev_priv, results); |
| 4196 | 4216 | ||
| 4197 | /* store the new configuration */ | 4217 | /* |
| 4198 | dev_priv->wm.skl_hw = *results; | 4218 | * Store the new configuration (but only for the pipes that have |
| 4219 | * changed; the other values weren't recomputed). | ||
| 4220 | */ | ||
| 4221 | for_each_pipe_masked(dev_priv, pipe, results->dirty_pipes) | ||
| 4222 | skl_copy_wm_for_pipe(hw_vals, results, pipe); | ||
| 4199 | 4223 | ||
| 4200 | mutex_unlock(&dev_priv->wm.wm_mutex); | 4224 | mutex_unlock(&dev_priv->wm.wm_mutex); |
| 4201 | } | 4225 | } |
