Mir

Comment 12 for bug 1413211

Revision history for this message
Kevin DuBois (kdub) wrote :

So, when adding the new surface, the code ends up in SoftwareCursor::create_renderable_for, which calls the mg::Buffer::write. On android while using overlays, the software buffer is almost-always locked, as it always onscreen. mg::Buffer::write appropriately blocks, waiting for the buffer to go offscreen, but the cursor doesn't really go offscreen, so it locks forever.

The attached fix changes from trying to reuse and rewrite an existing buffer to just allocating a new buffer every time.

The alternatives seemed worse (at least in the short run). I could have tagged the buffer internally as 'the software cursor' and rejected it on submission to HWC (effectively disabling overlay for no reason in the large majority of cases). I could have expanded the write() signature to fail if it would block, but that had strange semantics.