drm/imx: keep GEM object referenced as long as scanout is active
authorLucas Stach <l.stach@pengutronix.de>
Tue, 9 Feb 2016 13:29:49 +0000 (14:29 +0100)
committerPhilipp Zabel <p.zabel@pengutronix.de>
Tue, 1 Mar 2016 07:33:40 +0000 (08:33 +0100)
commit0a7ad343c8717a11b9e1feeac511d61b76c05766
tree88dfb66e7eb7b48aee8df32e76e78f534805ddd4
parent0bfc2b3d01feaedff65c27a36eab0d428190947d
drm/imx: keep GEM object referenced as long as scanout is active

The DRM core only references the currently queued/active framebuffer.
So there is a period of time where the flip is not completed, but
the GEM object backing the FB is already unreferenced and could be
destroyed if userspace closes its handle.

Make sure to keep a reference to the GEM object until the flip is
actually executed clean things up in a worker running behind the
flip execution.

Also move the page flip event into the context of this worker, so
it gets cleaned up automatically.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
drivers/gpu/drm/imx/ipuv3-crtc.c