Commit 4982dfd5 authored by Fabian Vogt's avatar Fabian Vogt
Browse files

glx: Don't use sRGB configs on llvmpipe with depth 16

This is necessary to keep openQA working, which uses LLVMpipe as a
renderer on a Cirrus device that operates in depth 16.

LLVMpipe advertises 24/32 bit sRGB configurations on this setup, but
they cannot be presented.

CCBUG: 408594

Test Plan: Compile tested only.

Reviewers: fvogt, #kwin, zzag

Reviewed By: fvogt, #kwin, zzag

Subscribers: romangg, sbergeron, fvogt, kwin

Tags: #kwin

Differential Revision:
parent 446e23af
......@@ -430,9 +430,24 @@ bool GlxBackend::initFbConfig()
bool llvmpipe = false;
// Note that we cannot use GLPlatform::driver() here, because it has not been initialized at this point
if (hasExtension(QByteArrayLiteral("GLX_MESA_query_renderer"))) {
const QByteArray device = glXQueryRendererStringMESA(display(), DefaultScreen(display()), 0, GLX_RENDERER_DEVICE_ID_MESA);
if (device.contains(QByteArrayLiteral("llvmpipe"))) {
llvmpipe = true;
// Try to find a double buffered sRGB capable configuration
int count = 0;
GLXFBConfig *configs = glXChooseFBConfig(display(), DefaultScreen(display()), attribs_srgb, &count);
GLXFBConfig *configs = nullptr;
// Don't request an sRGB configuration with LLVMpipe when the default depth is 16. See bug #408594.
if (!llvmpipe || Xcb::defaultDepth() > 16) {
configs = glXChooseFBConfig(display(), DefaultScreen(display()), attribs_srgb, &count);
if (count == 0) {
// Try to find a double buffered non-sRGB capable configuration
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment