Joined with branch XORG-6_8_2.

This commit is contained in:
Deron Johnson 2005-02-17 22:44:42 +00:00
parent 57c954d3aa
commit b70b6bd91e
57 changed files with 2091 additions and 473 deletions

View file

@ -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);

View file

@ -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);

View file

@ -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;

View file

@ -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;
}
/*

View file

@ -141,30 +141,6 @@ ReplaceFileString(
return string;
}
/*
* ExecCommand takes two character pointers - the command to execute,
* and the "argv" style NULL-terminated vector of arguments for the command.
* We wait for the command to terminate before continuing to ensure that
* we don't delete the job file before the spooler has made a copy.
*/
void
ExecCommand(
char *pCommand,
char **argVector)
{
pid_t childPid;
int status;
if((childPid = fork()) == 0)
{
execv(pCommand, argVector);
}
else
{
(void) waitpid(childPid, &status, 0);
}
return;
}
/*
* TransferBytes reads numBytes of data from pSrcFile and writes them

View file

@ -816,7 +816,7 @@ AppendEntry(
char *s, c;
if (*type != XrmQString)
return;
return False;
for (firstNameSeen = False; *quarks; bindings++, quarks++) {
if (*bindings == XrmBindLoosely) {
@ -1083,34 +1083,6 @@ XpSpoolerGetServerAttributes(void)
return db;
}
/*
* ExecuteCommand takes two pointers - the command to execute,
* and the "argv" style NULL-terminated vector of arguments for the command.
* We wait for the command to terminate before continuing to ensure that
* we don't delete the job file before the spooler has made a copy.
*/
static void
ExecCommand(pCommand, argVector)
char *pCommand;
char **argVector;
{
pid_t childPid;
int status;
if((childPid = fork()) == 0)
{
/* return BadAlloc? */
if (execv(pCommand, argVector) == -1) {
FatalError("unable to exec '%s'", pCommand);
}
}
else
{
(void) waitpid(childPid, &status, 0);
}
return;
}
/*
* SendFileToCommand takes three character pointers - the file name,
* the command to execute,
@ -1515,6 +1487,8 @@ XpSubmitJob(fileName, pContext)
FreeVector(vector);
xfree(cmdNam);
return Success;
}
/*

View file

@ -109,8 +109,6 @@ char *ReplaceAnyString(char *string,
char *ReplaceFileString(char *string,
char *inFileName,
char *outFileName);
void ExecCommand(char *pCommand,
char **argVector);
int TransferBytes(FILE *pSrcFile,
FILE *pDstFile,
int numBytes);

115
Xprint/doc/Xprt.html Normal file
View file

@ -0,0 +1,115 @@
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Xprt</title><meta name="generator" content="DocBook XSL Stylesheets V1.62.4"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en"><a name="Xprt"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2>Name</h2><p>Xprt &#8212; Print server for X Version 11</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><tt class="command">Xprt</tt> [<tt class="option">-ac</tt>] [<tt class="option">-audit <i class="replaceable"><tt>level</tt></i></tt>] [<tt class="option">-pn</tt>] [<tt class="option">-fp <i class="replaceable"><tt>fontpath</tt></i></tt>] [<tt class="option">-XpFile <i class="replaceable"><tt>file</tt></i></tt>] [<tt class="option">-XpSpoolerType <i class="replaceable"><tt>spoolername</tt></i></tt>] [<tt class="option">:<i class="replaceable"><tt>display</tt></i></tt>]</p></div></div><div class="refsect1" lang="en"><a name="id2804962"></a><h2>DESCRIPTION</h2><p><span><b class="command">Xprt</b></span> is the Xprint print server
for version 11 of the X Window system for non display devices
such as printers and fax machines.</p><p>Xprint is an advanced printing system which enables X11
applications to use devices like printers, FAX or create
documents in formats like PostScript, PCL or PDF. It may be used by
clients such as <span class="application">mozilla</span>.
</p><p>Xprint is a very flexible, extensible, scaleable, client/server
print system based on ISO 10175 (and some other specs) and the X11
rendering protocol.
Using Xprint an application can search, query and use devices like
printers, FAX machines or create documents in formats like PDF.
In particular, an application can seek a printer, query supported
attributes (like paper size, trays, fonts etc.), configure the printer
device to match it's needs and print on it like on any other X device
reusing parts of the code which is used for the video card Xserver.
</p></div><div xmlns:ns1="" class="refsect1" lang="en"><a name="id2805117"></a><h2>USAGE</h2><p>
Although Xprt may be invoked from the command line, it is
preferable to run it as a daemon via the init script
<tt class="filename">/etc/init.d/xprint</tt> (where this script exists).
</p><p>Client programs such as mozilla will require environment
variable <tt class="envar">${XPSERVERLIST}</tt> to be set, identifying the
&quot;display&quot; on which Xprt is running. This variable may be set
for all users via <tt class="filename">/etc/profile</tt> (or similar), using
<b class="userinput"><tt>/etc/init.d/xprint get_xpserverlist</tt></b>:
</p><div class="informalexample"><pre class="programlisting">export XPSERVERLIST=`/etc/init.d/xprint get_xpserverlist`</pre></div></div><div class="refsect1" lang="en"><a name="id2805150"></a><h2>OPTIONS</h2><p>Many of Xprt's command line options are shared in common
with the usual X servers (see <span class="citerefentry"><span class="refentrytitle">Xserver</span>(1x)</span>).
Commonly used options include:</p><div class="variablelist"><dl><dt><span class="term"><tt class="option">:<i class="replaceable"><tt>display</tt></i></tt></span></dt><dd><p> The X server runs on the given display. If multiple X
servers are to run simultaneously on a host, each must
have a unique display number. Note that the standard X
server (for video displays) typically runs on display
:0. If <tt class="filename">/etc/init.d/xprint</tt> is used
to invoke Xprt, it may be configured to automatically assign an available
display number.</p></dd><dt><span class="term"><tt class="option">-ac</tt></span></dt><dd><p>disables host-based access control mechanisms. Enables access
by any host, and permits any host to modify the access control
list. Use with extreme caution. This option exists primarily
for running test suites remotely.</p></dd><dt><span class="term"><tt class="option">-audit <i class="replaceable"><tt>level</tt></i></tt></span></dt><dd><p>sets the audit trail level. The default level is 1, meaning
only connection rejections are reported. Level 2 additionally
reports all successful connections and disconnects. Level 4
enables messages from the SECURITY extension, if present,
including generation and revocation of authorizations and
violations of the security policy. Level 0 turns off the audit
trail. Audit lines are sent as standard error output.</p></dd><dt><span class="term"><tt class="option">-fp <i class="replaceable"><tt>fontpath</tt></i></tt></span></dt><dd><p>sets the search path for fonts. This path is a comma
separated list of directories which Xprt searches for
font databases.</p></dd><dt><span class="term"><tt class="option">-pn</tt></span></dt><dd><p>permits the server to continue running if it fails to
establish all of its well-known sockets (connection
points for clients), but establishes at least
one.</p></dd><dt><span class="term"><tt class="option">-XpFile <i class="replaceable"><tt>file</tt></i></tt></span></dt><dd><p>Sets an altername Xprinters file (see section FILES).</p></dd><dt><span class="term"><tt class="option">-XpSpoolerType <i class="replaceable"><tt>spoolername</tt></i></tt></span></dt><dd xmlns:ns2=""><p>
Defines the spooler system to be used for print job spooling.
Supported values in xprint.mozdev.org release 009 are:
</p><table class="simplelist" border="0" summary="Simple list"><tr><td>aix</td></tr><tr><td>aix4</td></tr><tr><td>bsd</td></tr><tr><td>osf</td></tr><tr><td>solaris</td></tr><tr><td>sysv</td></tr><tr><td>uxp</td></tr><tr><td>cups</td></tr><tr><td>lprng</td></tr><tr><td>other</td></tr><tr><td>none</td></tr></table><p>
(multiple values can be specified, seperated by ':', the first active spooler will be chosen).
The default value is platform-specific and can be obtained via
</p><pre class="programlisting">Xprt -h</pre><p>.
</p></dd></dl></div></div><div xmlns:ns3="" class="refsect1" lang="en"><a name="id2805336"></a><h2>ENVIRONMENT</h2><p>
The following environment variables are recognized by the X print server
(environment variables recognized by Xprint clients are described in
<span class="citerefentry"><span class="refentrytitle">Xprint</span>(7)</span>):
</p><div class="variablelist"><dl><dt><span class="term"><tt class="envar">${XPCONFIGDIR}</tt></span></dt><dd><p> This environment variable points to the root
of the Xprint server configuration directory hierarchy.
If the variable is not defined, the default
path is be assumed. The default path may be
<tt class="filename">/usr/X11R6/lib/X11/xserver/</tt>,
<tt class="filename">/usr/lib/X11/xserver/</tt>,
<tt class="filename">/usr/share/Xprint/xserver/</tt> or
<tt class="filename">/usr/openwin/server/etc/XpConfig</tt>, depending on the
system, and may be configured in <tt class="filename">/etc/init.d/xprint</tt>.</p></dd><dt><span class="term"><tt class="envar">${LANG}</tt></span></dt><dd><p>
This environment variable selects the locale settings used by the Xprint server.
Xprt allows language-specific settings (stored in <tt class="filename">${XPCONFIGDIR}/${LANG}/print/</tt>)
which will override the default settings (stored in <tt class="filename">${XPCONFIGDIR}/C/print/</tt>).
If <tt class="envar">${LANG}</tt> is not set &quot;C&quot; is assumed.
</p></dd></dl></div></div><div class="refsect1" lang="en"><a name="id2805421"></a><h2>FILES</h2><div class="variablelist"><dl><dt><span class="term"><tt class="filename">${XPCONFIGDIR}/${LANG}/print/Xprinters</tt>, </span><span class="term"><tt class="filename">${XPCONFIGDIR}/C/print/Xprinters</tt></span></dt><dd><p>
`Xprinters' is the top most configuration file. It tells
Xprt which specific printer names (e.g. mylaser) should
be supported, and whether <span class="citerefentry"><span class="refentrytitle">lpstat</span>(1)</span> or other commands
should be used to automatically supplement the list of
printers.
</p></dd><dt><span class="term"><tt class="filename">${XPCONFIGDIR}/${LANG}/print/attributes/printer</tt>, </span><span class="term"><tt class="filename">${XPCONFIGDIR}/C/print/attributes/printer</tt></span></dt><dd><p>
The `printer' file maps printer names to model
configurations (see `model-config' below). For example,
&quot;mylaser&quot; could be mapped to a &quot;HPDJ1600C&quot;, and all other
arbitrary printers could be mapped to a default, such as
&quot;HPLJ4SI&quot;. When depending on <span class="citerefentry"><span class="refentrytitle">lpstat</span>(1)</span> in the Xprinters
file, setting up defaults in `printer' becomes all the
more important.
</p></dd><dt><span class="term"><tt class="filename">${XPCONFIGDIR}/${LANG}/print/attributes/document</tt>, </span><span class="term"><tt class="filename">${XPCONFIGDIR}/C/print/attributes/document</tt></span></dt><dd><p>
The `document' file specifies the initial document values
for any print jobs. For example, which paper tray to
use, what default resolution, etc.
</p></dd><dt><span class="term"><tt class="filename">${XPCONFIGDIR}/${LANG}/print/attributes/job</tt>, </span><span class="term"><tt class="filename">${XPCONFIGDIR}/C/print/attributes/job</tt></span></dt><dd><p>
The `job' file specifies the initial job values for any
print jobs. For example, &quot;notification-profile&quot; can be
set so that when a print job is successfully sent to a
printer, e-mail is sent to the user.
</p></dd><dt><span class="term"><tt class="filename">${XPCONFIGDIR}/C/print/models/PSdefault/model-config</tt>, </span><span class="term"><tt class="filename">${XPCONFIGDIR}/C/print/models/PSdefault/fonts/fonts.dir</tt>, </span><span class="term"><tt class="filename">${XPCONFIGDIR}/C/print/models/PSdefault/fonts/9nb00051.pmf</tt>, </span><span class="term"><tt class="filename">${XPCONFIGDIR}/C/print/models/PSdefault/fonts/9nb00093.pmf</tt></span></dt><dd><p>
The `model-config' file has attributes that describe the
printer model's capabilities and default settings.
Printer model fonts may also be present. The model-config
file also identifies the print ddx driver to be used.
For each printer model supported, a complete hierarchy of
files should exist. In most cases, these files do not
need to be modified.
</p></dd><dt><span class="term"><tt class="filename">${XPCONFIGDIR}/C/print/ddx-config/raster/pdf</tt>, </span><span class="term"><tt class="filename">${XPCONFIGDIR}/C/print/ddx-config/raster/pcl</tt>, </span><span class="term"><tt class="filename">${XPCONFIGDIR}/C/print/ddx-config/raster/postscript</tt></span></dt><dd><p>
The print ddx drivers can have highly specific
configuration files to control their behavior. In most
cases, these files do not need to be modified.
</p></dd></dl></div></div><div class="refsect1" lang="en"><a name="id2805584"></a><h2>SEE ALSO</h2><p><span class="simplelist"><span class="citerefentry"><span class="refentrytitle">Xprint</span>(7)</span>, <span class="citerefentry"><span class="refentrytitle">X11</span>(7)</span>, <span class="citerefentry"><span class="refentrytitle">xplsprinters</span>(1x)</span>, <span class="citerefentry"><span class="refentrytitle">xprehashprinterlist</span>(1x)</span>, <span class="citerefentry"><span class="refentrytitle">xphelloworld</span>(1x)</span>, <span class="citerefentry"><span class="refentrytitle">xpxmhelloworld</span>(1x)</span>, <span class="citerefentry"><span class="refentrytitle">xpawhelloworld</span>(1x)</span>, <span class="citerefentry"><span class="refentrytitle">xpxthelloworld</span>(1x)</span>, <span class="citerefentry"><span class="refentrytitle">xpsimplehelloworld</span>(1x)</span>, <span class="citerefentry"><span class="refentrytitle">Xserver</span>(1x)</span>, <span class="citerefentry"><span class="refentrytitle">libXp</span>(3x)</span>, <span class="citerefentry"><span class="refentrytitle">libXprintUtils</span>(3x)</span>, <span class="citerefentry"><span class="refentrytitle">libXprintAppUtils</span>(3x)</span>, <span class="citerefentry"><span class="refentrytitle">XmPrintShell</span>(3x)</span>, <span class="citerefentry"><span class="refentrytitle">XawPrintShell</span>(3x)</span>, Xprint FAQ (<a href="http://xprint.mozdev.org/docs/Xprint_FAQ.html" target="_top">http://xprint.mozdev.org/docs/Xprint_FAQ.html</a>), Xprint main site (<a href="http://xprint.mozdev.org/" target="_top">http://xprint.mozdev.org/</a>)</span></p></div><div class="refsect1" lang="en"><a name="id2805757"></a><h2>AUTHORS</h2><p>
This manual page was written by
Drew Parsons <tt class="email">&lt;<a href="mailto:dparsons@debian.org">dparsons@debian.org</a>&gt;</tt> and
Roland Mainz <tt class="email">&lt;<a href="mailto:roland.mainz@nrubsig.org">roland.mainz@nrubsig.org</a>&gt;</tt>,
with some help from the man page at
<a href="http://www.sins.com.au/unix/manpages/Xprt.html" target="_top">http://www.sins.com.au/unix/manpages/Xprt.html</a> and the XFree86
man page for <span class="citerefentry"><span class="refentrytitle">Xserver</span>(1)</span>.
</p></div></div></body></html>

196
Xprint/doc/Xprt.man.pre Normal file
View file

@ -0,0 +1,196 @@
.\" -*- coding: us-ascii -*-
.TH Xprt __appmansuffix__ "25 November 2004"
.SH NAME
Xprt \- Print server for X Version 11
.SH SYNOPSIS
.ad l
\fBXprt\fR \kx
.if (\nxu > (\n(.lu / 2)) .nr x (\n(.lu / 5)
'in \n(.iu+\nxu
[\fB\-ac\fR] [\fB\-audit \fBlevel\fR\fR] [\fB\-pn\fR] [\fB\-fp \fBfontpath\fR\fR] [\fB\-XpFile \fBfile\fR\fR] [\fB\-XpSpoolerType \fBspoolername\fR\fR] [\fB:\fBdisplay\fR\fR]
'in \n(.iu-\nxu
.ad b
.SH DESCRIPTION
Xprt is the Xprint print server
for version 11 of the X Window system for non display devices
such as printers and fax machines.
.PP
Xprint is an advanced printing system which enables X11
applications to use devices like printers, FAX or create
documents in formats like PostScript, PCL or PDF. It may be used by
clients such as mozilla.
.PP
Xprint is a very flexible, extensible, scaleable, client/server
print system based on ISO 10175 (and some other specs) and the X11
rendering protocol.
Using Xprint an application can search, query and use devices like
printers, FAX machines or create documents in formats like PDF.
In particular, an application can seek a printer, query supported
attributes (like paper size, trays, fonts etc.), configure the printer
device to match it's needs and print on it like on any other X device
reusing parts of the code which is used for the video card Xserver.
.SH USAGE
Although Xprt may be invoked from the command line, it is
preferable to run it as a daemon via the init script
\fB/etc/init.d/xprint\fR (where this script exists).
.PP
Client programs such as mozilla will require environment
variable \fB${XPSERVERLIST}\fR to be set, identifying the
"display" on which Xprt is running. This variable may be set
for all users via \fB/etc/profile\fR (or similar), using
\fB/etc/init.d/xprint get_xpserverlist\fR:
.nf
export XPSERVERLIST=`/etc/init.d/xprint get_xpserverlist`
.fi
.SH OPTIONS
Many of Xprt's command line options are shared in common
with the usual X servers (see \fBXserver\fR(__appmansuffix__)).
Commonly used options include:
.TP
\fB:\fIdisplay\fB\fR
The X server runs on the given display. If multiple X
servers are to run simultaneously on a host, each must
have a unique display number. Note that the standard X
server (for video displays) typically runs on display
:0. If \fB/etc/init.d/xprint\fR is used
to invoke Xprt, it may be configured to automatically assign an available
display number.
.TP
\fB\-ac\fR
disables host-based access control mechanisms. Enables access
by any host, and permits any host to modify the access control
list. Use with extreme caution. This option exists primarily
for running test suites remotely.
.TP
\fB\-audit \fIlevel\fB\fR
sets the audit trail level. The default level is 1, meaning
only connection rejections are reported. Level 2 additionally
reports all successful connections and disconnects. Level 4
enables messages from the SECURITY extension, if present,
including generation and revocation of authorizations and
violations of the security policy. Level 0 turns off the audit
trail. Audit lines are sent as standard error output.
.TP
\fB\-fp \fIfontpath\fB\fR
sets the search path for fonts. This path is a comma
separated list of directories which Xprt searches for
font databases.
.TP
\fB\-pn\fR
permits the server to continue running if it fails to
establish all of its well-known sockets (connection
points for clients), but establishes at least
one.
.TP
\fB\-XpFile \fIfile\fB\fR
Sets an altername Xprinters file (see section FILES).
.TP
\fB\-XpSpoolerType \fIspoolername\fB\fR
Defines the spooler system to be used for print job spooling.
Supported values in xprint.mozdev.org release 009 are:
aix
aix4
bsd
osf
solaris
sysv
uxp
cups
lprng
other
none
(multiple values can be specified, seperated by ':', the first active spooler will be chosen).
The default value is platform-specific and can be obtained via
.nf
Xprt \-h
.fi
\&.
.SH ENVIRONMENT
The following environment variables are recognized by the X print server
(environment variables recognized by Xprint clients are described in
\fBXprint\fR(__miscmansuffix__)):
.TP
\fB${XPCONFIGDIR}\fR
This environment variable points to the root
of the Xprint server configuration directory hierarchy.
If the variable is not defined, the default
path is be assumed. The default path may be
\fB/usr/X11R6/lib/X11/xserver/\fR,
\fB/usr/lib/X11/xserver/\fR,
\fB/usr/share/Xprint/xserver/\fR or
\fB/usr/openwin/server/etc/XpConfig\fR, depending on the
system, and may be configured in \fB/etc/init.d/xprint\fR.
.TP
\fB${LANG}\fR
This environment variable selects the locale settings used by the Xprint server.
Xprt allows language-specific settings (stored in \fB${XPCONFIGDIR}/${LANG}/print/\fR)
which will override the default settings (stored in \fB${XPCONFIGDIR}/C/print/\fR).
If \fB${LANG}\fR is not set "C" is assumed.
.PP
.SH FILES
.TP
\fB${XPCONFIGDIR}/${LANG}/print/Xprinters\fR, \fB${XPCONFIGDIR}/C/print/Xprinters\fR
`Xprinters' is the top most configuration file. It tells
Xprt which specific printer names (e.g. mylaser) should
be supported, and whether \fBlpstat\fR(1) or other commands
should be used to automatically supplement the list of
printers.
.TP
\fB${XPCONFIGDIR}/${LANG}/print/attributes/printer\fR, \fB${XPCONFIGDIR}/C/print/attributes/printer\fR
The `printer' file maps printer names to model
configurations (see `model-config' below). For example,
"mylaser" could be mapped to a "HPDJ1600C", and all other
arbitrary printers could be mapped to a default, such as
"HPLJ4SI". When depending on \fBlpstat\fR(1) in the Xprinters
file, setting up defaults in `printer' becomes all the
more important.
.TP
\fB${XPCONFIGDIR}/${LANG}/print/attributes/document\fR, \fB${XPCONFIGDIR}/C/print/attributes/document\fR
The `document' file specifies the initial document values
for any print jobs. For example, which paper tray to
use, what default resolution, etc.
.TP
\fB${XPCONFIGDIR}/${LANG}/print/attributes/job\fR, \fB${XPCONFIGDIR}/C/print/attributes/job\fR
The `job' file specifies the initial job values for any
print jobs. For example, "notification-profile" can be
set so that when a print job is successfully sent to a
printer, e-mail is sent to the user.
.TP
\fB${XPCONFIGDIR}/C/print/models/PSdefault/model\-config\fR, \fB${XPCONFIGDIR}/C/print/models/PSdefault/fonts/fonts.dir\fR, \fB${XPCONFIGDIR}/C/print/models/PSdefault/fonts/9nb00051.pmf\fR, \fB${XPCONFIGDIR}/C/print/models/PSdefault/fonts/9nb00093.pmf\fR
The `model-config' file has attributes that describe the
printer model's capabilities and default settings.
Printer model fonts may also be present. The model-config
file also identifies the print ddx driver to be used.
For each printer model supported, a complete hierarchy of
files should exist. In most cases, these files do not
need to be modified.
.TP
\fB${XPCONFIGDIR}/C/print/ddx\-config/raster/pdf\fR, \fB${XPCONFIGDIR}/C/print/ddx\-config/raster/pcl\fR, \fB${XPCONFIGDIR}/C/print/ddx\-config/raster/postscript\fR
The print ddx drivers can have highly specific
configuration files to control their behavior. In most
cases, these files do not need to be modified.
.SH "SEE ALSO"
\fBXprint\fR(__miscmansuffix__), \fBX11\fR(__miscmansuffix__), \fBxplsprinters\fR(__appmansuffix__), \fBxprehashprinterlist\fR(__appmansuffix__), \fBxphelloworld\fR(__appmansuffix__), \fBxpxmhelloworld\fR(__appmansuffix__), \fBxpawhelloworld\fR(__appmansuffix__), \fBxpxthelloworld\fR(__appmansuffix__), \fBxpsimplehelloworld\fR(__appmansuffix__), \fBXserver\fR(__appmansuffix__), \fBlibXp\fR(__libmansuffix__), \fBlibXprintUtils\fR(__libmansuffix__), \fBlibXprintAppUtils\fR(__libmansuffix__), \fBXmPrintShell\fR(__libmansuffix__), \fBXawPrintShell\fR(__libmansuffix__), Xprint FAQ (http://xprint.mozdev.org/docs/Xprint_FAQ.html), Xprint main site (http://xprint.mozdev.org/)
.SH AUTHORS
This manual page was written by
Drew Parsons <dparsons@debian.org> and
Roland Mainz <roland.mainz@nrubsig.org>,
with some help from the man page at
http://www.sins.com.au/unix/manpages/Xprt.html and the XFree86
man page for \fBXserver\fR(1).

371
Xprint/doc/Xprt.sgml Normal file
View file

@ -0,0 +1,371 @@
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.2//EN" 'http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd'>
<!-- Process this file with docbook-to-man to generate an nroff manual
page: 'docbook-to-man manpage.sgml > manpage.1'. You may view
the manual page with: 'docbook-to-man manpage.sgml | nroff -man | less'.
A typical entry in a Makefile or Makefile.am is:
manpage.1: manpage.sgml
docbook-to-man $< > $@
HTML generation can be done like this:
% xsltproc ==docbook /usr/share/sgml/docbook/docbook-xsl-stylesheets-1.60.1/html/docbook.xsl Xprint.sgml >Xprint.html
-->
<refentry id="Xprt">
<refmeta>
<refentrytitle>Xprt</refentrytitle>
<manvolnum>__appmansuffix__</manvolnum>
</refmeta>
<refnamediv>
<refname>Xprt</refname>
<refpurpose>Print server for X Version 11</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>Xprt</command>
<arg><option>-ac</option></arg>
<arg><option>-audit <replaceable>level</replaceable></option></arg>
<arg><option>-pn</option></arg>
<arg><option>-fp <replaceable>fontpath</replaceable></option></arg>
<arg><option>-XpFile <replaceable>file</replaceable></option></arg>
<arg><option>-XpSpoolerType <replaceable>spoolername</replaceable></option></arg>
<arg><option>:<replaceable>display</replaceable></option></arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1>
<title>DESCRIPTION</title>
<para><command>Xprt</command> is the Xprint print server
for version 11 of the X Window system for non display devices
such as printers and fax machines.</para>
<para>Xprint is an advanced printing system which enables X11
applications to use devices like printers, FAX or create
documents in formats like PostScript, PCL or PDF. It may be used by
clients such as <application>mozilla</application>.
</para>
<para>Xprint is a very flexible, extensible, scaleable, client/server
print system based on ISO 10175 (and some other specs) and the X11
rendering protocol.
Using Xprint an application can search, query and use devices like
printers, FAX machines or create documents in formats like PDF.
In particular, an application can seek a printer, query supported
attributes (like paper size, trays, fonts etc.), configure the printer
device to match it's needs and print on it like on any other X device
reusing parts of the code which is used for the video card Xserver.
</para>
</refsect1>
<refsect1>
<title>USAGE</title>
<para>
Although Xprt may be invoked from the command line, it is
preferable to run it as a daemon via the init script
<filename>/etc/init.d/xprint</filename> (where this script exists).
</para>
<para>Client programs such as mozilla will require environment
variable <envar>${XPSERVERLIST}</envar> to be set, identifying the
"display" on which Xprt is running. This variable may be set
for all users via <filename>/etc/profile</filename> (or similar), using
<userinput>/etc/init.d/xprint get_xpserverlist</userinput>:
<informalexample>
<programlisting>export XPSERVERLIST=`/etc/init.d/xprint get_xpserverlist`</programlisting>
</informalexample>
</para>
</refsect1>
<refsect1>
<title>OPTIONS</title>
<para>Many of Xprt's command line options are shared in common
with the usual X servers (see <citerefentry><refentrytitle>Xserver</refentrytitle><manvolnum>__appmansuffix__</manvolnum></citerefentry>).
Commonly used options include:</para>
<variablelist>
<varlistentry>
<term><option>:<replaceable>display</replaceable></option>
</term>
<listitem>
<para> The X server runs on the given display. If multiple X
servers are to run simultaneously on a host, each must
have a unique display number. Note that the standard X
server (for video displays) typically runs on display
:0. If <filename>/etc/init.d/xprint</filename> is used
to invoke Xprt, it may be configured to automatically assign an available
display number.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-ac</option>
</term>
<listitem>
<para>disables host-based access control mechanisms. Enables access
by any host, and permits any host to modify the access control
list. Use with extreme caution. This option exists primarily
for running test suites remotely.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-audit <replaceable>level</replaceable></option>
</term>
<listitem>
<para>sets the audit trail level. The default level is 1, meaning
only connection rejections are reported. Level 2 additionally
reports all successful connections and disconnects. Level 4
enables messages from the SECURITY extension, if present,
including generation and revocation of authorizations and
violations of the security policy. Level 0 turns off the audit
trail. Audit lines are sent as standard error output.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-fp <replaceable>fontpath</replaceable></option>
</term>
<listitem>
<para>sets the search path for fonts. This path is a comma
separated list of directories which Xprt searches for
font databases.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-pn</option>
</term>
<listitem>
<para>permits the server to continue running if it fails to
establish all of its well-known sockets (connection
points for clients), but establishes at least
one.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-XpFile <replaceable>file</replaceable></option>
</term>
<listitem>
<para>Sets an altername Xprinters file (see section FILES).</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-XpSpoolerType <replaceable>spoolername</replaceable></option>
</term>
<listitem>
<para>
Defines the spooler system to be used for print job spooling.
Supported values in xprint.mozdev.org release 009 are:
<simplelist type="vert">
<member>aix</member>
<member>aix4</member>
<member>bsd</member>
<member>osf</member>
<member>solaris</member>
<member>sysv</member>
<member>uxp</member>
<member>cups</member>
<member>lprng</member>
<member>other</member>
<member>none</member>
</simplelist>
(multiple values can be specified, seperated by ':', the first active spooler will be chosen).
The default value is platform-specific and can be obtained via
<programlisting>Xprt -h</programlisting>.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>ENVIRONMENT</title>
<para>
The following environment variables are recognized by the X print server
(environment variables recognized by Xprint clients are described in
<citerefentry><refentrytitle>Xprint</refentrytitle><manvolnum>__miscmansuffix__</manvolnum></citerefentry>):
<variablelist>
<varlistentry>
<term><envar>${XPCONFIGDIR}</envar></term>
<listitem>
<para> This environment variable points to the root
of the Xprint server configuration directory hierarchy.
If the variable is not defined, the default
path is be assumed. The default path may be
<filename>/usr/X11R6/lib/X11/xserver/</filename>,
<filename>/usr/lib/X11/xserver/</filename>,
<filename>/usr/share/Xprint/xserver/</filename> or
<filename>/usr/openwin/server/etc/XpConfig</filename>, depending on the
system, and may be configured in <filename>/etc/init.d/xprint</filename>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><envar>${LANG}</envar></term>
<listitem>
<para>
This environment variable selects the locale settings used by the Xprint server.
Xprt allows language-specific settings (stored in <filename>${XPCONFIGDIR}/${LANG}/print/</filename>)
which will override the default settings (stored in <filename>${XPCONFIGDIR}/C/print/</filename>).
If <envar>${LANG}</envar> is not set "C" is assumed.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1>
<title>FILES</title>
<variablelist>
<varlistentry>
<term><filename>${XPCONFIGDIR}/${LANG}/print/Xprinters</filename></term>
<term><filename>${XPCONFIGDIR}/C/print/Xprinters</filename></term>
<listitem>
<para>
`Xprinters' is the top most configuration file. It tells
Xprt which specific printer names (e.g. mylaser) should
be supported, and whether <citerefentry><refentrytitle>lpstat</refentrytitle><manvolnum>1</manvolnum></citerefentry> or other commands
should be used to automatically supplement the list of
printers.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><filename>${XPCONFIGDIR}/${LANG}/print/attributes/printer</filename></term>
<term><filename>${XPCONFIGDIR}/C/print/attributes/printer</filename></term>
<listitem>
<para>
The `printer' file maps printer names to model
configurations (see `model-config' below). For example,
"mylaser" could be mapped to a "HPDJ1600C", and all other
arbitrary printers could be mapped to a default, such as
"HPLJ4SI". When depending on <citerefentry><refentrytitle>lpstat</refentrytitle><manvolnum>1</manvolnum></citerefentry> in the Xprinters
file, setting up defaults in `printer' becomes all the
more important.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><filename>${XPCONFIGDIR}/${LANG}/print/attributes/document</filename></term>
<term><filename>${XPCONFIGDIR}/C/print/attributes/document</filename></term>
<listitem>
<para>
The `document' file specifies the initial document values
for any print jobs. For example, which paper tray to
use, what default resolution, etc.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><filename>${XPCONFIGDIR}/${LANG}/print/attributes/job</filename></term>
<term><filename>${XPCONFIGDIR}/C/print/attributes/job</filename></term>
<listitem>
<para>
The `job' file specifies the initial job values for any
print jobs. For example, "notification-profile" can be
set so that when a print job is successfully sent to a
printer, e-mail is sent to the user.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><filename>${XPCONFIGDIR}/C/print/models/PSdefault/model-config</filename></term>
<term><filename>${XPCONFIGDIR}/C/print/models/PSdefault/fonts/fonts.dir</filename></term>
<term><filename>${XPCONFIGDIR}/C/print/models/PSdefault/fonts/9nb00051.pmf</filename></term>
<term><filename>${XPCONFIGDIR}/C/print/models/PSdefault/fonts/9nb00093.pmf</filename></term>
<listitem>
<para>
The `model-config' file has attributes that describe the
printer model's capabilities and default settings.
Printer model fonts may also be present. The model-config
file also identifies the print ddx driver to be used.
For each printer model supported, a complete hierarchy of
files should exist. In most cases, these files do not
need to be modified.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><filename>${XPCONFIGDIR}/C/print/ddx-config/raster/pdf</filename></term>
<term><filename>${XPCONFIGDIR}/C/print/ddx-config/raster/pcl</filename></term>
<term><filename>${XPCONFIGDIR}/C/print/ddx-config/raster/postscript</filename></term>
<listitem>
<para>
The print ddx drivers can have highly specific
configuration files to control their behavior. In most
cases, these files do not need to be modified.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>SEE ALSO</title>
<para>
<simplelist type="inline">
<!-- specific references -->
<!-- none -->
<!-- Xprint general references -->
<member><citerefentry><refentrytitle>Xprint</refentrytitle><manvolnum>__miscmansuffix__</manvolnum></citerefentry></member>
<member><citerefentry><refentrytitle>X11</refentrytitle><manvolnum>__miscmansuffix__</manvolnum></citerefentry></member>
<member><citerefentry><refentrytitle>xplsprinters</refentrytitle><manvolnum>__appmansuffix__</manvolnum></citerefentry></member>
<member><citerefentry><refentrytitle>xprehashprinterlist</refentrytitle><manvolnum>__appmansuffix__</manvolnum></citerefentry></member>
<member><citerefentry><refentrytitle>xphelloworld</refentrytitle><manvolnum>__appmansuffix__</manvolnum></citerefentry></member>
<member><citerefentry><refentrytitle>xpxmhelloworld</refentrytitle><manvolnum>__appmansuffix__</manvolnum></citerefentry></member>
<member><citerefentry><refentrytitle>xpawhelloworld</refentrytitle><manvolnum>__appmansuffix__</manvolnum></citerefentry></member>
<member><citerefentry><refentrytitle>xpxthelloworld</refentrytitle><manvolnum>__appmansuffix__</manvolnum></citerefentry></member>
<member><citerefentry><refentrytitle>xpsimplehelloworld</refentrytitle><manvolnum>__appmansuffix__</manvolnum></citerefentry></member>
<member><citerefentry><refentrytitle>Xserver</refentrytitle><manvolnum>__appmansuffix__</manvolnum></citerefentry></member>
<!--
<member><citerefentry><refentrytitle>Xprt</refentrytitle><manvolnum>__appmansuffix__</manvolnum></citerefentry></member>
-->
<!-- ToDO: Add manual pages for the single Xprint DDX implementations (PostScript/PDF/PCL/PCL-MONO/Raster/etc.) -->
<member><citerefentry><refentrytitle>libXp</refentrytitle><manvolnum>__libmansuffix__</manvolnum></citerefentry></member>
<member><citerefentry><refentrytitle>libXprintUtils</refentrytitle><manvolnum>__libmansuffix__</manvolnum></citerefentry></member>
<member><citerefentry><refentrytitle>libXprintAppUtils</refentrytitle><manvolnum>__libmansuffix__</manvolnum></citerefentry></member>
<member><citerefentry><refentrytitle>XmPrintShell</refentrytitle><manvolnum>__libmansuffix__</manvolnum></citerefentry></member>
<member><citerefentry><refentrytitle>XawPrintShell</refentrytitle><manvolnum>__libmansuffix__</manvolnum></citerefentry></member>
<member>Xprint FAQ (<ulink url="http://xprint.mozdev.org/docs/Xprint_FAQ.html">http://xprint.mozdev.org/docs/Xprint_FAQ.html</ulink>)</member>
<member>Xprint main site (<ulink url="http://xprint.mozdev.org/">http://xprint.mozdev.org/</ulink>)</member>
</simplelist>
</para>
</refsect1>
<refsect1>
<title>AUTHORS</title>
<para>
This manual page was written by
Drew Parsons <email>dparsons@debian.org</email> and
Roland Mainz <email>roland.mainz@nrubsig.org</email>,
with some help from the man page at
<ulink url="http://www.sins.com.au/unix/manpages/Xprt.html">http://www.sins.com.au/unix/manpages/Xprt.html</ulink> and the XFree86
man page for <citerefentry><refentrytitle>Xserver</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
</para>
</refsect1>
</refentry>

View file

@ -248,7 +248,7 @@ get_fontlist_from_xfs_config()
tok="${val#*=}"
done
done
) | tr "," "[\n]" | fontpath2fontlist
) | tr "," "\n" | fontpath2fontlist
}
get_fontlist_from_all_xfs_configs()
@ -832,7 +832,7 @@ do_get_xpserverlist()
echo ${display}
fi
)
done | tr "[\n]" " "
done | tr "\n" " "
)
# Only produce output if we have some entries...
[ "${xpserverlist}" != "" ] && echo "${xpserverlist}"

View file

@ -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 );

View file

@ -350,7 +350,6 @@ typedef struct
extern Bool InitializePsDriver(int ndx, ScreenPtr pScreen, int argc,
char **argv);
static Bool PsDestroyContext(XpContextPtr pCon);
extern XpContextPtr PsGetContextFromWindow(WindowPtr win);
/*
@ -374,9 +373,6 @@ extern int PsGetDocumentData(XpContextPtr pCon, ClientPtr client,
*/
extern Bool PsCreateGC(GCPtr pGC);
static int PsGetDrawablePrivateStuff(DrawablePtr pDrawable, GC *gc,
unsigned long *valid, PsOutPtr *psOut,
ColormapPtr *cMap);
extern PsContextPrivPtr PsGetPsContextPriv( DrawablePtr pDrawable );
extern int PsUpdateDrawableGC(GCPtr pGC, DrawablePtr pDrawable,
PsOutPtr *psOut, ColormapPtr *cMap);
@ -556,7 +552,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 +562,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);

