]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915: Skip vblank waits for cursor updates when watermarks dont need updating
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Tue, 19 Sep 2017 12:14:19 +0000 (14:14 +0200)
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Wed, 4 Oct 2017 07:16:22 +0000 (09:16 +0200)
In legacy cursor updates we need the extra vblank waits if we update
watermarks, and then we cannot skip the vblank for cursors.

This is why for < gen9 we disabled the cursor fastpath, but we can skip
the wait when post vblank watermarks are untouched.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170919121419.13708-2-maarten.lankhorst@linux.intel.com
drivers/gpu/drm/i915/intel_display.c

index e55f68cda7557a6771395b546ae3f2c8030da054..cdb2e25a577c92dfea6361faba37785f58aaf77d 100644 (file)
@@ -12562,8 +12562,16 @@ static int intel_atomic_commit(struct drm_device *dev,
         * FIXME doing watermarks and fb cleanup from a vblank worker
         * (assuming we had any) would solve these problems.
         */
-       if (INTEL_GEN(dev_priv) < 9)
-               state->legacy_cursor_update = false;
+       if (INTEL_GEN(dev_priv) < 9 && state->legacy_cursor_update) {
+               struct intel_crtc_state *new_crtc_state;
+               struct intel_crtc *crtc;
+               int i;
+
+               for_each_new_intel_crtc_in_state(intel_state, crtc, new_crtc_state, i)
+                       if (new_crtc_state->wm.need_postvbl_update ||
+                           new_crtc_state->update_wm_post)
+                               state->legacy_cursor_update = false;
+       }
 
        ret = intel_atomic_prepare_commit(dev, state);
        if (ret) {