drm/i915: Extract intel_mode_vblank_delay()

Extract the code that computes the hardware centric view
of the vblank delay into a helper. We'll need a slightly
different variant for VRR soon.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241210211007.5976-10-ville.syrjala@linux.intel.com
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
This commit is contained in:
Ville Syrjälä
2025-01-15 19:43:29 +02:00
parent ab68429316
commit 730ac786e8
3 changed files with 8 additions and 4 deletions
+1 -2
View File
@@ -130,8 +130,7 @@ pre_commit_crtc_state(struct intel_atomic_state *state,
static int dsb_vblank_delay(const struct intel_crtc_state *crtc_state)
{
return intel_mode_vblank_start(&crtc_state->hw.adjusted_mode) -
intel_mode_vdisplay(&crtc_state->hw.adjusted_mode);
return intel_mode_vblank_delay(&crtc_state->hw.adjusted_mode);
}
static int dsb_vtotal(struct intel_atomic_state *state,
+6 -2
View File
@@ -597,6 +597,11 @@ int intel_mode_vtotal(const struct drm_display_mode *mode)
return vtotal;
}
int intel_mode_vblank_delay(const struct drm_display_mode *mode)
{
return intel_mode_vblank_start(mode) - intel_mode_vdisplay(mode);
}
void intel_vblank_evade_init(const struct intel_crtc_state *old_crtc_state,
const struct intel_crtc_state *new_crtc_state,
struct intel_vblank_evade_ctx *evade)
@@ -653,8 +658,7 @@ void intel_vblank_evade_init(const struct intel_crtc_state *old_crtc_state,
*/
if (intel_color_uses_dsb(new_crtc_state) ||
new_crtc_state->update_m_n || new_crtc_state->update_lrr)
evade->min -= intel_mode_vblank_start(adjusted_mode) -
intel_mode_vdisplay(adjusted_mode);
evade->min -= intel_mode_vblank_delay(adjusted_mode);
}
/* must be called with vblank interrupt already enabled! */
@@ -24,6 +24,7 @@ int intel_mode_vdisplay(const struct drm_display_mode *mode);
int intel_mode_vblank_start(const struct drm_display_mode *mode);
int intel_mode_vblank_end(const struct drm_display_mode *mode);
int intel_mode_vtotal(const struct drm_display_mode *mode);
int intel_mode_vblank_delay(const struct drm_display_mode *mode);
void intel_vblank_evade_init(const struct intel_crtc_state *old_crtc_state,
const struct intel_crtc_state *new_crtc_state,