@@ -2075,15 +2075,35 @@ static void intel_flip_fini(struct drm_device *dev)
drm_flip_driver_fini(&dev_priv->flip_driver);
}
+static void intel_atomic_schedule_flips(struct drm_i915_private *dev_priv,
+ struct intel_crtc *intel_crtc,
+ struct list_head *flips)
+{
+ if (!intel_crtc->active) {
+ drm_flip_driver_complete_flips(&dev_priv->flip_driver, flips);
+ return;
+ }
+
+ drm_flip_driver_prepare_flips(&dev_priv->flip_driver, flips);
+
+ local_irq_disable();
+
+ intel_pipe_vblank_evade(&intel_crtc->base);
+
+ drm_flip_driver_schedule_flips(&dev_priv->flip_driver, flips);
+
+ local_irq_enable();
+}
+
static void atomic_pipe_commit(struct drm_device *dev,
struct intel_atomic_state *state,
int pipe)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct drm_i915_file_private *file_priv = state->file->driver_priv;
+ struct intel_crtc *intel_crtc = to_intel_crtc(intel_get_crtc_for_pipe(dev, pipe));
LIST_HEAD(flips);
int i;
- bool pipe_enabled = to_intel_crtc(intel_get_crtc_for_pipe(dev, pipe))->active;
for (i = 0; i < dev->mode_config.num_crtc; i++) {
struct intel_crtc_state *st = &state->crtc[i];
@@ -2189,20 +2209,7 @@ static void atomic_pipe_commit(struct drm_device *dev,
if (list_empty(&flips))
return;
- if (!pipe_enabled) {
- drm_flip_driver_complete_flips(&dev_priv->flip_driver, &flips);
- return;
- }
-
- drm_flip_driver_prepare_flips(&dev_priv->flip_driver, &flips);
-
- local_irq_disable();
-
- intel_pipe_vblank_evade(intel_get_crtc_for_pipe(dev, pipe));
-
- drm_flip_driver_schedule_flips(&dev_priv->flip_driver, &flips);
-
- local_irq_enable();
+ intel_atomic_schedule_flips(dev_priv, intel_crtc, &flips);
}
void intel_atomic_handle_vblank(struct drm_device *dev, int pipe)