All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH v9 2/7] drm/i915: Extract cdclk requirements checking to separate function
Date: Tue, 19 May 2020 16:11:12 +0300	[thread overview]
Message-ID: <20200519131117.17190-3-stanislav.lisovskiy@intel.com> (raw)
In-Reply-To: <20200519131117.17190-1-stanislav.lisovskiy@intel.com>

In Gen11+ whenever we might exceed DBuf bandwidth we might need to
recalculate CDCLK which DBuf bandwidth is scaled with.
Total Dbuf bw used might change based on particular plane needs.

Thus to calculate if cdclk needs to be changed it is not enough
anymore to check plane configuration and plane min cdclk, per DBuf
bw can be calculated only after wm/ddb calculation is done and
all required planes are added into the state. In order to keep
all min_cdclk related checks in one place let's extract it into
separate function, checking and modifying any_ms.

Reviewed-by: Manasi Navare <manasi.d.navare@intel.com>
Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
---
 drivers/gpu/drm/i915/display/intel_display.c | 30 ++++++++++++++------
 1 file changed, 22 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 005e324d0582..e93a553a344d 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -14572,8 +14572,7 @@ static bool active_planes_affects_min_cdclk(struct drm_i915_private *dev_priv)
 		IS_IVYBRIDGE(dev_priv);
 }
 
