Commit 066cf55b authored by Rodrigo Vivi's avatar Rodrigo Vivi Committed by Daniel Vetter

drm/i915: Fix IPS related flicker

We cannot let IPS enabled with no plane on the pipe:

BSpec: "IPS cannot be enabled until after at least one plane has
been enabled for at least one vertical blank." and "IPS must be
disabled while there is still at least one plane enabled on the
same pipe as IPS." This restriction apply to HSW and BDW.

However a shortcut path on update primary plane function
to make primary plane invisible by setting DSPCTRL to 0
was leting IPS enabled while there was no
other plane enabled on the pipe causing flickerings that we were
believing that it was caused by that other restriction where
ips cannot be used when pixel rate is greater than 95% of cdclok.

v2: Don't mess with Atomic path as pointed out by Ville.

v3: Rebase after a long time and atomic path changes.
    Accept Ville suggestion of not check !fb

v4: Re-factore on dinq

Reference: https://bugs.freedesktop.org/show_bug.cgi?id=85583
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Tested-by: default avatarKenneth Graunke <kenneth@whitecape.org>
[danvet: Make it compile]
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent e7ad9878
...@@ -4766,6 +4766,9 @@ static void intel_pre_plane_update(struct intel_crtc *crtc) ...@@ -4766,6 +4766,9 @@ static void intel_pre_plane_update(struct intel_crtc *crtc)
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
} }
if (crtc->atomic.disable_ips)
hsw_disable_ips(crtc);
if (atomic->pre_disable_primary) if (atomic->pre_disable_primary)
intel_pre_disable_primary(&crtc->base); intel_pre_disable_primary(&crtc->base);
} }
...@@ -11616,8 +11619,19 @@ int intel_plane_atomic_calc_changes(struct drm_crtc_state *crtc_state, ...@@ -11616,8 +11619,19 @@ int intel_plane_atomic_calc_changes(struct drm_crtc_state *crtc_state,
intel_crtc->atomic.pre_disable_primary = turn_off; intel_crtc->atomic.pre_disable_primary = turn_off;
intel_crtc->atomic.post_enable_primary = turn_on; intel_crtc->atomic.post_enable_primary = turn_on;
if (turn_off) if (turn_off) {
/*
* FIXME: Actually if we will still have any other
* plane enabled on the pipe we could let IPS enabled
* still, but for now lets consider that when we make
* primary invisible by setting DSPCNTR to 0 on
* update_primary_plane function IPS needs to be
* disable.
*/
intel_crtc->atomic.disable_ips = true;
intel_crtc->atomic.disable_fbc = true; intel_crtc->atomic.disable_fbc = true;
}
/* /*
* FBC does not work on some platforms for rotated * FBC does not work on some platforms for rotated
......
...@@ -498,6 +498,7 @@ struct intel_crtc_atomic_commit { ...@@ -498,6 +498,7 @@ struct intel_crtc_atomic_commit {
/* Sleepable operations to perform before commit */ /* Sleepable operations to perform before commit */
bool wait_for_flips; bool wait_for_flips;
bool disable_fbc; bool disable_fbc;
bool disable_ips;
bool pre_disable_primary; bool pre_disable_primary;
bool update_wm; bool update_wm;
unsigned disabled_planes; unsigned disabled_planes;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment