]> git.baikalelectronics.ru Git - kernel.git/commit
drm/vc4: kms: Wait on previous FIFO users before a commit
authorMaxime Ripard <maxime@cerno.tech>
Fri, 4 Dec 2020 15:11:35 +0000 (16:11 +0100)
committerMaxime Ripard <maxime@cerno.tech>
Tue, 15 Dec 2020 10:33:34 +0000 (11:33 +0100)
commit4c39a07c780040046074ce7c24103cc03b7bd05a
treec8c75ac2997c392219ba65a28a3b3e9c55953763
parent26c4142a7c5551f7f1d75df6232d684b869fbd0c
drm/vc4: kms: Wait on previous FIFO users before a commit

If we're having two subsequent, non-blocking, commits on two different
CRTCs that share no resources, there's no guarantee on the order of
execution of both commits.

However, the second one will consider the first one as the old state,
and will be in charge of freeing it once that second commit is done.

If the first commit happens after that second commit, it might access
some resources related to its state that has been freed, resulting in a
use-after-free bug.

The standard DRM objects are protected against this, but our HVS private
state isn't so let's make sure we wait for all the previous FIFO users
to finish their commit before going with our own.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20201204151138.1739736-5-maxime@cerno.tech
drivers/gpu/drm/vc4/vc4_kms.c