All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] drm/i915: Use explicit old crtc state in skl_compute_wm()
@ 2018-11-13 17:23 Ville Syrjala
  2018-11-13 17:23 ` [PATCH 2/3] drm/i915: Remove bogus FIXME from SKL wm computation Ville Syrjala
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Ville Syrjala @ 2018-11-13 17:23 UTC (permalink / raw)
  To: intel-gfx

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

skl_compute_wm() wants to compare the old and new watermarks. Currently
it gets at the old watermarks via crtc->state, which is confusing since
it can point at either the old or the new state depending on where
in the sequence we are. In this case it is correct since we have not yet
swapped the states, but let's make it super clear what this is doing
by using the explicit old state.

Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_pm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 27498ded4949..6426af873cef 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -5435,6 +5435,7 @@ skl_compute_wm(struct drm_atomic_state *state)
 {
 	struct drm_crtc *crtc;
 	struct drm_crtc_state *cstate;
+	struct drm_crtc_state *old_crtc_state;
 	struct intel_atomic_state *intel_state = to_intel_atomic_state(state);
 	struct skl_ddb_values *results = &intel_state->wm_results;
 	struct skl_pipe_wm *pipe_wm;
@@ -5462,11 +5463,11 @@ skl_compute_wm(struct drm_atomic_state *state)
 	 * should allow skl_update_pipe_wm() to return failure in cases where
 	 * no suitable watermark values can be found.
 	 */
-	for_each_new_crtc_in_state(state, crtc, cstate, i) {
+	for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, cstate, i) {
 		struct intel_crtc_state *intel_cstate =
 			to_intel_crtc_state(cstate);
 		const struct skl_pipe_wm *old_pipe_wm =
-			&to_intel_crtc_state(crtc->state)->wm.skl.optimal;
+			&to_intel_crtc_state(old_crtc_state)->wm.skl.optimal;
 
 		pipe_wm = &intel_cstate->wm.skl.optimal;
 		ret = skl_update_pipe_wm(cstate, old_pipe_wm, pipe_wm,
-- 
2.18.1

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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-12-07 18:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-13 17:23 [PATCH 1/3] drm/i915: Use explicit old crtc state in skl_compute_wm() Ville Syrjala
2018-11-13 17:23 ` [PATCH 2/3] drm/i915: Remove bogus FIXME from SKL wm computation Ville Syrjala
2018-11-30  6:28   ` Rodrigo Vivi
2018-11-13 17:23 ` [PATCH 3/3] drm/i915: Remove dead update_wm_pre assignment from SKL wm code Ville Syrjala
2018-11-30  6:30   ` Rodrigo Vivi
2018-12-07 18:47     ` Ville Syrjälä
2018-11-13 18:16 ` ✓ Fi.CI.BAT: success for series starting with [1/3] drm/i915: Use explicit old crtc state in skl_compute_wm() Patchwork
2018-11-14 16:37 ` ✓ Fi.CI.IGT: " Patchwork
2018-11-30  6:27 ` [PATCH 1/3] " Rodrigo Vivi

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.