xc/programs/Xserver/hw/vfb/InitOutput.c

//bugs.freedesktop.org/show_bug.cgi?id=2791) attachment #2197
    (https://bugs.freedesktop.org/attachment.cgi?id=2197) Add support for
    12bit PseudoColor and 30bit TrueColor to Xvfb.
This commit is contained in:
Roland Mainz 2005-03-23 20:49:52 +00:00
parent 26aec10ada
commit 1be6e2388b
2 changed files with 41 additions and 16 deletions

View File

@ -68,7 +68,7 @@ from The Open Group.
#define VFB_DEFAULT_WIDTH 1280
#define VFB_DEFAULT_HEIGHT 1024
#define VFB_DEFAULT_DEPTH 8
#define VFB_DEFAULT_DEPTH 12
#define VFB_DEFAULT_WHITEPIXEL 1
#define VFB_DEFAULT_BLACKPIXEL 0
#define VFB_DEFAULT_LINEBIAS 0
@ -694,11 +694,12 @@ vfbAllocateFramebufferMemory(vfbScreenInfoPtr pvfb)
/* Calculate how many entries in colormap. This is rather bogus, because
* the visuals haven't even been set up yet, but we need to know because we
* have to allocate space in the file for the colormap. The number 10
* below comes from the MAX_PSEUDO_DEPTH define in cfbcmap.c.
* have to allocate space in the file for the colormap. The number 15
* below comes from the detail that the size of a colormap is limited to
* 15bits.
*/
if (pvfb->depth <= 10)
if (pvfb->depth <= 15)
{ /* single index colormaps */
pvfb->ncolors = 1 << pvfb->depth;
}
@ -885,11 +886,25 @@ vfbScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
(1 << PseudoColor) |
(1 << TrueColor) |
(1 << DirectColor)),
8, PseudoColor, 0x07, 0x38, 0xc0);
8, PseudoColor, 0, 0, 0);
break;
/* 12bit PseudoColor with 12bit color resolution
* (to simulate SGI hardware and the 12bit PseudoColor emulation layer) */
case 12:
miSetVisualTypesAndMasks (12,
((1 << StaticGray) |
(1 << GrayScale) |
(1 << StaticColor) |
(1 << PseudoColor) |
(1 << TrueColor) |
(1 << DirectColor)),
12, PseudoColor, 0, 0, 0);
break;
case 15:
miSetVisualTypesAndMasks (15,
((1 << TrueColor) |
((1 << GrayScale) |
(1 << PseudoColor) |
(1 << TrueColor) |
(1 << DirectColor)),
8, TrueColor, 0x7c00, 0x03e0, 0x001f);
break;
@ -905,6 +920,14 @@ vfbScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
(1 << DirectColor)),
8, TrueColor, 0xff0000, 0x00ff00, 0x0000ff);
break;
/* 30bit TrueColor (to simulate Sun's XVR-1000/-4000 high quality
* framebuffer series) */
case 30:
miSetVisualTypesAndMasks (30,
((1 << TrueColor) |
(1 << DirectColor)),
10, TrueColor, 0x3ff00000, 0x000ffc00, 0x000003ff);
break;
}
ret = fbScreenInit(pScreen, pbits, pvfb->width, pvfb->height,
@ -968,9 +991,11 @@ InitOutput(ScreenInfo *screenInfo, int argc, char **argv)
vfbPixmapDepths[1] = TRUE;
vfbPixmapDepths[4] = TRUE;
vfbPixmapDepths[8] = TRUE;
vfbPixmapDepths[12] = TRUE;
/* vfbPixmapDepths[15] = TRUE; */
vfbPixmapDepths[16] = TRUE;
vfbPixmapDepths[24] = TRUE;
vfbPixmapDepths[30] = TRUE;
vfbPixmapDepths[32] = TRUE;
}

View File

@ -1,4 +1,4 @@
.\" $XdotOrg: Xvfb.man,v 1.4 2001/02/09 02:04:45 xorgcvs Exp $
.\" $XdotOrg: xc/programs/Xserver/hw/vfb/Xvfb.man,v 1.2 2004/04/23 19:19:32 eich Exp $
.\" $Xorg: Xvfb.man,v 1.4 2001/02/09 02:04:45 xorgcvs Exp $
.\" Copyright 1993, 1998 The Open Group
.\"
@ -62,7 +62,7 @@ manual page, \fIXvfb\fP accepts the following command line switches:
.B "\-screen \fIscreennum\fP \fIWxHxD\fP"
This option creates screen \fIscreennum\fP and sets its width, height,
and depth to W, H, and D respectively. By default, only screen 0 exists
and has the dimensions 1280x1024x8.
and has the dimensions 1280x1024x12.
.TP 4
.B "\-pixdepths \fIlist-of-depths\fP"
This option specifies a list of pixmap depths that the server should
@ -113,12 +113,12 @@ will be depth 32 1600x1200.
.TP 8
Xvfb :1 -screen 1 1600x1200x16
The server will listen for connections as server number 1, will have the
default screen configuration (one screen, 1280x1024x8), and screen 1
default screen configuration (one screen, 1280x1024x12), and screen 1
will be depth 16 1600x1200.
.TP 8
Xvfb -pixdepths 3 27 -fbdir /usr/tmp
The server will listen for connections as server number 0, will have the
default screen configuration (one screen, 1280x1024x8),
default screen configuration (one screen, 1280x1024x12),
will also support pixmap
depths of 3 and 27,
and will use memory mapped files in /usr/tmp for the framebuffer.