[PATCH 23/24] drm/i915: Add a workaround for sprite only <-> primary only switching

ville.syrjala
2014-03-07T16:33:48Z

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

ILK and IVB don't like switching between sprite only and primary only
configurations when LP1+ watermarks have been enabled in the recent
past. Like WaCxSRDisabledForSpriteScaling we can avoid the flash
by disabling LP1+ watermarks for one frame before the critical plane
reconfiguration.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/intel_pm.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index ddf77d5..c011da5 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -3127,9 +3127,18 @@ static int ilk_update_sprite_wm(struct drm_plane *plane,
* when scaling is disabled.
*
* WaCxSRDisabledForSpriteScaling:ivb
+ *
+ * We also seem to need something similar when switching between
+ * primary only and sprite only configurations. Otherwise the screen
+ * flashes black. No underrun reported though.
*/
if (IS_IVYBRIDGE(dev) && config->spr.scaled && ilk_disable_lp_wm(crtc))
intel_wait_for_vblank(dev, to_intel_plane(plane)->pipe);
+ else if (config->pri.enabled != config->spr.enabled &&
+ config->pri.enabled != params.pri.enabled &&
+ config->spr.enabled != params.spr.enabled &&
+ ilk_disable_lp_wm(crtc))
+ intel_wait_for_vblank(dev, to_intel_plane(plane)->pipe);

params.pri = config->pri;
params.spr = config->spr;
--
1.8.3.2