Skip to content

Commit 667ca85

Browse files
chadmedjannau
authored andcommitted
drm: apple: Assume all RGB planes are sRGB
DCP enables us to specify a colourspace and transfer function for each plane, and will automatically tonemap them to the connected display's native colourspace. It also has a fallback "NATIVE" colourspace that tells it to assume the input framebuffer has already been transformed correctly. We were previously using this fallback for all RGB framebuffers, however this is incorrect. By convention, userspace treats the default colourspace as sRGB. This is fine when a display is in sRGB mode, however modern displays almost always cover a wider colour gamut out of the box, This is true of the MacBook builtin displays, which have full DCI-P3 coverage. The result of passing through sRGB framebuffers as "native" is oversaturated colours and bloomy highlights. It is exceedingly rare for userspace to ever output RGB framebuffers in non-sRGB colourspaces unless HDR is enabled, which we currently do not support. Let's just tell DCP that all RGB framebuffers are sRGB until the per-plane colour management patches are merged, at which point we can revisit this logic to make it more accurate. Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
1 parent b31ecd3 commit 667ca85

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/gpu/drm/apple/plane.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ static enum dcp_colorspace get_colorspace(bool is_yuv,
191191
enum drm_color_encoding enc)
192192
{
193193
if (!is_yuv)
194-
return DCP_COLORSPACE_NATIVE;
194+
return DCP_COLORSPACE_BG_SRGB;
195195

196196
switch (enc) {
197197
case DRM_COLOR_YCBCR_BT601:

0 commit comments

Comments
 (0)