View file

@ -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];

View file

@ -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

View file

@ -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)
{

View file

@ -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 = (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));
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;
nv = nv_1bit = nv_8bit = nv_12bit = nv_24bit = nv_30bit = nd = 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;
/* 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++;
depths[0].depth = 24;
depths[0].numVids = 1;
depths[0].vids = (VisualID *)xalloc(sizeof(VisualID));
depths[0].vids[0] = visuals[0].vid;
/* 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++;
depths[1].depth = 8;
depths[1].numVids = 1;
depths[1].vids = (VisualID *)xalloc(sizeof(VisualID));
depths[1].vids[0] = visuals[1].vid;
/* 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;
}

View file

@ -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++ )
{

View file

@ -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);

View file

@ -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

View file

@ -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);

View file

@ -125,7 +125,7 @@ copyright holders.
"| sort -u` " \
"| nawk -F: ' NF == 2 { name=$1 } " \
" NF == 1 { sub(\"^.*description\\( - undefined|=\\)\",\"\"); " \
" printf \"%sxp-printerattr.descriptor=%s\\n\", name, $1 } '"
" printf \"%s\txp-printerattr.descriptor=%s\\n\", name, $1 } '"
#define LIST_QUEUES_OTHER \
"LANG=C lpstat -v | " \

View file

@ -1,4 +1,4 @@
/* $XdotOrg: xc/programs/Xserver/dix/dispatch.c,v 1.5.14.2 2005/01/16 00:09:53 deronj Exp $ */
/* $XdotOrg: xc/programs/Xserver/dix/dispatch.c,v 1.5.4.1 2005/01/20 23:47:25 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;

View file

@ -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;

View file

@ -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

View file

@ -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;

View file

@ -1076,7 +1076,12 @@ xf86WriteMmio32Be(__volatile__ void *base, const unsigned long offset,
extern volatile unsigned char *ioBase;
# define eieio() __asm__ __volatile__ ("eieio" ::: "memory")
#if defined(linux) && defined(__powerpc64__)
# include <asm/memory.h>
#endif /* defined(linux) && defined(__powerpc64__) */
#ifndef eieio /* We deal with arch-specific eieio() routines above... */
# define eieio() __asm__ __volatile__ ("eieio" ::: "memory")
#endif /* eieio */
static __inline__ unsigned char
xf86ReadMmio8(__volatile__ void *base, const unsigned long offset)

