#1057195 mesa: Colours are too dark due to bad sRGB conversion

Package:
src:mesa
Source:
src:mesa
Submitter:
Chris Boot
Date:
2023-12-01 11:51:04 UTC
Severity:
normal
Tags:
#1057195#5
Date:
2023-12-01 11:45:58 UTC
From:
To:
Dear Maintainer,

I have been debugging a problem that appears in Kitty, the terminal
emulator. It uses OpenGL directly, and its windows/buffers use sRGB
colour space. The issue is that colours are too dark; black and white
are correct but the colours in between are off. It appears as though the
sRGB mapping is applied twice.

Please see my upstream bug for some discussion and screenshots that
display the problem:
https://github.com/kovidgoyal/kitty/issues/6845

The issue is immediately apparent when selecting a colour theme. My
enviconrment is:
- Debian Testing
- Kitty 0.31.0 (from testing)
- Wayland
- Running in a Parallels VM on macOS (currently 14.2 Beta 23C5055b) with
  GPU acceleration enabled.

If I use an older version of Kitty which doesn't use sRGB, or hack
Kitty to not perform the sRGB colour conversion, the display is fine.
It's as though the driver doesn't actually do the conversion when it
should. The colours are also fine if I disable GPU acceleration, but
clearly performance is very poor.

Kitty is the only program so far that I've been able to replicate the
problem with. It doesn't happen in the desktop, using Chromium or
Firefox, or simple tools like glxgears. If you can suggest a program
that uses sRGB colourspace output I'd be happy to test with that.

Kitty also runs fine under macOS natively, so I don't think it can be a
macOS platform/driver bug, but potentially could be something in
Parallels I guess.

I have tagged this bug 'upstream' and will attempt to create the issue
in the Freedesktop GitLab later; I'll update this bug if I succeed.

Cheers,
Chris