]> www.infradead.org Git - users/willy/xarray.git/commitdiff
drm/i915: Introduce intel_mode_vdisplay()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 11 Jun 2024 13:33:37 +0000 (16:33 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 20 Jun 2024 12:37:47 +0000 (15:37 +0300)
The DSB code will need to know the hardware's idea of vertical
active, as that is also what defines the start of undelayed
vblank. Introduce a helper that gives us that information,
in line with the other intel_mode_v*() functions.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240611133344.30673-5-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_vblank.c
drivers/gpu/drm/i915/display/intel_vblank.h

index e5db54b1c6320d5ba96dc71edf8d3481ddc5d2cf..5b065e1cd4e44c126875d37ea490bea19a0c678f 100644 (file)
@@ -557,6 +557,16 @@ void intel_crtc_update_active_timings(const struct intel_crtc_state *crtc_state,
        spin_unlock_irqrestore(&i915->drm.vblank_time_lock, irqflags);
 }
 
+int intel_mode_vdisplay(const struct drm_display_mode *mode)
+{
+       int vdisplay = mode->crtc_vdisplay;
+
+       if (mode->flags & DRM_MODE_FLAG_INTERLACE)
+               vdisplay = DIV_ROUND_UP(vdisplay, 2);
+
+       return vdisplay;
+}
+
 int intel_mode_vblank_start(const struct drm_display_mode *mode)
 {
        int vblank_start = mode->crtc_vblank_start;
index b51ae2c1039ec9be924233d987c90ea38c5652ad..7e526f6861e4509f83c01923d4b7290c8c5a3266 100644 (file)
@@ -20,6 +20,7 @@ struct intel_vblank_evade_ctx {
        bool need_vlv_dsi_wa;
 };
 
+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);