public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 5/8] drm/i915: Streamline skl_commit_modeset_enables()
Date: Fri, 11 Oct 2019 23:09:46 +0300	[thread overview]
Message-ID: <20191011200949.7839-6-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20191011200949.7839-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

skl_commit_modeset_enables() is a bit of mess. Let's streamline
it by simply tracking which pipes still need to be updated.
As a bonus we get rid of the state->wm_results.dirty_pipes usage.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_display.c | 39 +++++++++-----------
 1 file changed, 17 insertions(+), 22 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index b9b51bd0c956..9eab67bbf61d 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -13881,17 +13881,19 @@ static void skl_commit_modeset_enables(struct intel_atomic_state *state)
 	struct drm_i915_private *dev_priv = to_i915(state->base.dev);
 	struct intel_crtc *crtc;
 	struct intel_crtc_state *old_crtc_state, *new_crtc_state;
-	unsigned int updated = 0;
-	bool progress;
-	int i;
 	u8 hw_enabled_slices = dev_priv->wm.skl_hw.ddb.enabled_slices;
 	u8 required_slices = state->wm_results.ddb.enabled_slices;
 	struct skl_ddb_entry entries[I915_MAX_PIPES] = {};
+	u8 dirty_pipes = 0;
+	int i;
 
-	for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i)
+	for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
 		/* ignore allocations for crtc's that have been turned off. */
-		if (new_crtc_state->base.active)
+		if (new_crtc_state->base.active) {
 			entries[i] = old_crtc_state->wm.skl.ddb;
+			dirty_pipes |= BIT(crtc->pipe);
+		}
+	}
 
 	/* If 2nd DBuf slice required, enable it here */
 	if (INTEL_GEN(dev_priv) >= 11 && required_slices > hw_enabled_slices)
@@ -13903,14 +13905,12 @@ static void skl_commit_modeset_enables(struct intel_atomic_state *state)
 	 * never overlap with eachother inbetween CRTC updates. Otherwise we'll
 	 * cause pipe underruns and other bad stuff.
 	 */
-	do {
-		progress = false;
-
-		for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
+	while (dirty_pipes) {
+		for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state,
+						    new_crtc_state, i) {
 			enum pipe pipe = crtc->pipe;
-			bool vbl_wait = false;
 
-			if (updated & BIT(crtc->pipe) || !new_crtc_state->base.active)
+			if ((dirty_pipes & BIT(pipe)) == 0)
 				continue;
 
 			if (skl_ddb_allocation_overlaps(&new_crtc_state->wm.skl.ddb,
@@ -13918,8 +13918,11 @@ static void skl_commit_modeset_enables(struct intel_atomic_state *state)
 							INTEL_NUM_PIPES(dev_priv), i))
 				continue;
 
-			updated |= BIT(pipe);
 			entries[i] = new_crtc_state->wm.skl.ddb;
+			dirty_pipes &= ~BIT(pipe);
+
+			intel_update_crtc(crtc, state, old_crtc_state,
+					  new_crtc_state);
 
 			/*
 			 * If this is an already active pipe, it's DDB changed,
@@ -13930,18 +13933,10 @@ static void skl_commit_modeset_enables(struct intel_atomic_state *state)
 			if (!skl_ddb_entry_equal(&new_crtc_state->wm.skl.ddb,
 						 &old_crtc_state->wm.skl.ddb) &&
 			    !new_crtc_state->base.active_changed &&
-			    state->wm_results.dirty_pipes != updated)
-				vbl_wait = true;
-
-			intel_update_crtc(crtc, state, old_crtc_state,
-					  new_crtc_state);
-
-			if (vbl_wait)
+			    dirty_pipes)
 				intel_wait_for_vblank(dev_priv, pipe);
-
-			progress = true;
 		}
-	} while (progress);
+	}
 
 	/* If 2nd DBuf slice is no more required disable it */
 	if (INTEL_GEN(dev_priv) >= 11 && required_slices < hw_enabled_slices)
-- 
2.21.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2019-10-11 20:10 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-11 20:09 [PATCH 0/8] drm/i915: Some cleanup near the SKL wm/ddb area Ville Syrjala
2019-10-11 20:09 ` [PATCH 1/8] drm/i915: Nuke the useless changed param from skl_ddb_add_affected_pipes() Ville Syrjala
2019-10-16 14:25   ` Lisovskiy, Stanislav
2019-10-11 20:09 ` [PATCH 2/8] drm/i915: Nuke 'realloc_pipes' Ville Syrjala
2019-10-16 14:27   ` Lisovskiy, Stanislav
2019-10-11 20:09 ` [PATCH 3/8] drm/i915: Make dirty_pipes refer to pipes Ville Syrjala
2019-10-16 14:28   ` Lisovskiy, Stanislav
2019-10-11 20:09 ` [PATCH 4/8] drm/i915: Don't set undefined bits in dirty_pipes Ville Syrjala
2019-11-29  9:24   ` Lisovskiy, Stanislav
2019-11-29  9:24     ` [Intel-gfx] " Lisovskiy, Stanislav
2019-10-11 20:09 ` Ville Syrjala [this message]
2019-12-03 13:47   ` [Intel-gfx] [PATCH 5/8] drm/i915: Streamline skl_commit_modeset_enables() Lisovskiy, Stanislav
2019-10-11 20:09 ` [PATCH 6/8] drm/i915: Polish WM_LINETIME register stuff Ville Syrjala
2019-10-14 14:56   ` [PATCH v2 " Ville Syrjala
2019-12-03 14:02     ` [Intel-gfx] " Lisovskiy, Stanislav
2019-10-11 20:09 ` [PATCH 7/8] drm/i915: Move linetime wms into the crtc state Ville Syrjala
2019-10-11 20:09 ` [PATCH 8/8] drm/i915: Nuke skl wm.dirty_pipes bitmask Ville Syrjala
2019-11-29  9:18   ` Lisovskiy, Stanislav
2019-11-29  9:18     ` [Intel-gfx] " Lisovskiy, Stanislav
2019-10-11 21:35 ` ✗ Fi.CI.BUILD: failure for drm/i915: Some cleanup near the SKL wm/ddb area Patchwork
2019-10-14 18:19 ` ✓ Fi.CI.BAT: success for drm/i915: Some cleanup near the SKL wm/ddb area (rev2) Patchwork
2019-10-15  3:21 ` ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191011200949.7839-6-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox