drm/i915: Fix DSI TE max_vblank_count handling
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 4 Mar 2021 17:04:21 +0000 (19:04 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 5 Mar 2021 14:38:56 +0000 (16:38 +0200)
commit 33267703df15 ("drm/i915/dsi: Enable software vblank counter")
claims to get the mode_flags from the crtc_state, but in fact does
not. Fix it to do it right.

Cc: Vandita Kulkarni <vandita.kulkarni@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210304170421.10901-5-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_crtc.c

index c7a3e09..3248f49 100644 (file)
@@ -51,8 +51,6 @@ u32 intel_crtc_get_vblank_counter(struct intel_crtc *crtc)
 u32 intel_crtc_max_vblank_count(const struct intel_crtc_state *crtc_state)
 {
        struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev);
-       struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
-       u32 mode_flags = crtc->mode_flags;
 
        /*
         * From Gen 11, In case of dsi cmd mode, frame counter wouldnt
@@ -60,7 +58,8 @@ u32 intel_crtc_max_vblank_count(const struct intel_crtc_state *crtc_state)
         * the hw counter, then we would find it updated in only
         * the next TE, hence switching to sw counter.
         */
-       if (mode_flags & (I915_MODE_FLAG_DSI_USE_TE0 | I915_MODE_FLAG_DSI_USE_TE1))
+       if (crtc_state->mode_flags & (I915_MODE_FLAG_DSI_USE_TE0 |
+                                     I915_MODE_FLAG_DSI_USE_TE1))
                return 0;
 
        /*