aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVille Syrjälä <[email protected]>2021-11-24 13:36:41 +0200
committerVille Syrjälä <[email protected]>2021-12-03 13:12:19 +0200
commit62d4874bee61d971b74dfd5fcd8032ff33746885 (patch)
tree6e4e5a738fd633d8988b0811739b78c3ade9d61c
parent004f80f91a7831cd32970e1078bb00594d042089 (diff)
drm/i915/fbc: Flatten __intel_fbc_pre_update()
Use an early return to flatten most of __intel_fbc_pre_update(). Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Mika Kahola <[email protected]>
-rw-r--r--drivers/gpu/drm/i915/display/intel_fbc.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
index cf7fc0de6081..0bef3b948670 100644
--- a/drivers/gpu/drm/i915/display/intel_fbc.c
+++ b/drivers/gpu/drm/i915/display/intel_fbc.c
@@ -1223,27 +1223,27 @@ static bool __intel_fbc_pre_update(struct intel_atomic_state *state,
intel_fbc_update_state_cache(state, crtc, plane);
fbc->flip_pending = true;
- if (!intel_fbc_can_flip_nuke(state, crtc, plane)) {
- intel_fbc_deactivate(fbc, "update pending");
-
- /*
- * Display WA #1198: glk+
- * Need an extra vblank wait between FBC disable and most plane
- * updates. Bspec says this is only needed for plane disable, but
- * that is not true. Touching most plane registers will cause the
- * corruption to appear. Also SKL/derivatives do not seem to be
- * affected.
- *
- * TODO: could optimize this a bit by sampling the frame
- * counter when we disable FBC (if it was already done earlier)
- * and skipping the extra vblank wait before the plane update
- * if at least one frame has already passed.
- */
- if (fbc->activated &&
- DISPLAY_VER(i915) >= 10)
- need_vblank_wait = true;
- fbc->activated = false;
- }
+ if (intel_fbc_can_flip_nuke(state, crtc, plane))
+ return need_vblank_wait;
+
+ intel_fbc_deactivate(fbc, "update pending");
+
+ /*
+ * Display WA #1198: glk+
+ * Need an extra vblank wait between FBC disable and most plane
+ * updates. Bspec says this is only needed for plane disable, but
+ * that is not true. Touching most plane registers will cause the
+ * corruption to appear. Also SKL/derivatives do not seem to be
+ * affected.
+ *
+ * TODO: could optimize this a bit by sampling the frame
+ * counter when we disable FBC (if it was already done earlier)
+ * and skipping the extra vblank wait before the plane update
+ * if at least one frame has already passed.
+ */
+ if (fbc->activated && DISPLAY_VER(i915) >= 10)
+ need_vblank_wait = true;
+ fbc->activated = false;
return need_vblank_wait;
}