Skip to content

Commit

Permalink
drm/i915/fbc: replace a loop with drm_atomic_get_existing_crtc_state()
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Paulo Zanoni committed Nov 14, 2016
1 parent 03e3910 commit ba67fab
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions drivers/gpu/drm/i915/intel_fbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -1092,23 +1092,20 @@ 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;

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:
Expand Down

0 comments on commit ba67fab

Please sign in to comment.