Lavapipe can't handle HDR Monitor
System information
System:
Kernel: 5.15.0-48-generic x86_64 bits: 64 compiler: gcc
v: 11.2.0 Desktop: Cinnamon 5.4.12 tk: GTK 3.24.33 wm: Mutter dm: LightDM
Distro: Linux Mint 21 Vanessa base: Ubuntu 22.04 jammy
CPU:
Info: 12-core model: AMD Ryzen 9 5900X bits: 64 type: MT MCP arch: Zen 3
rev: 2 cache: L1: 768 KiB L2: 6 MiB L3: 64 MiB
Speed (MHz): avg: 2877 high: 3597 min/max: 2200/4950 boost: enabled
cores: 1: 2873 2: 2874 3: 3587 4: 2907 5: 2874 6: 2872 7: 2671 8: 2810
9: 2865 10: 2395 11: 2478 12: 2816 13: 2845 14: 2876 15: 3593 16: 2874
17: 2872 18: 2874 19: 3597 20: 2529 21: 2705 22: 2525 23: 2874 24: 2870
bogomips: 177271
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Graphics:
Device-1: NVIDIA GA102 [GeForce RTX 3080 Lite Hash Rate] vendor: ZOTAC
driver: nvidia v: 515.65.01 pcie: speed: 16 GT/s lanes: 16 ports:
active: none off: DP-3,HDMI-A-1 empty: DP-1,DP-2 bus-ID: 0a:00.0
chip-ID: 10de:2216
Display: x11 server: X.Org v: 1.21.1.3 driver: X: loaded: nvidia
unloaded: fbdev,modesetting,nouveau,vesa gpu: nvidia display-ID: :0
screens: 1
Screen-1: 0 s-res: 8192x2304 s-dpi: 120
Monitor-1: DP-4 res: 8192x2304 dpi: 208077 diag: 1mm (0.1")
OpenGL: renderer: llvmpipe (LLVM 14.0.6 256 bits)
v: 4.5 Mesa 22.2.0 (git-4ef98ce435) direct render: Yes
Describe the issue
I'm trying to render to a window using the lavapipe vulkan implementation.
When querying the number of presentable surface formats, the number of formats returned is 0.
Debugging through wsi_common_x11.c I could find the issue. Mesa queries the xcb_visualtype_t. It then first compares the bits_per_rgb_value member in visual_supported against either 8 or 10. Later in get_sorted_vk_formats it tries to find a vulkan format which has a bits_per_rgb equal to the bits_per_rgb_value in xcb_visualtype_t. On my system however the bits_per_rgb_value is 11. I attached the output of xdpyinfo.txt for reference. The active visual id in my case is 0x33.
When I replace both checks against bist_per_rgb_value with "true" everything works fine and lavapipe works as expected. I have limited understanding of the xserver protocol, but it seems that bits_per_rgb_value is used incorrectly in lavapipe.
Log files as attachment
- Output of xdpyinfo