OK, I think this might be the problem. The client API is releasing its
shared pointer the the software buffer region prematurely (before
mir_buffer_stream_get_graphics_region even returns). This means we are
calling Android's gralloc->unlock() way before the client has even
started filling the buffer!


void mir_buffer_stream_get_graphics_region(
    MirBufferStream *buffer_stream,
    MirGraphicsRegion *region_out)
try
{
    mcl::ClientBufferStream *bs = 
reinterpret_cast<mcl::ClientBufferStream*>(buffer_stream);

    auto secured_region = bs->secure_for_cpu_write();
    region_out->width = secured_region->width.as_uint32_t();
    region_out->height = secured_region->height.as_uint32_t();
    region_out->stride = secured_region->stride.as_uint32_t();
    region_out->pixel_format = secured_region->format;
    region_out->vaddr = secured_region->vaddr.get();
}
catch (std::exception const& ex)
{
    MIR_LOG_UNCAUGHT_EXCEPTION(ex);
}


** Changed in: mir
     Assignee: (unassigned) => Daniel van Vugt (vanvugt)

** Changed in: mir
    Milestone: None => 0.17.0

** Changed in: mir
       Status: Triaged => In Progress

-- 
You received this bug notification because you are a member of Ubuntu-X,
which is subscribed to xorg-server in Ubuntu.
https://bugs.launchpad.net/bugs/1406725

Title:
  Severe graphical corruption running software clients (including Xmir)
  on android

To manage notifications about this bug go to:
https://bugs.launchpad.net/mir/+bug/1406725/+subscriptions

_______________________________________________
Mailing list: https://launchpad.net/~ubuntu-x-swat
Post to     : ubuntu-x-swat@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ubuntu-x-swat
More help   : https://help.launchpad.net/ListHelp

Reply via email to