Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/atomic: Add sanity checks to drm_atomic_helper_async_commit()

->atomic_async_update() requires that drivers update the plane->state
object before returning. Make sure at least common properties have been
updated.

Cc: Gustavo Padovan <gustavo@padovan.org>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Acked-by: Eric Anholt <eric@anholt.net>
Acked-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20180330145518.29770-1-boris.brezillon@bootlin.com

+11
+11
drivers/gpu/drm/drm_atomic_helper.c
··· 1572 1572 for_each_new_plane_in_state(state, plane, plane_state, i) { 1573 1573 funcs = plane->helper_private; 1574 1574 funcs->atomic_async_update(plane, plane_state); 1575 + 1576 + /* 1577 + * ->atomic_async_update() is supposed to update the 1578 + * plane->state in-place, make sure at least common 1579 + * properties have been properly updated. 1580 + */ 1581 + WARN_ON_ONCE(plane->state->fb != plane_state->fb); 1582 + WARN_ON_ONCE(plane->state->crtc_x != plane_state->crtc_x); 1583 + WARN_ON_ONCE(plane->state->crtc_y != plane_state->crtc_y); 1584 + WARN_ON_ONCE(plane->state->src_x != plane_state->src_x); 1585 + WARN_ON_ONCE(plane->state->src_y != plane_state->src_y); 1575 1586 } 1576 1587 } 1577 1588 EXPORT_SYMBOL(drm_atomic_helper_async_commit);