MLK-19673-1: drm/imx/core: add a workqueue and a commit object
authorLaurentiu Palcu <laurentiu.palcu@nxp.com>
Fri, 5 Oct 2018 12:35:54 +0000 (15:35 +0300)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
commit70126e04e6dc8be6f29483c949fd49899c448fc8
tree278f3f461edbcf8b5cb613c9e37d4ce2af9ea66d
parent57b11d7a16b4c349e4caf55403204a02b3dd9101
MLK-19673-1: drm/imx/core: add a workqueue and a commit object

This change adds a workqueue and a commit object that can be used by the
drivers to protect pending commits (non-blocking ones) from concurent
commits using legacy API (for example).

A non-blocking commit will defer the work to a workqueue and it may wait
for fences to be cleared. Waiting for fences to be cleared is
interruptible. Hence, if a SETPLANE IOCTL is performed (to disable a
plane), it may preempt the current commit and will mess up the atomic
states.  When the legacy calls finish, the non-blocking commit worker
will resume, but the crtc and/or FBs of some planes are already NULL.
Hence, the non-blocking commit will crash in
drm_atomic_helper_commit_planes() with NULL pointer dereference.

This particular patch does not affect existing drivers in any way.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
CC: Ying Liu <victor.liu@nxp.com>
CC: Fancy Fang <chen.fang@nxp.com>
drivers/gpu/drm/imx/imx-drm-core.c
drivers/gpu/drm/imx/imx-drm.h