Problem: Xvfb set wrong default depth

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello all
	I am running Xvfb for testing. But I found it set a wrong
default depth.

	This is my steps. I run testing with 16bit depth. But I always
get the default depth 15. 
		Xvfb -screen 0 1024x768x16 :1.0 -ac +bs -kb &
		xdpyinfo -display :1.0 | grep "depth of root window"

	The result is "15 planes". There are totally 16 visuals. 8 visuals
for the format with depth 15. And the other 8 visuals for the format
with dep 16. When run Xvfb with "1024x768x32", it will report "24 planes".
	By te way, the whitepixel is 32767 when I test in 16bit mode.

	I debugged the Xvfb. The visuals is allocated in miDoInitVisuals(...).
(xc/programs/Xserver/mi/micmap.c) In that function, it didn't know the
default depth of the screen. It will also create visuals for depth 15
because both formats have the same bitsPerPixel.

miDoInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp,
		int *ndepthp, int *rootDepthp, VisualID *defaultVisp,
		unsigned long sizes, int bitsPerRGB, int preferredVis)
{
    ....
    /* none specified, we'll guess from pixmap formats */
    if (!miVisuals) 
    {
    	for (f = 0; f < screenInfo.numPixmapFormats; f++) 
    	{
            d = screenInfo.formats[f].depth;
            b = screenInfo.formats[f].bitsPerPixel;
            if (sizes & (1 << (b - 1)))
                vtype = miGetDefaultVisualMask(d);
            else
                vtype = 0;
            if (!miSetVisualTypes (d, vtype, bitsPerRGB, -1))
                return FALSE;
    	}
    }
	
    ....
}

When the other driver , such as I810, calls into miDoInitVisuals, the
miVisual will not be NULL. It seems vfb didn't create the visuals based
on its default depth.

Best Regards!
Peng Hongbo



_______________________________________________
XFree86 mailing list
XFree86@xxxxxxxxxxx
http://XFree86.Org/mailman/listinfo/xfree86

[Index of Archives]     [X Forum]     [Xorg]     [XFree86 Newbie]     [IETF Announce]     [Security]     [Font Config]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux Kernel]

  Powered by Linux