-static int intel_atomic_check_planes(struct intel_atomic_state *state,
-				     bool *need_cdclk_calc)
+static int intel_atomic_check_planes(struct intel_atomic_state *state)
 {
 	struct drm_i915_private *dev_priv = to_i915(state->base.dev);
 	struct intel_crtc_state *old_crtc_state, *new_crtc_state;
@@ -14623,6 +14622,22 @@ static int intel_atomic_check_planes(struct intel_atomic_state *state,
 			return ret;
 	}
 
+	return 0;
+}
+
+static int intel_atomic_check_cdclk(struct intel_atomic_state *state,
+				    bool *need_cdclk_calc)
+{
+	struct intel_cdclk_state *new_cdclk_state;
+	int i;
+	struct intel_plane_state *plane_state;
+	struct intel_plane *plane;
+	int ret;
+
+	new_cdclk_state = intel_atomic_get_new_cdclk_state(state);
+	if (new_cdclk_state && new_cdclk_state->force_min_cdclk_changed)
+		*need_cdclk_calc = true;
+
 	/*
 	 * active_planes bitmask has been updated, and potentially
 	 * affected planes are part of the state. We can now
@@ -14685,7 +14700,6 @@ static int intel_atomic_check(struct drm_device *dev,
 	struct drm_i915_private *dev_priv = to_i915(dev);
 	struct intel_atomic_state *state = to_intel_atomic_state(_state);
 	struct intel_crtc_state *old_crtc_state, *new_crtc_state;
-	struct intel_cdclk_state *new_cdclk_state;
 	struct intel_crtc *crtc;
 	int ret, i;
 	bool any_ms = false;
@@ -14796,14 +14810,10 @@ static int intel_atomic_check(struct drm_device *dev,
 	if (ret)
 		goto fail;
 
-	ret = intel_atomic_check_planes(state, &any_ms);
+	ret = intel_atomic_check_planes(state);
 	if (ret)
 		goto fail;
 
-	new_cdclk_state = intel_atomic_get_new_cdclk_state(state);
-	if (new_cdclk_state && new_cdclk_state->force_min_cdclk_changed)
-		any_ms = true;
-
 	/*
 	 * distrust_bios_wm will force a full dbuf recomputation
 	 * but the hardware state will only get updated accordingly
@@ -14833,6 +14843,10 @@ static int intel_atomic_check(struct drm_device *dev,
 	if (ret)
 		goto fail;
 
+	ret = intel_atomic_check_cdclk(state, &any_ms);
+	if (ret)
+		goto fail;
+
 	if (any_ms) {
 		ret = intel_modeset_calc_cdclk(state);
 		if (ret)
-- 
2.24.1.485.gad05a3d8e5

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

  parent reply	other threads:[~2020-05-19 13:15 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-19 13:11 [Intel-gfx] [PATCH v9 0/7] Consider DBuf bandwidth when calculating CDCLK Stanislav Lisovskiy
2020-05-19 13:11 ` [Intel-gfx] [PATCH v9 1/7] drm/i915: Decouple cdclk calculation from modeset checks Stanislav Lisovskiy
2020-05-19 13:11 ` Stanislav Lisovskiy [this message]
2020-05-19 13:11 ` [Intel-gfx] [PATCH v9 3/7] drm/i915: Check plane configuration properly Stanislav Lisovskiy
2020-05-20 14:58   ` Stanislav Lisovskiy
2020-05-19 13:11 ` [Intel-gfx] [PATCH v9 4/7] drm/i915: Plane configuration affects CDCLK in Gen11+ Stanislav Lisovskiy
2020-05-20 14:59   ` Stanislav Lisovskiy
2020-05-19 13:11 ` [Intel-gfx] [PATCH v9 5/7] drm/i915: Introduce for_each_dbuf_slice_in_mask macro Stanislav Lisovskiy
2020-05-19 13:11 ` [Intel-gfx] [PATCH v9 6/7] drm/i915: Adjust CDCLK accordingly to our DBuf bw needs Stanislav Lisovskiy
2020-05-19 21:25   ` Stanislav Lisovskiy
2020-05-19 23:55     ` Manasi Navare
2020-05-20 15:00     ` Stanislav Lisovskiy
2020-05-19 13:11 ` [Intel-gfx] [PATCH v9 7/7] drm/i915: Remove unneeded hack now for CDCLK Stanislav Lisovskiy
2020-05-19 17:22 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for Consider DBuf bandwidth when calculating CDCLK (rev14) Patchwork
2020-05-19 23:32 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Consider DBuf bandwidth when calculating CDCLK (rev15) Patchwork
2020-05-19 23:33 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2020-05-19 23:59 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2020-05-20  6:22   ` Lisovskiy, Stanislav
2020-05-20  8:43     ` Vudum, Lakshminarayana
2020-05-20  8:44       ` Lisovskiy, Stanislav
2020-05-20  8:27 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-05-20 15:28 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Consider DBuf bandwidth when calculating CDCLK (rev18) Patchwork
2020-05-20 15:29 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2020-05-20 15:50 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-05-20 19:57 ` [Intel-gfx] ✓ Fi.CI.IGT: success for Consider DBuf bandwidth when calculating CDCLK (rev15) Patchwork
2020-05-21  6:55 ` [Intel-gfx] ✗ Fi.CI.IGT: failure for Consider DBuf bandwidth when calculating CDCLK (rev18) Patchwork
2020-05-21  9:35   ` Lisovskiy, Stanislav
2020-05-21 21:02     ` Vudum, Lakshminarayana
2020-05-22 22:00     ` Chris Wilson
2020-05-22 23:18       ` Chris Wilson
2020-05-25  8:00         ` Lisovskiy, Stanislav
2020-05-25  8:03           ` Chris Wilson
2020-05-25  8:07             ` Lisovskiy, Stanislav
2020-05-25  8:09               ` Chris Wilson
2020-05-25  8:14                 ` Lisovskiy, Stanislav
2020-05-21 21:01 ` [Intel-gfx] ✓ Fi.CI.IGT: success " Patchwork
2020-05-21 21:28 ` [Intel-gfx] [PATCH v9 0/7] Consider DBuf bandwidth when calculating CDCLK Manasi Navare
2020-05-21 22:17   ` Chris Wilson

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=20200519131117.17190-3-stanislav.lisovskiy@intel.com \
    --to=stanislav.lisovskiy@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.