Commit ba67fab0 authored by Paulo Zanoni's avatar Paulo Zanoni

drm/i915/fbc: replace a loop with drm_atomic_get_existing_crtc_state()

Much simpler. Thanks to Ville for pointing this.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reported-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1478883461-20201-3-git-send-email-paulo.r.zanoni@intel.com
parent 03e39104
...@@ -1071,7 +1071,7 @@ void intel_fbc_choose_crtc(struct drm_i915_private *dev_priv, ...@@ -1071,7 +1071,7 @@ void intel_fbc_choose_crtc(struct drm_i915_private *dev_priv,
struct drm_plane *plane; struct drm_plane *plane;
struct drm_plane_state *plane_state; struct drm_plane_state *plane_state;
bool fbc_crtc_present = false; bool fbc_crtc_present = false;
int i, j; int i;
mutex_lock(&fbc->lock); mutex_lock(&fbc->lock);
...@@ -1092,6 +1092,7 @@ void intel_fbc_choose_crtc(struct drm_i915_private *dev_priv, ...@@ -1092,6 +1092,7 @@ void intel_fbc_choose_crtc(struct drm_i915_private *dev_priv,
for_each_plane_in_state(state, plane, plane_state, i) { for_each_plane_in_state(state, plane, plane_state, i) {
struct intel_plane_state *intel_plane_state = struct intel_plane_state *intel_plane_state =
to_intel_plane_state(plane_state); to_intel_plane_state(plane_state);
struct intel_crtc_state *intel_crtc_state;
if (!intel_plane_state->base.visible) if (!intel_plane_state->base.visible)
continue; continue;
...@@ -1099,16 +1100,12 @@ void intel_fbc_choose_crtc(struct drm_i915_private *dev_priv, ...@@ -1099,16 +1100,12 @@ void intel_fbc_choose_crtc(struct drm_i915_private *dev_priv,
if (!intel_fbc_can_choose(to_intel_crtc(plane_state->crtc))) if (!intel_fbc_can_choose(to_intel_crtc(plane_state->crtc)))
continue; continue;
for_each_crtc_in_state(state, crtc, crtc_state, j) { intel_crtc_state = to_intel_crtc_state(
struct intel_crtc_state *intel_crtc_state = drm_atomic_get_existing_crtc_state(state,
to_intel_crtc_state(crtc_state); plane_state->crtc));
if (plane_state->crtc != crtc)
continue;
intel_crtc_state->enable_fbc = true; intel_crtc_state->enable_fbc = true;
goto out; break;
}
} }
out: 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