]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/gpu/drm/i915/intel_display.c
drm/i915: Workaround VLV/CHV DSI scanline counter hardware fail
[karo-tx-linux.git] / drivers / gpu / drm / i915 / intel_display.c
index a8ececfc759e8cb6a48f27bd589fa6786ab5aa11..b0a9e156bfd1fc46d9f1de6a00290cc16b1137c5 100644 (file)
@@ -11186,6 +11186,9 @@ static int intel_crtc_atomic_check(struct drm_crtc *crtc,
                if (mode_changed)
                        ret = skl_update_scaler_crtc(pipe_config);
 
+               if (!ret)
+                       ret = skl_check_pipe_max_pixel_rate(intel_crtc,
+                                                           pipe_config);
                if (!ret)
                        ret = intel_atomic_setup_scalers(dev_priv, intel_crtc,
                                                         pipe_config);
@@ -12391,6 +12394,15 @@ static void update_scanline_offset(struct intel_crtc *crtc)
         * type. For DP ports it behaves like most other platforms, but on HDMI
         * there's an extra 1 line difference. So we need to add two instead of
         * one to the value.
+        *
+        * On VLV/CHV DSI the scanline counter would appear to increment
+        * approx. 1/3 of a scanline before start of vblank. Unfortunately
+        * that means we can't tell whether we're in vblank or not while
+        * we're on that particular line. We must still set scanline_offset
+        * to 1 so that the vblank timestamps come out correct when we query
+        * the scanline counter from within the vblank interrupt handler.
+        * However if queried just before the start of vblank we'll get an
+        * answer that's slightly in the future.
         */
        if (IS_GEN2(dev_priv)) {
                const struct drm_display_mode *adjusted_mode = &crtc->config->base.adjusted_mode;