drm/omap: fix race issue when unloading omapdrm
At module unload, omap_fbdev_free() gets called which releases the
framebuffers. However, the framebuffers are still used by crtcs, and
will be released only later at vsync. The driver doesn't wait for this,
and goes on to release the rest of the resources, which often
causes a crash.
This patchs adds a omap_crtc_flush() function which waits until the crtc
has finished with its apply queue and page flips.
The function utilizes a simple polling while-loop, as the performance is
not an issue here.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>