No sRGB capable visuals/fbconfigs reported in glx
System information
System:
Host: lupino Kernel: 5.4.0-70-generic x86_64 bits: 64 compiler: gcc
v: 9.3.0 Desktop: Fluxbox 1.3.5 dm: GDM3
Distro: Ubuntu 20.04.2 LTS (Focal Fossa)
CPU:
Topology: 8-Core model: AMD Ryzen 7 1700X bits: 64 type: MT MCP arch: Zen
rev: 1 L2 cache: 4096 KiB
flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
bogomips: 108798
Speed: 1888 MHz min/max: 2200/3400 MHz Core speeds (MHz): 1: 1886 2: 1895
3: 1888 4: 1892 5: 1891 6: 1895 7: 2007 8: 1945 9: 1887 10: 1887 11: 2039
12: 1893 13: 1889 14: 1889 15: 1892 16: 1894
Graphics:
Device-1: AMD Ellesmere [Radeon RX 470/480/570/570X/580/580X/590]
vendor: PC Partner Limited driver: amdgpu v: kernel bus ID: 24:00.0
chip ID: 1002:67df
Device-2: NVIDIA TU102 [GeForce RTX 2080 Ti Rev. A] driver: N/A
bus ID: 25:00.0 chip ID: 10de:1e07
Display: x11 server: X.Org 1.20.9 driver: ati,modesetting
unloaded: fbdev,radeon,vesa resolution: 1920x1080~60Hz
OpenGL: renderer: AMD Radeon RX 480 Graphics (POLARIS10 DRM 3.35.0
5.4.0-70-generic LLVM 11.0.1)
v: 4.6 Mesa 21.0.3 (git-091978e0ec) direct render: Yes
Describe the issue
On my AMD system when running latest mesa there are no visuals reported that are sRGB capable. When I build against mesa 21.0.3 (as from the system info above) I get this glxinfo output: glxinfo_21.0.3.txt
but when building against latest master I get this: glxinfo_21.2.0-devel.txt
In particular note that on master the sRGB column is all .
so none are reporting sRGB capability.
This seems weird to me since I'd expect sRGB to be the default, and indeed when I run a test application that shows a B-W colour ramp it doesn't show any banding of any kind and the ramp is the same (not over/under corrected) even though the code is identical. The red/green band shows when the application was able to select an fbconfig with GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB
:
The application chooses visuals with these attribs:
// GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB MUST be the last attrib so that we can remove it to retry
// if we find no srgb fbconfigs
static int visAttribs[] = {GLX_X_RENDERABLE,
True,
GLX_DRAWABLE_TYPE,
GLX_WINDOW_BIT,
GLX_RENDER_TYPE,
GLX_RGBA_BIT,
GLX_X_VISUAL_TYPE,
GLX_TRUE_COLOR,
GLX_RED_SIZE,
8,
GLX_GREEN_SIZE,
8,
GLX_BLUE_SIZE,
8,
GLX_ALPHA_SIZE,
8,
GLX_DEPTH_SIZE,
0,
GLX_STENCIL_SIZE,
0,
GLX_DOUBLEBUFFER,
True,
GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB,
True,
0};
int numCfgs = 0;
GLXFBConfig *fbcfg = glXChooseFBConfig(dpy, DefaultScreen(dpy), visAttribs, &numCfgs);
which fails when sRGB isn't available, at which point it zeroes out the last two values and tries again.
Am I misunderstanding something about how these visuals should be reported? My GLX knowledge is limited and I know in particular this is an area of GL with heavy legacy baggage.
Regression
This used to work in 21.0.3. I bisected it down to f0861c80