Skip to content

Commit

Permalink
drm/i915: Always recompute watermarks when distrust_bios_wm is set, v2.
Browse files Browse the repository at this point in the history
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: Maarten Lankhorst <[email protected]>
Inspired-by: Mahesh Kumar <[email protected]>
Signed-off-by: Maarten Lankhorst <[email protected]>
Fixes: 98d3949 ("drm/i915/gen9: Compute DDB allocation at atomic
check time (v4)")
Cc: <[email protected]> # v4.8+
Cc: Mahesh Kumar <[email protected]>
Cc: Matt Roper <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Mahesh Kumar <[email protected]>
Reviewed-by: Matt Roper <[email protected]>
  • Loading branch information
mlankhorst committed Jun 1, 2017
1 parent adfdf85 commit 367d73d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/gpu/drm/i915/intel_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -4819,10 +4819,18 @@ skl_compute_wm(struct drm_atomic_state *state)
struct drm_crtc_state *cstate;
struct intel_atomic_state *intel_state = to_intel_atomic_state(state);
struct skl_wm_values *results = &intel_state->wm_results;
struct drm_device *dev = state->dev;
struct skl_pipe_wm *pipe_wm;
bool changed = false;
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
* bother with watermark calculation. Note that if we pass this
Expand All @@ -4833,6 +4841,7 @@ skl_compute_wm(struct drm_atomic_state *state)
*/
for_each_new_crtc_in_state(state, crtc, cstate, i)
changed = true;

if (!changed)
return 0;

Expand Down

0 comments on commit 367d73d

Please sign in to comment.