Index: xc/ChangeLog =================================================================== RCS file: /cvs/xorg/xc/ChangeLog,v retrieving revision 1.831 diff -u -2 -0 -r1.831 ChangeLog --- xc/ChangeLog 23 Mar 2005 19:58:44 -0000 1.831 +++ xc/ChangeLog 23 Mar 2005 20:45:19 -0000 @@ -1,20 +1,27 @@ +2005-03-22 Roland Mainz + * xc/programs/Xserver/hw/vfb/InitOutput.c + * xc/programs/Xserver/hw/vfb/Xvfb.man + bugzilla #2791 (https://bugs.freedesktop.org/show_bug.cgi?id=2791) + attachment #xxx (https://bugs.freedesktop.org/attachment.cgi?id=xxx) + Add support for 12bit PseudoColor and 30bit TrueColor to Xvfb. + 2005-03-23 Roland Mainz * xc/programs/Xserver/Imakefile * xc/programs/Xserver/Xprint/DiPrint.h * xc/programs/Xserver/Xprint/Imakefile * xc/programs/Xserver/Xprint/Init.c * xc/programs/Xserver/Xprint/ddxInit.c * xc/programs/Xserver/dix/Imakefile * xc/programs/Xserver/dix/main.c * xc/programs/Xserver/dix/xpstubs.c * xc/programs/Xserver/os/Imakefile * xc/programs/Xserver/os/utils.c bugzilla #2792 (https://bugs.freedesktop.org/show_bug.cgi?id=2792) attachment #2193 (https://bugs.freedesktop.org/attachment.cgi?id=2193) Fix build bustage when |PrintOnlyServer| is set to |NO|. Patch by Roland Mainz and Julien Lafon . 2005-03-22 Roland Mainz * xc/programs/Xserver/hw/vfb/InitOutput.c bugzilla #2789 (https://bugs.freedesktop.org/show_bug.cgi?id=2789) Index: xc/programs/Xserver/hw/vfb/InitOutput.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/vfb/InitOutput.c,v retrieving revision 1.7 diff -u -2 -0 -r1.7 InitOutput.c --- xc/programs/Xserver/hw/vfb/InitOutput.c 23 Mar 2005 00:32:49 -0000 1.7 +++ xc/programs/Xserver/hw/vfb/InitOutput.c 23 Mar 2005 20:45:44 -0000 @@ -49,47 +49,47 @@ #include #ifdef HAS_MMAP #include #ifndef MAP_FILE #define MAP_FILE 0 #endif #endif /* HAS_MMAP */ #include #include #ifndef WIN32 #include #endif #include #ifdef HAS_SHM #include #include #endif /* HAS_SHM */ #include "dix.h" #include "miline.h" -#define VFB_DEFAULT_WIDTH 1280 -#define VFB_DEFAULT_HEIGHT 1024 -#define VFB_DEFAULT_DEPTH 8 -#define VFB_DEFAULT_WHITEPIXEL 1 -#define VFB_DEFAULT_BLACKPIXEL 0 -#define VFB_DEFAULT_LINEBIAS 0 -#define XWD_WINDOW_NAME_LEN 60 +#define VFB_DEFAULT_WIDTH 1280 +#define VFB_DEFAULT_HEIGHT 1024 +#define VFB_DEFAULT_DEPTH 12 +#define VFB_DEFAULT_WHITEPIXEL 1 +#define VFB_DEFAULT_BLACKPIXEL 0 +#define VFB_DEFAULT_LINEBIAS 0 +#define XWD_WINDOW_NAME_LEN 60 typedef struct { int scrnum; int width; int paddedBytesWidth; int paddedWidth; int height; int depth; int bitsPerPixel; int sizeInBytes; int ncolors; char *pfbMemory; XWDColor *pXWDCmap; XWDFileHeader *pXWDHeader; Pixel blackPixel; Pixel whitePixel; unsigned int lineBias; CloseScreenProcPtr closeScreen; @@ -677,45 +677,46 @@ { perror("shmat"); ErrorF("shmat failed, errno %d", errno); pvfb->pXWDHeader = NULL; return; } ErrorF("screen %d shmid %d\n", pvfb->scrnum, pvfb->shmid); } #endif /* HAS_SHM */ static char * vfbAllocateFramebufferMemory(vfbScreenInfoPtr pvfb) { if (pvfb->pfbMemory) return pvfb->pfbMemory; /* already done */ pvfb->sizeInBytes = pvfb->paddedBytesWidth * pvfb->height; /* 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; } else { /* decomposed colormaps */ int nplanes_per_color_component = pvfb->depth / 3; if (pvfb->depth % 3) nplanes_per_color_component++; pvfb->ncolors = 1 << nplanes_per_color_component; } /* add extra bytes for XWDFileHeader, window name, and colormap */ pvfb->sizeInBytes += SIZEOF(XWDheader) + XWD_WINDOW_NAME_LEN + pvfb->ncolors * SIZEOF(XWDColor); pvfb->pXWDHeader = NULL; switch (fbmemtype) { #ifdef HAS_MMAP case MMAPPED_FILE_FB: vfbAllocateMmappedFramebuffer(pvfb); break; @@ -868,60 +869,82 @@ pvfb->paddedBytesWidth = PixmapBytePad(pvfb->width, pvfb->depth); pvfb->bitsPerPixel = vfbBitsPerPixel(pvfb->depth); if (pvfb->bitsPerPixel >= 8 ) pvfb->paddedWidth = pvfb->paddedBytesWidth / (pvfb->bitsPerPixel / 8); else pvfb->paddedWidth = pvfb->paddedBytesWidth * 8; pbits = vfbAllocateFramebufferMemory(pvfb); if (!pbits) return FALSE; miSetPixmapDepths (); switch (pvfb->depth) { case 8: miSetVisualTypesAndMasks (8, ((1 << StaticGray) | (1 << GrayScale) | (1 << StaticColor) | (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; case 16: miSetVisualTypesAndMasks (16, ((1 << TrueColor) | (1 << DirectColor)), 8, TrueColor, 0xf800, 0x07e0, 0x001f); break; case 24: miSetVisualTypesAndMasks (24, ((1 << TrueColor) | (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, dpix, dpiy, pvfb->paddedWidth,pvfb->bitsPerPixel); #ifdef RENDER if (ret && Render) fbPictureInit (pScreen, 0, 0); #endif if (!ret) return FALSE; /* miInitializeBackingStore(pScreen); */ /* * Circumvent the backing store that was just initialised. This amounts * to a truely bizarre way of initialising SaveDoomedAreas and friends. */ pScreen->InstallColormap = vfbInstallColormap; pScreen->UninstallColormap = vfbUninstallColormap; @@ -951,43 +974,45 @@ void InitOutput(ScreenInfo *screenInfo, int argc, char **argv) { int i; int NumFormats = 0; /* initialize pixmap formats */ /* must have a pixmap depth to match every screen depth */ for (i = 0; i < vfbNumScreens; i++) { vfbPixmapDepths[vfbScreens[i].depth] = TRUE; } /* RENDER needs a good set of pixmaps. */ if (Render) { 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; } for (i = 1; i <= 32; i++) { if (vfbPixmapDepths[i]) { if (NumFormats >= MAXFORMATS) FatalError ("MAXFORMATS is too small for this server\n"); screenInfo->formats[NumFormats].depth = i; screenInfo->formats[NumFormats].bitsPerPixel = vfbBitsPerPixel(i); screenInfo->formats[NumFormats].scanlinePad = BITMAP_SCANLINE_PAD; NumFormats++; } } screenInfo->imageByteOrder = IMAGE_BYTE_ORDER; screenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT; screenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD; screenInfo->bitmapBitOrder = BITMAP_BIT_ORDER; Index: xc/programs/Xserver/hw/vfb/Xvfb.man =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/vfb/Xvfb.man,v retrieving revision 1.2 diff -u -2 -0 -r1.2 Xvfb.man --- xc/programs/Xserver/hw/vfb/Xvfb.man 23 Apr 2004 19:19:32 -0000 1.2 +++ xc/programs/Xserver/hw/vfb/Xvfb.man 23 Mar 2005 20:45:44 -0000 @@ -45,41 +45,41 @@ including testing clients against unusual depths and screen configurations, doing batch processing with \fIXvfb\fP as a background rendering engine, load testing, as an aid to porting the X server to a new platform, and providing an unobtrusive way to run applications that don't really need an X server but insist on having one anyway. .SH BUILDING To build \fIXvfb\fP, put the following in your host.def and remake. .PP \&#define BuildServer YES /\(** if you aren't already building other servers */ .br \&#define XVirtualFramebufferServer YES .SH OPTIONS .PP In addition to the normal server options described in the \fIXserver(1)\fP manual page, \fIXvfb\fP accepts the following command line switches: .TP 4 .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 support in addition to the depths implied by the supported screens. \fIlist-of-depths\fP is a space-separated list of integers that can have values from 1 to 32. .TP 4 .B "\-fbdir \fIframebuffer-directory\fP" This option specifies the directory in which the memory mapped files containing the framebuffer memory should be created. See FILES. This option only exists on machines that have the mmap and msync system calls. .TP 4 .B "\-shmem" This option specifies that the framebuffer should be put in shared memory. The shared memory ID for each screen will be printed by the server. The shared memory is in xwd format. This option only exists on machines that support the System V shared memory interface. @@ -96,37 +96,37 @@ possible with the cfb and mfb code. .TP 4 .B "\-blackpixel \fIpixel-value\fP, \-whitepixel \fIpixel-value\fP" These options specify the black and white pixel values the server should use. .SH FILES The following files are created if the \-fbdir option is given. .TP 4 \fIframebuffer-directory\fP/Xvfb_screen Memory mapped file containing screen n's framebuffer memory, one file per screen. The file is in xwd format. Thus, taking a full-screen snapshot can be done with a file copy command, and the resulting snapshot will even contain the cursor image. .SH EXAMPLES .TP 8 Xvfb :1 -screen 0 1600x1200x32 The server will listen for connections as server number 1, and screen 0 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. .TP 8 xwud -in /usr/tmp/Xvfb_screen0 Displays screen 0 of the server started by the preceding example. .SH "SEE ALSO" .PP X(__miscmansuffix__), Xserver(1), xwd(1), xwud(1), XWDFile.h .SH AUTHORS David P. Wiggins, The Open Group, Inc.