lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1468945856-23126-3-git-send-email-cpaul@redhat.com>
Date:	Tue, 19 Jul 2016 12:30:56 -0400
From:	Lyude <cpaul@...hat.com>
To:	intel-gfx@...ts.freedesktop.org
Cc:	Lyude <cpaul@...hat.com>, stable@...r.kernel.org,
	Ville Syrjälä 
	<ville.syrjala@...ux.intel.com>,
	Daniel Vetter <daniel.vetter@...el.com>,
	Radhakrishna Sripada <radhakrishna.sripada@...el.com>,
	Hans de Goede <hdegoede@...hat.com>,
	Matt Roper <matthew.d.roper@...el.com>,
	Jani Nikula <jani.nikula@...ux.intel.com>,
	David Airlie <airlied@...ux.ie>,
	dri-devel@...ts.freedesktop.org (open list:INTEL DRM DRIVERS (excluding
	Poulsbo, Moorestow...), linux-kernel@...r.kernel.org (open list))
Subject: [PATCH 2/2] drm/i915/skl: Don't mark pipes as dirty unless we've added/removed pipes

Now that we update the watermark values atomically, we still need to fix
the case of how we update watermarks when we haven't added or removed
pipes.

When we haven't added or removed any pipes, we don't need to worry about
the ddb allocation changing. As such there's no order of flushing pipes
we have to guarantee; e.g. each pipe can be flushed at the earliest
given oppurtunity. This means all we have to do is:

 - Calculate the new wm values
 - Update each plane's settings and wm values
 - Arm the plane's registers to update at the next vblank

Right now the watermark code takes an additional few steps:
 - Rewrite the ddb allocations
 - Arm all of the planes for another update at the start of the next
   vblank
 - *Potentially underrun later if we update the wm registers before the
   start of the next vblank*

This patch prevents us from marking pipes as dirty unless the number of
pipes, and with that the ddb allocation, has actually changed. This
results in us skipping the additional steps, preventing the hardware
from using any intermediate values during each wm update.

This also fixes cursors causing monitors to flicker on Skylake. Finally.

Signed-off-by: Lyude Paul <cpaul@...hat.com>
Cc: stable@...r.kernel.org
Cc: Ville Syrjälä <ville.syrjala@...ux.intel.com>
Cc: Daniel Vetter <daniel.vetter@...el.com>
Cc: Radhakrishna Sripada <radhakrishna.sripada@...el.com>
Cc: Hans de Goede <hdegoede@...hat.com>
Cc: Matt Roper <matthew.d.roper@...el.com>
---
 drivers/gpu/drm/i915/intel_pm.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 3a7709c..92158e3 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -4086,12 +4086,18 @@ skl_compute_wm(struct drm_atomic_state *state)
 		if (ret)
 			return ret;
 
-		if (changed)
-			results->dirty_pipes |= drm_crtc_mask(crtc);
+		/*
+		 * We don't need to do any additional setup for the pipes if we
+		 * haven't changed the number of active crtcs
+		 */
+		if (intel_state->active_pipe_changes) {
+			if (changed)
+				results->dirty_pipes |= drm_crtc_mask(crtc);
 
-		if ((results->dirty_pipes & drm_crtc_mask(crtc)) == 0)
-			/* This pipe's WM's did not change */
-			continue;
+			if ((results->dirty_pipes & drm_crtc_mask(crtc)) == 0)
+				/* This pipe's WM's did not change */
+				continue;
+		}
 
 		intel_cstate->update_wm_pre = true;
 		skl_compute_wm_results(crtc->dev, pipe_wm, results, intel_crtc);
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