mirror of https://github.com/torvalds/linux.git
drm/amdgpu: Enable async flip on overlay planes
amdgpu can handle async flips on overlay planes, so allow it for atomic async checks. Signed-off-by: André Almeida <andrealmeid@igalia.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250127-tonyk-async_flip-v12-2-0f7f8a8610d3@igalia.com [DB: fixed checkpatch warning by adding braces] Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
This commit is contained in:
parent
fd40a63c63
commit
41129e236f
|
|
@ -1258,21 +1258,24 @@ static int amdgpu_dm_plane_atomic_check(struct drm_plane *plane,
|
|||
}
|
||||
|
||||
static int amdgpu_dm_plane_atomic_async_check(struct drm_plane *plane,
|
||||
struct drm_atomic_state *state)
|
||||
struct drm_atomic_state *state, bool flip)
|
||||
{
|
||||
struct drm_crtc_state *new_crtc_state;
|
||||
struct drm_plane_state *new_plane_state;
|
||||
struct dm_crtc_state *dm_new_crtc_state;
|
||||
|
||||
/* Only support async updates on cursor planes. */
|
||||
if (plane->type != DRM_PLANE_TYPE_CURSOR)
|
||||
if (flip) {
|
||||
if (plane->type != DRM_PLANE_TYPE_OVERLAY)
|
||||
return -EINVAL;
|
||||
} else if (plane->type != DRM_PLANE_TYPE_CURSOR) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
new_plane_state = drm_atomic_get_new_plane_state(state, plane);
|
||||
new_crtc_state = drm_atomic_get_new_crtc_state(state, new_plane_state->crtc);
|
||||
dm_new_crtc_state = to_dm_crtc_state(new_crtc_state);
|
||||
/* Reject overlay cursors for now*/
|
||||
if (dm_new_crtc_state->cursor_mode == DM_CURSOR_OVERLAY_MODE)
|
||||
if (!flip && dm_new_crtc_state->cursor_mode == DM_CURSOR_OVERLAY_MODE)
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue