drm/exynos: release unhandled page flip events at postclose.
authorInki Dae <inki.dae@samsung.com>
Tue, 1 Oct 2013 05:51:37 +0000 (14:51 +0900)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:47:43 +0000 (11:47 +0900)
commite0ac6157b7299bb53ee87a715f967f81d258c974
tree74c87417885836090e4738e6c75d48cd8f0f9760
parent59a0e546396ed502dd010b9c12580caa4dd7f107
drm/exynos: release unhandled page flip events at postclose.

This patch resolves a dead lock issue that could be incurred when
exynos_drm_crtc_dpms function was called.

The exynos_drm_crtc_dpms function waits for the completion of pended
page flip events. However, preclose callback - this releases all unhandled
page flip events - is called prior to the exynos_drm_crtc_dpms function call
when drm is closed. So at this time, this will make the exynos_drm_crtc_dpms
to wait infiniately for the completion of the page flip events.

This patch releases the unhandled page flip events at postclose instead
of preclose so that exynos_drm_crtc_dpms function can be waked up.

Changelog v2:
- fix a memory leak when drm is closed.
  . it has a memory leak when a requeste page flip is handled after
    drm_events_release() is called and before drm_fb_release()
    is called. At this time, a drm_pending_event will not be freed.
    So also this chage releases the drm_pending_event at postclose().
    And it calls drm_vblank_put() for pair if there is any unhandled page
    flip event.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
drivers/gpu/drm/exynos/exynos_drm_drv.c