Commit 4e3aed84 authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Jani Nikula

drm/i915: Always recompute watermarks when distrust_bios_wm is set, v2.

On some systems there can be a race condition in which no crtc state is
added to the first atomic commit. This results in all crtc's having a
null DDB allocation, causing a FIFO underrun on any update until the
first modeset.

Changes since v1:
- Do not take the connection_mutex, this is already done below.
Reported-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Inspired-by: default avatarMahesh Kumar <mahesh1.kumar@intel.com>
Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Fixes: 98d39494 ("drm/i915/gen9: Compute DDB allocation at atomic
check time (v4)")
Cc: <stable@vger.kernel.org> # v4.8+
Cc: Mahesh Kumar <mahesh1.kumar@intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170531154236.27180-1-maarten.lankhorst@linux.intel.comReviewed-by: default avatarMahesh Kumar <mahesh1.kumar@intel.com>
Reviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>

(cherry picked from commit 367d73d2)
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 6ab92afc
...@@ -4335,10 +4335,18 @@ skl_compute_wm(struct drm_atomic_state *state) ...@@ -4335,10 +4335,18 @@ skl_compute_wm(struct drm_atomic_state *state)
struct drm_crtc_state *cstate; struct drm_crtc_state *cstate;
struct intel_atomic_state *intel_state = to_intel_atomic_state(state); struct intel_atomic_state *intel_state = to_intel_atomic_state(state);
struct skl_wm_values *results = &intel_state->wm_results; struct skl_wm_values *results = &intel_state->wm_results;
struct drm_device *dev = state->dev;
struct skl_pipe_wm *pipe_wm; struct skl_pipe_wm *pipe_wm;
bool changed = false; bool changed = false;
int ret, i; int ret, i;
/*
* When we distrust bios wm we always need to recompute to set the
* expected DDB allocations for each CRTC.
*/
if (to_i915(dev)->wm.distrust_bios_wm)
changed = true;
/* /*
* If this transaction isn't actually touching any CRTC's, don't * If this transaction isn't actually touching any CRTC's, don't
* bother with watermark calculation. Note that if we pass this * bother with watermark calculation. Note that if we pass this
...@@ -4349,6 +4357,7 @@ skl_compute_wm(struct drm_atomic_state *state) ...@@ -4349,6 +4357,7 @@ skl_compute_wm(struct drm_atomic_state *state)
*/ */
for_each_new_crtc_in_state(state, crtc, cstate, i) for_each_new_crtc_in_state(state, crtc, cstate, i)
changed = true; changed = true;
if (!changed) if (!changed)
return 0; return 0;
......
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