Skip to content

Commit b000abd

Browse files
committed
drm/i915: Do .crtc_compute_clock() earlier
Currently we calculate a lot of things (pixel rate, watermarks, cdclk) trusting that the DPLL can generate the exact frequency we ask it. In practice that is not true and there can be certain amount of rounding involved. To allow us to eventually get accurate numbers for all our DPLL clock derived state we need to move the DPLL calculation to hapen much earlier. To that end we hoist it up to the just after the fastset checks. For now we just do the easy code motion, and the actual back feeding of the final DPLL clock into the state will come later. A slight change here is that now .crtc_compute_clock() can get called while the shared_dpll is still assigned. But since .crtc_compute_clock() no longer assignes new shared_dplls this is perfectly fine. TODO: I'd actually like to do this before the fastset check so that if the DPLL state should change we actually do the modeset. Which I think is what the video aficionados want, but it might not be what the fans of fastboot want. Not yet sure how to reconcile those conflicting requirements... v2: s/return/goto/ in error handling Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220907091057.11572-6-ville.syrjala@linux.intel.com
1 parent e72df53 commit b000abd

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

drivers/gpu/drm/i915/display/intel_display.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4820,10 +4820,6 @@ static int intel_crtc_atomic_check(struct intel_atomic_state *state,
48204820
crtc_state->update_wm_post = true;
48214821

48224822
if (mode_changed) {
4823-
ret = intel_dpll_crtc_compute_clock(state, crtc);
4824-
if (ret)
4825-
return ret;
4826-
48274823
ret = intel_dpll_crtc_get_shared_dpll(state, crtc);
48284824
if (ret)
48294825
return ret;
@@ -6912,6 +6908,11 @@ static int intel_atomic_check(struct drm_device *dev,
69126908
new_crtc_state, i) {
69136909
if (intel_crtc_needs_modeset(new_crtc_state)) {
69146910
any_ms = true;
6911+
6912+
ret = intel_dpll_crtc_compute_clock(state, crtc);
6913+
if (ret)
6914+
goto fail;
6915+
69156916
continue;
69166917
}
69176918

drivers/gpu/drm/i915/display/intel_dpll.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,9 +1411,6 @@ int intel_dpll_crtc_compute_clock(struct intel_atomic_state *state,
14111411

14121412
drm_WARN_ON(&i915->drm, !intel_crtc_needs_modeset(crtc_state));
14131413

1414-
if (drm_WARN_ON(&i915->drm, crtc_state->shared_dpll))
1415-
return 0;
1416-
14171414
memset(&crtc_state->dpll_hw_state, 0,
14181415
sizeof(crtc_state->dpll_hw_state));
14191416

0 commit comments

Comments
 (0)