Commit 1fea2978 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Extract intel_mode_vblank_end()

Extract intel_mode_vblank_end() in the same vein as
intel_mode_vblank_start(). While we have only one use
of this it seems nicer to unify the approach.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240528185647.7765-3-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent edd27f8e
......@@ -312,12 +312,10 @@ static bool i915_get_crtc_scanoutpos(struct drm_crtc *_crtc,
hsync_start = mode->crtc_hsync_start;
vtotal = mode->crtc_vtotal;
vbl_start = intel_mode_vblank_start(mode);
vbl_end = mode->crtc_vblank_end;
vbl_end = intel_mode_vblank_end(mode);
if (mode->flags & DRM_MODE_FLAG_INTERLACE) {
vbl_end /= 2;
if (mode->flags & DRM_MODE_FLAG_INTERLACE)
vtotal /= 2;
}
/*
* Enter vblank critical section, as we will do multiple
......@@ -584,6 +582,16 @@ int intel_mode_vblank_start(const struct drm_display_mode *mode)
return vblank_start;
}
int intel_mode_vblank_end(const struct drm_display_mode *mode)
{
int vblank_end = mode->crtc_vblank_end;
if (mode->flags & DRM_MODE_FLAG_INTERLACE)
vblank_end /= 2;
return vblank_end;
}
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)
......
......@@ -21,6 +21,7 @@ struct intel_vblank_evade_ctx {
};
int intel_mode_vblank_start(const struct drm_display_mode *mode);
int intel_mode_vblank_end(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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment