compositor-drm: Avoid output_destroy happened before page_flip event
authorXiong Zhang <xiong.y.zhang@intel.com>
Fri, 11 Oct 2013 06:43:07 +0000 (14:43 +0800)
committerKristian Høgsberg <krh@bitplanet.net>
Fri, 11 Oct 2013 19:29:22 +0000 (12:29 -0700)
commitabd5d47b3b3ce45be81adf04dd9d9730a9d3fd32
treebf457888957da111040ba0727cbac327ae9d16a0
parentcab9aeaff5e9a73f37f9895d67a63864803a4dd6
compositor-drm: Avoid output_destroy happened before page_flip event

Currently there is no guarentee that output remove event always happend after
page_flip event on the same output. So if the following situation occur:

  first: unplug a output
  second: output remove event arrive, output_destrory called adn free output
  third: page_flip event arrive on the destroyed output

the segment fault will happpen in page_flip_handler().

This patch add a variable drm_compositor->destroy_pending, if page flip
event is pending when output remove event arrive, output_destroy will be
delayed until page flip finished.

Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
src/compositor-drm.c