/** * intel_fbc_disable - disable FBC * @dev_priv: i915 device instance * * This function disables FBC. */ void intel_fbc_disable(struct drm_i915_private *dev_priv) { if (!fbc_supported(dev_priv)) return; mutex_lock(&dev_priv->fbc.lock); __intel_fbc_disable(dev_priv); mutex_unlock(&dev_priv->fbc.lock); }
/* * intel_fbc_disable_crtc - disable FBC if it's associated with crtc * @crtc: the CRTC * * This function disables FBC if it's associated with the provided CRTC. */ void intel_fbc_disable_crtc(struct intel_crtc *crtc) { struct drm_i915_private *dev_priv = crtc->base.dev->dev_private; if (!fbc_supported(dev_priv)) return; mutex_lock(&dev_priv->fbc.lock); if (dev_priv->fbc.crtc == crtc) __intel_fbc_disable(dev_priv); mutex_unlock(&dev_priv->fbc.lock); }
/** * intel_fbc_global_disable - globally disable FBC * @dev_priv: i915 device instance * * This function disables FBC regardless of which CRTC is associated with it. */ void intel_fbc_global_disable(struct drm_i915_private *dev_priv) { struct intel_fbc *fbc = &dev_priv->fbc; if (!fbc_supported(dev_priv)) return; mutex_lock(&fbc->lock); if (fbc->enabled) __intel_fbc_disable(dev_priv); mutex_unlock(&fbc->lock); cancel_work_sync(&fbc->work.work); }
/** * intel_fbc_disable - disable FBC if it's associated with crtc * @crtc: the CRTC * * This function disables FBC if it's associated with the provided CRTC. */ void intel_fbc_disable(struct intel_crtc *crtc) { struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); struct intel_fbc *fbc = &dev_priv->fbc; if (!fbc_supported(dev_priv)) return; mutex_lock(&fbc->lock); if (fbc->crtc == crtc) __intel_fbc_disable(dev_priv); mutex_unlock(&fbc->lock); cancel_work_sync(&fbc->work.work); }
/** * intel_fbc_disable - disable FBC if it's associated with crtc * @crtc: the CRTC * * This function disables FBC if it's associated with the provided CRTC. */ void intel_fbc_disable(struct intel_crtc *crtc) { struct drm_i915_private *dev_priv = crtc->base.dev->dev_private; struct intel_fbc *fbc = &dev_priv->fbc; if (!fbc_supported(dev_priv)) return; mutex_lock(&fbc->lock); if (fbc->crtc == crtc) { WARN_ON(!fbc->enabled); WARN_ON(fbc->active); __intel_fbc_disable(dev_priv); } mutex_unlock(&fbc->lock); cancel_work_sync(&fbc->work.work); }
static void __intel_fbc_post_update(struct intel_crtc *crtc) { struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); struct intel_fbc *fbc = &dev_priv->fbc; struct intel_fbc_reg_params old_params; WARN_ON(!mutex_is_locked(&fbc->lock)); if (!fbc->enabled || fbc->crtc != crtc) return; if (!i915_modparams.enable_fbc) { intel_fbc_deactivate(dev_priv, "disabled at runtime per module param"); __intel_fbc_disable(dev_priv); return; } if (!intel_fbc_can_activate(crtc)) { WARN_ON(fbc->active); return; } old_params = fbc->params; intel_fbc_get_reg_params(crtc, &fbc->params); /* If the scanout has not changed, don't modify the FBC settings. * Note that we make the fundamental assumption that the fb->obj * cannot be unpinned (and have its GTT offset and fence revoked) * without first being decoupled from the scanout and FBC disabled. */ if (fbc->active && intel_fbc_reg_params_equal(&old_params, &fbc->params)) return; intel_fbc_deactivate(dev_priv, "FBC enabled (active or scheduled)"); intel_fbc_schedule_activation(crtc); }