drm/i915: add timeout to FBC disable waits
FBC disable on 965 can take long enough to trigger latency checks in the kernel so be sure to timeout after a reasonable period. Fixes https://bugzilla.kernel.org/show_bug.cgi?id=15015. Tested-by: James Ettle <theholyettlz@googlemail.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
parent
d1b851fc0d
commit
9517a92f48
|
@ -1029,19 +1029,28 @@ static void i8xx_enable_fbc(struct drm_crtc *crtc, unsigned long interval)
|
||||||
void i8xx_disable_fbc(struct drm_device *dev)
|
void i8xx_disable_fbc(struct drm_device *dev)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||||
|
unsigned long timeout = jiffies + msecs_to_jiffies(1);
|
||||||
u32 fbc_ctl;
|
u32 fbc_ctl;
|
||||||
|
|
||||||
if (!I915_HAS_FBC(dev))
|
if (!I915_HAS_FBC(dev))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!(I915_READ(FBC_CONTROL) & FBC_CTL_EN))
|
||||||
|
return; /* Already off, just return */
|
||||||
|
|
||||||
/* Disable compression */
|
/* Disable compression */
|
||||||
fbc_ctl = I915_READ(FBC_CONTROL);
|
fbc_ctl = I915_READ(FBC_CONTROL);
|
||||||
fbc_ctl &= ~FBC_CTL_EN;
|
fbc_ctl &= ~FBC_CTL_EN;
|
||||||
I915_WRITE(FBC_CONTROL, fbc_ctl);
|
I915_WRITE(FBC_CONTROL, fbc_ctl);
|
||||||
|
|
||||||
/* Wait for compressing bit to clear */
|
/* Wait for compressing bit to clear */
|
||||||
while (I915_READ(FBC_STATUS) & FBC_STAT_COMPRESSING)
|
while (I915_READ(FBC_STATUS) & FBC_STAT_COMPRESSING) {
|
||||||
; /* nothing */
|
if (time_after(jiffies, timeout)) {
|
||||||
|
DRM_DEBUG_DRIVER("FBC idle timed out\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
; /* do nothing */
|
||||||
|
}
|
||||||
|
|
||||||
intel_wait_for_vblank(dev);
|
intel_wait_for_vblank(dev);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue