Skip to content

Commit

Permalink
drm/atomic: Rename crtc_state->pageflip_flags to async_flip
Browse files Browse the repository at this point in the history
It's the only flag anyone actually cares about. Plus if we're unlucky,
the atomic ioctl might need a different flag for async flips. So
better to abstract this away from the uapi a bit.

Reviewed-by: Maarten Lankhorst <[email protected]>
Reviewed-by: Nicholas Kazlauskas <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Michel Dänzer <[email protected]>
Cc: Alex Deucher <[email protected]>
Cc: Adam Jackson <[email protected]>
Cc: Sean Paul <[email protected]>
Cc: David Airlie <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Nicholas Kazlauskas <[email protected]>
Cc: Leo Li <[email protected]>
Cc: Harry Wentland <[email protected]>
Cc: David Francis <[email protected]>
Cc: Mario Kleiner <[email protected]>
Cc: Bhawanpreet Lakha <[email protected]>
Cc: Ben Skeggs <[email protected]>
Cc: "Christian König" <[email protected]>
Cc: Ilia Mirkin <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Cc: Chris Wilson <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
danvet committed Sep 18, 2019
1 parent f2cbda2 commit 4d85f45
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
5 changes: 2 additions & 3 deletions drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -5756,8 +5756,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
* change FB pitch, DCC state, rotation or mirroing.
*/
bundle->flip_addrs[planes_count].flip_immediate =
(crtc->state->pageflip_flags &
DRM_MODE_PAGE_FLIP_ASYNC) != 0 &&
crtc->state->async_flip &&
acrtc_state->update_type == UPDATE_TYPE_FAST;

timestamp_ns = ktime_get_ns();
Expand Down Expand Up @@ -6334,7 +6333,7 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
amdgpu_dm_enable_crtc_interrupts(dev, state, true);

for_each_new_crtc_in_state(state, crtc, new_crtc_state, j)
if (new_crtc_state->pageflip_flags & DRM_MODE_PAGE_FLIP_ASYNC)
if (new_crtc_state->async_flip)
wait_for_vblank = false;

/* update planes when needed per crtc*/
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/drm_atomic_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -3275,7 +3275,7 @@ static int page_flip_common(struct drm_atomic_state *state,
return PTR_ERR(crtc_state);

crtc_state->event = event;
crtc_state->pageflip_flags = flags;
crtc_state->async_flip = flags & DRM_MODE_PAGE_FLIP_ASYNC;

plane_state = drm_atomic_get_plane_state(state, plane);
if (IS_ERR(plane_state))
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/drm_atomic_state_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void __drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc,
state->zpos_changed = false;
state->commit = NULL;
state->event = NULL;
state->pageflip_flags = 0;
state->async_flip = false;

/* Self refresh should be canceled when a new update is available */
state->active = drm_atomic_crtc_effectively_active(state);
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/nouveau/dispnv50/wndw.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ nv50_wndw_atomic_check_acquire(struct nv50_wndw *wndw, bool modeset,
asyw->image.pitch[0] = fb->base.pitches[0];
}

if (!(asyh->state.pageflip_flags & DRM_MODE_PAGE_FLIP_ASYNC))
if (!asyh->state.async_flip)
asyw->image.interval = 1;
else
asyw->image.interval = 0;
Expand Down Expand Up @@ -383,7 +383,7 @@ nv50_wndw_atomic_check_lut(struct nv50_wndw *wndw,
}

/* Can't do an immediate flip while changing the LUT. */
asyh->state.pageflip_flags &= ~DRM_MODE_PAGE_FLIP_ASYNC;
asyh->state.async_flip = false;
}

static int
Expand Down
8 changes: 4 additions & 4 deletions include/drm/drm_crtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,12 +285,12 @@ struct drm_crtc_state {
u32 target_vblank;

/**
* @pageflip_flags:
* @async_flip:
*
* DRM_MODE_PAGE_FLIP_* flags, as passed to the page flip ioctl.
* Zero in any other case.
* This is set when DRM_MODE_PAGE_FLIP_ASYNC is set in the legacy
* PAGE_FLIP IOCTL. It's not wired up for the atomic IOCTL itself yet.
*/
u32 pageflip_flags;
bool async_flip;

/**
* @vrr_enabled:
Expand Down

0 comments on commit 4d85f45

Please sign in to comment.