OSDN Git Service

drm/imx: only send commit done event when all state has been applied
authorLucas Stach <l.stach@pengutronix.de>
Tue, 11 Sep 2018 14:03:16 +0000 (16:03 +0200)
committerPhilipp Zabel <p.zabel@pengutronix.de>
Fri, 22 Feb 2019 11:17:58 +0000 (12:17 +0100)
commita0ea4ffff2662c10ca69d5e246adf5543fd945b9
tree7540f9d167c79ef14ac61f461c13698e2b828237
parentf6019702d9646da03c11bb5c9bd89e23ccc4e14d
drm/imx: only send commit done event when all state has been applied

Currently there is a small race window where we could manage to arm the
vblank event from atomic flush, but programming the hardware was too close
to the frame end, so the hardware will only apply the current state on the
next vblank. In this case we will send out the commit done event too early
causing userspace to reuse framebuffes that are still in use.

Instead of using the event arming mechnism, just remember the pending event
and send it from the vblank IRQ handler, once we are sure that all state
has been applied successfully.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
[p.zabel@pengutronix.de: inverted logic: done -> pending, added back
 spinlock in atomic_flush, commit message typo fix]
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
drivers/gpu/drm/imx/ipuv3-crtc.c