aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulo Zanoni <paulo.r.zanoni@intel.com>2016-10-04 13:37:32 -0400
committerJani Nikula <jani.nikula@intel.com>2016-10-28 08:18:32 -0400
commit01c72d6c17dc524f04d4dbe361d214e423b35457 (patch)
treeda29e75292b9c80bc82be1e61f1b4dbdde49d168
parent7a0e17bd5d5a20784431df24601bfafec9d8ec61 (diff)
drm/i915/gen9: fix DDB partitioning for multi-screen cases
With the previous code we were only recomputing the DDB partitioning for the CRTCs included in the atomic commit, so any other active CRTCs would end up having their DDB registers zeroed. In this patch we make sure that the computed state starts as a copy of the current partitioning, and then we only zero the DDBs that we're actually going to recompute. How to reproduce the bug: 1 - Enable the primary plane on pipe A 2 - Enable the primary plane on pipe B 3 - Enable the cursor or sprite plane on pipe A Step 3 will zero the DDB partitioning for pipe B since it's not included in the commit that enabled the cursor or sprite for pipe A. I expect this to fix many FIFO underrun problems on gen9+. v2: - Mention the cursor on the steps to reproduce the problem (Paulo). - Add Testcase tag provided by Maarten (Maarten). Testcase: kms_cursor_legacy.cursorA-vs-flipB-atomic-transitions Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96226 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96828 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97450 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97596 Bugzilla: https://www.phoronix.com/scan.php?page=news_item&px=Intel-Skylake-Multi-Screen-Woes Cc: stable@vger.kernel.org Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Reviewed-by: Lyude <cpaul@redhat.com> Link: http://patchwork.freedesktop.org/patch/msgid/1475602652-17326-1-git-send-email-paulo.r.zanoni@intel.com (cherry picked from commit 5a920b85f2c6e3fd7d9dd9bb3f3345e9085e2360) Signed-off-by: Jani Nikula <jani.nikula@intel.com>
-rw-r--r--drivers/gpu/drm/i915/intel_pm.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index a2f751cd187a..1a11ab87ec5d 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -3362,13 +3362,15 @@ skl_allocate_pipe_ddb(struct intel_crtc_state *cstate,
3362 int num_active; 3362 int num_active;
3363 int id, i; 3363 int id, i;
3364 3364
3365 /* Clear the partitioning for disabled planes. */
3366 memset(ddb->plane[pipe], 0, sizeof(ddb->plane[pipe]));
3367 memset(ddb->y_plane[pipe], 0, sizeof(ddb->y_plane[pipe]));
3368
3365 if (WARN_ON(!state)) 3369 if (WARN_ON(!state))
3366 return 0; 3370 return 0;
3367 3371
3368 if (!cstate->base.active) { 3372 if (!cstate->base.active) {
3369 ddb->pipe[pipe].start = ddb->pipe[pipe].end = 0; 3373 ddb->pipe[pipe].start = ddb->pipe[pipe].end = 0;
3370 memset(ddb->plane[pipe], 0, sizeof(ddb->plane[pipe]));
3371 memset(ddb->y_plane[pipe], 0, sizeof(ddb->y_plane[pipe]));
3372 return 0; 3374 return 0;
3373 } 3375 }
3374 3376
@@ -4050,6 +4052,12 @@ skl_compute_ddb(struct drm_atomic_state *state)
4050 intel_state->wm_results.dirty_pipes = ~0; 4052 intel_state->wm_results.dirty_pipes = ~0;
4051 } 4053 }
4052 4054
4055 /*
4056 * We're not recomputing for the pipes not included in the commit, so
4057 * make sure we start with the current state.
4058 */
4059 memcpy(ddb, &dev_priv->wm.skl_hw.ddb, sizeof(*ddb));
4060
4053 for_each_intel_crtc_mask(dev, intel_crtc, realloc_pipes) { 4061 for_each_intel_crtc_mask(dev, intel_crtc, realloc_pipes) {
4054 struct intel_crtc_state *cstate; 4062 struct intel_crtc_state *cstate;
4055 4063