Skip to content

Commit 0826edb

Browse files
committed
drm/i915/display: Check async flip state of every crtc and plane once
For every crtc in state, intel_atomic_check_async() was checking all the crtc and plane states again. v2: comparing pipe ids instead of crtc pointers when iterating over planes Cc: Karthik B S <[email protected]> Cc: Vandita Kulkarni <[email protected]> Cc: Ville Syrjälä <[email protected]> Signed-off-by: José Roberto de Souza <[email protected]> Reviewed-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 49c55f7 commit 0826edb

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

drivers/gpu/drm/i915/display/intel_display.c

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7707,35 +7707,37 @@ static void kill_bigjoiner_slave(struct intel_atomic_state *state,
77077707
* correspond to the last vblank and have no relation to the actual time when
77087708
* the flip done event was sent.
77097709
*/
7710-
static int intel_atomic_check_async(struct intel_atomic_state *state)
7710+
static int intel_atomic_check_async(struct intel_atomic_state *state, struct intel_crtc *crtc)
77117711
{
77127712
struct drm_i915_private *i915 = to_i915(state->base.dev);
77137713
const struct intel_crtc_state *old_crtc_state, *new_crtc_state;
77147714
const struct intel_plane_state *new_plane_state, *old_plane_state;
7715-
struct intel_crtc *crtc;
77167715
struct intel_plane *plane;
77177716
int i;
77187717

7719-
for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state,
7720-
new_crtc_state, i) {
7721-
if (intel_crtc_needs_modeset(new_crtc_state)) {
7722-
drm_dbg_kms(&i915->drm, "Modeset Required. Async flip not supported\n");
7723-
return -EINVAL;
7724-
}
7718+
old_crtc_state = intel_atomic_get_old_crtc_state(state, crtc);
7719+
new_crtc_state = intel_atomic_get_new_crtc_state(state, crtc);
77257720

7726-
if (!new_crtc_state->hw.active) {
7727-
drm_dbg_kms(&i915->drm, "CRTC inactive\n");
7728-
return -EINVAL;
7729-
}
7730-
if (old_crtc_state->active_planes != new_crtc_state->active_planes) {
7731-
drm_dbg_kms(&i915->drm,
7732-
"Active planes cannot be changed during async flip\n");
7733-
return -EINVAL;
7734-
}
7721+
if (intel_crtc_needs_modeset(new_crtc_state)) {
7722+
drm_dbg_kms(&i915->drm, "Modeset Required. Async flip not supported\n");
7723+
return -EINVAL;
7724+
}
7725+
7726+
if (!new_crtc_state->hw.active) {
7727+
drm_dbg_kms(&i915->drm, "CRTC inactive\n");
7728+
return -EINVAL;
7729+
}
7730+
if (old_crtc_state->active_planes != new_crtc_state->active_planes) {
7731+
drm_dbg_kms(&i915->drm,
7732+
"Active planes cannot be changed during async flip\n");
7733+
return -EINVAL;
77357734
}
77367735

77377736
for_each_oldnew_intel_plane_in_state(state, plane, old_plane_state,
77387737
new_plane_state, i) {
7738+
if (plane->pipe != crtc->pipe)
7739+
continue;
7740+
77397741
/*
77407742
* TODO: Async flip is only supported through the page flip IOCTL
77417743
* as of now. So support currently added for primary plane only.
@@ -8054,7 +8056,7 @@ static int intel_atomic_check(struct drm_device *dev,
80548056
for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state,
80558057
new_crtc_state, i) {
80568058
if (new_crtc_state->uapi.async_flip) {
8057-
ret = intel_atomic_check_async(state);
8059+
ret = intel_atomic_check_async(state, crtc);
80588060
if (ret)
80598061
goto fail;
80608062
}

0 commit comments

Comments
 (0)