Mir

mir_buffer_usage_software produces incorrect colours / pixel format

Bug #1172163 reported by Daniel van Vugt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mir
Fix Released
High
Alexandros Frantzis

Bug Description

Using mir_buffer_usage_software produces the wrong colours.

The documentation says:
/**
 * The order of components in a format enum matches the
 * order of the components as they would be written in an
 * integer representing a pixel value of that format.
 *
 * For example, abgr_8888 corresponds to 0xAABBGGRR, which will
 * end up as R,G,B,A in memory in a little endian system, and
 * as A,B,G,R in memory in a big endian system.
 */
This sounds logical and portable. No byte swapping is ever required in the client.

And my system says I get: mir_pixel_format_abgr_8888

However on screen I don't get the right colours unless I draw 0xAARRGGBB. That's clearly wrong no matter how you interpret the endian-ness.

Related branches

Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Using intel graphics on raring by the way.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I oh see the problem...

void MirSurface::get_cpu_region(MirGraphicsRegion& region_out)
{
    auto buffer = buffer_depository->current_buffer();

    secured_region = buffer->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();
    //todo: fix
    region_out.pixel_format = mir_pixel_format_abgr_8888;

    region_out.vaddr = secured_region->vaddr.get();
}

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The problem is that my system really is using ARGB. And the comment in src/client/mir_surface.cpp shows that Mir just doesn't return the correct pixel_format yet :(

Changed in mir:
status: New → In Progress
assignee: nobody → Alexandros Frantzis (afrantzis)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:mir at revision 662, scheduled for release in mir, milestone 0.0.3

Changed in mir:
status: In Progress → Fix Committed
Changed in mir:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.