[PATCH] Reorder visuals reported by the intel driver

Tomas Carnecky tom at dbservice.com
Wed Jul 30 12:13:41 PDT 2008


Jesse Barnes wrote:
> On Sunday, June 15, 2008 5:27 am Tomas Carnecky wrote:
>> The root window visual can not be changed. Neither at runtime nor
>> through the configuration file. The xserver simply selects the first one
>> that matches the class (usually TrueColor). I need a root window visual
>> with stencil buffer because my compiz plugin uses the it for some
>> operations. This patch reorders the visuals that the 3D driver reports
>> and puts the one with stencil (and depth) bits as first.
> 
> So until we have private back buffers etc. we'll need to make sure the root 
> window's visual is as featureful as possible because the X server just picks 
> the first visual matching the current bit depth at startup (sorry I'm a GLX 
> novice here)?

Yes, that's it basically.

The xserver only knows about X11 visuals and not GLX fb configs, so it 
can't intelligently choose a 'good' default visual that also exposes 
useful features to OpenGL clients. So it's up to the driver to order the 
visuals in a way to make the xserver choose a reasonable default visual.

I'd say the driver should make sure that the most featureful visual gets 
selected as the default (but make sure the visual is not flagged as SLOW 
or NON_CONFORMING, 16bpp visuals with stencil buffer are flagged as SLOW 
by the i830 driver for example, hence the patch only changes the 
ordering for 32bpp visuals).

Thanks for looking at the patch.


tom



More information about the xorg mailing list