intel_state->ggtt_vma = NULL;
intel_state->dpt_vma = NULL;
intel_state->flags = 0;
- intel_state->do_async_flip = false;
/* add reference to fb */
if (intel_state->hw.fb)
new_crtc_state->disable_lp_wm = true;
if (intel_plane_do_async_flip(plane, old_crtc_state, new_crtc_state))
- new_plane_state->do_async_flip = true;
+ new_crtc_state->do_async_flip = true;
return 0;
}
trace_intel_plane_update_arm(&plane->base, crtc);
- if (plane_state->do_async_flip)
+ if (crtc_state->do_async_flip && plane->async_flip)
plane->async_flip(plane, crtc_state, plane_state, true);
else
plane->update_arm(plane, crtc_state, plane_state);
struct intel_plane *plane;
int i;
- if (new_crtc_state->uapi.async_flip)
+ if (new_crtc_state->do_async_flip)
return;
/*
intel_crtc_has_type(new_crtc_state, INTEL_OUTPUT_DSI);
DEFINE_WAIT(wait);
- if (new_crtc_state->uapi.async_flip)
+ if (new_crtc_state->do_async_flip)
return;
if (intel_crtc_needs_vblank_work(new_crtc_state))
ktime_t end_vbl_time = ktime_get();
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
- if (new_crtc_state->uapi.async_flip)
+ if (new_crtc_state->do_async_flip)
return;
trace_intel_pipe_update_end(crtc, end_vbl_count, scanline_end);
int i;
for_each_new_intel_plane_in_state(state, plane, plane_state, i) {
- if (plane->enable_flip_done &&
- plane->pipe == crtc->pipe &&
- update_planes & BIT(plane->id) &&
- plane_state->do_async_flip)
+ if (plane->pipe == crtc->pipe &&
+ update_planes & BIT(plane->id))
plane->enable_flip_done(plane);
}
}
int i;
for_each_new_intel_plane_in_state(state, plane, plane_state, i) {
- if (plane->disable_flip_done &&
- plane->pipe == crtc->pipe &&
- update_planes & BIT(plane->id) &&
- plane_state->do_async_flip)
+ if (plane->pipe == crtc->pipe &&
+ update_planes & BIT(plane->id))
plane->disable_flip_done(plane);
}
}
continue;
/*
- * TODO: Async flip is only supported through the page flip IOCTL
- * as of now. So support currently added for primary plane only.
- * Support for other planes on platforms on which supports
- * this(vlv/chv and icl+) should be added when async flip is
- * enabled in the atomic IOCTL path.
+ * Only async flip capable planes should be in the state
+ * if we're really about to ask the hardware to perform
+ * an async flip. We should never get this far otherwise.
*/
- if (!plane->async_flip)
+ if (drm_WARN_ON(&i915->drm,
+ new_crtc_state->do_async_flip && !plane->async_flip))
return -EINVAL;
+ /*
+ * Only check async flip capable planes other planes
+ * may be involved in the initial commit due to
+ * the wm0/ddb optimization.
+ *
+ * TODO maybe should track which planes actually
+ * were requested to do the async flip...
+ */
+ if (!plane->async_flip)
+ continue;
+
/*
* FIXME: This check is kept generic for all platforms.
* Need to verify this for all gen9 platforms to enable
intel_dbuf_pre_plane_update(state);
for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) {
- if (new_crtc_state->uapi.async_flip)
+ if (new_crtc_state->do_async_flip)
intel_crtc_enable_flip_done(state, crtc);
}
drm_atomic_helper_wait_for_flip_done(dev, &state->base);
for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) {
- if (new_crtc_state->uapi.async_flip)
+ if (new_crtc_state->do_async_flip)
intel_crtc_disable_flip_done(state, crtc);
}