From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mblankhorst.nl ([141.105.120.124]:34786 "EHLO mblankhorst.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751082AbdEaPml (ORCPT ); Wed, 31 May 2017 11:42:41 -0400 From: Maarten Lankhorst To: intel-gfx@lists.freedesktop.org Cc: Maarten Lankhorst , "# v4 . 8+" , Mahesh Kumar , Matt Roper Subject: [PATCH] drm/i915: Always recompute watermarks when distrust_bios_wm is set, v2. Date: Wed, 31 May 2017 17:42:36 +0200 Message-Id: <20170531154236.27180-1-maarten.lankhorst@linux.intel.com> In-Reply-To: <20170531075646.15158-1-maarten.lankhorst@linux.intel.com> References: <20170531075646.15158-1-maarten.lankhorst@linux.intel.com> Sender: stable-owner@vger.kernel.org List-ID: 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 Inspired-by: Mahesh Kumar Signed-off-by: Maarten Lankhorst Fixes: 98d39494d375 ("drm/i915/gen9: Compute DDB allocation at atomic check time (v4)") Cc: # v4.8+ Cc: Mahesh Kumar Cc: Matt Roper --- drivers/gpu/drm/i915/intel_pm.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index 936eef1634c7..fce4bc5ccc99 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c @@ -4819,11 +4819,19 @@ 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 * test, we're guaranteed to hold at least one CRTC state mutex, @@ -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; -- 2.11.0