Skip to content

[WIP] add 10bit color support

Simon Ser requested to merge github/fork/DerVerruckteFuchs/10bit-color into master

Created by: DerVerruckteFuchs

This is an initial pull request to address issue #1378 (closed) using @tadeokondrak's patch posted in the issue as a starting point. I've added some of the color formats contained within the wl_shm_format enum that are in/usr/include/wayland-server-protocol.h. The initial 10bit color formats that have been added seem like a reasonable starting place, given that they look like 10bit versions of the 8bit color formats already being used. In future, adding YCbCr color formats seem like a good addition for TV/HDMI output.

I'm not quite sure if wlr_output_set_format() is doing enough when setting the color format. It looks fine, but I don't know if I need to be using output->pending.format = format; instead of output->format = format;. From what I gather from reading types/wlr_output.h and interfaces/wlr_output.h, the pending state is used for checking output state changes before committing them. I'm thinking checking before committing the change is possibly desirable in the event someone tries to set 10bit output to an 8bit monitor (and/or using an inadequate video cable). I'm not sure how to check for that at the moment.

Also, I'm not sure if renderer->gbm_format should get changed. I'm supposing 8bit color by default is safer than trying to use 10bit color on an 8bit monitor.

Edited by Simon Ser

Merge request reports

Loading