Skip to content

Commit b7048ea

Browse files
vsyrjalajnikula
authored andcommitted
drm/i915: Do .init_clock_gating() earlier to avoid it clobbering watermarks
Currently ILK-BDW explicitly disable LP1+ watermarks from their .init_clock_gating() hooks. Unfortunately that hook gets called way too late since by that time we've already initialized all the watermark state tracking which then gets out of sync with the hardware state. We may eventually want to consider killing off the explicit LP1+ disable from .init_clock_gating(). In the meantime however, we can avoid the problem by reordering the init sequence such that intel_modeset_init_hw()->intel_init_clock_gating() gets called prior to the hardware state takeover. I suppose prior to the two stage watermark programming we were magically saved by something that forced the watermarks to be reprogrammed fully after .init_clock_gating() got called. But now that no longer happens. Note that the diff might look a bit odd as it kills off one call of intel_update_cdclk(), but that's fine because intel_modeset_init_hw() does the exact same thing. Previously we just did it twice. Actually even this new init sequence is pretty bogus as .init_clock_gating() really should be called before any gem hardware init since it can configure various clock gating workarounds and whatnot that affect the GT side as well. Also intel_modeset_init() really should get split up into better defined init stages. Another "fun" detail is that intel_modeset_gem_init() is where RPS/RC6 gets configured. Why that is done from the display code is beyond me. I've decided to leave all this be for now, and just try to fix the init sequence enough for watermarks to work. Cc: [email protected] Cc: Gabriele Mazzotta <[email protected]> Cc: David Purton <[email protected]> Cc: Matt Roper <[email protected]> Cc: Maarten Lankhorst <[email protected]> Reported-by: Gabriele Mazzotta <[email protected]> Reported-by: David Purton <[email protected]> Tested-by: Gabriele Mazzotta <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96645 Fixes: ed4a6a7 ("drm/i915: Add two-stage ILK-style watermark programming (v11)") Signed-off-by: Ville Syrjälä <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 5be6e33) Signed-off-by: Jani Nikula <[email protected]>
1 parent e67351d commit b7048ea

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

drivers/gpu/drm/i915/intel_display.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16696,12 +16696,11 @@ int intel_modeset_init(struct drm_device *dev)
1669616696
}
1669716697
}
1669816698

16699-
intel_update_czclk(dev_priv);
16700-
intel_update_cdclk(dev_priv);
16701-
dev_priv->atomic_cdclk_freq = dev_priv->cdclk_freq;
16702-
1670316699
intel_shared_dpll_init(dev);
1670416700

16701+
intel_update_czclk(dev_priv);
16702+
intel_modeset_init_hw(dev);
16703+
1670516704
if (dev_priv->max_cdclk_freq == 0)
1670616705
intel_update_max_cdclk(dev_priv);
1670716706

@@ -17258,8 +17257,6 @@ void intel_modeset_gem_init(struct drm_device *dev)
1725817257

1725917258
intel_init_gt_powersave(dev_priv);
1726017259

17261-
intel_modeset_init_hw(dev);
17262-
1726317260
intel_setup_overlay(dev_priv);
1726417261
}
1726517262

0 commit comments

Comments
 (0)