2003-11-14 16:54:54 +01:00
|
|
|
/***********************************************************
|
|
|
|
|
|
|
|
Copyright 1987, 1998 The Open Group
|
|
|
|
|
|
|
|
Permission to use, copy, modify, distribute, and sell this software and its
|
|
|
|
documentation for any purpose is hereby granted without fee, provided that
|
|
|
|
the above copyright notice appear in all copies and that both that
|
|
|
|
copyright notice and this permission notice appear in supporting
|
|
|
|
documentation.
|
|
|
|
|
|
|
|
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
|
|
|
|
OPEN GROUP 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 Open Group 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 Open Group.
|
|
|
|
|
|
|
|
|
|
|
|
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
|
|
|
|
|
|
|
|
All Rights Reserved
|
|
|
|
|
|
|
|
Permission to use, copy, modify, and distribute this software and its
|
|
|
|
documentation for any purpose and without fee is hereby granted,
|
|
|
|
provided that the above copyright notice appear in all copies and that
|
|
|
|
both that copyright notice and this permission notice appear in
|
|
|
|
supporting documentation, and that the name of Digital not be
|
|
|
|
used in advertising or publicity pertaining to distribution of the
|
|
|
|
software without specific, written prior permission.
|
|
|
|
|
|
|
|
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
|
|
|
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
|
|
|
DIGITAL BE LIABLE FOR 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.
|
|
|
|
|
|
|
|
******************************************************************/
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
/* The panoramix components contained the following notice */
|
2004-04-23 21:54:30 +02:00
|
|
|
/*****************************************************************
|
|
|
|
|
|
|
|
Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
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
|
|
|
|
DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
|
|
|
|
BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL 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 Digital Equipment Corporation
|
|
|
|
shall not be used in advertising or otherwise to promote the sale, use or other
|
|
|
|
dealings in this Software without prior written authorization from Digital
|
|
|
|
Equipment Corporation.
|
|
|
|
|
|
|
|
******************************************************************/
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
#define NEED_EVENTS
|
2005-07-03 09:02:09 +02:00
|
|
|
#ifdef HAVE_DIX_CONFIG_H
|
|
|
|
#include <dix-config.h>
|
|
|
|
#endif
|
|
|
|
|
2005-04-20 14:25:48 +02:00
|
|
|
#include <X11/X.h>
|
|
|
|
#include <X11/Xos.h> /* for unistd.h */
|
|
|
|
#include <X11/Xproto.h>
|
2003-11-14 16:54:54 +01:00
|
|
|
#include "scrnintstr.h"
|
2005-07-03 10:53:54 +02:00
|
|
|
#include "misc.h"
|
|
|
|
#include "os.h"
|
2003-11-14 16:54:54 +01:00
|
|
|
#include "windowstr.h"
|
|
|
|
#include "resource.h"
|
|
|
|
#include "dixstruct.h"
|
|
|
|
#include "gcstruct.h"
|
|
|
|
#include "extension.h"
|
|
|
|
#include "colormap.h"
|
|
|
|
#include "colormapst.h"
|
|
|
|
#include "cursorstr.h"
|
2008-03-01 00:00:23 +01:00
|
|
|
#include "selection.h"
|
2005-07-03 09:02:09 +02:00
|
|
|
#include <X11/fonts/font.h>
|
2003-11-14 16:54:54 +01:00
|
|
|
#include "opaque.h"
|
|
|
|
#include "servermd.h"
|
2006-12-06 22:21:15 +01:00
|
|
|
#include "hotplug.h"
|
2003-11-14 16:54:54 +01:00
|
|
|
#include "site.h"
|
|
|
|
#include "dixfont.h"
|
2003-11-14 17:49:22 +01:00
|
|
|
#include "extnsionst.h"
|
2007-04-04 21:59:51 +02:00
|
|
|
#include "privates.h"
|
2007-10-11 20:17:17 +02:00
|
|
|
#include "registry.h"
|
2003-11-14 17:49:22 +01:00
|
|
|
#ifdef PANORAMIX
|
|
|
|
#include "panoramiXsrv.h"
|
|
|
|
#else
|
|
|
|
#include "dixevents.h" /* InitEvents() */
|
|
|
|
#include "dispatch.h" /* InitProcVectors() */
|
|
|
|
#endif
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
#ifdef DPMSExtension
|
2003-11-14 17:49:22 +01:00
|
|
|
#define DPMS_SERVER
|
2005-04-20 14:25:48 +02:00
|
|
|
#include <X11/extensions/dpms.h>
|
2003-11-14 17:49:22 +01:00
|
|
|
#include "dpmsproc.h"
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
|
2005-03-08 00:02:59 +01:00
|
|
|
extern void Dispatch(void);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
xConnSetupPrefix connSetupPrefix;
|
|
|
|
|
|
|
|
extern FontPtr defaultFont;
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
extern void InitProcVectors(void);
|
|
|
|
extern Bool CreateGCperDepthArray(void);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
#ifndef PANORAMIX
|
|
|
|
static
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
2003-11-14 17:49:22 +01:00
|
|
|
Bool CreateConnectionBlock(void);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
PaddingInfo PixmapWidthPaddingInfo[33];
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
int connBlockScreenStart;
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-14 17:49:22 +01:00
|
|
|
NotImplemented(xEvent *from, xEvent *to)
|
|
|
|
{
|
|
|
|
FatalError("Not implemented");
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Dummy entry for ReplySwapVector[]
|
|
|
|
*/
|
2005-03-08 00:02:59 +01:00
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-14 17:49:22 +01:00
|
|
|
ReplyNotSwappd(
|
|
|
|
ClientPtr pClient ,
|
|
|
|
int size ,
|
|
|
|
void * pbuf
|
|
|
|
)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
FatalError("Not implemented");
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This array encodes the answer to the question "what is the log base 2
|
|
|
|
* of the number of pixels that fit in a scanline pad unit?"
|
|
|
|
* Note that ~0 is an invalid entry (mostly for the benefit of the reader).
|
|
|
|
*/
|
|
|
|
static int answer[6][4] = {
|
|
|
|
/* pad pad pad pad*/
|
|
|
|
/* 8 16 32 64 */
|
|
|
|
|
|
|
|
{ 3, 4, 5 , 6 }, /* 1 bit per pixel */
|
|
|
|
{ 1, 2, 3 , 4 }, /* 4 bits per pixel */
|
|
|
|
{ 0, 1, 2 , 3 }, /* 8 bits per pixel */
|
|
|
|
{ ~0, 0, 1 , 2 }, /* 16 bits per pixel */
|
|
|
|
{ ~0, ~0, 0 , 1 }, /* 24 bits per pixel */
|
|
|
|
{ ~0, ~0, 0 , 1 } /* 32 bits per pixel */
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This array gives the answer to the question "what is the first index for
|
|
|
|
* the answer array above given the number of bits per pixel?"
|
|
|
|
* Note that ~0 is an invalid entry (mostly for the benefit of the reader).
|
|
|
|
*/
|
|
|
|
static int indexForBitsPerPixel[ 33 ] = {
|
|
|
|
~0, 0, ~0, ~0, /* 1 bit per pixel */
|
|
|
|
1, ~0, ~0, ~0, /* 4 bits per pixel */
|
|
|
|
2, ~0, ~0, ~0, /* 8 bits per pixel */
|
|
|
|
~0,~0, ~0, ~0,
|
|
|
|
3, ~0, ~0, ~0, /* 16 bits per pixel */
|
|
|
|
~0,~0, ~0, ~0,
|
|
|
|
4, ~0, ~0, ~0, /* 24 bits per pixel */
|
|
|
|
~0,~0, ~0, ~0,
|
|
|
|
5 /* 32 bits per pixel */
|
|
|
|
};
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
/*
|
|
|
|
* This array gives the bytesperPixel value for cases where the number
|
|
|
|
* of bits per pixel is a multiple of 8 but not a power of 2.
|
|
|
|
*/
|
|
|
|
static int answerBytesPerPixel[ 33 ] = {
|
|
|
|
~0, 0, ~0, ~0, /* 1 bit per pixel */
|
|
|
|
0, ~0, ~0, ~0, /* 4 bits per pixel */
|
|
|
|
0, ~0, ~0, ~0, /* 8 bits per pixel */
|
|
|
|
~0,~0, ~0, ~0,
|
|
|
|
0, ~0, ~0, ~0, /* 16 bits per pixel */
|
|
|
|
~0,~0, ~0, ~0,
|
|
|
|
3, ~0, ~0, ~0, /* 24 bits per pixel */
|
|
|
|
~0,~0, ~0, ~0,
|
|
|
|
0 /* 32 bits per pixel */
|
|
|
|
};
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
/*
|
|
|
|
* This array gives the answer to the question "what is the second index for
|
|
|
|
* the answer array above given the number of bits per scanline pad unit?"
|
|
|
|
* Note that ~0 is an invalid entry (mostly for the benefit of the reader).
|
|
|
|
*/
|
|
|
|
static int indexForScanlinePad[ 65 ] = {
|
|
|
|
~0, ~0, ~0, ~0,
|
|
|
|
~0, ~0, ~0, ~0,
|
|
|
|
0, ~0, ~0, ~0, /* 8 bits per scanline pad unit */
|
|
|
|
~0, ~0, ~0, ~0,
|
|
|
|
1, ~0, ~0, ~0, /* 16 bits per scanline pad unit */
|
|
|
|
~0, ~0, ~0, ~0,
|
|
|
|
~0, ~0, ~0, ~0,
|
|
|
|
~0, ~0, ~0, ~0,
|
|
|
|
2, ~0, ~0, ~0, /* 32 bits per scanline pad unit */
|
|
|
|
~0, ~0, ~0, ~0,
|
|
|
|
~0, ~0, ~0, ~0,
|
|
|
|
~0, ~0, ~0, ~0,
|
|
|
|
~0, ~0, ~0, ~0,
|
|
|
|
~0, ~0, ~0, ~0,
|
|
|
|
~0, ~0, ~0, ~0,
|
|
|
|
~0, ~0, ~0, ~0,
|
|
|
|
3 /* 64 bits per scanline pad unit */
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef MIN
|
|
|
|
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
|
|
|
|
#endif
|
|
|
|
|
2008-04-27 04:21:05 +02:00
|
|
|
#ifdef XQUARTZ
|
|
|
|
int dix_main(int argc, char *argv[], char *envp[])
|
|
|
|
#else
|
|
|
|
int main(int argc, char *argv[], char *envp[])
|
2007-12-20 22:17:30 +01:00
|
|
|
#endif
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2008-07-18 14:38:10 +02:00
|
|
|
int i;
|
2003-11-14 16:54:54 +01:00
|
|
|
HWEventQueueType alwaysCheckForInput[2];
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
display = "0";
|
|
|
|
|
2007-05-12 23:41:47 +02:00
|
|
|
InitRegions();
|
2004-04-23 21:54:30 +02:00
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
CheckUserParameters(argc, argv, envp);
|
|
|
|
|
|
|
|
CheckUserAuthorization();
|
|
|
|
|
|
|
|
InitConnectionLimits();
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
ProcessCommandLine(argc, argv);
|
|
|
|
|
|
|
|
alwaysCheckForInput[0] = 0;
|
|
|
|
alwaysCheckForInput[1] = 1;
|
|
|
|
while(1)
|
|
|
|
{
|
|
|
|
serverGeneration++;
|
2003-11-14 17:49:22 +01:00
|
|
|
ScreenSaverTime = defaultScreenSaverTime;
|
2003-11-14 16:54:54 +01:00
|
|
|
ScreenSaverInterval = defaultScreenSaverInterval;
|
|
|
|
ScreenSaverBlanking = defaultScreenSaverBlanking;
|
|
|
|
ScreenSaverAllowExposures = defaultScreenSaverAllowExposures;
|
2003-11-14 17:49:22 +01:00
|
|
|
#ifdef DPMSExtension
|
|
|
|
DPMSStandbyTime = defaultDPMSStandbyTime;
|
|
|
|
DPMSSuspendTime = defaultDPMSSuspendTime;
|
|
|
|
DPMSOffTime = defaultDPMSOffTime;
|
|
|
|
DPMSEnabled = defaultDPMSEnabled;
|
|
|
|
DPMSPowerLevel = 0;
|
|
|
|
#endif
|
2003-11-14 16:54:54 +01:00
|
|
|
InitBlockAndWakeupHandlers();
|
|
|
|
/* Perform any operating system dependent initializations you'd like */
|
2006-12-06 22:21:15 +01:00
|
|
|
OsInit();
|
2007-07-08 13:28:58 +02:00
|
|
|
config_init();
|
2003-11-14 16:54:54 +01:00
|
|
|
if(serverGeneration == 1)
|
|
|
|
{
|
|
|
|
CreateWellKnownSockets();
|
|
|
|
InitProcVectors();
|
2008-08-04 22:26:00 +02:00
|
|
|
for (i=1; i<MAXCLIENTS; i++)
|
2003-11-14 16:54:54 +01:00
|
|
|
clients[i] = NullClient;
|
|
|
|
serverClient = (ClientPtr)xalloc(sizeof(ClientRec));
|
|
|
|
if (!serverClient)
|
|
|
|
FatalError("couldn't create server client");
|
|
|
|
InitClient(serverClient, 0, (pointer)NULL);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
ResetWellKnownSockets ();
|
2003-11-25 20:29:01 +01:00
|
|
|
clients[0] = serverClient;
|
|
|
|
currentMaxClients = 1;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
if (!InitClientResources(serverClient)) /* for root resources */
|
|
|
|
FatalError("couldn't init server resources");
|
|
|
|
|
|
|
|
SetInputCheck(&alwaysCheckForInput[0], &alwaysCheckForInput[1]);
|
|
|
|
screenInfo.arraySize = MAXSCREENS;
|
|
|
|
screenInfo.numScreens = 0;
|
|
|
|
|
|
|
|
InitAtoms();
|
|
|
|
InitEvents();
|
2008-03-01 00:00:23 +01:00
|
|
|
InitSelections();
|
2003-11-14 16:54:54 +01:00
|
|
|
InitGlyphCaching();
|
2007-03-01 21:00:02 +01:00
|
|
|
if (!dixResetPrivates())
|
|
|
|
FatalError("couldn't init private data storage");
|
2007-10-11 20:17:17 +02:00
|
|
|
dixResetRegistry();
|
2003-11-14 16:54:54 +01:00
|
|
|
ResetFontPrivateIndex();
|
|
|
|
InitCallbackManager();
|
|
|
|
InitOutput(&screenInfo, argc, argv);
|
2005-03-23 20:58:45 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
if (screenInfo.numScreens < 1)
|
|
|
|
FatalError("no screens found");
|
|
|
|
InitExtensions(argc, argv);
|
|
|
|
for (i = 0; i < screenInfo.numScreens; i++)
|
|
|
|
{
|
|
|
|
ScreenPtr pScreen = screenInfo.screens[i];
|
|
|
|
if (!CreateScratchPixmapsForScreen(i))
|
|
|
|
FatalError("failed to create scratch pixmaps");
|
|
|
|
if (pScreen->CreateScreenResources &&
|
|
|
|
!(*pScreen->CreateScreenResources)(pScreen))
|
|
|
|
FatalError("failed to create screen resources");
|
|
|
|
if (!CreateGCperDepth(i))
|
|
|
|
FatalError("failed to create scratch GCs");
|
|
|
|
if (!CreateDefaultStipple(i))
|
|
|
|
FatalError("failed to create default stipple");
|
|
|
|
if (!CreateRootWindow(pScreen))
|
|
|
|
FatalError("failed to create root window");
|
|
|
|
}
|
|
|
|
|
|
|
|
InitFonts();
|
2008-05-14 22:02:05 +02:00
|
|
|
if (SetDefaultFontPath(defaultFontPath) != Success) {
|
2008-05-20 02:50:14 +02:00
|
|
|
ErrorF("[dix] failed to set default font path '%s'", defaultFontPath);
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
2006-11-18 20:55:42 +01:00
|
|
|
if (!SetDefaultFont(defaultTextFont)) {
|
2003-11-14 16:54:54 +01:00
|
|
|
FatalError("could not open default font '%s'", defaultTextFont);
|
2006-11-18 20:55:42 +01:00
|
|
|
}
|
2007-07-08 13:31:35 +02:00
|
|
|
|
2007-07-08 19:48:57 +02:00
|
|
|
if (!(rootCursor = CreateRootCursor(NULL, 0))) {
|
2003-11-14 16:54:54 +01:00
|
|
|
FatalError("could not open default cursor font '%s'",
|
|
|
|
defaultCursorFont);
|
2006-11-18 20:55:42 +01:00
|
|
|
}
|
2007-07-08 13:31:35 +02:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
#ifdef DPMSExtension
|
|
|
|
/* check all screens, looking for DPMS Capabilities */
|
|
|
|
DPMSCapableFlag = DPMSSupported();
|
|
|
|
if (!DPMSCapableFlag)
|
|
|
|
DPMSEnabled = FALSE;
|
|
|
|
#endif
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
#ifdef PANORAMIX
|
|
|
|
/*
|
|
|
|
* Consolidate window and colourmap information for each screen
|
|
|
|
*/
|
|
|
|
if (!noPanoramiXExtension)
|
|
|
|
PanoramiXConsolidate();
|
|
|
|
#endif
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
for (i = 0; i < screenInfo.numScreens; i++)
|
|
|
|
InitRootWindow(WindowTable[i]);
|
2003-11-25 20:29:01 +01:00
|
|
|
DefineInitialRootWindow(WindowTable[0]);
|
2007-05-01 08:19:41 +02:00
|
|
|
|
|
|
|
InitCoreDevices();
|
|
|
|
InitInput(argc, argv);
|
2008-11-21 03:39:55 +01:00
|
|
|
InitAndStartDevices();
|
2007-05-01 08:19:41 +02:00
|
|
|
|
2007-11-19 22:55:09 +01:00
|
|
|
dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
#ifdef PANORAMIX
|
|
|
|
if (!noPanoramiXExtension) {
|
2006-11-18 20:55:42 +01:00
|
|
|
if (!PanoramiXCreateConnectionBlock()) {
|
2003-11-14 17:49:22 +01:00
|
|
|
FatalError("could not create connection block info");
|
2006-11-18 20:55:42 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
} else
|
|
|
|
#endif
|
|
|
|
{
|
2006-11-18 20:55:42 +01:00
|
|
|
if (!CreateConnectionBlock()) {
|
2003-11-14 17:49:22 +01:00
|
|
|
FatalError("could not create connection block info");
|
2006-11-18 20:55:42 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2007-11-01 20:41:11 +01:00
|
|
|
NotifyParentProcess();
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
Dispatch();
|
|
|
|
|
2007-04-09 12:01:59 +02:00
|
|
|
UndisplayDevices();
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
/* Now free up whatever must be freed */
|
|
|
|
if (screenIsSaved == SCREEN_SAVER_ON)
|
2007-11-19 22:55:09 +01:00
|
|
|
dixSaveScreens(serverClient, SCREEN_SAVER_OFF, ScreenSaverReset);
|
2003-11-25 20:29:01 +01:00
|
|
|
FreeScreenSaverTimer();
|
2003-11-14 16:54:54 +01:00
|
|
|
CloseDownExtensions();
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
#ifdef PANORAMIX
|
|
|
|
{
|
|
|
|
Bool remember_it = noPanoramiXExtension;
|
|
|
|
noPanoramiXExtension = TRUE;
|
|
|
|
FreeAllResources();
|
|
|
|
noPanoramiXExtension = remember_it;
|
|
|
|
}
|
|
|
|
#else
|
2003-11-14 16:54:54 +01:00
|
|
|
FreeAllResources();
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
|
2007-07-08 13:28:58 +02:00
|
|
|
config_fini();
|
2008-04-24 05:59:46 +02:00
|
|
|
|
2008-08-04 22:06:08 +02:00
|
|
|
memset(WindowTable, 0, sizeof(WindowTable));
|
2003-11-14 16:54:54 +01:00
|
|
|
CloseDownDevices();
|
2008-06-25 05:53:09 +02:00
|
|
|
CloseDownEvents();
|
2008-04-24 05:59:46 +02:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
for (i = screenInfo.numScreens - 1; i >= 0; i--)
|
|
|
|
{
|
|
|
|
FreeScratchPixmapsForScreen(i);
|
|
|
|
FreeGCperDepth(i);
|
|
|
|
FreeDefaultStipple(i);
|
|
|
|
(* screenInfo.screens[i]->CloseScreen)(i, screenInfo.screens[i]);
|
2007-08-28 15:28:25 +02:00
|
|
|
dixFreePrivates(screenInfo.screens[i]->devPrivates);
|
|
|
|
xfree(screenInfo.screens[i]);
|
2003-11-14 16:54:54 +01:00
|
|
|
screenInfo.numScreens = i;
|
|
|
|
}
|
2003-11-25 20:29:01 +01:00
|
|
|
FreeFonts();
|
|
|
|
|
|
|
|
FreeAuditTimer();
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2007-08-28 15:28:25 +02:00
|
|
|
dixFreePrivates(serverClient->devPrivates);
|
2003-11-14 17:49:22 +01:00
|
|
|
serverClient->devPrivates = NULL;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
if (dispatchException & DE_TERMINATE)
|
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
CloseWellKnownConnections();
|
2003-11-25 20:29:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
OsCleanup((dispatchException & DE_TERMINATE) != 0);
|
|
|
|
|
|
|
|
if (dispatchException & DE_TERMINATE)
|
|
|
|
{
|
2003-11-14 16:54:54 +01:00
|
|
|
ddxGiveUp();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
xfree(ConnectionInfo);
|
2003-11-14 17:49:22 +01:00
|
|
|
ConnectionInfo = NULL;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
2004-06-30 22:06:56 +02:00
|
|
|
static int VendorRelease = VENDOR_RELEASE;
|
2007-09-05 21:34:29 +02:00
|
|
|
static char *VendorString = VENDOR_NAME;
|
2004-06-30 22:06:56 +02:00
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2004-06-30 22:06:56 +02:00
|
|
|
SetVendorRelease(int release)
|
|
|
|
{
|
|
|
|
VendorRelease = release;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2004-06-30 22:06:56 +02:00
|
|
|
SetVendorString(char *string)
|
|
|
|
{
|
|
|
|
VendorString = string;
|
|
|
|
}
|
|
|
|
|
2008-10-03 21:47:50 +02:00
|
|
|
static const int padlength[4] = {0, 3, 2, 1};
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
#ifndef PANORAMIX
|
|
|
|
static
|
|
|
|
#endif
|
|
|
|
Bool
|
2007-04-09 23:33:15 +02:00
|
|
|
CreateConnectionBlock(void)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
xConnSetup setup;
|
|
|
|
xWindowRoot root;
|
|
|
|
xDepth depth;
|
|
|
|
xVisualType visual;
|
|
|
|
xPixmapFormat format;
|
|
|
|
unsigned long vid;
|
|
|
|
int i, j, k,
|
|
|
|
lenofblock,
|
|
|
|
sizesofar = 0;
|
|
|
|
char *pBuf;
|
|
|
|
|
|
|
|
|
|
|
|
/* Leave off the ridBase and ridMask, these must be sent with
|
|
|
|
connection */
|
|
|
|
|
2004-06-30 22:06:56 +02:00
|
|
|
setup.release = VendorRelease;
|
2003-11-14 16:54:54 +01:00
|
|
|
/*
|
|
|
|
* per-server image and bitmap parameters are defined in Xmd.h
|
|
|
|
*/
|
|
|
|
setup.imageByteOrder = screenInfo.imageByteOrder;
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
setup.bitmapScanlineUnit = screenInfo.bitmapScanlineUnit;
|
|
|
|
setup.bitmapScanlinePad = screenInfo.bitmapScanlinePad;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
setup.bitmapBitOrder = screenInfo.bitmapBitOrder;
|
|
|
|
setup.motionBufferSize = NumMotionEvents();
|
|
|
|
setup.numRoots = screenInfo.numScreens;
|
2004-06-30 22:06:56 +02:00
|
|
|
setup.nbytesVendor = strlen(VendorString);
|
2003-11-14 16:54:54 +01:00
|
|
|
setup.numFormats = screenInfo.numPixmapFormats;
|
|
|
|
setup.maxRequestSize = MAX_REQUEST_SIZE;
|
|
|
|
QueryMinMaxKeyCodes(&setup.minKeyCode, &setup.maxKeyCode);
|
|
|
|
|
|
|
|
lenofblock = sizeof(xConnSetup) +
|
|
|
|
((setup.nbytesVendor + 3) & ~3) +
|
|
|
|
(setup.numFormats * sizeof(xPixmapFormat)) +
|
|
|
|
(setup.numRoots * sizeof(xWindowRoot));
|
|
|
|
ConnectionInfo = (char *) xalloc(lenofblock);
|
|
|
|
if (!ConnectionInfo)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
memmove(ConnectionInfo, (char *)&setup, sizeof(xConnSetup));
|
|
|
|
sizesofar = sizeof(xConnSetup);
|
|
|
|
pBuf = ConnectionInfo + sizeof(xConnSetup);
|
|
|
|
|
2004-06-30 22:06:56 +02:00
|
|
|
memmove(pBuf, VendorString, (int)setup.nbytesVendor);
|
2003-11-14 16:54:54 +01:00
|
|
|
sizesofar += setup.nbytesVendor;
|
|
|
|
pBuf += setup.nbytesVendor;
|
|
|
|
i = padlength[setup.nbytesVendor & 3];
|
|
|
|
sizesofar += i;
|
|
|
|
while (--i >= 0)
|
2003-11-25 20:29:01 +01:00
|
|
|
*pBuf++ = 0;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
for (i=0; i<screenInfo.numPixmapFormats; i++)
|
|
|
|
{
|
|
|
|
format.depth = screenInfo.formats[i].depth;
|
|
|
|
format.bitsPerPixel = screenInfo.formats[i].bitsPerPixel;
|
2003-11-14 17:49:22 +01:00
|
|
|
format.scanLinePad = screenInfo.formats[i].scanlinePad;
|
2003-11-14 16:54:54 +01:00
|
|
|
memmove(pBuf, (char *)&format, sizeof(xPixmapFormat));
|
|
|
|
pBuf += sizeof(xPixmapFormat);
|
|
|
|
sizesofar += sizeof(xPixmapFormat);
|
|
|
|
}
|
|
|
|
|
|
|
|
connBlockScreenStart = sizesofar;
|
|
|
|
for (i=0; i<screenInfo.numScreens; i++)
|
|
|
|
{
|
|
|
|
ScreenPtr pScreen;
|
|
|
|
DepthPtr pDepth;
|
|
|
|
VisualPtr pVisual;
|
|
|
|
|
|
|
|
pScreen = screenInfo.screens[i];
|
|
|
|
root.windowId = WindowTable[i]->drawable.id;
|
|
|
|
root.defaultColormap = pScreen->defColormap;
|
|
|
|
root.whitePixel = pScreen->whitePixel;
|
|
|
|
root.blackPixel = pScreen->blackPixel;
|
|
|
|
root.currentInputMask = 0; /* filled in when sent */
|
|
|
|
root.pixWidth = pScreen->width;
|
|
|
|
root.pixHeight = pScreen->height;
|
|
|
|
root.mmWidth = pScreen->mmWidth;
|
|
|
|
root.mmHeight = pScreen->mmHeight;
|
|
|
|
root.minInstalledMaps = pScreen->minInstalledCmaps;
|
|
|
|
root.maxInstalledMaps = pScreen->maxInstalledCmaps;
|
|
|
|
root.rootVisualID = pScreen->rootVisual;
|
|
|
|
root.backingStore = pScreen->backingStoreSupport;
|
2008-08-13 23:28:08 +02:00
|
|
|
root.saveUnders = FALSE;
|
2003-11-14 16:54:54 +01:00
|
|
|
root.rootDepth = pScreen->rootDepth;
|
|
|
|
root.nDepths = pScreen->numDepths;
|
|
|
|
memmove(pBuf, (char *)&root, sizeof(xWindowRoot));
|
|
|
|
sizesofar += sizeof(xWindowRoot);
|
|
|
|
pBuf += sizeof(xWindowRoot);
|
|
|
|
|
|
|
|
pDepth = pScreen->allowedDepths;
|
|
|
|
for(j = 0; j < pScreen->numDepths; j++, pDepth++)
|
|
|
|
{
|
|
|
|
lenofblock += sizeof(xDepth) +
|
|
|
|
(pDepth->numVids * sizeof(xVisualType));
|
|
|
|
pBuf = (char *)xrealloc(ConnectionInfo, lenofblock);
|
|
|
|
if (!pBuf)
|
|
|
|
{
|
|
|
|
xfree(ConnectionInfo);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
ConnectionInfo = pBuf;
|
|
|
|
pBuf += sizesofar;
|
|
|
|
depth.depth = pDepth->depth;
|
|
|
|
depth.nVisuals = pDepth->numVids;
|
|
|
|
memmove(pBuf, (char *)&depth, sizeof(xDepth));
|
|
|
|
pBuf += sizeof(xDepth);
|
|
|
|
sizesofar += sizeof(xDepth);
|
|
|
|
for(k = 0; k < pDepth->numVids; k++)
|
|
|
|
{
|
|
|
|
vid = pDepth->vids[k];
|
|
|
|
for (pVisual = pScreen->visuals;
|
|
|
|
pVisual->vid != vid;
|
|
|
|
pVisual++)
|
|
|
|
;
|
|
|
|
visual.visualID = vid;
|
|
|
|
visual.class = pVisual->class;
|
|
|
|
visual.bitsPerRGB = pVisual->bitsPerRGBValue;
|
|
|
|
visual.colormapEntries = pVisual->ColormapEntries;
|
|
|
|
visual.redMask = pVisual->redMask;
|
|
|
|
visual.greenMask = pVisual->greenMask;
|
|
|
|
visual.blueMask = pVisual->blueMask;
|
|
|
|
memmove(pBuf, (char *)&visual, sizeof(xVisualType));
|
|
|
|
pBuf += sizeof(xVisualType);
|
|
|
|
sizesofar += sizeof(xVisualType);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
connSetupPrefix.success = xTrue;
|
|
|
|
connSetupPrefix.length = lenofblock/4;
|
|
|
|
connSetupPrefix.majorVersion = X_PROTOCOL;
|
|
|
|
connSetupPrefix.minorVersion = X_PROTOCOL_REVISION;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
grow the array of screenRecs if necessary.
|
|
|
|
call the device-supplied initialization procedure
|
|
|
|
with its screen number, a pointer to its ScreenRec, argc, and argv.
|
|
|
|
return the number of successfully installed screens.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int
|
2003-11-14 17:49:22 +01:00
|
|
|
AddScreen(
|
|
|
|
Bool (* pfnInit)(
|
|
|
|
int /*index*/,
|
|
|
|
ScreenPtr /*pScreen*/,
|
|
|
|
int /*argc*/,
|
|
|
|
char ** /*argv*/
|
|
|
|
),
|
|
|
|
int argc,
|
|
|
|
char **argv)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
int i;
|
|
|
|
int scanlinepad, format, depth, bitsPerPixel, j, k;
|
|
|
|
ScreenPtr pScreen;
|
|
|
|
|
|
|
|
i = screenInfo.numScreens;
|
|
|
|
if (i == MAXSCREENS)
|
|
|
|
return -1;
|
|
|
|
|
2004-09-19 01:18:35 +02:00
|
|
|
pScreen = (ScreenPtr) xcalloc(1, sizeof(ScreenRec));
|
2003-11-14 16:54:54 +01:00
|
|
|
if (!pScreen)
|
|
|
|
return -1;
|
|
|
|
|
2007-08-28 15:28:25 +02:00
|
|
|
pScreen->devPrivates = NULL;
|
2003-11-14 16:54:54 +01:00
|
|
|
pScreen->myNum = i;
|
2003-11-14 17:49:22 +01:00
|
|
|
pScreen->totalPixmapSize = BitmapBytePad(sizeof(PixmapRec)*8);
|
|
|
|
pScreen->ClipNotify = 0; /* for R4 ddx compatibility */
|
|
|
|
pScreen->CreateScreenResources = 0;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* This loop gets run once for every Screen that gets added,
|
|
|
|
* but thats ok. If the ddx layer initializes the formats
|
|
|
|
* one at a time calling AddScreen() after each, then each
|
|
|
|
* iteration will make it a little more accurate. Worst case
|
|
|
|
* we do this loop N * numPixmapFormats where N is # of screens.
|
|
|
|
* Anyway, this must be called after InitOutput and before the
|
|
|
|
* screen init routine is called.
|
|
|
|
*/
|
|
|
|
for (format=0; format<screenInfo.numPixmapFormats; format++)
|
|
|
|
{
|
|
|
|
depth = screenInfo.formats[format].depth;
|
|
|
|
bitsPerPixel = screenInfo.formats[format].bitsPerPixel;
|
|
|
|
scanlinepad = screenInfo.formats[format].scanlinePad;
|
|
|
|
j = indexForBitsPerPixel[ bitsPerPixel ];
|
|
|
|
k = indexForScanlinePad[ scanlinepad ];
|
|
|
|
PixmapWidthPaddingInfo[ depth ].padPixelsLog2 = answer[j][k];
|
|
|
|
PixmapWidthPaddingInfo[ depth ].padRoundUp =
|
|
|
|
(scanlinepad/bitsPerPixel) - 1;
|
|
|
|
j = indexForBitsPerPixel[ 8 ]; /* bits per byte */
|
|
|
|
PixmapWidthPaddingInfo[ depth ].padBytesLog2 = answer[j][k];
|
2003-11-14 17:49:22 +01:00
|
|
|
PixmapWidthPaddingInfo[ depth ].bitsPerPixel = bitsPerPixel;
|
|
|
|
if (answerBytesPerPixel[bitsPerPixel])
|
|
|
|
{
|
|
|
|
PixmapWidthPaddingInfo[ depth ].notPower2 = 1;
|
|
|
|
PixmapWidthPaddingInfo[ depth ].bytesPerPixel =
|
|
|
|
answerBytesPerPixel[bitsPerPixel];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
PixmapWidthPaddingInfo[ depth ].notPower2 = 0;
|
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* This is where screen specific stuff gets initialized. Load the
|
|
|
|
screen structure, call the hardware, whatever.
|
|
|
|
This is also where the default colormap should be allocated and
|
|
|
|
also pixel values for blackPixel, whitePixel, and the cursor
|
|
|
|
Note that InitScreen is NOT allowed to modify argc, argv, or
|
|
|
|
any of the strings pointed to by argv. They may be passed to
|
|
|
|
multiple screens.
|
|
|
|
*/
|
|
|
|
pScreen->rgf = ~0L; /* there are no scratch GCs yet*/
|
|
|
|
WindowTable[i] = NullWindow;
|
|
|
|
screenInfo.screens[i] = pScreen;
|
|
|
|
screenInfo.numScreens++;
|
|
|
|
if (!(*pfnInit)(i, pScreen, argc, argv))
|
|
|
|
{
|
2007-08-28 15:28:25 +02:00
|
|
|
dixFreePrivates(pScreen->devPrivates);
|
|
|
|
xfree(pScreen);
|
2003-11-14 16:54:54 +01:00
|
|
|
screenInfo.numScreens--;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
return i;
|
|
|
|
}
|