~mir-team/mir/0.19

Viewing all changes in revision 3292.

  • Committer: Alberto Aguirre
  • Author(s): Andreas Pokorny
  • Date: 2016-02-09 20:47:36 UTC
  • Revision ID: alberto.aguirre@canonical.com-20160209204736-lvdb2u169by86oiu
input: Copy output rectangles when configuration changes

DisplayInputRegion used to calculate a set of rectangles on every mouse event, even when the set of outputs rarely changes. This change keeps a mir::geometry::Rectangles as cache. The actual dead lock of lp:1538632 was caused by the fact that DisplauInputRegion would use - to calculate the mir::geometry::Rectangles - the following locks in the given order:
  * mir::graphics::Display::configuration_mutex via for_each_display_sync_group()
  * mir::graphics::DisplayGroup::guard via for_each_display_buffer()

Simultaneously the SystemWindowManager::add_display method is called by the CompositingFunctor, which uses DisplaySyncGroup::for_each_display_buffer, and deeper in the call tree GraphicsDisplayLayout would request a copy of the DisplayConfiguration during place_in_output, which results in the reverse lock ordering:
  * mir::graphics::DisplayGroup::guard via for_each_display_buffer()
  * mir::graphics::Display::configuration_mutex via configration()

This change makes sure that the DisplayInputRegion does not touch any locks used by the graphics platform during input event handling

Cherry picked from lp:mir r3288

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: