Commit 49227c4a authored by Paulo Zanoni's avatar Paulo Zanoni

drm/i915/fbc: make FBC work with fastboot

Move intel_fbc_enable to a place where it is called regardless of the
"modeset" variable, and make sure intel_fbc_enable can be called
multiple times without intel_fbc_disable being called.
Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1453210558-7875-20-git-send-email-paulo.r.zanoni@intel.com
parent 58f9c0bc
...@@ -13558,7 +13558,6 @@ static int intel_atomic_commit(struct drm_device *dev, ...@@ -13558,7 +13558,6 @@ static int intel_atomic_commit(struct drm_device *dev,
if (modeset && crtc->state->active) { if (modeset && crtc->state->active) {
update_scanline_offset(to_intel_crtc(crtc)); update_scanline_offset(to_intel_crtc(crtc));
dev_priv->display.crtc_enable(crtc); dev_priv->display.crtc_enable(crtc);
intel_fbc_enable(intel_crtc);
} }
if (update_pipe) { if (update_pipe) {
...@@ -13571,6 +13570,9 @@ static int intel_atomic_commit(struct drm_device *dev, ...@@ -13571,6 +13570,9 @@ static int intel_atomic_commit(struct drm_device *dev,
if (!modeset) if (!modeset)
intel_pre_plane_update(intel_crtc); intel_pre_plane_update(intel_crtc);
if (crtc->state->active && intel_crtc->atomic.update_fbc)
intel_fbc_enable(intel_crtc);
if (crtc->state->active && if (crtc->state->active &&
(crtc->state->planes_changed || update_pipe)) (crtc->state->planes_changed || update_pipe))
drm_atomic_helper_commit_planes_on_crtc(crtc_state); drm_atomic_helper_commit_planes_on_crtc(crtc_state);
......
...@@ -1084,7 +1084,9 @@ void intel_fbc_choose_crtc(struct drm_i915_private *dev_priv, ...@@ -1084,7 +1084,9 @@ void intel_fbc_choose_crtc(struct drm_i915_private *dev_priv,
* @crtc: the CRTC * @crtc: the CRTC
* *
* This function checks if the given CRTC was chosen for FBC, then enables it if * This function checks if the given CRTC was chosen for FBC, then enables it if
* possible. Notice that it doesn't activate FBC. * possible. Notice that it doesn't activate FBC. It is valid to call
* intel_fbc_enable multiple times for the same pipe without an
* intel_fbc_disable in the middle, as long as it is deactivated.
*/ */
void intel_fbc_enable(struct intel_crtc *crtc) void intel_fbc_enable(struct intel_crtc *crtc)
{ {
...@@ -1097,7 +1099,11 @@ void intel_fbc_enable(struct intel_crtc *crtc) ...@@ -1097,7 +1099,11 @@ void intel_fbc_enable(struct intel_crtc *crtc)
mutex_lock(&fbc->lock); mutex_lock(&fbc->lock);
if (fbc->enabled) { if (fbc->enabled) {
WARN_ON(fbc->crtc == crtc); WARN_ON(fbc->crtc == NULL);
if (fbc->crtc == crtc) {
WARN_ON(!crtc->config->enable_fbc);
WARN_ON(fbc->active);
}
goto out; goto out;
} }
......
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