[PATCH 2/7] drm/i915: Extract intel_mode_vblank_end()
Ville Syrjala
ville.syrjala at linux.intel.com
Tue May 28 18:56:42 UTC 2024
From: Ville Syrjälä <ville.syrjala at linux.intel.com>
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: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
drivers/gpu/drm/i915/display/intel_vblank.c | 16 ++++++++++++----
drivers/gpu/drm/i915/display/intel_vblank.h | 1 +
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_vblank.c b/drivers/gpu/drm/i915/display/intel_vblank.c
index 1f57596f8208..ba56015f2c40 100644
--- a/drivers/gpu/drm/i915/display/intel_vblank.c
+++ b/drivers/gpu/drm/i915/display/intel_vblank.c
@@ -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)
diff --git a/drivers/gpu/drm/i915/display/intel_vblank.h b/drivers/gpu/drm/i915/display/intel_vblank.h
index 08825a4d8fb7..6f11fd070f19 100644
--- a/drivers/gpu/drm/i915/display/intel_vblank.h
+++ b/drivers/gpu/drm/i915/display/intel_vblank.h
@@ -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,
--
2.44.1
More information about the Intel-gfx
mailing list