Skip to content

wsi/x11: Fix the is-visual-supported check

Adam Jackson requested to merge ajax/mesa:gitlab-issue-6995 into main

This was sort of well intentioned, but wrong. bits_per_rgb_value is the number of significant bits in the color (channel) specification, not the number of bits used to name that color within the pixel. If you have a depth 24 visual but the colormap is 11 bits deep then each of those channels selects one of 256 11-bit color values in the output ramp.

The open source drivers mostly don't expose anything like that, but nvidia does, and we refuse to work. That's silly. Practically speaking we can probably render to any TrueColor or DirectColor visual that your X server exposes, since it is probably not going to have visuals for non-color-renderable formats. Just check the visual class instead.

Closes: #6995 (closed)


I have more cleanup I want to do in this area, we're checking this way more often than we need to (which is to say, more than once at all, since it can never change for the lifetime of the window). But this should fix #6995 (closed) at least.

zink X11 wsi

Merge request reports