output-management: add color format support

Add a color_format enum and corresponding event/request to
wlr-output-management-unstable-v1 (version 5). The enum mirrors
the DRM connector color format property, allowing clients to
read the current color encoding (RGB, YCbCr 4:4:4, 4:2:2, 4:2:0)
and request a change. Compositors should ignore set_color_format
if the connector lacks the property.
This commit is contained in:
Igor Deordiev 2026-05-11 16:31:18 +07:00
parent bf4fc79abc
commit c43eb2da07

View file

@ -39,7 +39,7 @@
interface version number is reset.
</description>
<interface name="zwlr_output_manager_v1" version="4">
<interface name="zwlr_output_manager_v1" version="5">
<description summary="output device configuration manager">
This interface is a manager that allows reading and writing the current
output device configuration.
@ -125,7 +125,7 @@
</event>
</interface>
<interface name="zwlr_output_head_v1" version="4">
<interface name="zwlr_output_head_v1" version="5">
<description summary="output device">
A head is an output device. The difference between a wl_output object and
a head is that heads are advertised even if they are turned off. A head
@ -364,6 +364,28 @@
</description>
<arg name="state" type="uint" enum="adaptive_sync_state"/>
</event>
<!-- Version 5 additions -->
<enum name="color_format" since="5">
<description summary="color format for the output">
These values correspond to the DRM connector color format property.
The compositor may not support all formats on all connectors.
</description>
<entry name="auto" value="0" summary="compositor/driver picks"/>
<entry name="rgb" value="1" summary="RGB output"/>
<entry name="ycbcr444" value="2" summary="YCbCr 4:4:4"/>
<entry name="ycbcr422" value="3" summary="YCbCr 4:2:2"/>
<entry name="ycbcr420" value="4" summary="YCbCr 4:2:0"/>
</enum>
<event name="color_format" since="5">
<description summary="current color format">
This event describes the color format currently used by the head.
The color format determines the color encoding sent to the display.
</description>
<arg name="format" type="uint" enum="color_format"/>
</event>
</interface>
<interface name="zwlr_output_mode_v1" version="3">
@ -421,7 +443,7 @@
</request>
</interface>
<interface name="zwlr_output_configuration_v1" version="4">
<interface name="zwlr_output_configuration_v1" version="5">
<description summary="output configuration">
This object is used by the client to describe a full output configuration.
@ -539,7 +561,7 @@
</request>
</interface>
<interface name="zwlr_output_configuration_head_v1" version="4">
<interface name="zwlr_output_configuration_head_v1" version="5">
<description summary="head configuration">
This object is used by the client to update a single head's configuration.
@ -554,6 +576,8 @@
<entry name="invalid_scale" value="5" summary="scale negative or zero"/>
<entry name="invalid_adaptive_sync_state" value="6" since="4"
summary="invalid enum value used in the set_adaptive_sync request"/>
<entry name="invalid_color_format" value="7" since="5"
summary="invalid enum value used in the set_color_format request"/>
</enum>
<request name="set_mode">
@ -607,5 +631,19 @@
</description>
<arg name="state" type="uint" enum="zwlr_output_head_v1.adaptive_sync_state"/>
</request>
<!-- Version 5 additions -->
<request name="set_color_format" since="5">
<description summary="set the color format">
This request sets the color format for the output. The color format
determines the color encoding sent to the display (RGB, YCbCr 4:4:4,
YCbCr 4:2:2, YCbCr 4:2:0).
If the connector does not support the color format property, the
compositor should ignore this request.
</description>
<arg name="format" type="uint" enum="zwlr_output_head_v1.color_format"/>
</request>
</interface>
</protocol>