The MirAL API should support more options for display configuration #2913
Replies: 12 comments
-
Related to #1831 |
Beta Was this translation helpful? Give feedback.
-
Would you be able to give some more guidance to someone new trying to fix this? Because right now while I'd like to fix this, I'm not sure that I can... |
Beta Was this translation helpful? Give feedback.
-
So, the broad outline of the problem to solve is: There are a bunch of things that are needed: There needs to be a miral structure describing the relevant aspects of display configuration, there needs to be a miral API for changing that configuration, and there needs to be a miral API for choosing a display configuration when some display event happens (like plugging/unplugging a monitor).
Fortunately, this could be done a bit at a time - start with a class describing the available connectors, which connectors have displays plugged in, and which displays are active, and the ability to enable/disable a display. That could then be expanded to list the available modes of the plugged in displays, and select the mode, then expanded again to describe/set the orientation, and again to describe/set the gamma ramps, and so on. |
Beta Was this translation helpful? Give feedback.
-
@programizer as RAOF says, this is something of an epic issue to remind us of the wider considerations. Do you have a specific problem you want to solve that could be a step along the way? |
Beta Was this translation helpful? Give feedback.
-
@AlanGriffiths Yes, setting the gamma ramp. |
Beta Was this translation helpful? Give feedback.
-
Perhaps you could start with adding gamma curves to the static display configuration? I realise you probably want to change them dynamically, but this would introduce you to the internal APIs you need for that. Once you gain that familiarity, you'll have a better understanding of the options. |
Beta Was this translation helpful? Give feedback.
-
To be honest I was simply thinking in terms of reducing the brightness of RGB components by, say, a factor. I'm not so familiar with the term "gamma curve" itself, although I just looked it up. Would one gamma curve correspond to, for example, R=100%, G=98%, B=2%? |
Beta Was this translation helpful? Give feedback.
-
I'm a bit hazy on the details myself and don't want to confuse you. But each colour has a "curve" indicating the correction at different brightnesses (e.g. there may be a bigger adjustment at lower light levels than at higher levels). Each curve is represented as a vector (and the three vectors need to be the same length). |
Beta Was this translation helpful? Give feedback.
-
So, what we're describing as the “gamma curve” is the hardware LUT (lookup table) that the output hardware uses to translate between pixel values in video memory and the actual values sent to the display hardware. The lookup tables are typically 256 elements per colour channel, but can be smaller (with intermediate values interpolated) or larger (for higher precision with 10bpc displays). There's an additional quirk in that I believe HDR support requires changes here, but I don't yet have a good understanding of what. You can probably just ignore it for now. |
Beta Was this translation helpful? Give feedback.
-
To clarify, the config could say "R=100%, G=98%, B=2%" and the correspondin curves would be |
Beta Was this translation helpful? Give feedback.
-
I'm having trouble finding |
Beta Was this translation helpful? Give feedback.
-
Happy New Year!
No, the mirclient API to which it belonged was deprecated with Mir 2.0 and eventually deleted. It has gone, forget it.
As I recall (am not at computer) it is called by the gbm-kms platform when reporting the current LUT. You need to be using that platform (e.g. running in a VT) for it to be called, but I don't think it actually sets the hardware LUT. HTH |
Beta Was this translation helpful? Give feedback.
-
While the mirclient API (
mir_toolkit/mir_display_configuration.h
) provides for configuring the display we have no corresponding Wayland extension. (E.g. for setting the gamma ramp).Within the MirAL API there is inadequate support for many options:
miral::DisplayConfiguration
only offers the option to select some basic screen layout choices from a configuration file.To configure the display within the server currently requires use of the mirserver and mirplatform APIs (
mir/graphics/display_configuration.h
&mir::Server::wrap_display_configuration_policy()
).We should expose more of these features.
Beta Was this translation helpful? Give feedback.
All reactions