From 213f1bd035edc36f8d68c028d1b79675cd167d1d Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Tue, 19 Sep 2017 14:14:19 +0200 Subject: [PATCH] drm/i915: Skip vblank waits for cursor updates when watermarks dont need updating Mime-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 8bit Git-commit: 213f1bd035edc36f8d68c028d1b79675cd167d1d Patch-mainline: v4.15-rc1 References: FATE#322643 bsc#1055900 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 Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20170919121419.13708-2-maarten.lankhorst@linux.intel.com Acked-by: Takashi Iwai --- drivers/gpu/drm/i915/intel_display.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -12566,8 +12566,16 @@ static int intel_atomic_commit(struct dr * 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) {