|
@@ -5111,6 +5111,8 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state)
|
|
|
struct drm_plane_state *old_pri_state =
|
|
|
drm_atomic_get_existing_plane_state(old_state, primary);
|
|
|
bool modeset = needs_modeset(&pipe_config->base);
|
|
|
+ struct intel_atomic_state *old_intel_state =
|
|
|
+ to_intel_atomic_state(old_state);
|
|
|
|
|
|
if (old_pri_state) {
|
|
|
struct intel_plane_state *primary_state =
|
|
@@ -5178,7 +5180,8 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state)
|
|
|
* us to.
|
|
|
*/
|
|
|
if (dev_priv->display.initial_watermarks != NULL)
|
|
|
- dev_priv->display.initial_watermarks(pipe_config);
|
|
|
+ dev_priv->display.initial_watermarks(old_intel_state,
|
|
|
+ pipe_config);
|
|
|
else if (pipe_config->update_wm_pre)
|
|
|
intel_update_watermarks(crtc);
|
|
|
}
|
|
@@ -5334,6 +5337,8 @@ static void ironlake_crtc_enable(struct intel_crtc_state *pipe_config,
|
|
|
struct drm_i915_private *dev_priv = to_i915(dev);
|
|
|
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
|
|
|
int pipe = intel_crtc->pipe;
|
|
|
+ struct intel_atomic_state *old_intel_state =
|
|
|
+ to_intel_atomic_state(old_state);
|
|
|
|
|
|
if (WARN_ON(intel_crtc->active))
|
|
|
return;
|
|
@@ -5392,7 +5397,7 @@ static void ironlake_crtc_enable(struct intel_crtc_state *pipe_config,
|
|
|
intel_color_load_luts(&pipe_config->base);
|
|
|
|
|
|
if (dev_priv->display.initial_watermarks != NULL)
|
|
|
- dev_priv->display.initial_watermarks(intel_crtc->config);
|
|
|
+ dev_priv->display.initial_watermarks(old_intel_state, intel_crtc->config);
|
|
|
intel_enable_pipe(intel_crtc);
|
|
|
|
|
|
if (intel_crtc->config->has_pch_encoder)
|
|
@@ -5428,6 +5433,8 @@ static void haswell_crtc_enable(struct intel_crtc_state *pipe_config,
|
|
|
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
|
|
|
int pipe = intel_crtc->pipe, hsw_workaround_pipe;
|
|
|
enum transcoder cpu_transcoder = intel_crtc->config->cpu_transcoder;
|
|
|
+ struct intel_atomic_state *old_intel_state =
|
|
|
+ to_intel_atomic_state(old_state);
|
|
|
|
|
|
if (WARN_ON(intel_crtc->active))
|
|
|
return;
|
|
@@ -5498,7 +5505,8 @@ static void haswell_crtc_enable(struct intel_crtc_state *pipe_config,
|
|
|
intel_ddi_enable_transcoder_func(crtc);
|
|
|
|
|
|
if (dev_priv->display.initial_watermarks != NULL)
|
|
|
- dev_priv->display.initial_watermarks(pipe_config);
|
|
|
+ dev_priv->display.initial_watermarks(old_intel_state,
|
|
|
+ pipe_config);
|
|
|
else
|
|
|
intel_update_watermarks(intel_crtc);
|
|
|
|
|
@@ -14484,7 +14492,8 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)
|
|
|
intel_cstate = to_intel_crtc_state(crtc->state);
|
|
|
|
|
|
if (dev_priv->display.optimize_watermarks)
|
|
|
- dev_priv->display.optimize_watermarks(intel_cstate);
|
|
|
+ dev_priv->display.optimize_watermarks(intel_state,
|
|
|
+ intel_cstate);
|
|
|
}
|
|
|
|
|
|
for_each_crtc_in_state(state, crtc, old_crtc_state, i) {
|
|
@@ -14927,10 +14936,11 @@ static void intel_begin_crtc_commit(struct drm_crtc *crtc,
|
|
|
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
|
|
|
struct intel_crtc_state *intel_cstate =
|
|
|
to_intel_crtc_state(crtc->state);
|
|
|
- struct intel_crtc_state *old_intel_state =
|
|
|
+ struct intel_crtc_state *old_intel_cstate =
|
|
|
to_intel_crtc_state(old_crtc_state);
|
|
|
+ struct intel_atomic_state *old_intel_state =
|
|
|
+ to_intel_atomic_state(old_crtc_state->state);
|
|
|
bool modeset = needs_modeset(crtc->state);
|
|
|
- enum pipe pipe = intel_crtc->pipe;
|
|
|
|
|
|
/* Perform vblank evasion around commit operation */
|
|
|
intel_pipe_update_start(intel_crtc);
|
|
@@ -14943,14 +14953,14 @@ static void intel_begin_crtc_commit(struct drm_crtc *crtc,
|
|
|
intel_color_load_luts(crtc->state);
|
|
|
}
|
|
|
|
|
|
- if (intel_cstate->update_pipe) {
|
|
|
- intel_update_pipe_config(intel_crtc, old_intel_state);
|
|
|
- } else if (INTEL_GEN(dev_priv) >= 9) {
|
|
|
+ if (intel_cstate->update_pipe)
|
|
|
+ intel_update_pipe_config(intel_crtc, old_intel_cstate);
|
|
|
+ else if (INTEL_GEN(dev_priv) >= 9)
|
|
|
skl_detach_scalers(intel_crtc);
|
|
|
|
|
|
- I915_WRITE(PIPE_WM_LINETIME(pipe),
|
|
|
- intel_cstate->wm.skl.optimal.linetime);
|
|
|
- }
|
|
|
+ if (dev_priv->display.atomic_update_watermarks)
|
|
|
+ dev_priv->display.atomic_update_watermarks(old_intel_state,
|
|
|
+ intel_cstate);
|
|
|
}
|
|
|
|
|
|
static void intel_finish_crtc_commit(struct drm_crtc *crtc,
|
|
@@ -16373,6 +16383,7 @@ static void sanitize_watermarks(struct drm_device *dev)
|
|
|
{
|
|
|
struct drm_i915_private *dev_priv = to_i915(dev);
|
|
|
struct drm_atomic_state *state;
|
|
|
+ struct intel_atomic_state *intel_state;
|
|
|
struct drm_crtc *crtc;
|
|
|
struct drm_crtc_state *cstate;
|
|
|
struct drm_modeset_acquire_ctx ctx;
|
|
@@ -16401,12 +16412,14 @@ retry:
|
|
|
if (WARN_ON(IS_ERR(state)))
|
|
|
goto fail;
|
|
|
|
|
|
+ intel_state = to_intel_atomic_state(state);
|
|
|
+
|
|
|
/*
|
|
|
* Hardware readout is the only time we don't want to calculate
|
|
|
* intermediate watermarks (since we don't trust the current
|
|
|
* watermarks).
|
|
|
*/
|
|
|
- to_intel_atomic_state(state)->skip_intermediate_wm = true;
|
|
|
+ intel_state->skip_intermediate_wm = true;
|
|
|
|
|
|
ret = intel_atomic_check(dev, state);
|
|
|
if (ret) {
|
|
@@ -16430,7 +16443,7 @@ retry:
|
|
|
struct intel_crtc_state *cs = to_intel_crtc_state(cstate);
|
|
|
|
|
|
cs->wm.need_postvbl_update = true;
|
|
|
- dev_priv->display.optimize_watermarks(cs);
|
|
|
+ dev_priv->display.optimize_watermarks(intel_state, cs);
|
|
|
}
|
|
|
|
|
|
put_state:
|