View file

@ -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;

View file

@ -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. */
@ -1333,6 +1333,10 @@ xf86VTSwitch()
#ifdef DEBUG
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))
@ -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 */

View file

@ -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);
/*
@ -1253,6 +1254,10 @@ AbortDDX()
#ifdef HAS_USL_VTS
/* 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)
@ -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

View file

@ -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) {

View file

@ -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) ? \
@ -307,7 +304,7 @@ FindPCIVideoInfo(void)
mem64 = TRUE;
#if defined(LONG64) || defined(WORD64)
info->memBase[0] |=
(memType)PCIGETMEMORY64HIGH(pcrp->pci_base1) << 32;
(memType)PCIGETMEMORY64HIGH(pcrp->pci_base0) << 32;
#else
if (pcrp->pci_base1)
info->memBase[0] = 0;
@ -327,7 +324,7 @@ FindPCIVideoInfo(void)
mem64 = TRUE;
#if defined(LONG64) || defined(WORD64)
info->memBase[1] |=
(memType)PCIGETMEMORY64HIGH(pcrp->pci_base2) << 32;
(memType)PCIGETMEMORY64HIGH(pcrp->pci_base1) << 32;
#else
if (pcrp->pci_base2)
info->memBase[1] = 0;
@ -348,7 +345,7 @@ FindPCIVideoInfo(void)
mem64 = TRUE;
#if defined(LONG64) || defined(WORD64)
info->memBase[2] |=
(memType)PCIGETMEMORY64HIGH(pcrp->pci_base3) << 32;
(memType)PCIGETMEMORY64HIGH(pcrp->pci_base2) << 32;
#else
if (pcrp->pci_base3)
info->memBase[2] = 0;
@ -369,7 +366,7 @@ FindPCIVideoInfo(void)
mem64 = TRUE;
#if defined(LONG64) || defined(WORD64)
info->memBase[3] |=
(memType)PCIGETMEMORY64HIGH(pcrp->pci_base4) << 32;
(memType)PCIGETMEMORY64HIGH(pcrp->pci_base3) << 32;
#else
if (pcrp->pci_base4)
info->memBase[3] = 0;
@ -390,7 +387,7 @@ FindPCIVideoInfo(void)
mem64 = TRUE;
#if defined(LONG64) || defined(WORD64)
info->memBase[4] |=
(memType)PCIGETMEMORY64HIGH(pcrp->pci_base5) << 32;
(memType)PCIGETMEMORY64HIGH(pcrp->pci_base4) << 32;
#else
if (pcrp->pci_base5)
info->memBase[4] = 0;
@ -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) &&

View file

@ -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,28 @@
#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 = ((v->version > 1 || v->revision > 2) \
? (_HSIZE1(x) * 10) / 16 : _HSIZE1(x)); 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 +193,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 +224,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 +248,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 +279,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 +289,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 +325,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 +353,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 +401,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 +411,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 +419,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{

View file

@ -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;
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -1,4 +1,4 @@
Fonts in X11R6.8
Fonts in X11R6.8.2
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.2. 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.2 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.2 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.2 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.2'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.2 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.2 server can use bitmap fonts in both the cross-platform BDF for-
mat and the somewhat more efficient binary PCF format. (X11R6.8.2 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.2 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.2 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.2.)
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.2 supports the BDF, PCF, SNF, Type 1, Speedo, TrueType, OpenType and
CIDFont font formats. However, not all X11R6.8.2 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.2 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.2 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.2
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.2, 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.2 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.2 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.2 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.2 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.2.
4. More about core fonts
This section describes X11R6.8-specific enhancements to the core X11 fonts
This section describes X11R6.8.2-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.2.
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.2.
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.
@ -972,8 +974,8 @@ options are indispensable in CJKV. For example,
bw=0.5:ds=y:ai=0.2:mincho.ttc -misc-mincho-bold-i-normal--0-0-0-0-c-0-jisx0201.1976-0
setup the complete combination of jisx0208 and jisx0201 using mincho.ttc
only. More information on the TTCap syntax is found on the After X-TT Pro-
ject page <URL:http://x-tt.sourceforge.jp/>.
only. More information on the TTCap syntax is found on the After X-TT
Project page <URL:http://x-tt.sourceforge.jp/>.
The FreeType backend uses the fontenc layer in order to support recoding of
fonts; this was described in The fontenc layer (section 4.1.1, page 1) and
@ -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.2'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.2 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.2 documentation (including this
document and all manual pages) can be found from current X11R6.8.2 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.2 2005/02/08 00:44:27 kem Exp $

View file

@ -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.

View file

@ -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

View file

@ -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;

View file

@ -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)

View file

@ -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
}

View file

@ -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
}
@ -292,7 +295,7 @@ Bool SpecialKey(InputInfoPtr pInfo, int key, Bool down, int modifiers)
if ((ModifierSet(ControlMask | AltMask)) ||
(ModifierSet(ControlMask | AltLangMask))) {
if (VTSwitchEnabled && !xf86Info.vtSysreq) {
if (VTSwitchEnabled && !xf86Info.vtSysreq && !xf86Info.dontVTSwitch) {
switch (key) {
case KEY_F1:
case KEY_F2:
@ -318,7 +321,7 @@ Bool SpecialKey(InputInfoPtr pInfo, int key, Bool down, int modifiers)
}
}
#ifdef USE_VT_SYSREQ
if (VTSwitchEnabled && xf86Info.vtSysreq) {
if (VTSwitchEnabled && xf86Info.vtSysreq && !xf86Info.dontVTSwitch) {
switch (key) {
case KEY_F1:
case KEY_F2:
@ -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);
}
@ -494,6 +504,11 @@ OpenKeyboard(InputInfoPtr pInfo)
case WSKBD_TYPE_SUN:
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\"",
@ -535,4 +550,3 @@ xf86OSKbdPreInit(InputInfoPtr pInfo)
}
return TRUE;
}

View file

@ -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 */

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -273,7 +273,7 @@ void ix86PciSelectCfgmech(void)
switch (xf86Info.pciFlags) {
case PCIOsConfig:
#if ARCH_PCI_OS_INIT
#ifdef ARCH_PCI_OS_INIT
return;
#endif

View file

@ -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

View file

@ -27,6 +27,7 @@
#if defined(linux)
#include <asm/types.h>
#include <linux/fb.h>
#include <asm/fbio.h>
#include <asm/openpromio.h>
#elif defined(SVR4)

View file

@ -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 */

View file

@ -30,7 +30,7 @@
#include <X11/Xdefs.h>
Bool xf86PreScanZX1(void);
void xf86PreScanZX1(void);
void xf86PostScanZX1(void);
#endif

View file

@ -0,0 +1,45 @@
/*
* Copyright 2004, Egbert Eich
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* EGBERT EICH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON-
* NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name of Egbert Eich shall not
* be used in advertising or otherwise to promote the sale, use or other deal-
*ings in this Software without prior written authorization from Egbert Eich.
*
*/
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "ia64Pci.h"
#include "Pci.h"
#if defined OS_PROBE_PCI_CHIPSET
IA64Chipset OS_PROBE_PCI_CHIPSET(scanpciWrapperOpt flags)
{
struct stat unused;
if (!stat("/proc/bus/mckinley/zx1",&unused)
|| !stat("/proc/bus/mckinley/zx2",&unused))
return ZX1_CHIPSET;
return NONE_CHIPSET;
}
#endif

View file

@ -0,0 +1,81 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/ia64Pci.c,v 1.3 2003/02/23 20:26:49 tsi Exp $ */
/*
* Copyright (C) 2002-2003 The XFree86 Project, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name of the XFree86 Project shall
* not be used in advertising or otherwise to promote the sale, use or other
* dealings in this Software without prior written authorization from the
* XFree86 Project.
*/
/*
* This file contains the glue needed to support various IA-64 chipsets.
*/
#include "460gxPCI.h"
#include "e8870PCI.h"
#include "zx1PCI.h"
#include "Pci.h"
#include "ia64Pci.h"
void
ia64ScanPCIWrapper(scanpciWrapperOpt flags)
{
static IA64Chipset chipset = NONE_CHIPSET;
if (flags == SCANPCI_INIT) {
/* PCI configuration space probes should be done first */
if (xorgProbe460GX(flags)) {
chipset = I460GX_CHIPSET;
xf86PreScan460GX();
return;
} else if (xorgProbeE8870(flags)) {
chipset = E8870_CHIPSET;
xf86PreScanE8870();
return;
}
#ifdef OS_PROBE_PCI_CHIPSET
chipset = OS_PROBE_PCI_CHIPSET(flags);
switch (chipset) {
case ZX1_CHIPSET:
xf86PreScanZX1();
return;
default:
return;
}
#endif
} else /* if (flags == SCANPCI_TERM) */ {
switch (chipset) {
case I460GX_CHIPSET:
xf86PostScan460GX();
return;
case E8870_CHIPSET:
xf86PostScanE8870();
return;
case ZX1_CHIPSET:
xf86PostScanZX1();
return;
default:
return;
}
}
}

View file

@ -0,0 +1,41 @@
/*
* Copyright 2004, Egbert Eich
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* EGBERT EICH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON-
* NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name of Egbert Eich shall not
* be used in advertising or otherwise to promote the sale, use or other deal-
*ings in this Software without prior written authorization from Egbert Eich.
*
*/
#ifndef _IA64_PCI_H
# define _IA64_PCI_H
#include "Pci.h"
typedef enum {
NONE_CHIPSET,
I460GX_CHIPSET,
E8870_CHIPSET,
ZX1_CHIPSET
} IA64Chipset;
# ifdef OS_PROBE_PCI_CHIPSET
extern IA64Chipset OS_PROBE_PCI_CHIPSET(scanpciWrapperOpt flags);
# endif
#endif

View file

@ -0,0 +1,144 @@
/* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, and/or sell copies of the Software, and to permit persons
* to whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
* OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
* INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Except as contained in this notice, the name of a copyright holder
* shall not be used in advertising or otherwise to promote the sale, use
* or other dealings in this Software without prior written authorization
* of the copyright holder.
*/
#ifdef INLINE_ASM
#define FUNCTION_START(f,n) .inline f,n
#define FUNCTION_END(f) .end
#else
#define _ASM
#include <sys/asm_linkage.h>
#define FUNCTION_START(f,n) ENTRY(f)
#define FUNCTION_END(f) SET_SIZE(f)
#endif
/* Converted from common/compiler.h gcc inline format to Sun cc inline
* format by Kenjiro Tsuji
*
* The value 0x88 means ASI_PRIMARY_LITTLE.
* The store or load to/from the address space will be done
* as little-endian. In the original xrog code, the value
* is defined as the macro ASI_PL.
*
* In the original xorg code, "membar #StoreStore|#StoreLoad"
* is directly implemented as an instruction "0x8143e00a".
*
*/
FUNCTION_START(outb, 0)
stba %o1, [%o0] 0x88
membar #StoreStore|#StoreLoad
FUNCTION_END(outb)
FUNCTION_START(outw, 0)
stha %o1, [%o0] 0x88
membar #StoreStore|#StoreLoad
FUNCTION_END(outw)
FUNCTION_START(outl, 0)
sta %o1, [%o0] 0x88
membar #StoreStore|#StoreLoad
FUNCTION_END(outl)
FUNCTION_START(inb, 0)
lduba [%o0] 0x88, %o0
FUNCTION_END(inb)
FUNCTION_START(inw, 0)
lduha [%o0] 0x88, %o0
FUNCTION_END(inw)
FUNCTION_START(inl, 0)
lda [%o0] 0x88, %o0
FUNCTION_END(inl)
FUNCTION_START(xf86ReadMmio8, 0)
lduba [%o0 + %o1] 0x88, %o0
FUNCTION_END(xf86ReadMmio8)
FUNCTION_START(xf86ReadMmio16Be, 0)
lduh [%o0 + %o1], %o0
FUNCTION_END(xf86ReadMmio16Be)
FUNCTION_START(xf86ReadMmio16Le, 0)
lduha [%o0 + %o1] 0x88, %o0
FUNCTION_END(xf86ReadMmio16Le)
FUNCTION_START(xf86ReadMmio32Be, 0)
ld [%o0 + %o1], %o0
FUNCTION_END(xf86ReadMmio32Be)
FUNCTION_START(xf86ReadMmio32Le, 0)
lda [%o0 + %o1] 0x88, %o0
FUNCTION_END(xf86ReadMmio32Le)
FUNCTION_START(xf86WriteMmio8, 0)
stba %o2, [%o0 + %o1] 0x88
membar #StoreStore|#StoreLoad
FUNCTION_END(xf86WriteMmio8)
FUNCTION_START(xf86WriteMmio16Be, 0)
sth %o2, [%o0 + %o1]
membar #StoreStore|#StoreLoad
FUNCTION_END(xf86WriteMmio16Be)
FUNCTION_START(xf86WriteMmio16Le, 0)
stha %o2, [%o0 + %o1] 0x88
membar #StoreStore|#StoreLoad
FUNCTION_END(xf86WriteMmio16Le)
FUNCTION_START(xf86WriteMmio32Be, 0)
st %o2, [%o0 + %o1]
membar #StoreStore|#StoreLoad
FUNCTION_END(xf86WriteMmio32Be)
FUNCTION_START(xf86WriteMmio32Le, 0)
sta %o2, [%o0 + %o1] 0x88
membar #StoreStore|#StoreLoad
FUNCTION_END(xf86WriteMmio32Le)
FUNCTION_START(xf86WriteMmio8NB, 0)
add %o0, %o1, %o0
stba %o2, [%o0] 0x88
FUNCTION_END(xf86WriteMmio8NB)
FUNCTION_START(xf86WriteMmio16BeNB, 0)
sth %o2, [%o0 + %o1]
FUNCTION_END(xf86WriteMmio16BeNB)
FUNCTION_START(xf86WriteMmio16LeNB, 0)
stha %o2, [%o0 + %o1] 0x88
FUNCTION_END(xf86WriteMmio16LeNB)
FUNCTION_START(xf86WriteMmio32BeNB, 0)
st %o2, [%o0 + %o1]
FUNCTION_END(xf86WriteMmio32BeNB)
FUNCTION_START(xf86WriteMmio32LeNB, 0)
sta %o2, [%o0 + %o1] 0x88
FUNCTION_END(xf86WriteMmio32LeNB)