[enhancement] Add API for querying attributes of a MirPixelFormat

Bug #1236254 reported by Daniel van Vugt
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mir
Triaged
Medium
Unassigned
mir (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

MirPixelFormat does not encode details of the pixel format. This is annoying because we frequently need to switch/case for each supported pixel format.

Tags: enhancement
description: updated
summary: - MirPixelFormat does not encode details of the pixel format
+ [feature] MirPixelFormat should encode details of the pixel format
tags: added: feature
summary: - [feature] MirPixelFormat should encode details of the pixel format
+ [enhancement] MirPixelFormat should encode details of the pixel format
tags: added: enhancement
removed: feature
description: updated
Changed in mir:
assignee: nobody → Josh Arenson (josharenson)
Revision history for this message
Kevin DuBois (kdub) wrote : Re: [enhancement] MirPixelFormat should encode details of the pixel format

This was the original intention behind the format class, so I'm all for this enhancement

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

I now think a simple query function might be better than modifying the enum because 32 bits (typical enum size) isn't really enough space to store all the information we want. A simple query function could just return a const pointer to a struct that describes the pixel format in detail.

summary: - [enhancement] MirPixelFormat should encode details of the pixel format
+ [enhancement] Add API for querying attributes of a MirPixelFormat
Changed in mir:
assignee: Josh Arenson (josharenson) → nobody
description: updated
Changed in mir:
status: New → Triaged
importance: Medium → Low
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Low priority because any self-respecting software client that wants decent performance will always still need separate optimized code paths.

Revision history for this message
Gerry Boland (gerboland) wrote :

I want to raise priority on this as Qt allows clients to select different pixel formats at runtime, and needs to apply heuristics to select the closest matching mir pixel format. Right now to achieve this, we have to hardcode the mir pixelformats which have an alpha channel.

Changed in mir:
importance: Low → Medium
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I think you're waiting for the wrong feature :)

The right solution for you is probably what I added in Mir 0.15.0:
    mir_connection_get_egl_pixel_format()

So all you need to do is set up your EGL context config with what you need (EGL_ALPHA_SIZE=8 or whatever) and then mir_connection_get_egl_pixel_format() will tell you what the corresponding MirPixelFormat is. More importantly, when there are apparently multiple answers, mir_connection_get_egl_pixel_format() tells you the exact MirPixelFormat that the graphics driver is really using, so as to avoid ambiguity and messed up colours (LP: #1460149)

Revision history for this message
Michał Sawicz (saviq) wrote :

Syncing task from Mir.

Changed in mir (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
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.