summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeron Johnson <deron.johnson@sun.com>2005-01-06 04:14:03 +0000
committerDeron Johnson <deron.johnson@sun.com>2005-01-06 04:14:03 +0000
commita40112588f7aef30c78de2c1aa02b7e1f4ffaef8 (patch)
treec43b85a0b9f0f4e3f14f9f3d5b92eb6e21bf6c17
parentb17cfa150080f315e1b40c9926e4e30c4fdfd02c (diff)
Integrate updates from Xorg 6.8.2 RC2.lg3d-dev-0-6-1
VS: ----------------------------------------------------------------------
-rw-r--r--Xext/saver.c5
-rw-r--r--Xext/xf86bigfont.c13
-rw-r--r--Xprint/Init.c43
-rw-r--r--Xprint/Oid.c18
-rw-r--r--Xprint/attributes.c2
-rw-r--r--Xprint/pcl/PclInit.c10
-rw-r--r--Xprint/ps/Ps.h3
-rw-r--r--Xprint/ps/PsArea.c81
-rw-r--r--Xprint/ps/PsColor.c105
-rw-r--r--Xprint/ps/PsGC.c10
-rw-r--r--Xprint/ps/PsInit.c242
-rw-r--r--Xprint/ps/PsPixmap.c36
-rw-r--r--Xprint/ps/PsPolygon.c25
-rw-r--r--Xprint/ps/psout.c116
-rw-r--r--Xprint/ps/psout.h46
-rw-r--r--dix/dispatch.c4
-rw-r--r--dix/main.c4
-rw-r--r--fb/fb.h4
-rw-r--r--fb/fbwindow.c7
-rw-r--r--hw/xfree86/common/xf86Configure.c8
-rw-r--r--hw/xfree86/common/xf86Events.c14
-rw-r--r--hw/xfree86/common/xf86Init.c29
-rw-r--r--hw/xfree86/common/xf86Xinput.c13
-rw-r--r--hw/xfree86/common/xf86pciBus.c5
-rw-r--r--hw/xfree86/ddc/edid.h57
-rw-r--r--hw/xfree86/ddc/interpret_edid.c80
-rw-r--r--hw/xfree86/ddc/print_edid.c73
-rw-r--r--hw/xfree86/dixmods/extmod/xf86vmode.c34
-rw-r--r--hw/xfree86/doc/README.fonts82
-rw-r--r--hw/xfree86/dri/dri.c9
-rw-r--r--hw/xfree86/loader/dixsym.c110
-rw-r--r--hw/xfree86/loader/elfloader.c10
-rw-r--r--hw/xfree86/loader/extsym.c3
-rw-r--r--hw/xfree86/os-support/bsd/bsd_KbdMap.c42
-rw-r--r--hw/xfree86/os-support/bsd/bsd_kbd.c46
-rw-r--r--hw/xfree86/os-support/bus/460gxPCI.c44
-rw-r--r--hw/xfree86/os-support/bus/460gxPCI.h4
-rw-r--r--hw/xfree86/os-support/bus/Pci.c5
-rw-r--r--hw/xfree86/os-support/bus/e8870PCI.c14
-rw-r--r--hw/xfree86/os-support/bus/e8870PCI.h4
-rw-r--r--hw/xfree86/os-support/bus/ix86Pci.c2
-rw-r--r--hw/xfree86/os-support/bus/linuxPci.c6
-rw-r--r--hw/xfree86/os-support/bus/zx1PCI.c16
-rw-r--r--hw/xfree86/os-support/bus/zx1PCI.h2
44 files changed, 1081 insertions, 405 deletions
diff --git a/Xext/saver.c b/Xext/saver.c
index 4b783fd5e..972326ddc 100644
--- a/Xext/saver.c
+++ b/Xext/saver.c
@@ -1,4 +1,4 @@
-/* $XdotOrg$ */
+/* $XdotOrg: xc/programs/Xserver/Xext/saver.c,v 1.2.4.2 2004/12/13 03:34:33 gisburn Exp $ */
/*
* $XConsortium: saver.c,v 1.12 94/04/17 20:59:36 dpw Exp $
*
@@ -210,7 +210,7 @@ static int ScreenPrivateIndex;
#define GetScreenPrivate(s) ((ScreenSaverScreenPrivatePtr)(s)->devPrivates[ScreenPrivateIndex].ptr)
#define SetScreenPrivate(s,v) ((s)->devPrivates[ScreenPrivateIndex].ptr = (pointer) v);
-#define SetupScreen(s) ScreenSaverScreenPrivatePtr pPriv = GetScreenPrivate(s)
+#define SetupScreen(s) ScreenSaverScreenPrivatePtr pPriv = (s ? GetScreenPrivate(s) : NULL)
#define New(t) ((t *) xalloc (sizeof (t)))
@@ -1185,6 +1185,7 @@ ScreenSaverUnsetAttributes (ClientPtr client)
pPriv = GetScreenPrivate (pDraw->pScreen);
if (pPriv && pPriv->attr && pPriv->attr->client == client)
{
+ FreeResource (pPriv->attr->resource, AttrType);
FreeScreenAttr (pPriv->attr);
pPriv->attr = NULL;
CheckScreenPrivate (pDraw->pScreen);
diff --git a/Xext/xf86bigfont.c b/Xext/xf86bigfont.c
index dec2c181e..bcabaefa7 100644
--- a/Xext/xf86bigfont.c
+++ b/Xext/xf86bigfont.c
@@ -99,12 +99,12 @@ static int FontShmdescIndex;
static unsigned int pagesize;
+static Bool badSysCall = FALSE;
+
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__)
#include <sys/signal.h>
-static Bool badSysCall = FALSE;
-
static void
SigSysHandler(
int signo)
@@ -471,13 +471,16 @@ ProcXF86BigfontQueryFont(
if (nCharInfos > 0) {
#ifdef HAS_SHM
- pDesc = (ShmDescPtr) FontGetPrivate(pFont, FontShmdescIndex);
+ if (!badSysCall)
+ pDesc = (ShmDescPtr) FontGetPrivate(pFont, FontShmdescIndex);
+ else
+ pDesc = NULL;
if (pDesc) {
pCI = (xCharInfo *) pDesc->attach_addr;
if (stuff_flags & XF86Bigfont_FLAGS_Shm)
shmid = pDesc->shmid;
} else {
- if (stuff_flags & XF86Bigfont_FLAGS_Shm)
+ if (stuff_flags & XF86Bigfont_FLAGS_Shm && !badSysCall)
pDesc = shmalloc(nCharInfos * sizeof(xCharInfo)
+ sizeof(CARD32));
if (pDesc) {
@@ -522,7 +525,7 @@ ProcXF86BigfontQueryFont(
}
}
#ifdef HAS_SHM
- if (pDesc) {
+ if (pDesc && !badSysCall) {
*(CARD32 *)(pCI + nCharInfos) = signature;
if (!FontSetPrivate(pFont, FontShmdescIndex, pDesc)) {
shmdealloc(pDesc);
diff --git a/Xprint/Init.c b/Xprint/Init.c
index cd16847ee..cb47fa144 100644
--- a/Xprint/Init.c
+++ b/Xprint/Init.c
@@ -163,6 +163,7 @@ static
PixmapFormatRec PSPixmapFormats[] = {
{ 1, 1, BITMAP_SCANLINE_PAD },
{ 8, 8, BITMAP_SCANLINE_PAD },
+ { 12, 16, BITMAP_SCANLINE_PAD },
{ 24, 32, BITMAP_SCANLINE_PAD }
};
@@ -1217,9 +1218,9 @@ AugmentFontPath(void)
* calling XpContextOfClient (in Xserver/Xext/xprint.c) to determine
* the context associated with the client, and then queries the context's
* attributes to determine whether the bitmap fonts should be visible.
- * It looks at the value of the xp-listfonts-mode document/page attribute to
+ * It looks at the value of the xp-listfonts-modes document/page attribute to
* see if xp-list-glyph-fonts has been left out of the mode list. Only
- * if the xp-listfonts-mode attribute exists, and it does not contain
+ * if the xp-listfonts-modes attribute exists, and it does not contain
* xp-list-glyph-fonts does this function return FALSE. In any other
* case the funtion returns TRUE, indicating that the bitmap fonts
* should be visible to the client.
@@ -1238,10 +1239,10 @@ XpClientIsBitmapClient(
* Check the page attributes, and if it's not defined there, then
* check the document attributes.
*/
- mode = XpGetOneAttribute(pContext, XPPageAttr, "xp-listfonts-mode");
+ mode = XpGetOneAttribute(pContext, XPPageAttr, "xp-listfonts-modes");
if(!mode || !strlen(mode))
{
- mode = XpGetOneAttribute(pContext, XPDocAttr, "xp-listfonts-mode");
+ mode = XpGetOneAttribute(pContext, XPDocAttr, "xp-listfonts-modes");
if(!mode || !strlen(mode))
return TRUE;
}
@@ -1251,14 +1252,21 @@ XpClientIsBitmapClient(
return TRUE;
}
+
/*
* XpClientIsPrintClient is called by the font code to find out if
* a particular client has set a context which references a printer
- * which utilizes a particular font path. This function works by
- * calling XpContextOfClient (in Xserver/Xext/xprint.c) to determine
- * the context associated with the client, and then looks up the
- * font directory for the context. The font directory is then compared
- * with the directory specified in the FontPathElement which is passed in.
+ * which utilizes a particular font path.
+ * This function works by calling XpContextOfClient
+ * (in Xserver/Xext/xprint.c) to determine the context associated with
+ * the client and then looks at the value of the xp-listfonts-modes
+ * document/page attribute to see if xp-list-internal-printer-fonts has
+ * been left out of the mode list.
+ * If the xp-listfonts-modes attribute exists, and it does not contain
+ * xp-list-internal-printer-fonts this function returns FALSE.
+ * Otherwise it looks up the font directory for the context. The font
+ * directory is then compared with the directory specified in the
+ * FontPathElement which is passed in.
*/
Bool
XpClientIsPrintClient(
@@ -1266,11 +1274,28 @@ XpClientIsPrintClient(
FontPathElementPtr fpe)
{
XpContextPtr pContext;
+ char *mode;
char *modelID, *fontDir;
if(!(pContext = XpContextOfClient(client)))
return FALSE;
+ /*
+ * Check the page attributes, and if it's not defined there, then
+ * check the document attributes.
+ */
+ mode = XpGetOneAttribute(pContext, XPPageAttr, "xp-listfonts-modes");
+ if(!mode || !strlen(mode))
+ {
+ mode = XpGetOneAttribute(pContext, XPDocAttr, "xp-listfonts-modes");
+ }
+
+ if(mode && strlen(mode))
+ {
+ if(!strstr(mode, "xp-list-internal-printer-fonts"))
+ return FALSE;
+ }
+
if (!fpe)
return TRUE;
diff --git a/Xprint/Oid.c b/Xprint/Oid.c
index 32be3efb1..575f50582 100644
--- a/Xprint/Oid.c
+++ b/Xprint/Oid.c
@@ -2104,16 +2104,16 @@ const char* XpOidNotifyString(XpOidNotify notify)
{
switch(notify)
{
- case XPOID_NOTIFY_UNSUPPORTED:
- return (const char*)NULL;
- break;
- case XPOID_NOTIFY_NONE:
- return NOTIFY_NONE_STR;
- break;
- case XPOID_NOTIFY_EMAIL:
- return NOTIFY_EMAIL_STR;
- break;
+ case XPOID_NOTIFY_NONE:
+ return NOTIFY_NONE_STR;
+ case XPOID_NOTIFY_EMAIL:
+ return NOTIFY_EMAIL_STR;
+ case XPOID_NOTIFY_UNSUPPORTED:
+ return (const char *)NULL;
}
+
+ ErrorF("XpOidNotifyString: Unsupported notify=%ld\n", (long)notify);
+ return (const char *)NULL;
}
/*
diff --git a/Xprint/attributes.c b/Xprint/attributes.c
index 8dd1b64cb..2d981577a 100644
--- a/Xprint/attributes.c
+++ b/Xprint/attributes.c
@@ -1515,6 +1515,8 @@ XpSubmitJob(fileName, pContext)
FreeVector(vector);
xfree(cmdNam);
+
+ return Success;
}
/*
diff --git a/Xprint/pcl/PclInit.c b/Xprint/pcl/PclInit.c
index 460c11eb6..f48ece041 100644
--- a/Xprint/pcl/PclInit.c
+++ b/Xprint/pcl/PclInit.c
@@ -329,12 +329,12 @@ AllocatePclPrivates(ScreenPtr pScreen)
*/
static char DOC_ATT_SUPP[]="document-attributes-supported";
-static char DOC_ATT_VAL[]="document-format";
+static char DOC_ATT_VAL[]="document-format xp-listfonts-modes";
static char JOB_ATT_SUPP[]="job-attributes-supported";
static char JOB_ATT_VAL[]="";
static char PAGE_ATT_SUPP[]="xp-page-attributes-supported";
static char PAGE_ATT_VAL[]="content-orientation default-printer-resolution \
-default-input-tray default-medium plex";
+default-input-tray default-medium plex xp-listfonts-modes";
static int
PclInitContext(XpContextPtr pCon)
@@ -427,7 +427,7 @@ PclInitContext(XpContextPtr pCon)
server = XpGetOneAttribute( pCon, XPServerAttr, DOC_ATT_SUPP );
if( ( attrStr = (char *)xalloc(strlen(server) + strlen(DOC_ATT_SUPP)
+ strlen(DOC_ATT_VAL) +
- strlen(PAGE_ATT_VAL) + 6 ) )
+ strlen(PAGE_ATT_VAL) + 8 ) )
== (char *)NULL )
return BadAlloc;
sprintf( attrStr, "*%s:\t%s %s %s", DOC_ATT_SUPP, server,
@@ -440,7 +440,7 @@ PclInitContext(XpContextPtr pCon)
*/
server = XpGetOneAttribute( pCon, XPServerAttr, JOB_ATT_SUPP );
if( ( attrStr = (char *)xalloc(strlen(server) + strlen(JOB_ATT_SUPP)
- + strlen(JOB_ATT_VAL) + 4 ) )
+ + strlen(JOB_ATT_VAL) + 8 ) )
== (char *)NULL )
return BadAlloc;
sprintf( attrStr, "*%s:\t%s %s", JOB_ATT_SUPP, server, JOB_ATT_VAL );
@@ -452,7 +452,7 @@ PclInitContext(XpContextPtr pCon)
*/
server = XpGetOneAttribute( pCon, XPServerAttr, PAGE_ATT_SUPP );
if( ( attrStr = (char *)xalloc(strlen(server) + strlen(PAGE_ATT_SUPP)
- + strlen(PAGE_ATT_VAL) + 4 ) )
+ + strlen(PAGE_ATT_VAL) + 8 ) )
== (char *)NULL )
return BadAlloc;
sprintf( attrStr, "*%s:\t%s %s", PAGE_ATT_SUPP, server, PAGE_ATT_VAL );
diff --git a/Xprint/ps/Ps.h b/Xprint/ps/Ps.h
index 6bde70f47..726cf5aae 100644
--- a/Xprint/ps/Ps.h
+++ b/Xprint/ps/Ps.h
@@ -556,7 +556,7 @@ extern int PsListInstalledColormaps(ScreenPtr pScreen, XID *pCmapList);
extern void PsStoreColors(ColormapPtr pColor, int ndef, xColorItem *pdefs);
extern void PsResolveColor(unsigned short *pRed, unsigned short *pGreen,
unsigned short *pBlue, VisualPtr pVisual);
-extern int PsGetPixelColor(ColormapPtr cMap, int pixval);
+extern PsOutColor PsGetPixelColor(ColormapPtr cMap, int pixval);
extern void PsSetFillColor(DrawablePtr pDrawable, GCPtr pGC, PsOutPtr psOut,
ColormapPtr cMap);
@@ -566,6 +566,7 @@ extern void PsSetFillColor(DrawablePtr pDrawable, GCPtr pGC, PsOutPtr psOut,
extern PixmapPtr PsCreatePixmap(ScreenPtr pScreen, int width, int height,
int depth);
+extern void PsScrubPixmap(PixmapPtr pPixmap);
extern Bool PsDestroyPixmap(PixmapPtr pPixmap);
extern DisplayListPtr PsGetFreeDisplayBlock(PsPixmapPrivPtr priv);
extern void PsReplayPixmap(PixmapPtr pix, DrawablePtr pDrawable);
diff --git a/Xprint/ps/PsArea.c b/Xprint/ps/PsArea.c
index 134686a87..d01ccd2c1 100644
--- a/Xprint/ps/PsArea.c
+++ b/Xprint/ps/PsArea.c
@@ -131,6 +131,13 @@ PsPutScaledImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
PsOut_Offset(psOut, pDrawable->x, pDrawable->y);
pt = (char *)(&i); i = 1; if( pt[0]=='\001' ) swap = 1; else swap = 0;
+#ifdef PSOUT_USE_DEEPCOLOR
+ if( depth==30 )
+ {
+ ErrorF("PsPutScaledImage: Not implemented yet for 30bit\m");
+ }
+ else
+#endif /* PSOUT_USE_DEEPCOLOR */
if( depth==24 )
{
PsOut_BeginImage(psOut, 0, 0, x, y, w, h, sw, sh, 3);
@@ -174,6 +181,34 @@ PsPutScaledImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
else goto error;
PsOut_EndImage(psOut);
}
+#ifdef PSOUT_USE_DEEPCOLOR
+ else if( (depth > 8) && (depth < 16) )
+ {
+ int rowsiz = PixmapBytePad(w, depth);
+ PsOut_BeginImage(psOut, 0, 0, x, y, w, h, sw, sh, 3);
+ for( r=0 ; r<h ; r++ )
+ {
+ short *pt = (short *)&pImage[rowsiz*r];
+ for( c=0 ; c<w ; c++,pt++ )
+ {
+ PsOutColor clr = PsGetPixelColor(cMap, (int)(*pt)&0xFFFF);
+ /* XXX: This needs to be fixed for endian swapping and to support
+ * depths deeper than 8bit per R-,G-,B-gun... */
+ int val = PSOUTCOLOR_TO_RGB24BIT(clr);
+ char *ipt = (char *)&val;
+ if( swap )
+ {
+ char tmp[4];
+ tmp[0] = ipt[3]; tmp[1] = ipt[2]; tmp[2] = ipt[1]; tmp[3] = ipt[0];
+ PsOut_OutImageBytes(psOut, 3, &tmp[1]);
+ }
+ else
+ PsOut_OutImageBytes(psOut, 3, &ipt[1]);
+ }
+ }
+ PsOut_EndImage(psOut);
+ }
+#endif /* PSOUT_USE_DEEPCOLOR */
else if( depth==8 )
{
int rowsiz = PixmapBytePad(w, depth);
@@ -183,8 +218,9 @@ PsPutScaledImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
char *pt = &pImage[rowsiz*r];
for( c=0 ; c<w ; c++,pt++ )
{
- int val = PsGetPixelColor(cMap, (int)(*pt)&0xFF);
- char *ipt = (char *)&val;
+ PsOutColor clr = PsGetPixelColor(cMap, (int)(*pt)&0xFF);
+ int val = PSOUTCOLOR_TO_RGB24BIT(clr);
+ char *ipt = (char *)&val;
if( swap )
{
char tmp[4];
@@ -296,6 +332,14 @@ PsPutScaledImageIM(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
PsOut_BeginImageCache(psOut, cache_id);
#endif
+
+#ifdef PSOUT_USE_DEEPCOLOR
+ if( depth==30 )
+ {
+ ErrorF("PsPutScaledImageIM: Not implemented yet for 30bit\m");
+ }
+ else
+#endif /* PSOUT_USE_DEEPCOLOR */
if( depth==24 )
{
PsOut_BeginImageIM(psOut, 0, 0, x, y, w, h, sw, sh, 3);
@@ -339,6 +383,32 @@ PsPutScaledImageIM(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
else goto error;
PsOut_EndImage(psOut);
}
+#ifdef PSOUT_USE_DEEPCOLOR
+ else if( (depth > 8) && (depth < 16) )
+ {
+ int rowsiz = PixmapBytePad(w, depth);
+ PsOut_BeginImageIM(psOut, 0, 0, x, y, w, h, sw, sh, 3);
+ for( r=0 ; r<h ; r++ )
+ {
+ short *pt = (short *)&pImage[rowsiz*r];
+ for( c=0 ; c<w ; c++,pt++ )
+ {
+ PsOutColor clr = PsGetPixelColor(cMap, (int)(*pt)&0xFFFF);
+ int val = PSOUTCOLOR_TO_RGB24BIT(clr);
+ char *ipt = (char *)&val;
+ if( swap )
+ {
+ char tmp[4];
+ tmp[0] = ipt[3]; tmp[1] = ipt[2]; tmp[2] = ipt[1]; tmp[3] = ipt[0];
+ PsOut_OutImageBytes(psOut, 3, &tmp[1]);
+ }
+ else
+ PsOut_OutImageBytes(psOut, 3, &ipt[1]);
+ }
+ }
+ PsOut_EndImage(psOut);
+ }
+#endif /* PSOUT_USE_DEEPCOLOR */
else if( depth==8 )
{
int rowsiz = PixmapBytePad(w, depth);
@@ -348,8 +418,11 @@ PsPutScaledImageIM(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
char *pt = &pImage[rowsiz*r];
for( c=0 ; c<w ; c++,pt++ )
{
- int val = PsGetPixelColor(cMap, (int)(*pt)&0xFF);
- char *ipt = (char *)&val;
+ PsOutColor clr = PsGetPixelColor(cMap, (int)(*pt)&0xFF);
+ /* XXX: This needs to be fixed for endian swapping and to support
+ * depths deeper than 8bit per R-,G-,B-gun... */
+ int val = PSOUTCOLOR_TO_RGB24BIT(clr);
+ char *ipt = (char *)&val;
if( swap )
{
char tmp[4];
diff --git a/Xprint/ps/PsColor.c b/Xprint/ps/PsColor.c
index da6c82c1d..1f9842473 100644
--- a/Xprint/ps/PsColor.c
+++ b/Xprint/ps/PsColor.c
@@ -75,6 +75,8 @@ in this Software without prior written authorization from The Open Group.
********************************************************************/
#include "Ps.h"
+#include "mi.h"
+#include "micmap.h"
#include "gcstruct.h"
#include "windowstr.h"
#include "colormapst.h"
@@ -82,49 +84,25 @@ in this Software without prior written authorization from The Open Group.
Bool
PsCreateColormap(ColormapPtr pColor)
{
- int i;
- unsigned short rgb;
- VisualPtr pVisual = pColor->pVisual;
- Pixel pix;
-
- if( pVisual->class==TrueColor )
- {
- for( i=0 ; i<pVisual->ColormapEntries ; i++ )
- {
- rgb = (i<<8)|i;
-
- pColor->red[i].fShared = FALSE;
- pColor->red[i].co.local.red = rgb;
- pColor->red[i].co.local.green = 0;
- pColor->red[i].co.local.blue = 0;
-
- pColor->green[i].fShared = FALSE;
- pColor->green[i].co.local.red = 0;
- pColor->green[i].co.local.green = rgb;
- pColor->green[i].co.local.blue = 0;
-
- pColor->blue[i].fShared = FALSE;
- pColor->blue[i].co.local.red = 0;
- pColor->blue[i].co.local.green = 0;
- pColor->blue[i].co.local.blue = rgb;
- }
- }
- return TRUE;
+ return miInitializeColormap(pColor);
}
void
PsDestroyColormap(ColormapPtr pColor)
{
+ /* NO-OP */
}
void
PsInstallColormap(ColormapPtr pColor)
{
+ miInstallColormap(pColor);
}
void
PsUninstallColormap(ColormapPtr pColor)
{
+ miUninstallColormap(pColor);
}
int
@@ -132,7 +110,7 @@ PsListInstalledColormaps(
ScreenPtr pScreen,
XID *pCmapList)
{
- return 0;
+ return miListInstalledColormaps(pScreen, pCmapList);
}
void
@@ -160,18 +138,71 @@ PsResolveColor(
unsigned short *pBlue,
VisualPtr pVisual)
{
+ miResolveColor(pRed, pGreen, pBlue, pVisual);
}
-int
+PsOutColor
PsGetPixelColor(ColormapPtr cMap, int pixval)
{
- int r, g, b;
- if( cMap->pVisual->class==TrueColor ) return(pixval);
- if( pixval<0 || pixval>255 ) return(0);
- r = cMap->red[pixval].co.local.red>>8;
- g = cMap->red[pixval].co.local.green>>8;
- b = cMap->red[pixval].co.local.blue>>8;
- return((r<<16)|(g<<8)|b);
+ VisualPtr v = cMap->pVisual;
+ switch( v->class )
+ {
+ case TrueColor:
+ {
+ PsOutColor p = pixval;
+ PsOutColor r, g, b;
+#ifdef PSOUT_USE_DEEPCOLOR
+ int shift = 16 - v->bitsPerRGBValue;
+#else
+ int shift = 8 - v->bitsPerRGBValue;
+#endif /* PSOUT_USE_DEEPCOLOR */
+
+ r = ((p & v->redMask) >> v->offsetRed) << shift;
+ g = ((p & v->greenMask) >> v->offsetGreen) << shift;
+ b = ((p & v->blueMask) >> v->offsetBlue) << shift;
+
+#ifdef PSOUT_USE_DEEPCOLOR
+ return((r<<32)|(g<<16)|b);
+#else
+ return((r<<16)|(g<<8)|b);
+#endif /* PSOUT_USE_DEEPCOLOR */
+ }
+ case PseudoColor:
+ case GrayScale:
+ case StaticGray:
+ {
+ PsOutColor r, g, b;
+
+ if( pixval < 0 || pixval > v->ColormapEntries)
+ return(0);
+
+ r = cMap->red[pixval].co.local.red;
+ g = cMap->red[pixval].co.local.green;
+ b = cMap->red[pixval].co.local.blue;
+
+ if ((v->class | DynamicClass) == GrayScale)
+ {
+ /* rescale to gray (see |miResolveColor()|) */
+ r = g = b = (30L*r + 59L*g + 11L*b) / 100L;
+ }
+
+#ifdef PSOUT_USE_DEEPCOLOR
+ return((r<<32)|(g<<16)|b);
+#else
+ r >>= 8;
+ g >>= 8;
+ b >>= 8;
+
+ return((r<<16)|(g<<8)|b);
+#endif /* PSOUT_USE_DEEPCOLOR */
+ }
+ default:
+ FatalError("PsGetPixelColor: Unsupported visual %x\n",
+ (int)cMap->pVisual->class);
+ break;
+ }
+
+ return 0; /* NO-OP*/
}
void
diff --git a/Xprint/ps/PsGC.c b/Xprint/ps/PsGC.c
index 78c83930d..c4984d075 100644
--- a/Xprint/ps/PsGC.c
+++ b/Xprint/ps/PsGC.c
@@ -380,6 +380,16 @@ PsCreateAndCopyGC(DrawablePtr pDrawable, GCPtr pSrc)
{
GCPtr pDst;
+ if (pSrc == NULL) {
+ /* https://freedesktop.org/bugzilla/show_bug.cgi?id=1416 ("'x11perf
+ * -copypixpix500' crashes Xprt's PostScript DDX [PsCreateAndCopyGC"):
+ * I have no clue whether this is the real fix or just wallpapering
+ * over the crash (that's why we warn here loudly when this
+ * happens) ... */
+ fprintf(stderr, "PsCreateAndCopyGC: pSrc == NULL\n");
+ return NULL;
+ }
+
if ((pDst =
CreateScratchGC(pDrawable->pScreen, pDrawable->depth)) == NULL)
{
diff --git a/Xprint/ps/PsInit.c b/Xprint/ps/PsInit.c
index f2e064921..5097b7027 100644
--- a/Xprint/ps/PsInit.c
+++ b/Xprint/ps/PsInit.c
@@ -119,8 +119,18 @@ InitializePsDriver(ndx, pScreen, argc, argv)
#endif
char **printerNames;
int numPrinters;
- int nVisuals;
- int nDepths;
+ int nv, /* total number of visuals */
+ nv_1bit, /* number of 8bit visuals */
+ nv_8bit, /* number of 8bit visuals */
+ nv_12bit, /* number of 12bit visuals */
+ nv_24bit, /* number of 24bit visuals*/
+ nv_30bit; /* number of 30bit visuals*/
+ int nd; /* number of depths */
+ VisualID *vids_1bit,
+ *vids_8bit,
+ *vids_12bit,
+ *vids_24bit,
+ *vids_30bit;
VisualPtr visuals;
DepthPtr depths;
VisualID defaultVisual;
@@ -179,44 +189,180 @@ InitializePsDriver(ndx, pScreen, argc, argv)
/* Will BitmapToRegion make any difference at all? */
pScreen->BitmapToRegion = mfbPixmapToRegion;
- nVisuals = 2;
- nDepths = 2;
- visuals = (VisualPtr)xalloc(nVisuals*sizeof(VisualRec));
- depths = (DepthPtr) xalloc(nDepths*sizeof(DepthRec));
-
- visuals[0].vid = FakeClientID(0);
- visuals[0].class = TrueColor;
- visuals[0].bitsPerRGBValue = 8;
- visuals[0].ColormapEntries = 256;
- visuals[0].nplanes = 24;
- visuals[0].redMask = 0x00FF0000;
- visuals[0].greenMask = 0x0000FF00;
- visuals[0].blueMask = 0x000000FF;
- visuals[0].offsetRed = 16;
- visuals[0].offsetGreen = 8;
- visuals[0].offsetBlue = 0;
-
- visuals[1].vid = FakeClientID(0);
- visuals[1].class = PseudoColor;
- visuals[1].bitsPerRGBValue = 8;
- visuals[1].ColormapEntries = 256;
- visuals[1].nplanes = 8;
- visuals[1].redMask = 0x0;
- visuals[1].greenMask = 0x0;
- visuals[1].blueMask = 0x0;
- visuals[1].offsetRed = 0x0;
- visuals[1].offsetGreen = 0x0;
- visuals[1].offsetBlue = 0x0;
-
- depths[0].depth = 24;
- depths[0].numVids = 1;
- depths[0].vids = (VisualID *)xalloc(sizeof(VisualID));
- depths[0].vids[0] = visuals[0].vid;
-
- depths[1].depth = 8;
- depths[1].numVids = 1;
- depths[1].vids = (VisualID *)xalloc(sizeof(VisualID));
- depths[1].vids[0] = visuals[1].vid;
+ visuals = (VisualPtr) xalloc(8*sizeof(VisualRec));
+ depths = (DepthPtr) xalloc(8*sizeof(DepthRec));
+ vids_1bit = (VisualID *)xalloc(8*sizeof(VisualID));
+ vids_8bit = (VisualID *)xalloc(8*sizeof(VisualID));
+ vids_12bit = (VisualID *)xalloc(8*sizeof(VisualID));
+ vids_24bit = (VisualID *)xalloc(8*sizeof(VisualID));
+ vids_30bit = (VisualID *)xalloc(8*sizeof(VisualID));
+
+ nv = nv_1bit = nv_8bit = nv_12bit = nv_24bit = nv_30bit = nd = 0;
+
+ /* TrueColor, 24bit */
+ visuals[nv].vid = FakeClientID(0);
+ visuals[nv].class = TrueColor;
+ visuals[nv].bitsPerRGBValue = 8;
+ visuals[nv].ColormapEntries = 256;
+ visuals[nv].nplanes = 24;
+ visuals[nv].redMask = 0X00FF0000;
+ visuals[nv].greenMask = 0X0000FF00;
+ visuals[nv].blueMask = 0X000000FF;
+ visuals[nv].offsetRed = 16;
+ visuals[nv].offsetGreen = 8;
+ visuals[nv].offsetBlue = 0;
+ vids_24bit[nv_24bit] = visuals[nv].vid;
+ nv++; nv_24bit++;
+
+ /* PseudoColor, 8bit */
+ visuals[nv].vid = FakeClientID(0);
+ visuals[nv].class = PseudoColor;
+ visuals[nv].bitsPerRGBValue = 8;
+ visuals[nv].ColormapEntries = 256;
+ visuals[nv].nplanes = 8;
+ visuals[nv].redMask = 0x0;
+ visuals[nv].greenMask = 0x0;
+ visuals[nv].blueMask = 0x0;
+ visuals[nv].offsetRed = 0x0;
+ visuals[nv].offsetGreen = 0x0;
+ visuals[nv].offsetBlue = 0x0;
+ vids_8bit[nv_8bit] = visuals[nv].vid;
+ nv++; nv_8bit++;
+
+ /* GrayScale, 8bit */
+ visuals[nv].vid = FakeClientID(0);
+ visuals[nv].class = GrayScale;
+ visuals[nv].bitsPerRGBValue = 8;
+ visuals[nv].ColormapEntries = 256;
+ visuals[nv].nplanes = 8;
+ visuals[nv].redMask = 0x0;
+ visuals[nv].greenMask = 0x0;
+ visuals[nv].blueMask = 0x0;
+ visuals[nv].offsetRed = 0x0;
+ visuals[nv].offsetGreen = 0x0;
+ visuals[nv].offsetBlue = 0x0;
+ vids_8bit[nv_8bit] = visuals[nv].vid;
+ nv++; nv_8bit++;
+
+ /* StaticGray, 8bit */
+ visuals[nv].vid = FakeClientID(0);
+ visuals[nv].class = StaticGray;
+ visuals[nv].bitsPerRGBValue = 8;
+ visuals[nv].ColormapEntries = 256;
+ visuals[nv].nplanes = 8;
+ visuals[nv].redMask = 0x0;
+ visuals[nv].greenMask = 0x0;
+ visuals[nv].blueMask = 0x0;
+ visuals[nv].offsetRed = 0x0;
+ visuals[nv].offsetGreen = 0x0;
+ visuals[nv].offsetBlue = 0x0;
+ vids_8bit[nv_8bit] = visuals[nv].vid;
+ nv++; nv_8bit++;
+
+ /* StaticGray, 1bit */
+ visuals[nv].vid = FakeClientID(0);
+ visuals[nv].class = StaticGray;
+ visuals[nv].bitsPerRGBValue = 1;
+ visuals[nv].ColormapEntries = 2;
+ visuals[nv].nplanes = 1;
+ visuals[nv].redMask = 0x0;
+ visuals[nv].greenMask = 0x0;
+ visuals[nv].blueMask = 0x0;
+ visuals[nv].offsetRed = 0x0;
+ visuals[nv].offsetGreen = 0x0;
+ visuals[nv].offsetBlue = 0x0;
+ vids_1bit[nv_1bit] = visuals[nv].vid;
+ nv++; nv_1bit++;
+
+#ifdef PSOUT_USE_DEEPCOLOR
+ /* TrueColor, 30bit, 10bit per R-,G-,B-gun */
+ visuals[nv].vid = FakeClientID(0);
+ visuals[nv].class = TrueColor;
+ visuals[nv].bitsPerRGBValue = 10;
+ visuals[nv].ColormapEntries = 1024;
+ visuals[nv].nplanes = 30;
+ visuals[nv].redMask = 0X3FF00000;
+ visuals[nv].greenMask = 0X000FFC00;
+ visuals[nv].blueMask = 0X000003FF;
+ visuals[nv].offsetRed = 20;
+ visuals[nv].offsetGreen = 10;
+ visuals[nv].offsetBlue = 0;
+ vids_30bit[nv_30bit] = visuals[nv].vid;
+ nv++; nv_30bit++;
+
+ /* PostScript Level 2 and above, colors can have 12 bits per component
+ * (36 bit for RGB) */
+
+ /* GrayScale, 12bit, 12bit per R-,G-,B-gun */
+ visuals[nv].vid = FakeClientID(0);
+ visuals[nv].class = GrayScale;
+ visuals[nv].bitsPerRGBValue = 12;
+ visuals[nv].ColormapEntries = 4096;
+ visuals[nv].nplanes = 12;
+ visuals[nv].redMask = 0x0;
+ visuals[nv].greenMask = 0x0;
+ visuals[nv].blueMask = 0x0;
+ visuals[nv].offsetRed = 0x0;
+ visuals[nv].offsetGreen = 0x0;
+ visuals[nv].offsetBlue = 0x0;
+ vids_12bit[nv_12bit] = visuals[nv].vid;
+ nv++; nv_12bit++;
+
+ /* StaticGray, 12bit, 12bit per R-,G-,B-gun */
+ visuals[nv].vid = FakeClientID(0);
+ visuals[nv].class = StaticGray;
+ visuals[nv].bitsPerRGBValue = 12;
+ visuals[nv].ColormapEntries = 4096;
+ visuals[nv].nplanes = 12;
+ visuals[nv].redMask = 0x0;
+ visuals[nv].greenMask = 0x0;
+ visuals[nv].blueMask = 0x0;
+ visuals[nv].offsetRed = 0x0;
+ visuals[nv].offsetGreen = 0x0;
+ visuals[nv].offsetBlue = 0x0;
+ vids_12bit[nv_12bit] = visuals[nv].vid;
+ nv++; nv_12bit++;
+#endif /* PSOUT_USE_DEEPCOLOR */
+
+ if( nv_30bit > 0 )
+ {
+ depths[nd].depth = 30;
+ depths[nd].numVids = nv_30bit;
+ depths[nd].vids = vids_30bit;
+ nd++;
+ }
+
+ if( nv_24bit > 0 )
+ {
+ depths[nd].depth = 24;
+ depths[nd].numVids = nv_24bit;
+ depths[nd].vids = vids_24bit;
+ nd++;
+ }
+
+ if( nv_12bit > 0 )
+ {
+ depths[nd].depth = 12;
+ depths[nd].numVids = nv_12bit;
+ depths[nd].vids = vids_12bit;
+ nd++;
+ }
+
+ if( nv_8bit > 0 )
+ {
+ depths[nd].depth = 8;
+ depths[nd].numVids = nv_8bit;
+ depths[nd].vids = vids_8bit;
+ nd++;
+ }
+
+ if( nv_1bit > 0 )
+ {
+ depths[nd].depth = 1;
+ depths[nd].numVids = nv_1bit;
+ depths[nd].vids = vids_1bit;
+ nd++;
+ }
/* Defaul visual is 8bit PseudoColor */
defaultVisual = visuals[1].vid;
@@ -228,7 +374,7 @@ InitializePsDriver(ndx, pScreen, argc, argv)
GlxWrapInitVisuals(&proc);
/* GlxInitVisuals ignores the last three arguments. */
- proc(&visuals, &depths, &nVisuals, &nDepths,
+ proc(&visuals, &depths, &nv, &nd,
&rootDepth, &defaultVisual, 0, 0, 0);
}
#endif /* GLXEXT */
@@ -237,8 +383,8 @@ InitializePsDriver(ndx, pScreen, argc, argv)
pScreen->width, pScreen->height,
(int) (pScreen->width / (pScreen->mmWidth / 25.40)),
(int) (pScreen->height / (pScreen->mmHeight / 25.40)),
- 0, rootDepth, nDepths,
- depths, defaultVisual, nVisuals, visuals);
+ 0, rootDepth, nd,
+ depths, defaultVisual, nv, visuals);
if( cfbCreateDefColormap(pScreen)==FALSE ) return FALSE;
@@ -282,12 +428,12 @@ AllocatePsPrivates(ScreenPtr pScreen)
*/
static char DOC_ATT_SUPP[]="document-attributes-supported";
-static char DOC_ATT_VAL[]="document-format";
+static char DOC_ATT_VAL[]="document-format xp-listfonts-modes";
static char JOB_ATT_SUPP[]="job-attributes-supported";
static char JOB_ATT_VAL[]="";
static char PAGE_ATT_SUPP[]="xp-page-attributes-supported";
static char PAGE_ATT_VAL[]="content-orientation default-printer-resolution \
-default-input-tray default-medium plex";
+default-input-tray default-medium plex xp-listfonts-modes";
static int
PsInitContext(pCon)
@@ -346,7 +492,7 @@ PsInitContext(pCon)
server = XpGetOneAttribute( pCon, XPServerAttr, DOC_ATT_SUPP );
if ((attrStr = (char *) xalloc(strlen(server) +
strlen(DOC_ATT_SUPP) + strlen(DOC_ATT_VAL)
- + strlen(PAGE_ATT_VAL) + 6)) == NULL)
+ + strlen(PAGE_ATT_VAL) + 8)) == NULL)
{
return BadAlloc;
}
@@ -360,7 +506,7 @@ PsInitContext(pCon)
*/
server = XpGetOneAttribute( pCon, XPServerAttr, JOB_ATT_SUPP );
if ((attrStr = (char *) xalloc(strlen(server) + strlen(JOB_ATT_SUPP) +
- strlen(JOB_ATT_VAL) + 4)) == NULL)
+ strlen(JOB_ATT_VAL) + 8)) == NULL)
{
return BadAlloc;
}
@@ -373,7 +519,7 @@ PsInitContext(pCon)
*/
server = XpGetOneAttribute( pCon, XPServerAttr, PAGE_ATT_SUPP );
if ((attrStr = (char *) xalloc(strlen(server) + strlen(PAGE_ATT_SUPP) +
- strlen(PAGE_ATT_VAL) + 4)) == NULL)
+ strlen(PAGE_ATT_VAL) + 8)) == NULL)
{
return BadAlloc;
}
diff --git a/Xprint/ps/PsPixmap.c b/Xprint/ps/PsPixmap.c
index 616c2dbe8..25a525b82 100644
--- a/Xprint/ps/PsPixmap.c
+++ b/Xprint/ps/PsPixmap.c
@@ -92,7 +92,7 @@ PsCreatePixmap(
{
PixmapPtr pPixmap;
- pPixmap = (PixmapPtr)xalloc(sizeof(PixmapRec));
+ pPixmap = (PixmapPtr)xcalloc(1, sizeof(PixmapRec));
if( !pPixmap) return NullPixmap;
pPixmap->drawable.type = DRAWABLE_PIXMAP;
pPixmap->drawable.class = 0;
@@ -108,20 +108,21 @@ PsCreatePixmap(
pPixmap->devKind = 0;
pPixmap->refcnt = 1;
- pPixmap->devPrivate.ptr = (PsPixmapPrivPtr)xalloc(sizeof(PsPixmapPrivRec));
+ pPixmap->devPrivate.ptr = (PsPixmapPrivPtr)xcalloc(1, sizeof(PsPixmapPrivRec));
if( !pPixmap->devPrivate.ptr )
{ xfree(pPixmap); return NullPixmap; }
- memset(pPixmap->devPrivate.ptr, 0, sizeof(PsPixmapPrivRec));
return pPixmap;
}
-Bool
-PsDestroyPixmap(PixmapPtr pPixmap)
+/* PsScrubPixmap: Remove all content from a pixmap (used by
+ * |PsPolyFillRect()| when the "solid fill" operation covers
+ * the whole pixmap) */
+void
+PsScrubPixmap(PixmapPtr pPixmap)
{
PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pPixmap->devPrivate.ptr;
DisplayListPtr disp = priv->dispList;
- if( --pPixmap->refcnt ) return TRUE;
while( disp )
{
int i;
@@ -178,6 +179,20 @@ PsDestroyPixmap(PixmapPtr pPixmap)
}
xfree(oldDisp);
}
+
+ priv->dispList = NULL;
+}
+
+Bool
+PsDestroyPixmap(PixmapPtr pPixmap)
+{
+ PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pPixmap->devPrivate.ptr;
+ DisplayListPtr disp = priv->dispList;
+
+ if( --pPixmap->refcnt ) return TRUE;
+
+ PsScrubPixmap(pPixmap);
+
xfree(priv);
xfree(pPixmap);
return TRUE;
@@ -192,11 +207,11 @@ PsGetFreeDisplayBlock(PsPixmapPrivPtr priv)
{
if( disp->nelms>=DPY_BLOCKSIZE && disp->next ) continue;
if( disp->nelms<DPY_BLOCKSIZE ) return(disp);
- disp->next = (DisplayListPtr)xalloc(sizeof(DisplayListRec));
+ disp->next = (DisplayListPtr)xcalloc(1, sizeof(DisplayListRec));
disp->next->next = (DisplayListPtr)0;
disp->next->nelms = 0;
}
- disp = (DisplayListPtr)xalloc(sizeof(DisplayListRec));
+ disp = (DisplayListPtr)xcalloc(1, sizeof(DisplayListRec));
disp->next = (DisplayListPtr)0;
disp->nelms = 0;
priv->dispList = disp;
@@ -480,6 +495,7 @@ PsCreateFillElementList(PixmapPtr pix, int *nElms)
for( i=0 ; i<disp->nelms ; i++,elm++ )
{
+ if( !elm->gc ) continue; /* workaround for https://freedesktop.org/bugzilla/show_bug.cgi?id=1416 */
if( !elm->gc->fgPixel ) continue;
switch(elm->type)
{
@@ -498,7 +514,7 @@ PsCreateFillElementList(PixmapPtr pix, int *nElms)
if( (*nElms) )
{
- elms = (PsElmPtr)xalloc((*nElms)*sizeof(PsElmRec));
+ elms = (PsElmPtr)xcalloc(1, (*nElms)*sizeof(PsElmRec));
if( elms )
{
disp = priv->dispList;
@@ -568,7 +584,7 @@ PsCloneFillElementList(int nElms, PsElmPtr elms)
int i;
PsElmPtr newElms;
- newElms = (PsElmPtr)xalloc(nElms*sizeof(PsElmRec));
+ newElms = (PsElmPtr)xcalloc(1, nElms*sizeof(PsElmRec));
if( !newElms ) return(newElms);
for( i=0 ; i<nElms ; i++ )
{
diff --git a/Xprint/ps/PsPolygon.c b/Xprint/ps/PsPolygon.c
index a5b373775..dca00fa21 100644
--- a/Xprint/ps/PsPolygon.c
+++ b/Xprint/ps/PsPolygon.c
@@ -203,6 +203,31 @@ PsPolyFillRect(
DisplayListPtr disp;
GCPtr gc;
+#ifdef DBE
+ /* Remove previous pixmap content if we render one single rect which
+ * covers the whole pixmap surface (this optimisation was added for
+ * the double-buffer extension ("DBE") which uses |PolyFillRect()|
+ * to clear the buffer - but it makes sense in other cases, too).
+ */
+ if (nRects == 1)
+ {
+ extern Bool noDbeExtension;
+
+ if ( (pRects[0].x==0) && (pRects[0].y==0) &&
+ (pRects[0].width==pDrawable->width) && (pRects[0].height==pDrawable->height) &&
+ (pGC->fillStyle == FillSolid) &&
+ (noDbeExtension == False))
+ {
+#ifdef DEBUG_gismobile
+ ErrorF("PsPolyFillRect: scrubbing pixmap...\n");
+#endif /* DEBUG_gismobile */
+ /* Remove all content from the pixmap as it would be covered
+ * by the whole rect anyway */
+ PsScrubPixmap(pDrawable);
+ }
+ }
+#endif /* DBE */
+
if ((gc = PsCreateAndCopyGC(pDrawable, pGC)) == NULL) return;
disp = PsGetFreeDisplayBlock(priv);
diff --git a/Xprint/ps/psout.c b/Xprint/ps/psout.c
index d66374a4c..0f5ed2e02 100644
--- a/Xprint/ps/psout.c
+++ b/Xprint/ps/psout.c
@@ -422,17 +422,19 @@ S_OutTok(PsOutPtr self, char *tok, int cr)
}
static void
-S_Color(PsOutPtr self, int clr)
+S_Color(PsOutPtr self, PsOutColor clr)
{
int ir, ig, ib;
- ir = clr>>16; ig = (clr>>8)&0xFF; ib = clr&0xFF;
+ ir = PSOUTCOLOR_TO_REDBITS(clr);
+ ig = PSOUTCOLOR_TO_GREENBITS(clr);
+ ib = PSOUTCOLOR_TO_BLUEBITS(clr);
if( ir==ig && ig==ib )
- { S_OutNum(self, (float)ir/255.); S_OutTok(self, "g", 1); }
+ { S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ir)); S_OutTok(self, "g", 1); }
else
{
- S_OutNum(self, (float)ir/255.);
- S_OutNum(self, (float)ig/255.);
- S_OutNum(self, (float)ib/255.);
+ S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ir));
+ S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ig));
+ S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ib));
S_OutTok(self, "sc", 1);
}
}
@@ -636,7 +638,7 @@ PsOut_BeginFile(FILE *fp, char *title, int orient, int count, int plex, int res,
/*
* Initialize the structure
*/
- psout->CurColor = 0xFFFFFFFF;
+ psout->CurColor = PSOUTCOLOR_NOCOLOR;
psout->LineWidth = 1;
psout->LineCap = PsCButt;
psout->LineJoin = PsJMiter;
@@ -723,7 +725,7 @@ void
PsOut_DirtyAttributes(PsOutPtr self)
{
int i;
- self->CurColor = 0xFFFFFFFF;
+ self->CurColor = PSOUTCOLOR_NOCOLOR;
self->LineWidth = -1;
self->LineCap = (PsCapEnum)-1;
self->LineJoin = (PsJoinEnum)-1;
@@ -911,7 +913,7 @@ PsOut_Clip(PsOutPtr self, int clpTyp, PsClipPtr clpinf)
}
void
-PsOut_Color(PsOutPtr self, int clr)
+PsOut_Color(PsOutPtr self, PsOutColor clr)
{
if( clr==self->CurColor || self->InTile>=PsStip ) return;
self->CurColor = clr;
@@ -926,7 +928,7 @@ PsOut_FillRule(PsOutPtr self, PsRuleEnum rule)
void
PsOut_LineAttrs(PsOutPtr self, int wd, PsCapEnum cap, PsJoinEnum join,
- int nDsh, int *dsh, int dshOff, int bclr)
+ int nDsh, int *dsh, int dshOff, PsOutColor bclr)
{
int i;
int same = 1;
@@ -973,7 +975,10 @@ PsOut_LineAttrs(PsOutPtr self, int wd, PsCapEnum cap, PsJoinEnum join,
S_OutTok(self, "ds", 1);
}
- if( nDsh ) self->LineBClr = bclr; else bclr = -1;
+ if( nDsh )
+ self->LineBClr = bclr;
+ else
+ bclr = PSOUTCOLOR_NOCOLOR;
}
void
@@ -1094,7 +1099,7 @@ PsOut_Lines(PsOutPtr self, int nPts, PsPointPtr pts)
if( i==0 ) S_OutTok(self, "m", 0);
else S_OutTok(self, "l", 0);
}
- if( self->LineBClr>=0 )
+ if( self->LineBClr != PSOUTCOLOR_NOCOLOR )
{
S_OutTok(self, "gs", 0);
S_Color(self, self->LineBClr);
@@ -1133,7 +1138,7 @@ PsOut_DrawRect(PsOutPtr self, int x, int y, int w, int h)
S_OutNum(self, (float)w);
S_OutNum(self, (float)h);
S_OutTok(self, "R", 0);
- if( self->LineBClr>=0 )
+ if( self->LineBClr != PSOUTCOLOR_NOCOLOR )
{
S_OutTok(self, "gs", 0);
S_Color(self, self->LineBClr);
@@ -1159,7 +1164,7 @@ PsOut_DrawArc(PsOutPtr self, int x, int y, int w, int h,
S_OutNum(self, ang1+ang2);
if( ang2<0 ) S_OutTok(self, "An", 0);
else S_OutTok(self, "Ac", 0);
- if( self->LineBClr>=0 )
+ if( self->LineBClr != PSOUTCOLOR_NOCOLOR )
{
S_OutTok(self, "gs", 0);
S_Color(self, self->LineBClr);
@@ -1169,7 +1174,7 @@ PsOut_DrawArc(PsOutPtr self, int x, int y, int w, int h,
}
void
-PsOut_Text(PsOutPtr self, int x, int y, char *text, int textl, int bclr)
+PsOut_Text(PsOutPtr self, int x, int y, char *text, int textl, PsOutColor bclr)
{
int xo = self->XOff;
int yo = self->YOff;
@@ -1179,21 +1184,23 @@ PsOut_Text(PsOutPtr self, int x, int y, char *text, int textl, int bclr)
S_OutStr(self, text, textl);
S_OutNum(self, (float)x);
S_OutNum(self, (float)y);
- if( bclr<0 ) S_OutTok(self, "T", 1);
+ if( bclr == PSOUTCOLOR_NOCOLOR )
+ S_OutTok(self, "T", 1);
else
{
- int ir = bclr>>16;
- int ig = (bclr>>8)&0xFF;
- int ib = bclr&0xFF;
- S_OutNum(self, (float)ir/255.);
- S_OutNum(self, (float)ig/255.);
- S_OutNum(self, (float)ib/255.);
+ int ir = PSOUTCOLOR_TO_REDBITS(bclr);
+ int ig = PSOUTCOLOR_TO_GREENBITS(bclr);
+ int ib = PSOUTCOLOR_TO_BLUEBITS(bclr);
+
+ S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ir));
+ S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ig));
+ S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ib));
S_OutTok(self, "Tb", 1);
}
}
void
-PsOut_Text16(PsOutPtr self, int x, int y, unsigned short *text, int textl, int bclr)
+PsOut_Text16(PsOutPtr self, int x, int y, unsigned short *text, int textl, PsOutColor bclr)
{
int xo = self->XOff;
int yo = self->YOff;
@@ -1203,22 +1210,23 @@ PsOut_Text16(PsOutPtr self, int x, int y, unsigned short *text, int textl, int b
S_OutStr16(self, text, textl);
S_OutNum(self, (float)x);
S_OutNum(self, (float)y);
- if( bclr<0 ) S_OutTok(self, "T", 1);
+ if( bclr == PSOUTCOLOR_NOCOLOR )
+ S_OutTok(self, "T", 1);
else
{
- int ir = bclr>>16;
- int ig = (bclr>>8)&0xFF;
- int ib = bclr&0xFF;
- S_OutNum(self, (float)ir/255.);
- S_OutNum(self, (float)ig/255.);
- S_OutNum(self, (float)ib/255.);
+ int ir = PSOUTCOLOR_TO_REDBITS(bclr);
+ int ig = PSOUTCOLOR_TO_GREENBITS(bclr);
+ int ib = PSOUTCOLOR_TO_BLUEBITS(bclr);
+ S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ir));
+ S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ig));
+ S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ib));
S_OutTok(self, "Tb", 1);
}
}
#ifdef BM_CACHE
void /* new */
-PsOut_ImageCache(PsOutPtr self, int x, int y, long cache_id, int bclr, int fclr)
+PsOut_ImageCache(PsOutPtr self, int x, int y, long cache_id, PsOutColor bclr, PsOutColor fclr)
{
char cacheID[10];
int xo = self->XOff;
@@ -1231,22 +1239,26 @@ PsOut_ImageCache(PsOutPtr self, int x, int y, long cache_id, int bclr, int fclr)
S_OutNum(self, (float)x);
S_OutNum(self, (float)y);
- if( fclr==0xFFFFFF )
+ if( fclr==PSOUTCOLOR_WHITE )
{
- int ir, ig, ib;
- ir = bclr>>16; ig = (bclr>>8)&0xFF; ib = bclr&0xFF;
+ int ir = PSOUTCOLOR_TO_REDBITS(bclr);
+ int ig = PSOUTCOLOR_TO_GREENBITS(bclr);
+ int ib = PSOUTCOLOR_TO_BLUEBITS(bclr);
+
if( ir==ig && ig==ib )
- S_OutNum(self, (float)ir/255.);
+ S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ir));
else
S_OutNum(self, (float)0);
self->RevImage = 1;
}
else
{
- int ir, ig, ib;
- ir = fclr>>16; ig = (fclr>>8)&0xFF; ib = fclr&0xFF;
+ int ir = PSOUTCOLOR_TO_REDBITS(fclr);
+ int ig = PSOUTCOLOR_TO_GREENBITS(fclr);
+ int ib = PSOUTCOLOR_TO_BLUEBITS(fclr);
+
if( ir==ig && ig==ib )
- S_OutNum(self, (float)ir/255.);
+ S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ir));
else
S_OutNum(self, (float)0);
}
@@ -1272,10 +1284,10 @@ PsOut_EndImageCache(PsOutPtr self)
#endif
void
-PsOut_BeginImage(PsOutPtr self, int bclr, int fclr, int x, int y,
+PsOut_BeginImage(PsOutPtr self, PsOutColor bclr, PsOutColor fclr, int x, int y,
int w, int h, int sw, int sh, int format)
{
- int savClr = self->CurColor;
+ PsOutColor savClr = self->CurColor;
int xo = self->XOff;
int yo = self->YOff;
@@ -1291,7 +1303,7 @@ PsOut_BeginImage(PsOutPtr self, int bclr, int fclr, int x, int y,
S_OutTok(self, "<", 0);
self->ImageFormat = format;
self->RevImage = 0;
- if( self->InTile==PsTile && format==1 && fclr==0xFFFFFF )
+ if( self->InTile==PsTile && format==1 && fclr==PSOUTCOLOR_WHITE )
self->RevImage = 1;
return;
}
@@ -1300,7 +1312,7 @@ PsOut_BeginImage(PsOutPtr self, int bclr, int fclr, int x, int y,
if( format==1 )
{
S_OutTok(self, "gs", 0);
- if( fclr==0xFFFFFF )
+ if( fclr==PSOUTCOLOR_WHITE )
{
PsOut_Color(self, fclr);
PsOut_FillRect(self, x, y, sw, sh);
@@ -1332,10 +1344,10 @@ PsOut_BeginImage(PsOutPtr self, int bclr, int fclr, int x, int y,
}
void
-PsOut_BeginImageIM(PsOutPtr self, int bclr, int fclr, int x, int y,
+PsOut_BeginImageIM(PsOutPtr self, PsOutColor bclr, PsOutColor fclr, int x, int y,
int w, int h, int sw, int sh, int format)
{
- int savClr = self->CurColor;
+ PsOutColor savClr = self->CurColor;
int xo = self->XOff;
int yo = self->YOff;
@@ -1351,7 +1363,7 @@ PsOut_BeginImageIM(PsOutPtr self, int bclr, int fclr, int x, int y,
S_OutTok(self, "<", 0);
self->ImageFormat = format;
self->RevImage = 0;
- if( self->InTile==PsTile && format==1 && fclr==0xFFFFFF )
+ if( self->InTile==PsTile && format==1 && fclr==PSOUTCOLOR_WHITE )
self->RevImage = 1;
return;
}
@@ -1363,7 +1375,7 @@ PsOut_BeginImageIM(PsOutPtr self, int bclr, int fclr, int x, int y,
#ifdef BM_CACHE
S_OutTok(self, "g", 1);
#else
- if( fclr==0xFFFFFF )
+ if( fclr==PSOUTCOLOR_WHITE )
{
PsOut_Color(self, bclr);
self->RevImage = 1;
@@ -1411,7 +1423,7 @@ PsOut_EndImage(PsOutPtr self)
S_OutTok(self, ">", 1);
if( self->ImageFormat==1 && self->InTile==PsTile )
{
- if( self->ImgFClr==0xFFFFFF )
+ if( self->ImgFClr==PSOUTCOLOR_WHITE )
{
PsOut_Color(self, self->ImgFClr);
PsOut_FillRect(self, self->ImgX, self->ImgY, self->SclW, self->SclH);
@@ -1436,14 +1448,16 @@ PsOut_EndImage(PsOutPtr self)
self->RevImage = 0;
return;
}
-
+ /*
+ * Bug 4639307: Move flush before "> im" to get all of bitmap into ps file.
+ */
+ S_Flush(self);
#ifdef BM_CACHE
if(self->start_image)
S_OutTok(self, "> im", 1); /* new */
#endif
self->ImageFormat = 0;
self->RevImage = 0;
- S_Flush(self);
#ifdef BM_CACHE
if(self->start_image)
{
@@ -1509,7 +1523,7 @@ PsOut_EndFrame(PsOutPtr self)
int
PsOut_BeginPattern(PsOutPtr self, void *tag, int w, int h, PsFillEnum type,
- int bclr, int fclr)
+ PsOutColor bclr, PsOutColor fclr)
{
int i;
char key[64];
@@ -1585,7 +1599,7 @@ PsOut_SetPattern(PsOutPtr self, void *tag, PsFillEnum type)
case PsOpStip: key[0] = 'o'; break; }
S_OutTok(self, key, 0);
S_OutTok(self, "spt", 1);
- self->CurColor = 0xFFFFFFFF;
+ self->CurColor = PSOUTCOLOR_NOCOLOR;
}
void
diff --git a/Xprint/ps/psout.h b/Xprint/ps/psout.h
index c592d7250..a9c7d4a51 100644
--- a/Xprint/ps/psout.h
+++ b/Xprint/ps/psout.h
@@ -153,6 +153,30 @@ typedef enum PsFTDownloadFontType_
PsFontType3
} PsFTDownloadFontType;
+#ifdef PSOUT_USE_DEEPCOLOR
+typedef long long PsOutColor;
+#define PSOUTCOLOR_TO_REDBITS(clr) ((clr) >> 32)
+#define PSOUTCOLOR_TO_GREENBITS(clr) (((clr) >> 16) & 0xFFFF)
+#define PSOUTCOLOR_TO_BLUEBITS(clr) ((clr) & 0xFFFF)
+#define PSOUTCOLOR_BITS_TO_PSFLOAT(b) ((float)(b) / 65535.)
+#define PSOUTCOLOR_WHITE (0xFFFFFFFFFFFFLL)
+#define PSOUTCOLOR_NOCOLOR (-1LL)
+#define PSOUTCOLOR_TO_RGB24BIT(clr) (((PSOUTCOLOR_TO_REDBITS(clr) >> 8) << 16) | \
+ ((PSOUTCOLOR_TO_GREENBITS(clr) >> 8) << 8) | \
+ ((PSOUTCOLOR_TO_BLUEBITS(clr) >> 8) << 0))
+#else
+typedef long PsOutColor;
+#define PSOUTCOLOR_TO_REDBITS(clr) ((clr) >> 16)
+#define PSOUTCOLOR_TO_GREENBITS(clr) (((clr) >> 8) & 0xFF)
+#define PSOUTCOLOR_TO_BLUEBITS(clr) ((clr) & 0xFF)
+#define PSOUTCOLOR_BITS_TO_PSFLOAT(b) ((float)(b) / 255.)
+#define PSOUTCOLOR_WHITE (0xFFFFFF)
+#define PSOUTCOLOR_NOCOLOR (-1)
+#define PSOUTCOLOR_TO_RGB24BIT(clr) ((PSOUTCOLOR_TO_REDBITS(clr) << 16) | \
+ (PSOUTCOLOR_TO_GREENBITS(clr) << 8) | \
+ (PSOUTCOLOR_TO_BLUEBITS(clr) << 0))
+#endif /* PSOUT_USE_DEEPCOLOR */
+
#ifdef USE_PSOUT_PRIVATE
typedef void *voidPtr;
@@ -168,14 +192,14 @@ typedef struct PsOutRec_
{
FILE *Fp;
char Buf[16384];
- int CurColor;
+ PsOutColor CurColor;
int LineWidth;
PsCapEnum LineCap;
PsJoinEnum LineJoin;
int NDashes;
int *Dashes;
int DashOffset;
- int LineBClr;
+ PsOutColor LineBClr;
PsRuleEnum FillRule;
char *FontName;
int FontSize;
@@ -193,8 +217,8 @@ typedef struct PsOutRec_
PsFillEnum InTile;
int ImgSkip;
- int ImgBClr;
- int ImgFClr;
+ PsOutColor ImgBClr;
+ PsOutColor ImgFClr;
int ImgX;
int ImgY;
int ImgW;
@@ -230,11 +254,11 @@ extern void PsOut_Offset(PsOutPtr self, int x, int y);
extern void PsOut_Clip(PsOutPtr self, int clpTyp, PsClipPtr clpinf);
-extern void PsOut_Color(PsOutPtr self, int clr);
+extern void PsOut_Color(PsOutPtr self, PsOutColor clr);
extern void PsOut_FillRule(PsOutPtr self, PsRuleEnum rule);
extern void PsOut_LineAttrs(PsOutPtr self, int wd, PsCapEnum cap,
PsJoinEnum join, int nDsh, int *dsh, int dshOff,
- int bclr);
+ PsOutColor bclr);
extern void PsOut_TextAttrs(PsOutPtr self, char *fnam, int siz, int iso);
extern void PsOut_TextAttrsMtx(PsOutPtr self, char *fnam, float *mtx, int iso);
@@ -250,12 +274,12 @@ extern void PsOut_DrawArc(PsOutPtr self, int x, int y, int w, int h,
float ang1, float ang2);
extern void PsOut_Text(PsOutPtr self, int x, int y, char *text, int textl,
- int bclr);
-extern void PsOut_Text16(PsOutPtr self, int x, int y, unsigned short *text, int textl, int bclr);
+ PsOutColor bclr);
+extern void PsOut_Text16(PsOutPtr self, int x, int y, unsigned short *text, int textl, PsOutColor bclr);
-extern void PsOut_BeginImage(PsOutPtr self, int bclr, int fclr, int x, int y,
+extern void PsOut_BeginImage(PsOutPtr self, PsOutColor bclr, PsOutColor fclr, int x, int y,
int w, int h, int sw, int sh, int format);
-extern void PsOut_BeginImageIM(PsOutPtr self, int bclr, int fclr, int x, int y,
+extern void PsOut_BeginImageIM(PsOutPtr self, PsOutColor bclr, PsOutColor fclr, int x, int y,
int w, int h, int sw, int sh, int format);
extern void PsOut_EndImage(PsOutPtr self);
extern void PsOut_OutImageBytes(PsOutPtr self, int nBytes, char *bytes);
@@ -265,7 +289,7 @@ extern void PsOut_BeginFrame(PsOutPtr self, int xoff, int yoff, int x, int y,
extern void PsOut_EndFrame(PsOutPtr self);
extern int PsOut_BeginPattern(PsOutPtr self, void *tag, int w, int h,
- PsFillEnum type, int bclr, int fclr);
+ PsFillEnum type, PsOutColor bclr, PsOutColor fclr);
extern void PsOut_EndPattern(PsOutPtr self);
extern void PsOut_SetPattern(PsOutPtr self, void *tag, PsFillEnum type);
diff --git a/dix/dispatch.c b/dix/dispatch.c
index d9d26538d..4c693718f 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/dix/dispatch.c,v 1.5.6.2 2004/12/11 01:50:40 deronj Exp $ */
+/* $XdotOrg: xc/programs/Xserver/dix/dispatch.c,v 1.5.6.3 2004/12/23 23:50:21 deronj Exp $ */
/* $Xorg: dispatch.c,v 1.5 2001/02/09 02:04:40 xorgcvs Exp $ */
/************************************************************
@@ -494,7 +494,7 @@ Dispatch(void)
register int nready;
register HWEventQueuePtr* icheck = checkForInput;
#ifdef SMART_SCHEDULE
- int start_tick;
+ long start_tick;
#endif
nextFreeClientID = 1;
diff --git a/dix/main.c b/dix/main.c
index 2a930d9dc..33c18bbe7 100644
--- a/dix/main.c
+++ b/dix/main.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/dix/main.c,v 1.2 2004/04/23 19:04:44 eich Exp $ */
+/* $XdotOrg: xc/programs/Xserver/dix/main.c,v 1.3.4.1 2004/12/08 06:02:34 gisburn Exp $ */
/* $XFree86: xc/programs/Xserver/dix/main.c,v 3.43 2003/10/30 21:21:02 herrb Exp $ */
/***********************************************************
@@ -689,7 +689,7 @@ AddScreen(
if (i == MAXSCREENS)
return -1;
- pScreen = (ScreenPtr) xalloc(sizeof(ScreenRec));
+ pScreen = (ScreenPtr) xcalloc(1, sizeof(ScreenRec));
if (!pScreen)
return -1;
diff --git a/fb/fb.h b/fb/fb.h
index 799338284..6c1fd44e6 100644
--- a/fb/fb.h
+++ b/fb/fb.h
@@ -22,7 +22,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $XdotOrg: xc/programs/Xserver/fb/fb.h,v 1.5 2004/07/30 20:30:51 ajax Exp $ */
+/* $XdotOrg: xc/programs/Xserver/fb/fb.h,v 1.6.2.1 2004/12/15 04:53:05 gisburn Exp $ */
#ifndef _FB_H_
#define _FB_H_
@@ -647,7 +647,7 @@ typedef struct {
((WindowPtr) (pWin))->devPrivates[fbGetWinPrivateIndex()].ptr)
#endif
-#if defined(__DARWIN__)||defined(__CYGWIN__)
+#ifdef ROOTLESS
#define __fbPixOriginX(pPix) ((pPix)->drawable.x)
#define __fbPixOriginY(pPix) ((pPix)->drawable.y)
#else
diff --git a/fb/fbwindow.c b/fb/fbwindow.c
index afc7e510a..85f9799d8 100644
--- a/fb/fbwindow.c
+++ b/fb/fbwindow.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/fb/fbwindow.c,v 1.3 2004/08/11 22:40:14 keithp Exp $ */
+/* $XdotOrg: xc/programs/Xserver/fb/fbwindow.c,v 1.4.2.1 2004/12/17 00:38:21 gisburn Exp $ */
/*
* Id: fbwindow.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
*
@@ -122,12 +122,9 @@ fbCopyWindow(WindowPtr pWin,
{
RegionRec rgnDst;
int dx, dy;
-#ifdef COMPOSITE
+
PixmapPtr pPixmap = fbGetWindowPixmap (pWin);
DrawablePtr pDrawable = &pPixmap->drawable;
-#else
- DrawablePtr pDrawable = &WindowTable[pWin->drawable.pScreen->myNum]->drawable;
-#endif
dx = ptOldOrg.x - pWin->drawable.x;
dy = ptOldOrg.y - pWin->drawable.y;
diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
index be37f53be..ad711ef68 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -731,19 +731,13 @@ configureDDCMonitorSection (int screennum)
for (i=0;i<4;i++) {
switch (ConfiguredMonitor->det_mon[i].type) {
- case DT:
- case DS_STD_TIMINGS:
- case DS_WHITE_P:
- break;
case DS_NAME:
ptr->mon_modelname = xf86confrealloc(ptr->mon_modelname,
strlen((char*)(ConfiguredMonitor->det_mon[i].section.name))
+ 1);
strcpy(ptr->mon_modelname,
(char*)(ConfiguredMonitor->det_mon[i].section.name));
- break;
- case DS_ASCII_STR:
- case DS_SERIAL:
+ break;
case DS_RANGES:
ptr->mon_hsync[ptr->mon_n_hsync].lo =
ConfiguredMonitor->det_mon[i].section.ranges.min_h;
diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index 204bd9360..d3ee26046 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -49,7 +49,7 @@
*/
/* $XConsortium: xf86Events.c /main/46 1996/10/25 11:36:30 kaleb $ */
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/common/xf86Events.c,v 1.2 2004/04/23 19:20:32 eich Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/common/xf86Events.c,v 1.3.2.1 2004/12/15 05:36:14 gisburn Exp $ */
/* [JCH-96/01/21] Extended std reverse map to four buttons. */
@@ -1334,6 +1334,10 @@ xf86VTSwitch()
ErrorF("xf86VTSwitch: Leaving, xf86Exiting is %s\n",
BOOLTOSTRING((dispatchException & DE_TERMINATE) ? TRUE : FALSE));
#endif
+#ifdef DPMSExtension
+ if (DPMSPowerLevel != DPMSModeOn)
+ DPMSSet(DPMSModeOn);
+#endif
for (i = 0; i < xf86NumScreens; i++) {
if (!(dispatchException & DE_TERMINATE))
if (xf86Screens[i]->EnableDisableFBAccess)
@@ -1353,13 +1357,9 @@ xf86VTSwitch()
}
#endif /* !__UNIXOS2__ */
xf86EnterServerState(SETUP);
- for (i = 0; i < xf86NumScreens; i++) {
-#ifdef DPMSExtension
- if (xf86Screens[i]->DPMSSet)
- xf86Screens[i]->DPMSSet(xf86Screens[i],DPMSModeOn,0);
-#endif
+ for (i = 0; i < xf86NumScreens; i++)
xf86Screens[i]->LeaveVT(i, 0);
- }
+
for (ih = InputHandlers; ih; ih = ih->next)
xf86DisableInputHandler(ih);
xf86AccessLeave(); /* We need this here, otherwise */
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index f507753fe..20249102a 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -96,6 +96,7 @@ extern int xtest_command_key;
#ifdef DPMSExtension
#define DPMS_SERVER
#include "extensions/dpms.h"
+#include "dpmsproc.h"
#endif
@@ -1244,7 +1245,7 @@ AbortDDX()
/*
* try to deinitialize all input devices
*/
- if (xf86Info.pKeyboard)
+ if (xf86Info.kbdProc && xf86Info.pKeyboard)
(xf86Info.kbdProc)(xf86Info.pKeyboard, DEVICE_CLOSE);
/*
@@ -1254,6 +1255,10 @@ AbortDDX()
/* Need the sleep when starting X from within another X session */
sleep(1);
#endif
+#ifdef DPMSExtension /* Turn screens back on */
+ if (DPMSPowerLevel != DPMSModeOn)
+ DPMSSet(DPMSModeOn);
+#endif
if (xf86Screens) {
if (xf86Screens[0]->vtSema)
xf86EnterServerState(SETUP);
@@ -1265,10 +1270,6 @@ AbortDDX()
* screen explicitely.
*/
xf86EnableAccess(xf86Screens[i]);
-#ifdef DPMSExtension
- if (xf86Screens[i]->DPMSSet)
- xf86Screens[i]->DPMSSet(xf86Screens[i],DPMSModeOn,0);
-#endif
(xf86Screens[i]->LeaveVT)(i, 0);
}
}
@@ -1763,8 +1764,22 @@ xf86PrintBanner()
#endif
#if XORG_VERSION_SNAP >= 900
- ErrorF(" (%d.%d.0 RC %d)", XORG_VERSION_MAJOR, XORG_VERSION_MINOR + 1,
- XORG_VERSION_SNAP - 900);
+ /* When the patch number is 99, that signifies that the we are making
+ * a release candidate for a major version; however, if the patch
+ * number is < 99, then we are making a release candidate for the next
+ * point release.
+ */
+ if (XORG_VERSION_PATCH == 99)
+ ErrorF(" (%d.%d.0 RC %d)",
+ XORG_VERSION_MAJOR,
+ XORG_VERSION_MINOR + 1,
+ XORG_VERSION_SNAP - 900);
+ else
+ ErrorF(" (%d.%d.%d RC %d)",
+ XORG_VERSION_MAJOR,
+ XORG_VERSION_MINOR,
+ XORG_VERSION_PATCH + 1,
+ XORG_VERSION_SNAP - 900);
#endif
#ifdef XORG_CUSTOM_VERSION
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 557e14fa2..bdf628316 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -976,10 +976,15 @@ xf86PostMotionEvent(DeviceIntPtr device,
/* modeled from xf86Events.c */
if (device->ptrfeed->ctrl.threshold) {
if ((abs(dx) + abs(dy)) >= device->ptrfeed->ctrl.threshold) {
- valuator[0] = (dx * device->ptrfeed->ctrl.num) /
- device->ptrfeed->ctrl.den;
- valuator[1] = (dy * device->ptrfeed->ctrl.num) /
- device->ptrfeed->ctrl.den;
+ local->dxremaind = ((float)dx * (float)(device->ptrfeed->ctrl.num)) /
+ (float)(device->ptrfeed->ctrl.den) + local->dxremaind;
+ valuator[0] = (int)local->dxremaind;
+ local->dxremaind = local->dxremaind - (float)valuator[0];
+
+ local->dyremaind = ((float)dy * (float)(device->ptrfeed->ctrl.num)) /
+ (float)(device->ptrfeed->ctrl.den) + local->dyremaind;
+ valuator[1] = (int)local->dyremaind;
+ local->dyremaind = local->dyremaind - (float)valuator[1];
}
}
else if (dx || dy) {
diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
index c5a022bf9..ec55f6360 100644
--- a/hw/xfree86/common/xf86pciBus.c
+++ b/hw/xfree86/common/xf86pciBus.c
@@ -104,9 +104,6 @@ static PciBusPtr xf86PciBus = NULL;
#define PCI_MEM32_LENGTH_MAX 0xFFFFFFFF
-#undef MIN
-#define MIN(x,y) ((x<y)?x:y)
-
#define B2M(tag,base) pciBusAddrToHostAddr(tag,PCI_MEM,base)
#define B2I(tag,base) (base)
#define B2H(tag,base,type) (((type & ResPhysMask) == ResMem) ? \
@@ -1649,7 +1646,7 @@ getValidBIOSBase(PCITAG tag, int num)
m = xf86JoinResLists(m,tmp);
tmp = m;
while (tmp) {
- tmp->block_end = MIN(tmp->block_end,PCI_MEM32_LENGTH_MAX);
+ tmp->block_end = min(tmp->block_end,PCI_MEM32_LENGTH_MAX);
tmp = tmp->next;
}
} else if ((pbp->primary == pvp->bus) &&
diff --git a/hw/xfree86/ddc/edid.h b/hw/xfree86/ddc/edid.h
index ccf9d9280..e40492c4c 100644
--- a/hw/xfree86/ddc/edid.h
+++ b/hw/xfree86/ddc/edid.h
@@ -11,7 +11,7 @@
*/
#ifndef _EDID_H_
-#define _EDID_H_ 1
+#define _EDID_H_
#include "vdif.h"
@@ -126,7 +126,9 @@
#define SETUP _SETUP(GET(D_INPUT))
#define _SYNC(x) (x & 0x0F)
#define SYNC _SYNC(GET(D_INPUT))
-#define _GAMMA(x) ((x + 100.0)/100.0)
+#define _DFP(x) (x & 0x01)
+#define DFP _DFP(GET(D_INPUT))
+#define _GAMMA(x) (x == 0xff ? 1.0 : ((x + 100.0)/100.0))
#define GAMMA _GAMMA(GET(D_GAMMA))
#define HSIZE_MAX GET(D_HSIZE)
#define VSIZE_MAX GET(D_VSIZE)
@@ -158,20 +160,27 @@
#define T_MANU GET(E_TMANU)
/* extract information from estabished timing section */
+#define _VALID_TIMING(x) ((x[0] != 0x01 && x[1] != 0x01) \
+ && (x[0] != 0x00 && x[1] != 0x00) \
+ && (x[0] != 0x20 && x[1] != 0x20) )
+#define VALID_TIMING _VALID_TIMING(c)
#define _HSIZE1(x) ((x[0] + 31) * 8)
#define HSIZE1 _HSIZE1(c)
#define RATIO(x) ((x[1] & 0xC0) >> 6)
#define RATIO1_1 0
+/* EDID Ver. 1.3 redefined this */
+#define RATIO16_10 RATIO1_1
#define RATIO4_3 1
#define RATIO5_4 2
#define RATIO16_9 3
-#define _VSIZE1(x,y) switch(RATIO(x)){ \
- case RATIO1_1: y = _HSIZE1(x); break; \
+#define _VSIZE1(x,y,r) switch(RATIO(x)){ \
+ case RATIO1_1: y = _HSIZE1(x) * ((v->version>1||v->revision>2) ? 10/16 : 1); \
+ break; \
case RATIO4_3: y = _HSIZE1(x) * 3 / 4; break; \
case RATIO5_4: y = _HSIZE1(x) * 4 / 5; break; \
case RATIO16_9: y = _HSIZE1(x) * 9 / 16; break; \
}
-#define VSIZE1(x) _VSIZE1(c,x)
+#define VSIZE1(x) _VSIZE1(c,x,v)
#define _REFRESH_R(x) (x[1] & 0x3F) + 60
#define REFRESH_R _REFRESH_R(c)
#define _ID_LOW(x) x[0]
@@ -183,7 +192,7 @@
#define NEXT_STD_TIMING _NEXT_STD_TIMING(c)
-/* EDID Ver. > 1.2 */
+/* EDID Ver. >= 1.2 */
#define _IS_MONITOR_DESC(x) (x[0] == 0 && x[1] == 0 && x[2] == 0 && x[4] == 0)
#define IS_MONITOR_DESC _IS_MONITOR_DESC(c)
#define _PIXEL_CLOCK(x) (x[0] + (x[1] << 8)) * 10000
@@ -214,8 +223,10 @@
#define V_BORDER _V_BORDER(c)
#define _INTERLACED(x) ((x[17] & 0x80) >> 7)
#define INTERLACED _INTERLACED(c)
-#define _STEREO(x) ((x[17] & 0x60) >> 6)
+#define _STEREO(x) ((x[17] & 0x60) >> 5)
#define STEREO _STEREO(c)
+#define _STEREO1(x) (x[17] & 0x1)
+#define STEREO1 _STEREO(c)
#define _SYNC_T(x) ((x[17] & 0x18) >> 4)
#define SYNC_T _SYNC_T(c)
#define _MISC(x) ((x[17] & 0x06) >> 2)
@@ -236,6 +247,18 @@
#define MAX_H _MAX_H(c)
#define _MAX_CLOCK(x) x[9]
#define MAX_CLOCK _MAX_CLOCK(c)
+#define _HAVE_2ND_GTF(x) (x[10] == 0x02)
+#define HAVE_2ND_GTF _HAVE_2ND_GTF(c)
+#define _F_2ND_GTF(x) (x[12] * 2)
+#define F_2ND_GTF _F_2ND_GTF(c)
+#define _C_2ND_GTF(x) (x[13] / 2)
+#define C_2ND_GTF _C_2ND_GTF(c)
+#define _M_2ND_GTF(x) (x[14] + (x[15] << 8))
+#define M_2ND_GTF _M_2ND_GTF(c)
+#define _K_2ND_GTF(x) (x[16])
+#define K_2ND_GTF _K_2ND_GTF(c)
+#define _J_2ND_GTF(x) (x[17] / 2)
+#define J_2ND_GTF _J_2ND_GTF(c)
#define MONITOR_NAME 0xFC
#define ADD_COLOR_POINT 0xFB
#define WHITEX F_CC(I_CC((GET(D_BW_LOW)),(GET(D_WHITEX)),2))
@@ -255,6 +278,7 @@
#define _WHITE_GAMMA2(x) _GAMMA(x[14])
#define WHITE_GAMMA2 _WHITE_GAMMA2(c)
#define ADD_STD_TIMINGS 0xFA
+#define ADD_DUMMY 0x10
#define _NEXT_DT_MD_SECTION(x) (x = (x + DET_TIMING_INFO_LEN))
#define NEXT_DT_MD_SECTION _NEXT_DT_MD_SECTION(c)
@@ -264,6 +288,9 @@
/* input type */
#define DIGITAL(x) x
+/* DFP */
+#define DFP1(x) x
+
/* input voltage level */
#define V070 0 /* 0.700V/0.300V */
#define V071 1 /* 0.714V/0.286V */
@@ -297,8 +324,12 @@
/* detailed timing misc */
#define IS_INTERLACED(x) (x)
#define IS_STEREO(x) (x)
-#define IS_RIGHT_ON_SYNC(x) (x & 0x01)
-#define IS_LEFT_ON_SYNC(x) (x & 0x02)
+#define IS_RIGHT_STEREO(x) (x & 0x01)
+#define IS_LEFT_STEREO(x) (x & 0x02)
+#define IS_4WAY_STEREO(x) (x & 0x03)
+#define IS_RIGHT_ON_SYNC(x) IS_RIGHT_STEREO(x)
+#define IS_LEFT_ON_SYNC(x) IS_LEFT_STEREO(x)
+
typedef unsigned int Uint;
typedef unsigned char Uchar;
@@ -321,6 +352,7 @@ struct disp_features {
unsigned int input_voltage:2;
unsigned int input_setup:1;
unsigned int input_sync:5;
+ unsigned int input_dfp:1;
int hsize;
int vsize;
float gamma;
@@ -368,6 +400,7 @@ struct detailed_timings {
unsigned int stereo:2;
unsigned int sync:2;
unsigned int misc:2;
+ unsigned int stereo_1:1;
};
#define DT 0
@@ -377,6 +410,7 @@ struct detailed_timings {
#define DS_RANGES 0xFD
#define DS_WHITE_P 0xFB
#define DS_STD_TIMINGS 0xFA
+#define DS_DUMMY 0x10
struct monitor_ranges {
int min_v;
@@ -384,6 +418,11 @@ struct monitor_ranges {
int min_h;
int max_h;
int max_clock;
+ int gtf_2nd_f;
+ int gtf_2nd_c;
+ int gtf_2nd_m;
+ int gtf_2nd_k;
+ int gtf_2nd_j;
};
struct whitePoints{
diff --git a/hw/xfree86/ddc/interpret_edid.c b/hw/xfree86/ddc/interpret_edid.c
index d5a791570..36bb10cda 100644
--- a/hw/xfree86/ddc/interpret_edid.c
+++ b/hw/xfree86/ddc/interpret_edid.c
@@ -13,16 +13,21 @@
static void get_vendor_section(Uchar*, struct vendor *);
static void get_version_section(Uchar*, struct edid_version *);
-static void get_display_section(Uchar*, struct disp_features *);
+static void get_display_section(Uchar*, struct disp_features *,
+ struct edid_version *);
static void get_established_timing_section(Uchar*, struct established_timings *);
-static void get_std_timing_section(Uchar*, struct std_timings *);
+static void get_std_timing_section(Uchar*, struct std_timings *,
+ struct edid_version *);
static void get_dt_md_section(Uchar *, struct edid_version *,
struct detailed_monitor_section *det_mon);
static void copy_string(Uchar *, Uchar *);
-static void get_dst_timing_section(Uchar *, struct std_timings *);
+static void get_dst_timing_section(Uchar *, struct std_timings *,
+ struct edid_version *);
static void get_monitor_ranges(Uchar *, struct monitor_ranges *);
static void get_whitepoint_section(Uchar *, struct whitePoints *);
static void get_detailed_timing_section(Uchar*, struct detailed_timings *);
+static Bool validate_version(int scrnIndex, struct edid_version *);
+
xf86MonPtr
xf86InterpretEDID(int scrnIndex, Uchar *block)
@@ -33,15 +38,24 @@ xf86InterpretEDID(int scrnIndex, Uchar *block)
if (! (m = xnfcalloc(sizeof(xf86Monitor),1))) return NULL;
m->scrnIndex = scrnIndex;
m->rawData = block;
+
get_vendor_section(SECTION(VENDOR_SECTION,block),&m->vendor);
get_version_section(SECTION(VERSION_SECTION,block),&m->ver);
- get_display_section(SECTION(DISPLAY_SECTION,block),&m->features);
+ if (!validate_version(scrnIndex, &m->ver)) goto error;
+ get_display_section(SECTION(DISPLAY_SECTION,block),&m->features,
+ &m->ver);
get_established_timing_section(SECTION(ESTABLISHED_TIMING_SECTION,block),
&m->timings1);
- get_std_timing_section(SECTION(STD_TIMING_SECTION,block),m->timings2);
+ get_std_timing_section(SECTION(STD_TIMING_SECTION,block),m->timings2,
+ &m->ver);
get_dt_md_section(SECTION(DET_TIMING_SECTION,block),&m->ver, m->det_mon);
m->no_sections = (int)*(char *)SECTION(NO_EDID,block);
+
return (m);
+
+ error:
+ xfree(m);
+ return NULL;
}
static void
@@ -66,12 +80,16 @@ get_version_section(Uchar *c, struct edid_version *r)
}
static void
-get_display_section(Uchar *c, struct disp_features *r)
+get_display_section(Uchar *c, struct disp_features *r,
+ struct edid_version *v)
{
r->input_type = INPUT_TYPE;
- r->input_voltage = INPUT_VOLTAGE;
- r->input_setup = SETUP;
- r->input_sync = SYNC;
+ if (!DIGITAL(r->input_type)) {
+ r->input_voltage = INPUT_VOLTAGE;
+ r->input_setup = SETUP;
+ r->input_sync = SYNC;
+ } else if (v->version > 1 || v->revision > 2)
+ r->input_dfp = DFP;
r->hsize = HSIZE_MAX;
r->vsize = VSIZE_MAX;
r->gamma = GAMMA;
@@ -97,15 +115,20 @@ get_established_timing_section(Uchar *c, struct established_timings *r)
}
static void
-get_std_timing_section(Uchar *c, struct std_timings *r)
+get_std_timing_section(Uchar *c, struct std_timings *r,
+ struct edid_version *v)
{
int i;
for (i=0;i<STD_TIMINGS;i++){
- r[i].hsize = HSIZE1;
- VSIZE1(r[i].vsize);
- r[i].refresh = REFRESH_R;
- r[i].id = STD_TIMING_ID;
+ if (VALID_TIMING) {
+ r[i].hsize = HSIZE1;
+ VSIZE1(r[i].vsize);
+ r[i].refresh = REFRESH_R;
+ r[i].id = STD_TIMING_ID;
+ } else {
+ r[i].hsize = r[i].vsize = r[i].refresh = r[i].id = 0;
+ }
NEXT_STD_TIMING;
}
}
@@ -142,8 +165,11 @@ get_dt_md_section(Uchar *c, struct edid_version *ver,
break;
case ADD_STD_TIMINGS:
det_mon[i].type = DS_STD_TIMINGS;
- get_dst_timing_section(c,det_mon[i].section.std_t);
+ get_dst_timing_section(c,det_mon[i].section.std_t, ver);
break;
+ case ADD_DUMMY:
+ det_mon[i].type = DS_DUMMY;
+ break;
}
} else {
det_mon[i].type = DT;
@@ -165,7 +191,8 @@ copy_string(Uchar *c, Uchar *s)
}
static void
-get_dst_timing_section(Uchar *c, struct std_timings *t)
+get_dst_timing_section(Uchar *c, struct std_timings *t,
+ struct edid_version *v)
{
int j;
c = c + 5;
@@ -188,6 +215,14 @@ get_monitor_ranges(Uchar *c, struct monitor_ranges *r)
r->max_clock = 0;
if(MAX_CLOCK != 0xff) /* is specified? */
r->max_clock = MAX_CLOCK * 10;
+ if (HAVE_2ND_GTF) {
+ r->gtf_2nd_f = F_2ND_GTF;
+ r->gtf_2nd_c = C_2ND_GTF;
+ r->gtf_2nd_m = M_2ND_GTF;
+ r->gtf_2nd_k = K_2ND_GTF;
+ r->gtf_2nd_j = J_2ND_GTF;
+ } else
+ r->gtf_2nd_f = 0;
}
static void
@@ -221,8 +256,21 @@ get_detailed_timing_section(Uchar *c, struct detailed_timings *r)
r->v_border = V_BORDER;
r->interlaced = INTERLACED;
r->stereo = STEREO;
+ r->stereo_1 = STEREO1;
r->sync = SYNC_T;
r->misc = MISC;
}
+static Bool
+validate_version(int scrnIndex, struct edid_version *r)
+{
+ if (r->version != 1)
+ return FALSE;
+ if (r->revision > 3) {
+ xf86DrvMsg(scrnIndex, X_ERROR,"EDID Version 1.%i not yet supported\n",
+ r->revision);
+ return FALSE;
+ }
+ return TRUE;
+}
diff --git a/hw/xfree86/ddc/print_edid.c b/hw/xfree86/ddc/print_edid.c
index 29f418398..8af7702d8 100644
--- a/hw/xfree86/ddc/print_edid.c
+++ b/hw/xfree86/ddc/print_edid.c
@@ -12,7 +12,8 @@
static void print_vendor(int scrnIndex, struct vendor *);
static void print_version(int scrnIndex, struct edid_version *);
-static void print_display(int scrnIndex, struct disp_features *);
+static void print_display(int scrnIndex, struct disp_features *,
+ struct edid_version *);
static void print_established_timings(int scrnIndex,
struct established_timings *);
static void print_std_timings(int scrnIndex, struct std_timings *);
@@ -21,19 +22,23 @@ static void print_detailed_monitor_section(int scrnIndex,
static void print_detailed_timings(int scrnIndex, struct detailed_timings *);
static void print_input_features(int scrnIndex, struct disp_features *);
-static void print_dpms_features(int scrnIndex, struct disp_features *);
+static void print_dpms_features(int scrnIndex, struct disp_features *,
+ struct edid_version *v);
static void print_whitepoint(int scrnIndex, struct disp_features *);
-
+static void print_number_sections(int scrnIndex, int);
+
xf86MonPtr
xf86PrintEDID(xf86MonPtr m)
{
if (!(m)) return NULL;
print_vendor(m->scrnIndex,&m->vendor);
print_version(m->scrnIndex,&m->ver);
- print_display(m->scrnIndex,&m->features);
+ print_display(m->scrnIndex,&m->features, &m->ver);
print_established_timings(m->scrnIndex,&m->timings1);
print_std_timings(m->scrnIndex,m->timings2);
print_detailed_monitor_section(m->scrnIndex,m->det_mon);
+ print_number_sections(m->scrnIndex,m->no_sections);
+
return m;
}
@@ -53,7 +58,8 @@ print_version(int scrnIndex, struct edid_version *c)
}
static void
-print_display(int scrnIndex, struct disp_features *disp)
+print_display(int scrnIndex, struct disp_features *disp,
+ struct edid_version *version)
{
print_input_features(scrnIndex,disp);
xf86DrvMsg(scrnIndex,X_INFO,"Max H-Image Size [cm]: ");
@@ -66,16 +72,18 @@ print_display(int scrnIndex, struct disp_features *disp)
else
xf86ErrorF("V-Size may change\n");
xf86DrvMsg(scrnIndex,X_INFO,"Gamma: %.2f\n", disp->gamma);
- print_dpms_features(scrnIndex,disp);
+ print_dpms_features(scrnIndex,disp,version);
print_whitepoint(scrnIndex,disp);
}
static void
print_input_features(int scrnIndex, struct disp_features *c)
{
- if (DIGITAL(c->input_type))
+ if (DIGITAL(c->input_type)) {
xf86DrvMsg(scrnIndex,X_INFO,"Digital Display Input\n");
- else {
+ if (DFP1(c->input_dfp))
+ xf86DrvMsg(scrnIndex,X_INFO,"DFP 1.x compatible TMDS\n");
+ } else {
xf86DrvMsg(scrnIndex,X_INFO,"Analog Display Input, ");
xf86ErrorF("Input Voltage Level: ");
switch (c->input_voltage){
@@ -111,7 +119,8 @@ print_input_features(int scrnIndex, struct disp_features *c)
}
static void
-print_dpms_features(int scrnIndex, struct disp_features *c)
+print_dpms_features(int scrnIndex, struct disp_features *c,
+ struct edid_version *v)
{
if (c->dpms) {
xf86DrvMsg(scrnIndex,X_INFO,"DPMS capabilities:");
@@ -140,6 +149,10 @@ print_dpms_features(int scrnIndex, struct disp_features *c)
if (PREFERRED_TIMING_MODE(c->msc))
xf86DrvMsg(scrnIndex,X_INFO,
"First detailed timing is preferred mode\n");
+ else if (v->version == 1 && v->revision >= 3)
+ xf86DrvMsg(scrnIndex,X_INFO,
+ "First detailed timing not preferred "
+ "mode in violation of standard!");
if (GFT_SUPPORTED(c->msc))
xf86DrvMsg(scrnIndex,X_INFO,
"GTF timings supported\n");
@@ -234,7 +247,15 @@ print_detailed_monitor_section(int scrnIndex,
if (m[i].section.ranges.max_clock != 0)
xf86ErrorF(" PixClock max %i MHz\n",m[i].section.ranges.max_clock);
else
- xf86DrvMsg(scrnIndex,X_INFO,"\n");
+ xf86ErrorF("\n");
+ if (m[i].section.ranges.gtf_2nd_f > 0)
+ xf86DrvMsg(scrnIndex,X_INFO," 2nd GTF parameters: f: %i kHz "
+ "c: %i m: %i k %i j %i\n",
+ m[i].section.ranges.gtf_2nd_f,
+ m[i].section.ranges.gtf_2nd_c,
+ m[i].section.ranges.gtf_2nd_m,
+ m[i].section.ranges.gtf_2nd_k,
+ m[i].section.ranges.gtf_2nd_j);
break;
case DS_STD_TIMINGS:
for (j = 0; j<5; j++)
@@ -252,6 +273,9 @@ print_detailed_monitor_section(int scrnIndex,
m[i].section.wp[j].white_y,
m[i].section.wp[j].white_gamma);
break;
+ case DS_DUMMY:
+ default:
+ break;
}
}
}
@@ -278,9 +302,32 @@ print_detailed_timings(int scrnIndex, struct detailed_timings *t)
xf86ErrorF("v_border: %i\n",t->v_border);
if (IS_STEREO(t->stereo)) {
xf86DrvMsg(scrnIndex,X_INFO,"Stereo: ");
- if (IS_RIGHT_ON_SYNC(t->stereo))
- xf86ErrorF("right channel on sync\n");
- else xf86ErrorF("right channel on sync\n");
+ if (IS_RIGHT_STEREO(t->stereo)) {
+ if (!t->stereo_1)
+ xf86ErrorF("right channel on sync\n");
+ else
+ xf86ErrorF("left channel on sync\n");
+ } else if (IS_LEFT_STEREO(t->stereo)) {
+ if (!t->stereo_1)
+ xf86ErrorF("right channel on even line\n");
+ else
+ xf86ErrorF("left channel on evel line\n");
+ }
+ if (IS_4WAY_STEREO(t->stereo)) {
+ if (!t->stereo_1)
+ xf86ErrorF("4-way interleaved\n");
+ else
+ xf86ErrorF("side-by-side interleaved");
+ }
}
}
}
+
+static void
+print_number_sections(int scrnIndex, int num)
+{
+ if (num)
+ xf86DrvMsg(scrnIndex,X_INFO,"Number of EDID sections to follow: %i\n",
+ num);
+}
+
diff --git a/hw/xfree86/dixmods/extmod/xf86vmode.c b/hw/xfree86/dixmods/extmod/xf86vmode.c
index 737eb4b42..917b86605 100644
--- a/hw/xfree86/dixmods/extmod/xf86vmode.c
+++ b/hw/xfree86/dixmods/extmod/xf86vmode.c
@@ -29,7 +29,7 @@ or other dealings in this Software without prior written authorization
from Kaleb S. KEITHLEY
*/
-/* $XdotOrg: xf86vmode.c,v 1.3 2000/08/17 19:47:59 cpqbld Exp $ */
+/* $XdotOrg: xc/programs/Xserver/Xext/xf86vmode.c,v 1.2.4.1 2004/12/15 05:01:25 gisburn Exp $ */
/* $Xorg: xf86vmode.c,v 1.3 2000/08/17 19:47:59 cpqbld Exp $ */
/* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */
@@ -52,6 +52,8 @@ from Kaleb S. KEITHLEY
#include "xf86_ansic.h"
#endif
+#define DEFAULT_XF86VIDMODE_VERBOSITY 3
+
static int VidModeErrorBase;
static int VidModeGeneration = 0;
static int VidModeClientPrivateIndex;
@@ -468,7 +470,7 @@ ProcXF86VidModeGetModeLine(ClientPtr client)
rep.vtotal = VidModeGetModeValue(mode, VIDMODE_V_TOTAL);
rep.flags = VidModeGetModeValue(mode, VIDMODE_FLAGS);
- if (xf86GetVerbosity() > 1) {
+ if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
ErrorF("GetModeLine - scrn: %d clock: %ld\n",
stuff->screen, (unsigned long)rep.dotclock);
ErrorF("GetModeLine - hdsp: %d hbeg: %d hend: %d httl: %d\n",
@@ -676,7 +678,7 @@ ProcXF86VidModeAddModeLine(ClientPtr client)
stuff->after_vtotal = oldstuff->after_vtotal;
stuff->after_flags = oldstuff->after_flags;
}
- if (xf86GetVerbosity() > 1) {
+ if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
ErrorF("AddModeLine - scrn: %d clock: %ld\n",
(int)stuff->screen, (unsigned long)stuff->dotclock);
ErrorF("AddModeLine - hdsp: %d hbeg: %d hend: %d httl: %d\n",
@@ -787,7 +789,7 @@ ProcXF86VidModeAddModeLine(ClientPtr client)
VidModeAddModeline(stuff->screen, mode);
- if (xf86GetVerbosity() > 1)
+ if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY)
ErrorF("AddModeLine - Succeeded\n");
return client->noClientException;
}
@@ -824,7 +826,7 @@ ProcXF86VidModeDeleteModeLine(ClientPtr client)
stuff->flags = oldstuff->flags;
stuff->privsize = oldstuff->privsize;
}
- if (xf86GetVerbosity() > 1) {
+ if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
ErrorF("DeleteModeLine - scrn: %d clock: %ld\n",
(int)stuff->screen, (unsigned long)stuff->dotclock);
ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
@@ -843,7 +845,7 @@ ProcXF86VidModeDeleteModeLine(ClientPtr client)
len = client->req_len - (sizeof(xXF86VidModeDeleteModeLineReq) >> 2);
}
if (len != stuff->privsize) {
- if (xf86GetVerbosity() > 1) {
+ if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
ErrorF("req_len = %ld, sizeof(Req) = %d, privsize = %ld, "
"len = %d, length = %d\n",
(unsigned long)client->req_len,
@@ -859,7 +861,7 @@ ProcXF86VidModeDeleteModeLine(ClientPtr client)
if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock))
return BadValue;
- if (xf86GetVerbosity() > 1) {
+ if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
ErrorF("Checking against clock: %d (%d)\n",
VidModeGetModeValue(mode, VIDMODE_CLOCK), dotClock);
ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
@@ -882,7 +884,7 @@ ProcXF86VidModeDeleteModeLine(ClientPtr client)
return BadValue;
do {
- if (xf86GetVerbosity() > 1) {
+ if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
ErrorF("Checking against clock: %d (%d)\n",
VidModeGetModeValue(mode, VIDMODE_CLOCK), dotClock);
ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
@@ -900,7 +902,7 @@ ProcXF86VidModeDeleteModeLine(ClientPtr client)
if ((VidModeGetDotClock(stuff->screen, stuff->dotclock) == dotClock) &&
MODEMATCH(mode, stuff)) {
VidModeDeleteModeline(stuff->screen, mode);
- if (xf86GetVerbosity())
+ if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY)
ErrorF("DeleteModeLine - Succeeded\n");
return(client->noClientException);
}
@@ -940,7 +942,7 @@ ProcXF86VidModeModModeLine(ClientPtr client)
stuff->flags = oldstuff->flags;
stuff->privsize = oldstuff->privsize;
}
- if (xf86GetVerbosity() > 1) {
+ if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
ErrorF("ModModeLine - scrn: %d hdsp: %d hbeg: %d hend: %d httl: %d\n",
(int)stuff->screen, stuff->hdisplay, stuff->hsyncstart,
stuff->hsyncend, stuff->htotal);
@@ -1028,7 +1030,7 @@ ProcXF86VidModeModModeLine(ClientPtr client)
VidModeSetCrtcForMode(stuff->screen, mode);
VidModeSwitchMode(stuff->screen, mode);
- if (xf86GetVerbosity() > 1)
+ if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY)
ErrorF("ModModeLine - Succeeded\n");
return(client->noClientException);
}
@@ -1066,7 +1068,7 @@ ProcXF86VidModeValidateModeLine(ClientPtr client)
stuff->flags = oldstuff->flags;
stuff->privsize = oldstuff->privsize;
}
- if (xf86GetVerbosity() > 1) {
+ if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
ErrorF("ValidateModeLine - scrn: %d clock: %ld\n",
(int)stuff->screen, (unsigned long)stuff->dotclock);
ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
@@ -1146,7 +1148,7 @@ status_reply:
swapl(&rep.status, n);
}
WriteToClient(client, sizeof(xXF86VidModeValidateModeLineReply), (char *)&rep);
- if (xf86GetVerbosity() > 1)
+ if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY)
ErrorF("ValidateModeLine - Succeeded (status = %d)\n", status);
return(client->noClientException);
}
@@ -1200,7 +1202,7 @@ ProcXF86VidModeSwitchToMode(ClientPtr client)
stuff->flags = oldstuff->flags;
stuff->privsize = oldstuff->privsize;
}
- if (xf86GetVerbosity() > 1) {
+ if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
ErrorF("SwitchToMode - scrn: %d clock: %ld\n",
(int)stuff->screen, (unsigned long)stuff->dotclock);
ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
@@ -1235,7 +1237,7 @@ ProcXF86VidModeSwitchToMode(ClientPtr client)
return BadValue;
do {
- if (xf86GetVerbosity() > 1) {
+ if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
ErrorF("Checking against clock: %d (%d)\n",
VidModeGetModeValue(mode, VIDMODE_CLOCK), dotClock);
ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
@@ -1256,7 +1258,7 @@ ProcXF86VidModeSwitchToMode(ClientPtr client)
if (!VidModeSwitchMode(stuff->screen, mode))
return BadValue;
- if (xf86GetVerbosity() > 1)
+ if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY)
ErrorF("SwitchToMode - Succeeded\n");
return(client->noClientException);
}
diff --git a/hw/xfree86/doc/README.fonts b/hw/xfree86/doc/README.fonts
index 33c082b90..55410ccae 100644
--- a/hw/xfree86/doc/README.fonts
+++ b/hw/xfree86/doc/README.fonts
@@ -1,4 +1,4 @@
- Fonts in X11R6.8
+ Fonts in X11R6.8.1
Juliusz Chroboczek, <jch@pps.jussieu.fr>
@@ -6,9 +6,9 @@
1. Introduction
-This document describes the support for fonts in X11R6.8. Installing fonts
+This document describes the support for fonts in X11R6.8.1. Installing fonts
(section 2., page 1) is aimed at the casual user wishing to install fonts in
-X11R6.8 the rest of the document describes the font support in more detail.
+X11R6.8.1 the rest of the document describes the font support in more detail.
We assume some familiarity with digital fonts. If anything is not clear to
you, please consult Appendix: Background (section 5., page 1) at the end of
@@ -18,8 +18,8 @@ this document for background information.
X includes two font systems: the original core X11 fonts system, which is
present in all implementations of X11, and the Xft fonts system, which may
-not be distributed with implementations of X11 that are not based on X11R6.8
-but will hopefully be included by them in the future
+not be distributed with implementations of X11 that are not based on
+X11R6.8.1 but will hopefully be included by them in the future
The core X11 fonts system is directly derived from the fonts system included
with X11R1 in 1987, which could only use monochrome bitmap fonts. Over the
@@ -48,16 +48,17 @@ access newly-installed fonts.
Xft has no configuration mechanism itself, rather it relies upon the fontcon-
fig library to configure and customize fonts. That library is not specific
-to X11R6.8 or indeed on any particular font output mechanism. This discus-
+to X11R6.8.1 or indeed on any particular font output mechanism. This discus-
sion describes how fontconfig, rather than Xft, works.
2.1.1 Installing fonts in Xft
Fontconfig looks for fonts in a set of well-known directories that include
-all of X11R6.8's standard font directories (`/usr/X11R6/lib/X11/lib/fonts/*')
-by default) as well as a directory called `.fonts/' in the user's home direc-
-tory. Installing a font for use by Xft applications is as simple as copying
-a font file into one of these directories.
+all of X11R6.8.1's standard font directories
+(`/usr/X11R6/lib/X11/lib/fonts/*') by default) as well as a directory called
+`.fonts/' in the user's home directory. Installing a font for use by Xft
+applications is as simple as copying a font file into one of these directo-
+ries.
$ cp lucbr.ttf ~/.fonts/
@@ -114,7 +115,7 @@ Anti-aliasing can be disabled for all fonts by the following incantation:
</edit>
</match>
-Xft supports sub-pixel rasterisation on LCD displays. X11R6.8 should auto-
+Xft supports sub-pixel rasterisation on LCD displays. X11R6.8.1 should auto-
matically enable this feature on laptops and when using an LCD monitor con-
nected with a DVI cable; you can check whether this was done by typing
@@ -185,9 +186,9 @@ of this new directory by including it in the font path.
2.2.1 Installing bitmap fonts
-The X11R6.8 server can use bitmap fonts in both the cross-platform BDF format
-and the somewhat more efficient binary PCF format. (X11R6.8 also supports
-the obsolete SNF format.)
+The X11R6.8.1 server can use bitmap fonts in both the cross-platform BDF for-
+mat and the somewhat more efficient binary PCF format. (X11R6.8.1 also sup-
+ports the obsolete SNF format.)
Bitmap fonts are normally distributed in the BDF format. Before installing
such fonts, it is desirable (but not absolutely necessary) to convert the
@@ -215,7 +216,7 @@ directory; see Setting the server font path (section 2.2.4, page 1) below.
2.2.2 Installing scalable fonts
-The X11R6.8 server supports scalable fonts in four formats: Type 1, Speedo,
+The X11R6.8.1 server supports scalable fonts in four formats: Type 1, Speedo,
TrueType and CIDFont. This section only applies to the former three; for
information on CIDFonts, please see Installing CIDFonts (section 2.2.3, page
1) later in this document.
@@ -251,7 +252,7 @@ CMap `UniKS-UCS2-H' is called
Munhwa-Regular--UniKS-UCS2-H
-The CIDFont code in X11R6.8 requires a very rigid directory structure. The
+The CIDFont code in X11R6.8.1 requires a very rigid directory structure. The
main directory must be called `CID' (its location defaults to
`/usr/X11R6/lib/X11/fonts/CID' but it may be located anywhere), and it should
contain a subdirectory for every CID collection. Every subdirectory must
@@ -310,7 +311,7 @@ For best results, scalable fonts should appear in the font path before the
bitmap fonts; this way, the server will prefer bitmap fonts to scalable fonts
when an exact match is possible, but will avoid scaling bitmap fonts when a
scalable font can be used. (The `:unscaled' hack, while still supported,
-should no longer be necessary in X11R6.8.)
+should no longer be necessary in X11R6.8.1.)
You may check the font path of the running server by typing the command
@@ -353,11 +354,11 @@ mounted font directories). If this doesn't help, it is quite possible that
you are trying to use a font in a format that is not supported by your
server.
-X11R6.8 supports the BDF, PCF, SNF, Type 1, Speedo, TrueType, OpenType and
-CIDFont font formats. However, not all X11R6.8 servers come with all the
+X11R6.8.1 supports the BDF, PCF, SNF, Type 1, Speedo, TrueType, OpenType and
+CIDFont font formats. However, not all X11R6.8.1 servers come with all the
font backends configured in.
-On most platforms, the X11R6.8 servers are modular: the font backends are
+On most platforms, the X11R6.8.1 servers are modular: the font backends are
included in modules that are loaded at runtime. The modules to be loaded are
specified in the `xorg.conf' file using the `Load' directive:
@@ -365,7 +366,7 @@ specified in the `xorg.conf' file using the `Load' directive:
If you have trouble installing fonts in a specific format, you may want to
check the server's log file in order to see whether the relevant modules are
-properly loaded. The list of font modules distributed with X11R6.8 is as
+properly loaded. The list of font modules distributed with X11R6.8.1 is as
follows:
o "bitmap": bitmap fonts (`*.bdf', `*.pcf' and `*.snf');
@@ -382,7 +383,7 @@ follows:
Please note that the argument of the `Load' directive is case-sensitive.
-3. Fonts included with X11R6.8
+3. Fonts included with X11R6.8.1
3.1 Standard bitmap fonts
@@ -391,7 +392,7 @@ fonts, including the `fixed' family, and bitmap versions of Courier, Times,
Helvetica and some members of the Lucida family. In the SI, these fonts are
provided in the ISO 8859-1 encoding (ISO Latin Western-European).
-In X11R6.8, a number of these fonts are provided in Unicode-encoded font
+In X11R6.8.1, a number of these fonts are provided in Unicode-encoded font
files instead. At build time, these fonts are split into font files encoded
according to legacy encodings, a process which allows us to provide the stan-
dard fonts in a number of regional encodings with no duplication of work.
@@ -469,7 +470,7 @@ for improved presentation of text.
3.3 Standard scalable fonts
-X11R6.8 includes all the scalable fonts distributed with X11R6.
+X11R6.8.1 includes all the scalable fonts distributed with X11R6.
3.3.1 Standard Type 1 fonts
@@ -491,7 +492,7 @@ and reside in the font files
/usr/X11R6/lib/X11/fonts/Type1/UT*.pfa
-Finally, X11R6.8 also comes with Type 1 versions of Bitstream Courier and
+Finally, X11R6.8.1 also comes with Type 1 versions of Bitstream Courier and
Charter. These fonts have XLFD
-bitstream-courier-*-*-normal--0-0-0-0-m-0-iso8859-1
@@ -503,9 +504,10 @@ and reside in the font files
3.3.2 Standard Speedo fonts
-X11R6.8 includes Speedo versions of the Bitstream Courier and Charter fonts.
-In order to use these fonts, you should ensure that your X server is loading
-the `Speedo' font backend; see Troubleshooting (section 2.2.5, page 1).
+X11R6.8.1 includes Speedo versions of the Bitstream Courier and Charter
+fonts. In order to use these fonts, you should ensure that your X server is
+loading the `Speedo' font backend; see Troubleshooting (section 2.2.5, page
+1).
These fonts cover all of ISO 8859-1 and almost all of ISO 8859-2. They have
XLFD name
@@ -519,7 +521,7 @@ and reside in the font files
3.4 The Bigelow & Holmes Luxi family
-X11R6.8 includes the Luxi family of scalable fonts, in both TrueType and
+X11R6.8.1 includes the Luxi family of scalable fonts, in both TrueType and
Type 1 format. This family consists of the fonts Luxi Serif, with XLFD
-b&h-luxi serif-medium-*-normal--*-*-*-*-p-*-*-*
@@ -565,11 +567,11 @@ For more information, please contact <design@bigelowandholmes.com> or
An earlier version of the Luxi fonts was made available under the name
Lucidux. This name should no longer be used due to trademark uncertainties,
-and all traces of the Lucidux name have been removed from X11R6.8.
+and all traces of the Lucidux name have been removed from X11R6.8.1.
4. More about core fonts
-This section describes X11R6.8-specific enhancements to the core X11 fonts
+This section describes X11R6.8.1-specific enhancements to the core X11 fonts
system.
4.1 Core fonts and internationalisation
@@ -592,8 +594,8 @@ backend) use a common fontenc layer for font re-encoding. This allows these
backends to share their encoding data, and allows simple configuration of new
locales independently of font type.
-Please note: the X-TrueType (X-TT) backend is not included in X11R6.8. That
-functionality has been merged into the FreeType backend.>
+Please note: the X-TrueType (X-TT) backend is not included in X11R6.8.1.
+That functionality has been merged into the FreeType backend.>
In the fontenc layer, an encoding is defined by a name (such as iso8859-1),
possibly a number of aliases (alternate names), and an ordered collection of
@@ -652,7 +654,7 @@ option followed by the name of a directory containing encoding files, can be
used to automatically build `encodings.dir' files. Please see the mkfont-
dir(1) manual page for more details.
-A number of encoding files for common encodings are included with X11R6.8.
+A number of encoding files for common encodings are included with X11R6.8.1.
Information on writing new encoding files can be found in Format of encodings
directory files (section 4.1.3, page 1) and Format of encoding files (section
4.1.4, page 1) later in this document.
@@ -988,7 +990,7 @@ ings, but instead uses its own database of encodings.
Since the functionalities for CJKV support introduced by X-TT have been
merged into the new FreeType backend, the X-TT backend will be removed from
-X11R6.8's tree near the future. Therefore, the use of FreeType backend is
+X11R6.8.1's tree near the future. Therefore, the use of FreeType backend is
preferred over the X-TT backend.
General information on X-TrueType may be found at the After X-TT Project page
@@ -1135,16 +1137,16 @@ last two fields of their XLFD set to `iso10646-1'.
6. References
-X11R6.8 comes with extensive documentation in the form of manual pages and
+X11R6.8.1 comes with extensive documentation in the form of manual pages and
typeset documents. Before installing fonts, you really should read the font-
config(3) and mkfontdir(1) manual pages; other manual pages of interest
include X(7), Xserver(1), xset(1), Xft(3), xlsfonts(1) and showfont(1). In
addition, you may want to read the X Logical Font Description document, by
Jim Flowers, which is provided in the file `xc/doc/xlfd.PS.Z'.
-The latest released version of the X11R6.8 documentation (including this doc-
-ument and all manual pages) can be found from current X11R6.8 documentation
-<URL:http://wiki.x.org/>.
+The latest released version of the X11R6.8.1 documentation (including this
+document and all manual pages) can be found from current X11R6.8.1 documenta-
+tion <URL:http://wiki.x.org/>.
The comp.fonts FAQ <URL:http://www.netmeg.net/faq/computers/fonts/>, which is
unfortunately no longer being maintained, contains a wealth of information
@@ -1179,4 +1181,4 @@ world, often provide interesting information about character set issues; see
for example RFC 373.
-$XdotOrg$
+$XdotOrg: xc/programs/Xserver/hw/xfree86/doc/README.fonts,v 1.3.2.1 2004/09/17 15:38:19 kem Exp $
diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c
index 4748f17df..0a631782d 100644
--- a/hw/xfree86/dri/dri.c
+++ b/hw/xfree86/dri/dri.c
@@ -71,6 +71,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
extern Bool noPanoramiXExtension;
#endif
+extern Bool noXFree86DRIExtension;
+
static int DRIScreenPrivIndex = -1;
static int DRIWindowPrivIndex = -1;
static unsigned long DRIGeneration = 0;
@@ -129,6 +131,13 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD)
DRIGeneration = serverGeneration;
}
+ /* If the DRI extension is disabled, do not initialize the DRI */
+ if (noXFree86DRIExtension) {
+ DRIDrvMsg(pScreen->myNum, X_WARNING,
+ "Direct rendering has been disabled.\n");
+ return FALSE;
+ }
+
/*
* If Xinerama is on, don't allow DRI to initialise. It won't be usable
* anyway.
diff --git a/hw/xfree86/loader/dixsym.c b/hw/xfree86/loader/dixsym.c
index e0b93926f..46116a398 100644
--- a/hw/xfree86/loader/dixsym.c
+++ b/hw/xfree86/loader/dixsym.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/loader/dixsym.c,v 1.4 2004/08/09 03:40:50 krh Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/loader/dixsym.c,v 1.5.2.2 2004/12/08 05:32:54 gisburn Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/dixsym.c,v 1.63 2003/12/03
* 17:11:29 tsi Exp $ */
@@ -325,15 +325,122 @@ LOOKUP dixLookupTab[] = {
SYMFUNC(AdjustWaitForDelay)
SYMVAR(noTestExtensions)
SYMFUNC(GiveUp)
+
+#ifdef BEZIER
+ SYMVAR(noBezierExtension)
+#endif
+#ifdef BIGREQS
+ SYMVAR(noBigReqExtension)
+#endif
#ifdef COMPOSITE
SYMVAR(noCompositeExtension)
#endif
+#ifdef DAMAGE
+ SYMVAR(noDamageExtension)
+#endif
+#ifdef DBE
+ SYMVAR(noDbeExtension)
+#endif
+#ifdef DPSEXT
+ SYMVAR(noDPSExtension)
+#endif
+#ifdef DPMSExtension
+ SYMVAR(noDPMSExtension)
+#endif
+#ifdef EVI
+ SYMVAR(noEVIExtension)
+#endif
+#ifdef FONTCACHE
+ SYMVAR(noFontCacheExtension)
+#endif
+#ifdef GLXEXT
+ SYMVAR(noGlxExtension)
+#endif
+#ifdef LBX
+ SYMVAR(noLbxExtension)
+#endif
+#ifdef SCREENSAVER
+ SYMVAR(noScreenSaverExtension)
+#endif
+#ifdef MITSHM
+ SYMVAR(noMITShmExtension)
+#endif
+#ifdef MITMISC
+ SYMVAR(noMITMiscExtension)
+#endif
+#ifdef MULTIBUFFER
+ SYMVAR(noMultibufferExtension)
+#endif
+#ifdef RANDR
+ SYMVAR(noRRExtension)
+#endif
#ifdef RENDER
SYMVAR(noRenderExtension)
#endif
+#ifdef SHAPE
+ SYMVAR(noShapeExtension)
+#endif
+#ifdef XCSECURITY
+ SYMVAR(noSecurityExtension)
+#endif
+#ifdef XSYNC
+ SYMVAR(noSyncExtension)
+#endif
+#ifdef TOGCUP
+ SYMVAR(noXcupExtension)
+#endif
+#ifdef PEXEXT
+ SYMVAR(noPexExtension)
+#endif
+#ifdef RES
+ SYMVAR(noResExtension)
+#endif
+#ifdef XAPPGROUP
+ SYMVAR(noXagExtension)
+#endif
+#ifdef XCMISC
+ SYMVAR(noXCMiscExtension)
+#endif
#ifdef XEVIE
SYMVAR(noXevieExtension)
#endif
+#ifdef XIE
+ SYMVAR(noXie)
+#endif
+#ifdef XF86BIGFONT
+ SYMVAR(noXFree86BigfontExtension)
+#endif
+#ifdef XFreeXDGA
+ SYMVAR(noXFree86DGAExtension)
+#endif
+#ifdef XF86DRI
+ SYMVAR(noXFree86DRIExtension)
+#endif
+#ifdef XF86MISC
+ SYMVAR(noXFree86MiscExtension)
+#endif
+#ifdef XF86VIDMODE
+ SYMVAR(noXFree86VidModeExtension)
+#endif
+#ifdef XFIXES
+ SYMVAR(noXFixesExtension)
+#endif
+#ifdef XKB
+/* |noXkbExtension| is defined in xc/programs/Xserver/xkb/xkbInit.c */
+ SYMVAR(noXkbExtension)
+#endif
+#ifdef PANORAMIX
+ SYMVAR(noPanoramiXExtension)
+#endif
+#ifdef XINPUT
+ SYMVAR(noXInputExtension)
+#endif
+#ifdef XIDLE
+ SYMVAR(noXIdleExtension)
+#endif
+#ifdef XV
+ SYMVAR(noXvExtension)
+#endif
/* log.c */
SYMFUNC(LogVWrite)
@@ -386,7 +493,6 @@ LOOKUP dixLookupTab[] = {
/* xkb/xkbInit.c */
SYMFUNC(XkbInitKeyboardDeviceStruct)
SYMFUNC(XkbSetRulesDflts)
- SYMVAR(noXkbExtension)
#endif
#ifdef XINPUT
diff --git a/hw/xfree86/loader/elfloader.c b/hw/xfree86/loader/elfloader.c
index 4d2a050f7..9a8ba285b 100644
--- a/hw/xfree86/loader/elfloader.c
+++ b/hw/xfree86/loader/elfloader.c
@@ -1,4 +1,4 @@
-/* $XdotOrg$ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/loader/elfloader.c,v 1.2.4.1 2004/12/08 06:25:07 gisburn Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/elfloader.c,v 1.61tsi Exp $ */
/*
@@ -922,7 +922,7 @@ ELFCreateGOT(ELFModulePtr elffile, int maxalign)
ErrorF("ELFCreateGOT() Unable to reallocate memory!!!!\n");
return FALSE;
}
-# if defined(linux) || defined(__OpenBSD__)
+# if defined(linux) || defined(__OpenBSD__) || defined(sun)
{
unsigned long page_size = getpagesize();
unsigned long round;
@@ -1097,7 +1097,7 @@ ELFCreatePLT(ELFModulePtr elffile)
ErrorF("ELFCreatePLT() Unable to allocate memory!!!!\n");
return;
}
-# if defined(linux) || defined(__OpenBSD__)
+# if defined(linux) || defined(__OpenBSD__) || defined(sun)
{
unsigned long page_size = getpagesize();
unsigned long round;
@@ -2775,7 +2775,7 @@ ELFCollectSections(ELFModulePtr elffile, int pass, int *totalsize,
elffile->lsection[j].size = SecSize(i);
elffile->lsection[j].flags = flags;
switch (SecType(i)) {
-#if defined(linux) || defined(__OpenBSD__)
+#if defined(linux) || defined(__OpenBSD__) || defined(sun)
case SHT_PROGBITS:
{
unsigned long page_size = getpagesize();
@@ -2979,7 +2979,7 @@ ELFLoadModule(loaderPtr modrec, int elffd, LOOKUP **ppLookup)
ErrorF("Unable to allocate ELF sections\n");
return NULL;
}
-# if defined(linux) || defined(__OpenBSD__)
+# if defined(linux) || defined(__OpenBSD__) || defined(sun)
{
unsigned long page_size = getpagesize();
unsigned long round;
diff --git a/hw/xfree86/loader/extsym.c b/hw/xfree86/loader/extsym.c
index 76682e783..d5f32bf9d 100644
--- a/hw/xfree86/loader/extsym.c
+++ b/hw/xfree86/loader/extsym.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/loader/extsym.c,v 1.3 2004/08/08 17:02:19 krh Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/loader/extsym.c,v 1.4.2.1 2004/12/08 05:32:54 gisburn Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/extsym.c,v 1.9 2003/10/15 16:29:03 dawes Exp $ */
/*
@@ -66,7 +66,6 @@ LOOKUP extLookupTab[] = {
#ifdef PANORAMIX
SYMFUNC(XineramaRegisterConnectionBlockCallback)
SYMFUNC(XineramaDeleteResource)
- SYMVAR(noPanoramiXExtension)
SYMVAR(PanoramiXNumScreens)
SYMVAR(panoramiXdataPtr)
SYMVAR(PanoramiXVisualTable)
diff --git a/hw/xfree86/os-support/bsd/bsd_KbdMap.c b/hw/xfree86/os-support/bsd/bsd_KbdMap.c
index c0a8f8890..542eb2630 100644
--- a/hw/xfree86/os-support/bsd/bsd_KbdMap.c
+++ b/hw/xfree86/os-support/bsd/bsd_KbdMap.c
@@ -677,11 +677,11 @@ TransMapRec wsAdb = {
};
static CARD8 wsSunMap[] = {
- /* 0x00 */ KEY_NOTUSED,
- /* 0x01 */ KEY_NOTUSED, /* stop */
- /* 0x02 */ KEY_NOTUSED, /* BrightnessDown / S-VolumeDown */
- /* 0x03 */ KEY_NOTUSED, /* again */
- /* 0x04 */ KEY_NOTUSED, /* BridgtnessUp / S-VolumeUp */
+ /* 0x00 */ KEY_Help,
+ /* 0x01 */ KEY_L1, /* stop */
+ /* 0x02 */ KEY_AudioLower, /* BrightnessDown / S-VolumeDown */
+ /* 0x03 */ KEY_L2, /* again */
+ /* 0x04 */ KEY_AudioRaise, /* BridgtnessUp / S-VolumeUp */
/* 0x05 */ KEY_F1,
/* 0x06 */ KEY_F2,
/* 0x07 */ KEY_F10,
@@ -700,10 +700,10 @@ static CARD8 wsSunMap[] = {
/* 0x14 */ KEY_Up,
/* 0x15 */ KEY_Pause,
/* 0x16 */ KEY_Print,
- /* 0x17 */ KEY_NOTUSED, /* props */
+ /* 0x17 */ KEY_ScrollLock,
/* 0x18 */ KEY_Left,
- /* 0x19 */ KEY_ScrollLock,
- /* 0x1a */ KEY_NOTUSED, /* undo */
+ /* 0x19 */ KEY_L3, /* props */
+ /* 0x1a */ KEY_L4, /* undo */
/* 0x1b */ KEY_Down,
/* 0x1c */ KEY_Right,
/* 0x1d */ KEY_Escape,
@@ -722,13 +722,13 @@ static CARD8 wsSunMap[] = {
/* 0x2a */ KEY_Tilde,
/* 0x2b */ KEY_BackSpace,
/* 0x2c */ KEY_Insert,
- /* 0x2d */ KEY_KP_Equal,
+ /* 0x2d */ KEY_Mute, /* Audio Mute */
/* 0x2e */ KEY_KP_Divide,
/* 0x2f */ KEY_KP_Multiply,
/* 0x30 */ KEY_NOTUSED,
- /* 0x31 */ KEY_NOTUSED, /* front */
+ /* 0x31 */ KEY_L5, /* front */
/* 0x32 */ KEY_KP_Decimal,
- /* 0x33 */ KEY_NOTUSED, /* copy */
+ /* 0x33 */ KEY_L6, /* copy */
/* 0x34 */ KEY_Home,
/* 0x35 */ KEY_Tab,
/* 0x36 */ KEY_Q,
@@ -744,13 +744,13 @@ static CARD8 wsSunMap[] = {
/* 0x40 */ KEY_LBrace,
/* 0x41 */ KEY_RBrace,
/* 0x42 */ KEY_Delete,
- /* 0x43 */ KEY_NOTUSED, /* compose */
+ /* 0x43 */ KEY_Menu, /* compose */
/* 0x44 */ KEY_KP_7,
/* 0x45 */ KEY_KP_8,
/* 0x46 */ KEY_KP_9,
/* 0x47 */ KEY_KP_Minus,
- /* 0x48 */ KEY_NOTUSED, /* open */
- /* 0x49 */ KEY_NOTUSED, /* paste */
+ /* 0x48 */ KEY_L7, /* open */
+ /* 0x49 */ KEY_L8, /* paste */
/* 0x4a */ KEY_End,
/* 0x4b */ KEY_NOTUSED,
/* 0x4c */ KEY_LCtrl,
@@ -772,9 +772,9 @@ static CARD8 wsSunMap[] = {
/* 0x5c */ KEY_KP_5,
/* 0x5d */ KEY_KP_6,
/* 0x5e */ KEY_KP_0,
- /* 0x5f */ KEY_NOTUSED, /* find */
+ /* 0x5f */ KEY_L9, /* find */
/* 0x60 */ KEY_PgUp,
- /* 0x61 */ KEY_NOTUSED, /* cut */
+ /* 0x61 */ KEY_L10, /* cut */
/* 0x62 */ KEY_NumLock,
/* 0x63 */ KEY_ShiftL,
/* 0x64 */ KEY_Z,
@@ -801,7 +801,7 @@ static CARD8 wsSunMap[] = {
/* 0x79 */ KEY_Space,
/* 0x7a */ KEY_RMeta,
/* 0x7b */ KEY_PgDown,
- /* 0x7c */ KEY_NOTUSED,
+ /* 0x7c */ KEY_Less, /* < > on some keyboards */
/* 0x7d */ KEY_KP_Plus,
/* 0x7e */ KEY_NOTUSED,
/* 0x7f */ KEY_NOTUSED
@@ -1044,9 +1044,11 @@ KbdGetMapping (InputInfoPtr pInfo, KeySymsPtr pKeySyms, CARD8 *pModMap)
case PCCONS:
case PCVT:
pKbd->RemapScanCode = ATScancode;
+ break;
#endif
#ifdef WSCONS_SUPPORT
case WSCONS:
+ if (!pKbd->isConsole) {
switch (pKbd->wsKbdType) {
case WSKBD_TYPE_PC_XT:
case WSKBD_TYPE_PC_AT:
@@ -1061,6 +1063,9 @@ KbdGetMapping (InputInfoPtr pInfo, KeySymsPtr pKeySyms, CARD8 *pModMap)
break;
#endif
#ifdef WSKBD_TYPE_SUN
+#ifdef WSKBD_TYPE_SUN5
+ case WSKBD_TYPE_SUN5:
+#endif
case WSKBD_TYPE_SUN:
pKbd->scancodeMap = &wsSun;
break;
@@ -1068,6 +1073,9 @@ KbdGetMapping (InputInfoPtr pInfo, KeySymsPtr pKeySyms, CARD8 *pModMap)
default:
ErrorF("Unknown wskbd type %d\n", pKbd->wsKbdType);
}
+ } else {
+ pKbd->RemapScanCode = ATScancode;
+ }
break;
#endif
}
diff --git a/hw/xfree86/os-support/bsd/bsd_kbd.c b/hw/xfree86/os-support/bsd/bsd_kbd.c
index 871bd2411..67f0b800d 100644
--- a/hw/xfree86/os-support/bsd/bsd_kbd.c
+++ b/hw/xfree86/os-support/bsd/bsd_kbd.c
@@ -143,7 +143,7 @@ static int
KbdOn(InputInfoPtr pInfo, int what)
{
KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
-#if defined(SYSCONS_SUPPORT) || defined(PCCONS_SUPPORT) || defined(PCVT_SUPPORT)
+#if defined(SYSCONS_SUPPORT) || defined(PCCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT)
BsdKbdPrivPtr priv = (BsdKbdPrivPtr) pKbd->private;
struct termios nTty;
#endif
@@ -154,7 +154,7 @@ KbdOn(InputInfoPtr pInfo, int what)
if (pKbd->isConsole) {
switch (pKbd->consType) {
-#if defined(SYSCONS_SUPPORT) || defined(PCCONS_SUPPORT) || defined(PCVT_SUPPORT)
+#if defined(SYSCONS_SUPPORT) || defined(PCCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT)
case SYSCONS:
case PCCONS:
case PCVT:
@@ -170,7 +170,10 @@ KbdOn(InputInfoPtr pInfo, int what)
nTty.c_cc[VMIN] = 1;
cfsetispeed(&nTty, 9600);
cfsetospeed(&nTty, 9600);
- tcsetattr(pInfo->fd, TCSANOW, &nTty);
+ if (tcsetattr(pInfo->fd, TCSANOW, &nTty) < 0) {
+ xf86Msg(X_ERROR, "KbdOn: tcsetattr: %s\n",
+ strerror(errno));
+ }
break;
#endif
}
@@ -197,7 +200,7 @@ KbdOn(InputInfoPtr pInfo, int what)
"or use for example:\n\n"
"Option \"Protocol\" \"wskbd\"\n"
"Option \"Device\" \"/dev/wskbd0\"\n"
- "\nin your XF86Config(5) file\n");
+ "\nin your xorg.conf(5) file\n");
}
break;
#endif
@@ -232,7 +235,7 @@ KbdOff(InputInfoPtr pInfo, int what)
case WSCONS:
option = WSKBD_TRANSLATED;
ioctl(xf86Info.consoleFd, WSKBDIO_SETMODE, &option);
- tcsetattr(xf86Info.consoleFd, TCSANOW, &(priv->kbdtty));
+ tcsetattr(pInfo->fd, TCSANOW, &(priv->kbdtty));
break;
#endif
}
@@ -380,22 +383,30 @@ stdReadInput(InputInfoPtr pInfo)
}
#ifdef WSCONS_SUPPORT
+
static void
WSReadInput(InputInfoPtr pInfo)
{
KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
struct wscons_event events[64];
- int n, i;
+ int type;
+ int blocked, n, i;
+
if ((n = read( pInfo->fd, events, sizeof(events))) > 0) {
n /= sizeof(struct wscons_event);
- for (i = 0; i < n; i++)
- pKbd->PostEvent(pInfo, events[i].value,
- events[i].type == WSCONS_EVENT_KEY_DOWN ? TRUE : FALSE);
- }
+ for (i = 0; i < n; i++) {
+ type = events[i].type;
+ if (type == WSCONS_EVENT_KEY_UP || type == WSCONS_EVENT_KEY_DOWN) {
+ /* It seems better to block SIGIO there */
+ blocked = xf86BlockSIGIO();
+ pKbd->PostEvent(pInfo, (unsigned int)(events[i].value),
+ type == WSCONS_EVENT_KEY_DOWN ? TRUE : FALSE);
+ xf86UnblockSIGIO(blocked);
+ }
+ } /* for */
+ }
}
-#endif
-#ifdef WSCONS_SUPPORT
static void
printWsType(char *type, char *devname)
{
@@ -448,15 +459,14 @@ OpenKeyboard(InputInfoPtr pInfo)
pKbd->consType = xf86Info.consType;
}
} else {
- pInfo->fd = open(s, O_RDONLY | O_NONBLOCK | O_EXCL);
+ pInfo->fd = open(s, O_RDONLY | O_NONBLOCK | O_EXCL);
if (pInfo->fd == -1) {
xf86Msg(X_ERROR, "%s: cannot open \"%s\"\n", pInfo->name, s);
xfree(s);
return FALSE;
}
pKbd->isConsole = FALSE;
- /* XXX What is consType here? */
- pKbd->consType = SYSCONS;
+ pKbd->consType = xf86Info.consType;
xfree(s);
}
@@ -495,6 +505,11 @@ OpenKeyboard(InputInfoPtr pInfo)
printWsType("Sun", pInfo->name);
break;
#endif
+#ifdef WSKBD_TYPE_SUN5
+ case WSKBD_TYPE_SUN5:
+ xf86Msg(X_PROBED, "Keyboard type: Sun5\n");
+ break;
+#endif
default:
xf86Msg(X_ERROR, "%s: Unsupported wskbd type \"%d\"",
pInfo->name, pKbd->wsKbdType);
@@ -535,4 +550,3 @@ xf86OSKbdPreInit(InputInfoPtr pInfo)
}
return TRUE;
}
-
diff --git a/hw/xfree86/os-support/bus/460gxPCI.c b/hw/xfree86/os-support/bus/460gxPCI.c
index 3b16f401a..9855b8b41 100644
--- a/hw/xfree86/os-support/bus/460gxPCI.c
+++ b/hw/xfree86/os-support/bus/460gxPCI.c
@@ -201,32 +201,46 @@ Get460GXBridgeResources(int bus,
* the chipset scan is to be stopped, or FALSE if the scan is to move on to the
* next chipset.
*/
+
Bool
-xf86PreScan460GX(void)
+xorgProbe460GX(scanpciWrapperOpt flags)
{
pciBusInfo_t *pBusInfo;
PCITAG tag;
- CARD32 tmp;
- int i, devno;
/* Bus zero should already be set up */
if (!(pBusInfo = pciBusInfo[0])) {
cbn_460gx = -1;
return FALSE;
}
-
/* First look for a 460GX's primary host bridge */
tag = PCI_MAKE_TAG(0, 0x10, 0);
- if (pciReadLong(tag, PCI_ID_REG) != DEVID(VENDOR_INTEL, CHIP_460GX_SAC)) {
- cbn_460gx = -1;
- return FALSE;
+ if (pciReadLong(tag, PCI_ID_REG) == DEVID(VENDOR_INTEL, CHIP_460GX_SAC)) {
+ return TRUE;
}
+ cbn_460gx = -1;
+
+ return FALSE;
+}
+
+void
+xf86PreScan460GX(void)
+{
+ pciBusInfo_t *pBusInfo;
+ PCITAG tag;
+ CARD32 tmp;
+ int i, devno;
+
+ if (!(pBusInfo = pciBusInfo[0]))
+ return;
+
/* Get CBN (Chipset bus number) */
+ tag = PCI_MAKE_TAG(0, 0x10, 0);
if (!(cbn_460gx = (unsigned int)pciReadByte(tag, CBN))) {
/* Sanity check failed */
cbn_460gx = -1;
- return TRUE;
+ return;
}
if (pciNumBuses <= cbn_460gx)
@@ -242,7 +256,7 @@ xf86PreScan460GX(void)
if (pciReadLong(tag, PCI_ID_REG) != DEVID(VENDOR_INTEL, CHIP_460GX_SAC)) {
/* Sanity check failed */
cbn_460gx = -1;
- return TRUE;
+ return;
}
/*
@@ -257,7 +271,7 @@ xf86PreScan460GX(void)
DEVID(VENDOR_INTEL, CHIP_460GX_SAC)) {
/* Sanity check failed */
cbn_460gx = -1;
- return TRUE;
+ return;
}
if (devno == 0x10)
@@ -278,7 +292,7 @@ xf86PreScan460GX(void)
if (cbdevs_460gx & (1 << devno)) {
/* Sanity check failed */
cbn_460gx = -1;
- return TRUE;
+ return;
}
/*
@@ -294,7 +308,7 @@ xf86PreScan460GX(void)
if (cbdevs_460gx & (1 << devno)) {
/* Sanity check failed */
cbn_460gx = -1;
- return TRUE;
+ return;
}
/*
@@ -310,7 +324,7 @@ xf86PreScan460GX(void)
break;
/* Sanity check failed */
cbn_460gx = -1;
- return TRUE;
+ return;
}
}
@@ -337,7 +351,7 @@ xf86PreScan460GX(void)
break;
}
- return TRUE;
+ return;
}
/* This does some 460GX-related processing after the PCI bus scan */
@@ -423,7 +437,7 @@ xf86PostScan460GX(void)
if (pPCI->funcnum > 0)
break;
- if ((pBusInfo = pciBusInfo[busno_460gx[i]]))
+ if ((pBusInfo == pciBusInfo[busno_460gx[i]]))
break;
/* Fix bus linkage */
diff --git a/hw/xfree86/os-support/bus/460gxPCI.h b/hw/xfree86/os-support/bus/460gxPCI.h
index 2ae9c3528..9459705d0 100644
--- a/hw/xfree86/os-support/bus/460gxPCI.h
+++ b/hw/xfree86/os-support/bus/460gxPCI.h
@@ -29,8 +29,10 @@
#define PCI_460GX_H 1
#include <X11/Xdefs.h>
+#include <Pci.h>
-Bool xf86PreScan460GX(void);
+Bool xorgProbe460GX(scanpciWrapperOpt flags);
+void xf86PreScan460GX(void);
void xf86PostScan460GX(void);
#endif
diff --git a/hw/xfree86/os-support/bus/Pci.c b/hw/xfree86/os-support/bus/Pci.c
index ffa906505..4bc189bbd 100644
--- a/hw/xfree86/os-support/bus/Pci.c
+++ b/hw/xfree86/os-support/bus/Pci.c
@@ -954,10 +954,13 @@ xf86scanpci(int flags)
pciBusInfo_t *busp;
int idx = 0, i;
PCITAG tag;
+ static Bool done = FALSE;
- if (pci_devp[0])
+ if (done || pci_devp[0])
return pci_devp;
+ done = TRUE;
+
pciInit();
#ifdef XF86SCANPCI_WRAPPER
diff --git a/hw/xfree86/os-support/bus/e8870PCI.c b/hw/xfree86/os-support/bus/e8870PCI.c
index adbd189f1..9eb34a67a 100644
--- a/hw/xfree86/os-support/bus/e8870PCI.c
+++ b/hw/xfree86/os-support/bus/e8870PCI.c
@@ -34,17 +34,23 @@
#include "Pci.h"
Bool
-xf86PreScanE8870(void)
+xorgProbeE8870(scanpciWrapperOpt flags)
{
PCITAG tag;
/* Look for an E8870's Hub interface */
tag = PCI_MAKE_TAG(0, 0x1E, 0);
- if (pciReadLong(tag, PCI_ID_REG) != DEVID(VENDOR_INTEL, CHIP_82801_P2P))
- return FALSE;
+ if (pciReadLong(tag, PCI_ID_REG) == DEVID(VENDOR_INTEL, CHIP_82801_P2P))
+ return TRUE;
+
+ return FALSE;
+}
+void
+xf86PreScanE8870(void)
+{
/* XXX Fill me in... */
- return TRUE;
+ return;
}
void
diff --git a/hw/xfree86/os-support/bus/e8870PCI.h b/hw/xfree86/os-support/bus/e8870PCI.h
index b910bcfd8..2d16077ac 100644
--- a/hw/xfree86/os-support/bus/e8870PCI.h
+++ b/hw/xfree86/os-support/bus/e8870PCI.h
@@ -29,8 +29,10 @@
#define PCI_E8870_H 1
#include <X11/Xdefs.h>
+#include <Pci.h>
-Bool xf86PreScanE8870(void);
+Bool xorgProbeE8870(scanpciWrapperOpt flags);
+void xf86PreScanE8870(void);
void xf86PostScanE8870(void);
#endif
diff --git a/hw/xfree86/os-support/bus/ix86Pci.c b/hw/xfree86/os-support/bus/ix86Pci.c
index da1aa7d2f..9437204a9 100644
--- a/hw/xfree86/os-support/bus/ix86Pci.c
+++ b/hw/xfree86/os-support/bus/ix86Pci.c
@@ -273,7 +273,7 @@ void ix86PciSelectCfgmech(void)
switch (xf86Info.pciFlags) {
case PCIOsConfig:
-#if ARCH_PCI_OS_INIT
+#ifdef ARCH_PCI_OS_INIT
return;
#endif
diff --git a/hw/xfree86/os-support/bus/linuxPci.c b/hw/xfree86/os-support/bus/linuxPci.c
index 6e33c2550..146dccfd3 100644
--- a/hw/xfree86/os-support/bus/linuxPci.c
+++ b/hw/xfree86/os-support/bus/linuxPci.c
@@ -113,14 +113,16 @@ linuxPciOpenFile(PCITAG tag)
if (fd != -1)
close(fd);
if (bus < 256) {
- if (stat("/proc/bus/pci/00", &ignored) < 0)
+ sprintf(file,"/proc/bus/pci/%02x",bus);
+ if (stat(file, &ignored) < 0)
sprintf(file, "/proc/bus/pci/0000:%02x/%02x.%1x",
bus, dev, func);
else
sprintf(file, "/proc/bus/pci/%02x/%02x.%1x",
bus, dev, func);
} else {
- if (stat("/proc/bus/pci/00", &ignored) < 0)
+ sprintf(file,"/proc/bus/pci/%04x",bus);
+ if (stat(file, &ignored) < 0)
sprintf(file, "/proc/bus/pci/0000:%04x/%02x.%1x",
bus, dev, func);
else
diff --git a/hw/xfree86/os-support/bus/zx1PCI.c b/hw/xfree86/os-support/bus/zx1PCI.c
index 5d4d6a991..ce3260c26 100644
--- a/hw/xfree86/os-support/bus/zx1PCI.c
+++ b/hw/xfree86/os-support/bus/zx1PCI.c
@@ -465,13 +465,7 @@ static pciBusInfo_t zx1FakeBus = {
NULL, /* bridge -- dynamically set */
};
-/*
- * This checks for, and validates, the presence of the ZX1 chipset, and sets
- * pZX1mio to a non-NULL pointer accordingly. This function is called before
- * the server's PCI bus scan and returns TRUE if the chipset scan is to be
- * stopped, or FALSE if the scan is to move on to the next chipset.
- */
-Bool
+void
xf86PreScanZX1(void)
{
resRange range;
@@ -491,7 +485,7 @@ xf86PreScanZX1(void)
mapSize = MIO_SIZE;
if (!(pZX1mio = xf86MapVidMem(-1, VIDMEM_MMIO, MIO_BASE, mapSize)))
- return FALSE;
+ return;
/* Look for ZX1's SBA and IOC */ /* XXX What about Dino? */
if ((MIO_LONG(MIO_FUNCTION0 + PCI_ID_REG) !=
@@ -500,7 +494,7 @@ xf86PreScanZX1(void)
DEVID(VENDOR_HP, CHIP_ZX1_IOC))) {
xf86UnMapVidMem(-1, pZX1mio, mapSize);
pZX1mio = NULL;
- return FALSE;
+ return;
}
/* Map rope configuration space */
@@ -510,7 +504,7 @@ xf86PreScanZX1(void)
!(pZX1ioa = xf86MapVidMem(-1, VIDMEM_MMIO, ioaaddr, IOA_SIZE))) {
xf86UnMapVidMem(-1, pZX1mio, mapSize);
pZX1mio = NULL;
- return TRUE;
+ return;
}
for (i = 0; i < 8; i++) {
@@ -924,7 +918,7 @@ xf86PreScanZX1(void)
nRange = 0;
- return TRUE;
+ return;
}
/* This is called to finalise the results of a PCI bus scan */
diff --git a/hw/xfree86/os-support/bus/zx1PCI.h b/hw/xfree86/os-support/bus/zx1PCI.h
index b1e8a95b5..f46a68a30 100644
--- a/hw/xfree86/os-support/bus/zx1PCI.h
+++ b/hw/xfree86/os-support/bus/zx1PCI.h
@@ -30,7 +30,7 @@
#include <X11/Xdefs.h>
-Bool xf86PreScanZX1(void);
+void xf86PreScanZX1(void);
void xf86PostScanZX1(void);
#endif