diff options
author | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2016-11-11 19:57:36 +0300 |
---|---|---|
committer | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2016-11-14 19:00:29 +0300 |
commit | ba67fab02c02799323c502bf756bbc59da6bfad3 (patch) | |
tree | 5cb5d5ca1580f5d45e9de85aa16678d6380ac20e /drivers/gpu/drm/i915/intel_fbc.c | |
parent | 03e39104d9fd72238264576462138ed4b011b24b (diff) | |
download | linux-ba67fab02c02799323c502bf756bbc59da6bfad3.tar.xz |
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: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Ville 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
Diffstat (limited to 'drivers/gpu/drm/i915/intel_fbc.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_fbc.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c index ded77bda1e03..b53b88425d8c 100644 --- a/drivers/gpu/drm/i915/intel_fbc.c +++ b/drivers/gpu/drm/i915/intel_fbc.c @@ -1071,7 +1071,7 @@ void intel_fbc_choose_crtc(struct drm_i915_private *dev_priv, struct drm_plane *plane; struct drm_plane_state *plane_state; bool fbc_crtc_present = false; - int i, j; + int i; mutex_lock(&fbc->lock); @@ -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) { struct intel_plane_state *intel_plane_state = to_intel_plane_state(plane_state); + struct intel_crtc_state *intel_crtc_state; if (!intel_plane_state->base.visible) continue; @@ -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))) continue; - for_each_crtc_in_state(state, crtc, crtc_state, j) { - struct intel_crtc_state *intel_crtc_state = - to_intel_crtc_state(crtc_state); - - if (plane_state->crtc != crtc) - continue; + intel_crtc_state = to_intel_crtc_state( + drm_atomic_get_existing_crtc_state(state, + plane_state->crtc)); - intel_crtc_state->enable_fbc = true; - goto out; - } + intel_crtc_state->enable_fbc = true; + break; } out: |