Commit c866a0e4 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915/fbc: Nuke fbc.enabled

fbc.enabled == (fbc.crtc != NULL), so let's just nuke fbc.enabled.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191127201222.16669-11-ville.syrjala@linux.intel.comReviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
parent 31ce20c2
...@@ -840,7 +840,7 @@ void intel_fbc_pre_update(struct intel_crtc *crtc, ...@@ -840,7 +840,7 @@ void intel_fbc_pre_update(struct intel_crtc *crtc,
mutex_lock(&fbc->lock); mutex_lock(&fbc->lock);
if (!fbc->enabled || fbc->crtc != crtc) if (fbc->crtc != crtc)
goto unlock; goto unlock;
intel_fbc_update_state_cache(crtc, crtc_state, plane_state); intel_fbc_update_state_cache(crtc, crtc_state, plane_state);
...@@ -864,14 +864,13 @@ static void __intel_fbc_disable(struct drm_i915_private *dev_priv) ...@@ -864,14 +864,13 @@ static void __intel_fbc_disable(struct drm_i915_private *dev_priv)
struct intel_crtc *crtc = fbc->crtc; struct intel_crtc *crtc = fbc->crtc;
WARN_ON(!mutex_is_locked(&fbc->lock)); WARN_ON(!mutex_is_locked(&fbc->lock));
WARN_ON(!fbc->enabled); WARN_ON(!fbc->crtc);
WARN_ON(fbc->active); WARN_ON(fbc->active);
DRM_DEBUG_KMS("Disabling FBC on pipe %c\n", pipe_name(crtc->pipe)); DRM_DEBUG_KMS("Disabling FBC on pipe %c\n", pipe_name(crtc->pipe));
__intel_fbc_cleanup_cfb(dev_priv); __intel_fbc_cleanup_cfb(dev_priv);
fbc->enabled = false;
fbc->crtc = NULL; fbc->crtc = NULL;
} }
...@@ -882,7 +881,7 @@ static void __intel_fbc_post_update(struct intel_crtc *crtc) ...@@ -882,7 +881,7 @@ static void __intel_fbc_post_update(struct intel_crtc *crtc)
WARN_ON(!mutex_is_locked(&fbc->lock)); WARN_ON(!mutex_is_locked(&fbc->lock));
if (!fbc->enabled || fbc->crtc != crtc) if (fbc->crtc != crtc)
return; return;
fbc->flip_pending = false; fbc->flip_pending = false;
...@@ -922,7 +921,7 @@ void intel_fbc_post_update(struct intel_crtc *crtc) ...@@ -922,7 +921,7 @@ void intel_fbc_post_update(struct intel_crtc *crtc)
static unsigned int intel_fbc_get_frontbuffer_bit(struct intel_fbc *fbc) static unsigned int intel_fbc_get_frontbuffer_bit(struct intel_fbc *fbc)
{ {
if (fbc->enabled) if (fbc->crtc)
return to_intel_plane(fbc->crtc->base.primary)->frontbuffer_bit; return to_intel_plane(fbc->crtc->base.primary)->frontbuffer_bit;
else else
return fbc->possible_framebuffer_bits; return fbc->possible_framebuffer_bits;
...@@ -944,7 +943,7 @@ void intel_fbc_invalidate(struct drm_i915_private *dev_priv, ...@@ -944,7 +943,7 @@ void intel_fbc_invalidate(struct drm_i915_private *dev_priv,
fbc->busy_bits |= intel_fbc_get_frontbuffer_bit(fbc) & frontbuffer_bits; fbc->busy_bits |= intel_fbc_get_frontbuffer_bit(fbc) & frontbuffer_bits;
if (fbc->enabled && fbc->busy_bits) if (fbc->crtc && fbc->busy_bits)
intel_fbc_deactivate(dev_priv, "frontbuffer write"); intel_fbc_deactivate(dev_priv, "frontbuffer write");
mutex_unlock(&fbc->lock); mutex_unlock(&fbc->lock);
...@@ -965,7 +964,7 @@ void intel_fbc_flush(struct drm_i915_private *dev_priv, ...@@ -965,7 +964,7 @@ void intel_fbc_flush(struct drm_i915_private *dev_priv,
if (origin == ORIGIN_GTT || origin == ORIGIN_FLIP) if (origin == ORIGIN_GTT || origin == ORIGIN_FLIP)
goto out; goto out;
if (!fbc->busy_bits && fbc->enabled && if (!fbc->busy_bits && fbc->crtc &&
(frontbuffer_bits & intel_fbc_get_frontbuffer_bit(fbc))) { (frontbuffer_bits & intel_fbc_get_frontbuffer_bit(fbc))) {
if (fbc->active) if (fbc->active)
intel_fbc_recompress(dev_priv); intel_fbc_recompress(dev_priv);
...@@ -1061,8 +1060,7 @@ void intel_fbc_enable(struct intel_crtc *crtc, ...@@ -1061,8 +1060,7 @@ void intel_fbc_enable(struct intel_crtc *crtc,
mutex_lock(&fbc->lock); mutex_lock(&fbc->lock);
if (fbc->enabled) { if (fbc->crtc) {
WARN_ON(fbc->crtc == NULL);
if (fbc->crtc == crtc) { if (fbc->crtc == crtc) {
WARN_ON(!crtc_state->enable_fbc); WARN_ON(!crtc_state->enable_fbc);
WARN_ON(fbc->active); WARN_ON(fbc->active);
...@@ -1074,7 +1072,6 @@ void intel_fbc_enable(struct intel_crtc *crtc, ...@@ -1074,7 +1072,6 @@ void intel_fbc_enable(struct intel_crtc *crtc,
goto out; goto out;
WARN_ON(fbc->active); WARN_ON(fbc->active);
WARN_ON(fbc->crtc != NULL);
intel_fbc_update_state_cache(crtc, crtc_state, plane_state); intel_fbc_update_state_cache(crtc, crtc_state, plane_state);
...@@ -1099,7 +1096,6 @@ void intel_fbc_enable(struct intel_crtc *crtc, ...@@ -1099,7 +1096,6 @@ void intel_fbc_enable(struct intel_crtc *crtc,
DRM_DEBUG_KMS("Enabling FBC on pipe %c\n", pipe_name(crtc->pipe)); DRM_DEBUG_KMS("Enabling FBC on pipe %c\n", pipe_name(crtc->pipe));
fbc->no_fbc_reason = "FBC enabled but not active yet\n"; fbc->no_fbc_reason = "FBC enabled but not active yet\n";
fbc->enabled = true;
fbc->crtc = crtc; fbc->crtc = crtc;
out: out:
mutex_unlock(&fbc->lock); mutex_unlock(&fbc->lock);
...@@ -1139,7 +1135,7 @@ void intel_fbc_global_disable(struct drm_i915_private *dev_priv) ...@@ -1139,7 +1135,7 @@ void intel_fbc_global_disable(struct drm_i915_private *dev_priv)
return; return;
mutex_lock(&fbc->lock); mutex_lock(&fbc->lock);
if (fbc->enabled) { if (fbc->crtc) {
WARN_ON(fbc->crtc->active); WARN_ON(fbc->crtc->active);
__intel_fbc_disable(dev_priv); __intel_fbc_disable(dev_priv);
} }
...@@ -1155,7 +1151,7 @@ static void intel_fbc_underrun_work_fn(struct work_struct *work) ...@@ -1155,7 +1151,7 @@ static void intel_fbc_underrun_work_fn(struct work_struct *work)
mutex_lock(&fbc->lock); mutex_lock(&fbc->lock);
/* Maybe we were scheduled twice. */ /* Maybe we were scheduled twice. */
if (fbc->underrun_detected || !fbc->enabled) if (fbc->underrun_detected || !fbc->crtc)
goto out; goto out;
DRM_DEBUG_KMS("Disabling FBC due to FIFO underrun.\n"); DRM_DEBUG_KMS("Disabling FBC due to FIFO underrun.\n");
...@@ -1278,7 +1274,6 @@ void intel_fbc_init(struct drm_i915_private *dev_priv) ...@@ -1278,7 +1274,6 @@ void intel_fbc_init(struct drm_i915_private *dev_priv)
INIT_WORK(&fbc->underrun_work, intel_fbc_underrun_work_fn); INIT_WORK(&fbc->underrun_work, intel_fbc_underrun_work_fn);
mutex_init(&fbc->lock); mutex_init(&fbc->lock);
fbc->enabled = false;
fbc->active = false; fbc->active = false;
if (!drm_mm_initialized(&dev_priv->mm.stolen)) if (!drm_mm_initialized(&dev_priv->mm.stolen))
......
...@@ -373,7 +373,6 @@ struct intel_fbc { ...@@ -373,7 +373,6 @@ struct intel_fbc {
bool false_color; bool false_color;
bool enabled;
bool active; bool active;
bool flip_pending; bool flip_pending;
......
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