]> git.baikalelectronics.ru Git - kernel.git/commit
drm/atomic: make drm_atomic_helper_wait_for_vblanks more agressive
authorLucas Stach <l.stach@pengutronix.de>
Wed, 29 Nov 2017 11:04:31 +0000 (12:04 +0100)
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Wed, 29 Nov 2017 14:16:17 +0000 (15:16 +0100)
commit386652ae88497d4e2352a302339c6a54b11ffef1
tree2c9cf2bc316ae8b0006795d9c8c0b189b3561783
parentce49d302447e96c97ae99b91c39f4b03874e4b0d
drm/atomic: make drm_atomic_helper_wait_for_vblanks more agressive

drm_atomic_helper_setup_commit expects that flipping of previous commits
has happened when it is called to set up a new commit. This can be violated
by commits where userspace doesn't get a flip completion event to
synchronize against i.e. legacy modesets and property changes.

The expectation is that those are done by blocking commits, which wait for
completion. Most drivers call drm_atomic_helper_wait_for_vblanks in the
commit_tail to ensure completion, but the wait for next vblank might not
actually happen if the commit didn't change any planes.

Make the wait more agressive by also waiting if no planes changed. This
is the minimal regression fix for the 4.15 kernel series. Long term
drivers should switch away from drm_atomic_helper_wait_for_vblanks and
use drm_atomic_helper_wait_for_flip_done instead.

Fixes: 6bd0493e3a65 ("drm/atomic: Remove waits in drm_atomic_helper_commit_cleanup_done, v2.")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171129110431.6300-1-l.stach@pengutronix.de
drivers/gpu/drm/drm_atomic_helper.c