aboutsummaryrefslogtreecommitdiff
path: root/xorg-server
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server')
-rw-r--r--xorg-server/Xi/xiproperty.c2
-rw-r--r--xorg-server/dix/main.c774
-rw-r--r--xorg-server/exa/exa.c30
-rw-r--r--xorg-server/exa/exa_mixed.c42
-rw-r--r--xorg-server/exa/exa_priv.h1
-rw-r--r--xorg-server/fb/fb.h71
-rw-r--r--xorg-server/fb/fbpict.c169
-rw-r--r--xorg-server/fb/fbtrap.c6
-rw-r--r--xorg-server/hw/xfree86/common/xf86Configure.c1
-rw-r--r--xorg-server/hw/xquartz/mach-startup/stub.c3
-rw-r--r--xorg-server/hw/xquartz/pbproxy/Makefile.am3
-rw-r--r--xorg-server/miext/rootless/rootlessScreen.c2
-rw-r--r--xorg-server/os/backtrace.c4
-rw-r--r--xorg-server/record/set.c11
-rw-r--r--xorg-server/xkb/xkb.c12
-rw-r--r--xorg-server/xkb/xkbLEDs.c12
16 files changed, 574 insertions, 569 deletions
diff --git a/xorg-server/Xi/xiproperty.c b/xorg-server/Xi/xiproperty.c
index ecb326ee3..ea66c54c6 100644
--- a/xorg-server/Xi/xiproperty.c
+++ b/xorg-server/Xi/xiproperty.c
@@ -622,6 +622,8 @@ XIDeleteAllDeviceProperties (DeviceIntPtr device)
XIDestroyDeviceProperty(prop);
}
+ device->properties.properties = NULL;
+
/* Now free all handlers */
curr_handler = device->properties.handlers;
while(curr_handler)
diff --git a/xorg-server/dix/main.c b/xorg-server/dix/main.c
index fa65a4051..644f05b25 100644
--- a/xorg-server/dix/main.c
+++ b/xorg-server/dix/main.c
@@ -1,386 +1,388 @@
-/***********************************************************
-
-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.
-
-******************************************************************/
-
-/* The panoramix components contained the following notice */
-/*****************************************************************
-
-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.
-
-******************************************************************/
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#include <version-config.h>
-#endif
-
-#include <X11/X.h>
-#include <X11/Xos.h> /* for unistd.h */
-#include <X11/Xproto.h>
-#include <pixman.h>
-#include "scrnintstr.h"
-#include "misc.h"
-#include "os.h"
-#include "windowstr.h"
-#include "resource.h"
-#include "dixstruct.h"
-#include "gcstruct.h"
-#include "extension.h"
-#include "colormap.h"
-#include "colormapst.h"
-#include "cursorstr.h"
-#include "selection.h"
-#include <X11/fonts/font.h>
-#include "opaque.h"
-#include "servermd.h"
-#include "hotplug.h"
-#include "site.h"
-#include "dixfont.h"
-#include "extnsionst.h"
-#include "privates.h"
-#include "registry.h"
-#ifdef PANORAMIX
-#include "panoramiXsrv.h"
-#else
-#include "dixevents.h" /* InitEvents() */
-#include "dispatch.h" /* InitProcVectors() */
-#endif
-
-#ifdef DPMSExtension
-#include <X11/extensions/dpmsconst.h>
-#include "dpmsproc.h"
-#endif
-
-#ifdef _DEBUG
-#include <crtdbg.h>
-#endif
-
-extern void Dispatch(void);
-
-extern void InitProcVectors(void);
-
-#ifdef XQUARTZ
-#include <pthread.h>
-
-BOOL serverInitComplete = FALSE;
-pthread_mutex_t serverInitCompleteMutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_cond_t serverInitCompleteCond = PTHREAD_COND_INITIALIZER;
-
-int dix_main(int argc, char *argv[], char *envp[])
-#else
-int main(int argc, char *argv[], char *envp[])
-#endif
-{
- int i;
- HWEventQueueType alwaysCheckForInput[2];
- #ifdef _DEBUG
- //int TmpFlag=_CrtSetDbgFlag( _CRTDBG_REPORT_FLAG);
-
- //TmpFlag|=_CRTDBG_ALLOC_MEM_DF;
- //TmpFlag|=_CRTDBG_DELAY_FREE_MEM_DF;
- //TmpFlag|=_CRTDBG_CHECK_ALWAYS_DF;
- //TmpFlag|=_CRTDBG_CHECK_CRT_DF;
- //TmpFlag|=_CRTDBG_LEAK_CHECK_DF;
-
- //_CrtSetDbgFlag(TmpFlag);
- #endif
-
- ptw32_processInitialize();
- display = "0";
-
- #ifdef WIN32
- /* In Win32 we have different threads call Xlib functions (depending
- on the commandline options given).
- XInitThreads has to be called before
- any xlib function is called (aoccording to the man page) */
- XInitThreads();
- /* change the current directory to the directory where the vcxsrv.exe executable is installed.
- This is needed because the font directories are relative to the current directory.
- */
- {
- char ModuleFilename[MAX_PATH];
- char *pSlash;
- GetModuleFileName(NULL,ModuleFilename,sizeof(ModuleFilename));
- pSlash=strrchr(ModuleFilename,'\\');
- if (pSlash)
- {
- *pSlash='\0';
- chdir(ModuleFilename);
- }
- }
- #endif
-
- InitRegions();
-
- pixman_disable_out_of_bounds_workaround();
-
- CheckUserParameters(argc, argv, envp);
-
- CheckUserAuthorization();
-
- InitConnectionLimits();
-
- ProcessCommandLine(argc, argv);
-
- alwaysCheckForInput[0] = 0;
- alwaysCheckForInput[1] = 1;
- while(1)
- {
- serverGeneration++;
- ScreenSaverTime = defaultScreenSaverTime;
- ScreenSaverInterval = defaultScreenSaverInterval;
- ScreenSaverBlanking = defaultScreenSaverBlanking;
- ScreenSaverAllowExposures = defaultScreenSaverAllowExposures;
-#ifdef DPMSExtension
- DPMSStandbyTime = DEFAULT_SCREEN_SAVER_TIME;
- DPMSSuspendTime = DEFAULT_SCREEN_SAVER_TIME;
- DPMSOffTime = DEFAULT_SCREEN_SAVER_TIME;
- DPMSEnabled = TRUE;
- DPMSPowerLevel = 0;
-#endif
- InitBlockAndWakeupHandlers();
- /* Perform any operating system dependent initializations you'd like */
- OsInit();
- config_init();
- if(serverGeneration == 1)
- {
- CreateWellKnownSockets();
- InitProcVectors();
- for (i=1; i<MAXCLIENTS; i++)
- clients[i] = NullClient;
- serverClient = xalloc(sizeof(ClientRec));
- if (!serverClient)
- FatalError("couldn't create server client");
- InitClient(serverClient, 0, (pointer)NULL);
- }
- else
- ResetWellKnownSockets ();
- clients[0] = serverClient;
- currentMaxClients = 1;
-
- 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();
- InitSelections();
- InitGlyphCaching();
- if (!dixResetPrivates())
- FatalError("couldn't init private data storage");
- dixResetRegistry();
- ResetFontPrivateIndex();
- InitCallbackManager();
- InitOutput(&screenInfo, argc, argv);
-
- 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();
- if (SetDefaultFontPath(defaultFontPath) != Success) {
- ErrorF("[dix] failed to set default font path '%s'", defaultFontPath);
- }
- if (!SetDefaultFont(defaultTextFont)) {
- FatalError("could not open default font '%s'", defaultTextFont);
- }
-
- if (!(rootCursor = CreateRootCursor(NULL, 0))) {
- FatalError("could not open default cursor font '%s'",
- defaultCursorFont);
- }
-
-#ifdef DPMSExtension
- /* check all screens, looking for DPMS Capabilities */
- DPMSCapableFlag = DPMSSupported();
- if (!DPMSCapableFlag)
- DPMSEnabled = FALSE;
-#endif
-
-#ifdef PANORAMIX
- /*
- * Consolidate window and colourmap information for each screen
- */
- if (!noPanoramiXExtension)
- PanoramiXConsolidate();
-#endif
-
- for (i = 0; i < screenInfo.numScreens; i++)
- InitRootWindow(WindowTable[i]);
-
- InitCoreDevices();
- InitInput(argc, argv);
- InitAndStartDevices();
-
- dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset);
-
-#ifdef PANORAMIX
- if (!noPanoramiXExtension) {
- if (!PanoramiXCreateConnectionBlock()) {
- FatalError("could not create connection block info");
- }
- } else
-#endif
- {
- if (!CreateConnectionBlock()) {
- FatalError("could not create connection block info");
- }
- }
-
-#ifdef XQUARTZ
- /* Let the other threads know the server is done with its init */
- pthread_mutex_lock(&serverInitCompleteMutex);
- serverInitComplete = TRUE;
- pthread_cond_broadcast(&serverInitCompleteCond);
- pthread_mutex_unlock(&serverInitCompleteMutex);
-#endif
-
- NotifyParentProcess();
-
- Dispatch();
-
- UndisplayDevices();
-
- /* Now free up whatever must be freed */
- if (screenIsSaved == SCREEN_SAVER_ON)
- dixSaveScreens(serverClient, SCREEN_SAVER_OFF, ScreenSaverReset);
- FreeScreenSaverTimer();
- CloseDownExtensions();
-
-#ifdef PANORAMIX
- {
- Bool remember_it = noPanoramiXExtension;
- noPanoramiXExtension = TRUE;
- FreeAllResources();
- noPanoramiXExtension = remember_it;
- }
-#else
- FreeAllResources();
-#endif
-
- config_fini();
-
- memset(WindowTable, 0, sizeof(WindowTable));
- CloseDownDevices();
- InputDevicesClosed();
- CloseDownEvents();
-
- for (i = screenInfo.numScreens - 1; i >= 0; i--)
- {
- FreeScratchPixmapsForScreen(i);
- FreeGCperDepth(i);
- FreeDefaultStipple(i);
- (* screenInfo.screens[i]->CloseScreen)(i, screenInfo.screens[i]);
- dixFreePrivates(screenInfo.screens[i]->devPrivates);
- xfree(screenInfo.screens[i]);
- screenInfo.numScreens = i;
- }
- FreeFonts();
-
- FreeAuditTimer();
-
- dixFreePrivates(serverClient->devPrivates);
- serverClient->devPrivates = NULL;
-
- if (dispatchException & DE_TERMINATE)
- {
- CloseWellKnownConnections();
- }
-
- OsCleanup((dispatchException & DE_TERMINATE) != 0);
-
- if (dispatchException & DE_TERMINATE)
- {
- ddxGiveUp();
- break;
- }
-
- xfree(ConnectionInfo);
- ConnectionInfo = NULL;
- }
- return(0);
-}
-
+/***********************************************************
+
+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.
+
+******************************************************************/
+
+/* The panoramix components contained the following notice */
+/*****************************************************************
+
+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.
+
+******************************************************************/
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#include <version-config.h>
+#endif
+
+#include <X11/X.h>
+#include <X11/Xos.h> /* for unistd.h */
+#include <X11/Xproto.h>
+#include <pixman.h>
+#include "scrnintstr.h"
+#include "misc.h"
+#include "os.h"
+#include "windowstr.h"
+#include "resource.h"
+#include "dixstruct.h"
+#include "gcstruct.h"
+#include "extension.h"
+#include "colormap.h"
+#include "colormapst.h"
+#include "cursorstr.h"
+#include "selection.h"
+#include <X11/fonts/font.h>
+#include "opaque.h"
+#include "servermd.h"
+#include "hotplug.h"
+#include "site.h"
+#include "dixfont.h"
+#include "extnsionst.h"
+#include "privates.h"
+#include "registry.h"
+#ifdef PANORAMIX
+#include "panoramiXsrv.h"
+#else
+#include "dixevents.h" /* InitEvents() */
+#include "dispatch.h" /* InitProcVectors() */
+#endif
+
+#ifdef DPMSExtension
+#include <X11/extensions/dpmsconst.h>
+#include "dpmsproc.h"
+#endif
+
+#ifdef _DEBUG
+#include <crtdbg.h>
+#endif
+
+extern void Dispatch(void);
+
+extern void InitProcVectors(void);
+
+#ifdef XQUARTZ
+#include <pthread.h>
+
+BOOL serverInitComplete = FALSE;
+pthread_mutex_t serverInitCompleteMutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_cond_t serverInitCompleteCond = PTHREAD_COND_INITIALIZER;
+
+int dix_main(int argc, char *argv[], char *envp[]);
+
+int dix_main(int argc, char *argv[], char *envp[])
+#else
+int main(int argc, char *argv[], char *envp[])
+#endif
+{
+ int i;
+ HWEventQueueType alwaysCheckForInput[2];
+ #ifdef _DEBUG
+ //int TmpFlag=_CrtSetDbgFlag( _CRTDBG_REPORT_FLAG);
+
+ //TmpFlag|=_CRTDBG_ALLOC_MEM_DF;
+ //TmpFlag|=_CRTDBG_DELAY_FREE_MEM_DF;
+ //TmpFlag|=_CRTDBG_CHECK_ALWAYS_DF;
+ //TmpFlag|=_CRTDBG_CHECK_CRT_DF;
+ //TmpFlag|=_CRTDBG_LEAK_CHECK_DF;
+
+ //_CrtSetDbgFlag(TmpFlag);
+ #endif
+
+ ptw32_processInitialize();
+ display = "0";
+
+ #ifdef WIN32
+ /* In Win32 we have different threads call Xlib functions (depending
+ on the commandline options given).
+ XInitThreads has to be called before
+ any xlib function is called (aoccording to the man page) */
+ XInitThreads();
+ /* change the current directory to the directory where the vcxsrv.exe executable is installed.
+ This is needed because the font directories are relative to the current directory.
+ */
+ {
+ char ModuleFilename[MAX_PATH];
+ char *pSlash;
+ GetModuleFileName(NULL,ModuleFilename,sizeof(ModuleFilename));
+ pSlash=strrchr(ModuleFilename,'\\');
+ if (pSlash)
+ {
+ *pSlash='\0';
+ chdir(ModuleFilename);
+ }
+ }
+ #endif
+
+ InitRegions();
+
+ pixman_disable_out_of_bounds_workaround();
+
+ CheckUserParameters(argc, argv, envp);
+
+ CheckUserAuthorization();
+
+ InitConnectionLimits();
+
+ ProcessCommandLine(argc, argv);
+
+ alwaysCheckForInput[0] = 0;
+ alwaysCheckForInput[1] = 1;
+ while(1)
+ {
+ serverGeneration++;
+ ScreenSaverTime = defaultScreenSaverTime;
+ ScreenSaverInterval = defaultScreenSaverInterval;
+ ScreenSaverBlanking = defaultScreenSaverBlanking;
+ ScreenSaverAllowExposures = defaultScreenSaverAllowExposures;
+#ifdef DPMSExtension
+ DPMSStandbyTime = DEFAULT_SCREEN_SAVER_TIME;
+ DPMSSuspendTime = DEFAULT_SCREEN_SAVER_TIME;
+ DPMSOffTime = DEFAULT_SCREEN_SAVER_TIME;
+ DPMSEnabled = TRUE;
+ DPMSPowerLevel = 0;
+#endif
+ InitBlockAndWakeupHandlers();
+ /* Perform any operating system dependent initializations you'd like */
+ OsInit();
+ if(serverGeneration == 1)
+ {
+ CreateWellKnownSockets();
+ InitProcVectors();
+ for (i=1; i<MAXCLIENTS; i++)
+ clients[i] = NullClient;
+ serverClient = xalloc(sizeof(ClientRec));
+ if (!serverClient)
+ FatalError("couldn't create server client");
+ InitClient(serverClient, 0, (pointer)NULL);
+ }
+ else
+ ResetWellKnownSockets ();
+ clients[0] = serverClient;
+ currentMaxClients = 1;
+
+ 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();
+ InitSelections();
+ InitGlyphCaching();
+ if (!dixResetPrivates())
+ FatalError("couldn't init private data storage");
+ dixResetRegistry();
+ ResetFontPrivateIndex();
+ InitCallbackManager();
+ InitOutput(&screenInfo, argc, argv);
+
+ 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();
+ if (SetDefaultFontPath(defaultFontPath) != Success) {
+ ErrorF("[dix] failed to set default font path '%s'", defaultFontPath);
+ }
+ if (!SetDefaultFont(defaultTextFont)) {
+ FatalError("could not open default font '%s'", defaultTextFont);
+ }
+
+ if (!(rootCursor = CreateRootCursor(NULL, 0))) {
+ FatalError("could not open default cursor font '%s'",
+ defaultCursorFont);
+ }
+
+#ifdef DPMSExtension
+ /* check all screens, looking for DPMS Capabilities */
+ DPMSCapableFlag = DPMSSupported();
+ if (!DPMSCapableFlag)
+ DPMSEnabled = FALSE;
+#endif
+
+#ifdef PANORAMIX
+ /*
+ * Consolidate window and colourmap information for each screen
+ */
+ if (!noPanoramiXExtension)
+ PanoramiXConsolidate();
+#endif
+
+ for (i = 0; i < screenInfo.numScreens; i++)
+ InitRootWindow(WindowTable[i]);
+
+ InitCoreDevices();
+ config_init();
+ InitInput(argc, argv);
+ InitAndStartDevices();
+
+ dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset);
+
+#ifdef PANORAMIX
+ if (!noPanoramiXExtension) {
+ if (!PanoramiXCreateConnectionBlock()) {
+ FatalError("could not create connection block info");
+ }
+ } else
+#endif
+ {
+ if (!CreateConnectionBlock()) {
+ FatalError("could not create connection block info");
+ }
+ }
+
+#ifdef XQUARTZ
+ /* Let the other threads know the server is done with its init */
+ pthread_mutex_lock(&serverInitCompleteMutex);
+ serverInitComplete = TRUE;
+ pthread_cond_broadcast(&serverInitCompleteCond);
+ pthread_mutex_unlock(&serverInitCompleteMutex);
+#endif
+
+ NotifyParentProcess();
+
+ Dispatch();
+
+ UndisplayDevices();
+
+ /* Now free up whatever must be freed */
+ if (screenIsSaved == SCREEN_SAVER_ON)
+ dixSaveScreens(serverClient, SCREEN_SAVER_OFF, ScreenSaverReset);
+ FreeScreenSaverTimer();
+ CloseDownExtensions();
+
+#ifdef PANORAMIX
+ {
+ Bool remember_it = noPanoramiXExtension;
+ noPanoramiXExtension = TRUE;
+ FreeAllResources();
+ noPanoramiXExtension = remember_it;
+ }
+#else
+ FreeAllResources();
+#endif
+
+ config_fini();
+
+ memset(WindowTable, 0, sizeof(WindowTable));
+ CloseDownDevices();
+ InputDevicesClosed();
+ CloseDownEvents();
+
+ for (i = screenInfo.numScreens - 1; i >= 0; i--)
+ {
+ FreeScratchPixmapsForScreen(i);
+ FreeGCperDepth(i);
+ FreeDefaultStipple(i);
+ (* screenInfo.screens[i]->CloseScreen)(i, screenInfo.screens[i]);
+ dixFreePrivates(screenInfo.screens[i]->devPrivates);
+ xfree(screenInfo.screens[i]);
+ screenInfo.numScreens = i;
+ }
+ FreeFonts();
+
+ FreeAuditTimer();
+
+ dixFreePrivates(serverClient->devPrivates);
+ serverClient->devPrivates = NULL;
+
+ if (dispatchException & DE_TERMINATE)
+ {
+ CloseWellKnownConnections();
+ }
+
+ OsCleanup((dispatchException & DE_TERMINATE) != 0);
+
+ if (dispatchException & DE_TERMINATE)
+ {
+ ddxGiveUp();
+ break;
+ }
+
+ xfree(ConnectionInfo);
+ ConnectionInfo = NULL;
+ }
+ return(0);
+}
+
diff --git a/xorg-server/exa/exa.c b/xorg-server/exa/exa.c
index 023288c12..b3c5bfffe 100644
--- a/xorg-server/exa/exa.c
+++ b/xorg-server/exa/exa.c
@@ -283,7 +283,7 @@ exaGetOffscreenPixmap (DrawablePtr pDrawable, int *xp, int *yp)
}
/**
- * Returns TRUE if pixmap can be accessed offscreen.
+ * Returns TRUE if the pixmap GPU copy is being accessed.
*/
Bool
ExaDoPrepareAccess(PixmapPtr pPixmap, int index)
@@ -291,7 +291,7 @@ ExaDoPrepareAccess(PixmapPtr pPixmap, int index)
ScreenPtr pScreen = pPixmap->drawable.pScreen;
ExaScreenPriv (pScreen);
ExaPixmapPriv(pPixmap);
- Bool has_gpu_copy;
+ Bool has_gpu_copy, ret;
int i;
if (!(pExaScr->info->flags & EXA_OFFSCREEN_PIXMAPS))
@@ -304,7 +304,7 @@ ExaDoPrepareAccess(PixmapPtr pPixmap, int index)
for (i = 0; i < EXA_NUM_PREPARE_INDICES; i++) {
if (pExaScr->access[i].pixmap == pPixmap) {
pExaScr->access[i].count++;
- return TRUE;
+ return pExaScr->access[i].retval;
}
}
@@ -323,29 +323,33 @@ ExaDoPrepareAccess(PixmapPtr pPixmap, int index)
has_gpu_copy = exaPixmapHasGpuCopy(pPixmap);
- if (has_gpu_copy && pExaPixmap->fb_ptr)
+ if (has_gpu_copy && pExaPixmap->fb_ptr) {
pPixmap->devPrivate.ptr = pExaPixmap->fb_ptr;
- else
+ ret = TRUE;
+ } else {
pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;
+ ret = FALSE;
+ }
/* Store so we can handle repeated / nested calls. */
pExaScr->access[index].pixmap = pPixmap;
pExaScr->access[index].count = 1;
if (!has_gpu_copy)
- return FALSE;
+ goto out;
exaWaitSync (pScreen);
if (pExaScr->info->PrepareAccess == NULL)
- return TRUE;
+ goto out;
if (index >= EXA_PREPARE_AUX_DEST &&
!(pExaScr->info->flags & EXA_SUPPORTS_PREPARE_AUX)) {
if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED)
FatalError("Unsupported AUX indices used on a pinned pixmap.\n");
exaMoveOutPixmap (pPixmap);
- return FALSE;
+ ret = FALSE;
+ goto out;
}
if (!(*pExaScr->info->PrepareAccess) (pPixmap, index)) {
@@ -353,11 +357,15 @@ ExaDoPrepareAccess(PixmapPtr pPixmap, int index)
!(pExaScr->info->flags & EXA_MIXED_PIXMAPS))
FatalError("Driver failed PrepareAccess on a pinned pixmap.\n");
exaMoveOutPixmap (pPixmap);
-
- return FALSE;
+ ret = FALSE;
+ goto out;
}
- return TRUE;
+ ret = TRUE;
+
+out:
+ pExaScr->access[index].retval = ret;
+ return ret;
}
/**
diff --git a/xorg-server/exa/exa_mixed.c b/xorg-server/exa/exa_mixed.c
index 764c7dd58..155ed47c5 100644
--- a/xorg-server/exa/exa_mixed.c
+++ b/xorg-server/exa/exa_mixed.c
@@ -135,17 +135,53 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
pExaPixmap->score = EXA_PIXMAP_SCORE_PINNED;
}
- if (pExaPixmap->driverPriv) {
- if (width > 0 && height > 0 && bitsPerPixel > 0) {
+ has_gpu_copy = exaPixmapHasGpuCopy(pPixmap);
+
+ if (width <= 0)
+ width = pPixmap->drawable.width;
+
+ if (height <= 0)
+ height = pPixmap->drawable.height;
+
+ if (bitsPerPixel <= 0) {
+ if (depth <= 0)
+ bitsPerPixel = pPixmap->drawable.bitsPerPixel;
+ else
+ bitsPerPixel = BitsPerPixel(depth);
+ }
+
+ if (depth <= 0)
+ depth = pPixmap->drawable.depth;
+
+ if (width != pPixmap->drawable.width ||
+ height != pPixmap->drawable.height ||
+ depth != pPixmap->drawable.depth ||
+ bitsPerPixel != pPixmap->drawable.bitsPerPixel) {
+ if (pExaPixmap->driverPriv) {
exaSetFbPitch(pExaScr, pExaPixmap,
width, height, bitsPerPixel);
exaSetAccelBlock(pExaScr, pExaPixmap,
width, height, bitsPerPixel);
+ REGION_EMPTY(pScreen, &pExaPixmap->validFB);
}
+
+ /* Need to re-create system copy if there's also a GPU copy */
+ if (has_gpu_copy && pExaPixmap->sys_ptr) {
+ free(pExaPixmap->sys_ptr);
+ pExaPixmap->sys_ptr = NULL;
+ pExaPixmap->sys_pitch = devKind > 0 ? devKind :
+ PixmapBytePad(width, depth);
+ DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage);
+ DamageDestroy(pExaPixmap->pDamage);
+ pExaPixmap->pDamage = NULL;
+ REGION_EMPTY(pScreen, &pExaPixmap->validSys);
+
+ if (pExaScr->deferred_mixed_pixmap == pPixmap)
+ pExaScr->deferred_mixed_pixmap = NULL;
+ }
}
- has_gpu_copy = exaPixmapHasGpuCopy(pPixmap);
if (has_gpu_copy) {
pPixmap->devPrivate.ptr = pExaPixmap->fb_ptr;
pPixmap->devKind = pExaPixmap->fb_pitch;
diff --git a/xorg-server/exa/exa_priv.h b/xorg-server/exa/exa_priv.h
index 69c0d241d..085235524 100644
--- a/xorg-server/exa/exa_priv.h
+++ b/xorg-server/exa/exa_priv.h
@@ -194,6 +194,7 @@ typedef struct {
struct {
PixmapPtr pixmap;
int count;
+ Bool retval;
} access[EXA_NUM_PREPARE_INDICES];
/* Holds information on fallbacks that cannot be relayed otherwise. */
diff --git a/xorg-server/fb/fb.h b/xorg-server/fb/fb.h
index c35e7654b..02d6c0372 100644
--- a/xorg-server/fb/fb.h
+++ b/xorg-server/fb/fb.h
@@ -700,38 +700,41 @@ typedef struct {
#define __fbPixOffXPix(pPix) (__fbPixDrawableX(pPix))
#define __fbPixOffYPix(pPix) (__fbPixDrawableY(pPix))
-#define fbGetDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \
- PixmapPtr _pPix; \
- if ((pDrawable)->type != DRAWABLE_PIXMAP) { \
- _pPix = fbGetWindowPixmap(pDrawable); \
- (xoff) = __fbPixOffXWin(_pPix); \
- (yoff) = __fbPixOffYWin(_pPix); \
- } else { \
- _pPix = (PixmapPtr) (pDrawable); \
- (xoff) = __fbPixOffXPix(_pPix); \
- (yoff) = __fbPixOffYPix(_pPix); \
- } \
- fbPrepareAccess(pDrawable); \
- (pointer) = (FbBits *) _pPix->devPrivate.ptr; \
- (stride) = ((int) _pPix->devKind) / sizeof (FbBits); (void)(stride); \
- (bpp) = _pPix->drawable.bitsPerPixel; (void)(bpp); \
+#define fbGetDrawablePixmap(pDrawable, pixmap, xoff, yoff) { \
+ if ((pDrawable)->type != DRAWABLE_PIXMAP) { \
+ (pixmap) = fbGetWindowPixmap(pDrawable); \
+ (xoff) = __fbPixOffXWin(pixmap); \
+ (yoff) = __fbPixOffYWin(pixmap); \
+ } else { \
+ (pixmap) = (PixmapPtr) (pDrawable); \
+ (xoff) = __fbPixOffXPix(pixmap); \
+ (yoff) = __fbPixOffYPix(pixmap); \
+ } \
+ fbPrepareAccess(pDrawable); \
}
-#define fbGetStipDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \
- PixmapPtr _pPix; \
- if ((pDrawable)->type != DRAWABLE_PIXMAP) { \
- _pPix = fbGetWindowPixmap(pDrawable); \
- (xoff) = __fbPixOffXWin(_pPix); \
- (yoff) = __fbPixOffYWin(_pPix); \
- } else { \
- _pPix = (PixmapPtr) (pDrawable); \
- (xoff) = __fbPixOffXPix(_pPix); \
- (yoff) = __fbPixOffYPix(_pPix); \
- } \
- fbPrepareAccess(pDrawable); \
- (pointer) = (FbStip *) _pPix->devPrivate.ptr; \
- (stride) = ((int) _pPix->devKind) / sizeof (FbStip); (void)(stride); \
- (bpp) = _pPix->drawable.bitsPerPixel; (void)(bpp); \
+#define fbGetPixmapBitsData(pixmap, pointer, stride, bpp) { \
+ (pointer) = (FbBits *) (pixmap)->devPrivate.ptr; \
+ (stride) = ((int) (pixmap)->devKind) / sizeof (FbBits); (void)(stride); \
+ (bpp) = (pixmap)->drawable.bitsPerPixel; (void)(bpp); \
+}
+
+#define fbGetPixmapStipData(pixmap, pointer, stride, bpp) { \
+ (pointer) = (FbStip *) (pixmap)->devPrivate.ptr; \
+ (stride) = ((int) (pixmap)->devKind) / sizeof (FbStip); (void)(stride); \
+ (bpp) = (pixmap)->drawable.bitsPerPixel; (void)(bpp); \
+}
+
+#define fbGetDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \
+ PixmapPtr _pPix; \
+ fbGetDrawablePixmap(pDrawable, _pPix, xoff, yoff); \
+ fbGetPixmapBitsData(_pPix, pointer, stride, bpp); \
+}
+
+#define fbGetStipDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \
+ PixmapPtr _pPix; \
+ fbGetDrawablePixmap(pDrawable, _pPix, xoff, yoff); \
+ fbGetPixmapStipData(_pPix, pointer, stride, bpp); \
}
/*
@@ -2079,9 +2082,11 @@ fbFillRegionSolid (DrawablePtr pDrawable,
FbBits xor);
extern _X_EXPORT pixman_image_t *
-image_from_pict (PicturePtr pict,
- Bool has_clip,
- Bool is_src);
+image_from_pict (PicturePtr pict,
+ Bool has_clip,
+ int *xoff,
+ int *yoff);
+
extern _X_EXPORT void free_pixman_pict (PicturePtr, pixman_image_t *);
#endif /* _FB_H_ */
diff --git a/xorg-server/fb/fbpict.c b/xorg-server/fb/fbpict.c
index 7bab9a236..18ac49479 100644
--- a/xorg-server/fb/fbpict.c
+++ b/xorg-server/fb/fbpict.c
@@ -159,19 +159,24 @@ fbComposite (CARD8 op,
CARD16 height)
{
pixman_image_t *src, *mask, *dest;
+ int src_xoff, src_yoff;
+ int msk_xoff, msk_yoff;
+ int dst_xoff, dst_yoff;
- miCompositeSourceValidate (pSrc, xSrc, ySrc, width, height);
+ miCompositeSourceValidate (pSrc, xSrc - xDst, ySrc - yDst, width, height);
if (pMask)
- miCompositeSourceValidate (pMask, xMask, yMask, width, height);
+ miCompositeSourceValidate (pMask, xMask - xDst, yMask - yDst, width, height);
- src = image_from_pict (pSrc, TRUE, TRUE);
- mask = image_from_pict (pMask, TRUE, TRUE);
- dest = image_from_pict (pDst, TRUE, FALSE);
+ src = image_from_pict (pSrc, FALSE, &src_xoff, &src_yoff);
+ mask = image_from_pict (pMask, FALSE, &msk_xoff, &msk_yoff);
+ dest = image_from_pict (pDst, TRUE, &dst_xoff, &dst_yoff);
if (src && dest && !(pMask && !mask))
{
pixman_image_composite (op, src, mask, dest,
- xSrc, ySrc, xMask, yMask, xDst, yDst,
+ xSrc + src_xoff, ySrc + src_yoff,
+ xMask + msk_xoff, yMask + msk_yoff,
+ xDst + dst_xoff, yDst + dst_yoff,
width, height);
}
@@ -269,82 +274,24 @@ create_conical_gradient_image (PictGradient *gradient)
gradient->nstops);
}
-static DrawablePtr
-copy_drawable (DrawablePtr pDraw)
-{
- ScreenPtr pScreen = pDraw->pScreen;
- PixmapPtr pPixmap;
- GCPtr pGC;
- int width, height;
- ChangeGCVal gcv[2];
-
- width = pDraw->width;
- height = pDraw->height;
-
- pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, pDraw->depth, 0);
-
- if (!pPixmap)
- return NULL;
-
- pGC = GetScratchGC (pDraw->depth, pScreen);
-
- if (!pGC)
- {
- (*pScreen->DestroyPixmap) (pPixmap);
- return NULL;
- }
-
- /* First fill the pixmap with zeros */
- gcv[0].val = 0x00000000;
- gcv[1].val = IncludeInferiors;
- dixChangeGC (NullClient, pGC, GCBackground | GCSubwindowMode, NULL, gcv);
- ValidateGC ((DrawablePtr)pPixmap, pGC);
- miClearDrawable ((DrawablePtr)pPixmap, pGC);
-
- /* Then copy the window there */
- ValidateGC(&pPixmap->drawable, pGC);
- (* pGC->ops->CopyArea) (pDraw, &pPixmap->drawable, pGC, 0, 0, width, height, 0, 0);
-
- FreeScratchGC (pGC);
-
- return &pPixmap->drawable;
-}
-
-static void
-destroy_drawable (pixman_image_t *image, void *data)
-{
- DrawablePtr pDrawable = data;
- ScreenPtr pScreen = pDrawable->pScreen;
-
- pScreen->DestroyPixmap ((PixmapPtr)pDrawable);
-}
-
static pixman_image_t *
create_bits_picture (PicturePtr pict,
- Bool has_clip,
- Bool is_src)
+ Bool has_clip,
+ int *xoff,
+ int *yoff)
{
+ PixmapPtr pixmap;
FbBits *bits;
FbStride stride;
- int bpp, xoff, yoff;
+ int bpp;
pixman_image_t *image;
- DrawablePtr drawable;
-
- if (is_src && pict->pDrawable->type == DRAWABLE_WINDOW) {
- drawable = copy_drawable (pict->pDrawable);
- if (!drawable)
- return NULL;
- } else
- drawable = pict->pDrawable;
- fbGetDrawable (drawable, bits, stride, bpp, xoff, yoff);
-
- bits = (FbBits*)((CARD8*)bits +
- (drawable->y + yoff) * stride * sizeof(FbBits) +
- (drawable->x + xoff) * (bpp / 8));
+ fbGetDrawablePixmap (pict->pDrawable, pixmap, *xoff, *yoff);
+ fbGetPixmapBitsData(pixmap, bits, stride, bpp);
image = pixman_image_create_bits (
- pict->format, drawable->width, drawable->height,
+ pict->format,
+ pixmap->drawable.width, pixmap->drawable.height,
(uint32_t *)bits, stride * sizeof (FbStride));
@@ -362,59 +309,60 @@ create_bits_picture (PicturePtr pict,
#endif
#endif
+ /* pCompositeClip is undefined for source pictures, so
+ * only set the clip region for pictures with drawables
+ */
if (has_clip)
{
- if (is_src)
- {
- if (pict->clientClipType != CT_NONE)
- {
- pixman_image_set_has_client_clip (image, TRUE);
+ if (pict->clientClipType != CT_NONE)
+ pixman_image_set_has_client_clip (image, TRUE);
- pixman_region_translate (pict->clientClip,
- pict->clipOrigin.x,
- pict->clipOrigin.y);
-
- pixman_image_set_clip_region (image, pict->clientClip);
+ if (*xoff || *yoff)
+ pixman_region_translate (pict->pCompositeClip, *xoff, *yoff);
- pixman_region_translate (pict->clientClip,
- - pict->clipOrigin.x,
- - pict->clipOrigin.y);
- }
- }
- else
- {
- pixman_region_translate (pict->pCompositeClip,
- - pict->pDrawable->x,
- - pict->pDrawable->y);
+ pixman_image_set_clip_region (image, pict->pCompositeClip);
- pixman_image_set_clip_region (image, pict->pCompositeClip);
-
- pixman_region_translate (pict->pCompositeClip,
- pict->pDrawable->x,
- pict->pDrawable->y);
- }
+ if (*xoff || *yoff)
+ pixman_region_translate (pict->pCompositeClip, -*xoff, -*yoff);
}
/* Indexed table */
if (pict->pFormat->index.devPrivate)
pixman_image_set_indexed (image, pict->pFormat->index.devPrivate);
- if (drawable != pict->pDrawable)
- pixman_image_set_destroy_function (image, destroy_drawable, drawable);
-
+ /* Add in drawable origin to position within the image */
+ *xoff += pict->pDrawable->x;
+ *yoff += pict->pDrawable->y;
+
return image;
}
static void
-set_image_properties (pixman_image_t *image, PicturePtr pict)
+set_image_properties (pixman_image_t *image, PicturePtr pict, Bool has_clip, int *xoff, int *yoff)
{
pixman_repeat_t repeat;
pixman_filter_t filter;
if (pict->transform)
{
- pixman_image_set_transform (
- image, (pixman_transform_t *)pict->transform);
+ /* For source images, adjust the transform to account
+ * for the drawable offset within the pixman image,
+ * then set the offset to 0 as it will be used
+ * to compute positions within the transformed image.
+ */
+ if (!has_clip) {
+ struct pixman_transform adjusted;
+
+ adjusted = *pict->transform;
+ pixman_transform_translate(&adjusted,
+ NULL,
+ pixman_int_to_fixed(*xoff),
+ pixman_int_to_fixed(*yoff));
+ pixman_image_set_transform (image, &adjusted);
+ *xoff = 0;
+ *yoff = 0;
+ } else
+ pixman_image_set_transform (image, pict->transform);
}
switch (pict->repeatType)
@@ -441,7 +389,8 @@ set_image_properties (pixman_image_t *image, PicturePtr pict)
if (pict->alphaMap)
{
- pixman_image_t *alpha_map = image_from_pict (pict->alphaMap, TRUE, TRUE);
+ int alpha_xoff, alpha_yoff;
+ pixman_image_t *alpha_map = image_from_pict (pict->alphaMap, FALSE, &alpha_xoff, &alpha_yoff);
pixman_image_set_alpha_map (
image, alpha_map, pict->alphaOrigin.x, pict->alphaOrigin.y);
@@ -474,9 +423,7 @@ set_image_properties (pixman_image_t *image, PicturePtr pict)
}
pixman_image_t *
-image_from_pict (PicturePtr pict,
- Bool has_clip,
- Bool is_src)
+image_from_pict (PicturePtr pict, Bool has_clip, int *xoff, int *yoff)
{
pixman_image_t *image = NULL;
@@ -485,7 +432,7 @@ image_from_pict (PicturePtr pict,
if (pict->pDrawable)
{
- image = create_bits_picture (pict, has_clip, is_src);
+ image = create_bits_picture (pict, has_clip, xoff, yoff);
}
else if (pict->pSourcePict)
{
@@ -509,7 +456,7 @@ image_from_pict (PicturePtr pict,
}
if (image)
- set_image_properties (image, pict);
+ set_image_properties (image, pict, has_clip, xoff, yoff);
return image;
}
diff --git a/xorg-server/fb/fbtrap.c b/xorg-server/fb/fbtrap.c
index b1e1eff4a..515e2e1c1 100644
--- a/xorg-server/fb/fbtrap.c
+++ b/xorg-server/fb/fbtrap.c
@@ -40,7 +40,8 @@ fbAddTraps (PicturePtr pPicture,
int ntrap,
xTrap *traps)
{
- pixman_image_t *image = image_from_pict (pPicture, FALSE, FALSE);
+ int image_xoff, image_yoff;
+ pixman_image_t *image = image_from_pict (pPicture, FALSE, &image_xoff, &image_yoff);
if (!image)
return;
@@ -56,7 +57,8 @@ fbRasterizeTrapezoid (PicturePtr pPicture,
int x_off,
int y_off)
{
- pixman_image_t *image = image_from_pict (pPicture, FALSE, FALSE);
+ int mask_xoff, mask_yoff;
+ pixman_image_t *image = image_from_pict (pPicture, FALSE, &mask_xoff, &mask_yoff);
if (!image)
return;
diff --git a/xorg-server/hw/xfree86/common/xf86Configure.c b/xorg-server/hw/xfree86/common/xf86Configure.c
index 2df6b4ec3..d74d90bdd 100644
--- a/xorg-server/hw/xfree86/common/xf86Configure.c
+++ b/xorg-server/hw/xfree86/common/xf86Configure.c
@@ -577,7 +577,6 @@ static void handle_detailed_input(struct detailed_monitor_section *det_mon,
static XF86ConfMonitorPtr
configureDDCMonitorSection (int screennum)
{
- int i = 0;
int len, mon_width, mon_height;
#define displaySizeMaxLen 80
char displaySize_string[displaySizeMaxLen];
diff --git a/xorg-server/hw/xquartz/mach-startup/stub.c b/xorg-server/hw/xquartz/mach-startup/stub.c
index c8686e78f..89f9e1058 100644
--- a/xorg-server/hw/xquartz/mach-startup/stub.c
+++ b/xorg-server/hw/xquartz/mach-startup/stub.c
@@ -232,8 +232,9 @@ int main(int argc, char **argv, char **envp) {
kr = bootstrap_look_up(bootstrap_port, server_bootstrap_name, &mp);
if(kr != KERN_SUCCESS) {
- fprintf(stderr, "Xquartz: Unable to locate waiting server: %s\n", server_bootstrap_name);
pid_t child;
+
+ fprintf(stderr, "Xquartz: Unable to locate waiting server: %s\n", server_bootstrap_name);
set_x11_path();
/* This forking is ugly and will be cleaned up later */
diff --git a/xorg-server/hw/xquartz/pbproxy/Makefile.am b/xorg-server/hw/xquartz/pbproxy/Makefile.am
index e1c537fbb..02da6b265 100644
--- a/xorg-server/hw/xquartz/pbproxy/Makefile.am
+++ b/xorg-server/hw/xquartz/pbproxy/Makefile.am
@@ -15,6 +15,9 @@ if STANDALONE_XPBPROXY
bin_PROGRAMS = xpbproxy
xpbproxy_SOURCES = app-main.m
xpbproxy_LDADD = libxpbproxy.la
+xpbproxy_LDFLAGS = -Wl,-framework,Cocoa
+
+AM_CPPFLAGS += -DSTANDALONE_XPBPROXY
endif
diff --git a/xorg-server/miext/rootless/rootlessScreen.c b/xorg-server/miext/rootless/rootlessScreen.c
index c73d5170b..7a799d98c 100644
--- a/xorg-server/miext/rootless/rootlessScreen.c
+++ b/xorg-server/miext/rootless/rootlessScreen.c
@@ -431,7 +431,7 @@ RootlessMarkOverlappedWindows(WindowPtr pWin, WindowPtr pFirst,
register WindowPtr pChild;
Bool anyMarked = FALSE;
- void (* MarkWindow)() = pScreen->MarkWindow;
+ MarkWindowProcPtr MarkWindow = pScreen->MarkWindow;
RL_DEBUG_MSG("is top level! ");
/* single layered systems are easy */
diff --git a/xorg-server/os/backtrace.c b/xorg-server/os/backtrace.c
index dafb9904b..7ca6dab6d 100644
--- a/xorg-server/os/backtrace.c
+++ b/xorg-server/os/backtrace.c
@@ -48,10 +48,10 @@ void xorg_backtrace(void)
mod = (info.dli_fname && *info.dli_fname) ? info.dli_fname : "(vdso)";
if (info.dli_saddr)
ErrorF("%d: %s (%s+0x%lx) [%p]\n", i, mod,
- info.dli_sname, (char *) array[i] - (char *) info.dli_saddr, array[i]);
+ info.dli_sname, (long unsigned int)((char *) array[i] - (char *) info.dli_saddr), array[i]);
else
ErrorF("%d: %s (%p+0x%lx) [%p]\n", i, mod,
- info.dli_fbase, (char *) array[i] - (char *) info.dli_fbase, array[i]);
+ info.dli_fbase, (long unsigned int)((char *) array[i] - (char *) info.dli_fbase), array[i]);
}
}
diff --git a/xorg-server/record/set.c b/xorg-server/record/set.c
index 453452ec6..f0e094eed 100644
--- a/xorg-server/record/set.c
+++ b/xorg-server/record/set.c
@@ -406,10 +406,7 @@ _RecordSetMemoryRequirements(RecordSetInterval *pIntervals, int nIntervals,
/* user-visible functions */
int
-RecordSetMemoryRequirements(pIntervals, nIntervals, alignment)
- RecordSetInterval *pIntervals;
- int nIntervals;
- int *alignment;
+RecordSetMemoryRequirements(RecordSetInterval *pIntervals, int nIntervals, int *alignment)
{
RecordCreateSetProcPtr pCreateSet;
return _RecordSetMemoryRequirements(pIntervals, nIntervals, alignment,
@@ -417,11 +414,7 @@ RecordSetMemoryRequirements(pIntervals, nIntervals, alignment)
}
RecordSetPtr
-RecordCreateSet(pIntervals, nIntervals, pMem, memsize)
- RecordSetInterval *pIntervals;
- int nIntervals;
- void *pMem;
- int memsize;
+RecordCreateSet(RecordSetInterval *pIntervals, int nIntervals, void *pMem, int memsize)
{
RecordCreateSetProcPtr pCreateSet;
int alignment;
diff --git a/xorg-server/xkb/xkb.c b/xorg-server/xkb/xkb.c
index 62152b66a..2b06f3187 100644
--- a/xorg-server/xkb/xkb.c
+++ b/xorg-server/xkb/xkb.c
@@ -3273,20 +3273,21 @@ _XkbFindNamedIndicatorMap(XkbSrvLedInfoPtr sli, Atom indicator,
int *led_return)
{
XkbIndicatorMapPtr map;
- int led;
/* search for the right indicator */
map = NULL;
if (sli->names && sli->maps) {
+ int led;
+
for (led = 0; (led < XkbNumIndicators) && (map == NULL); led++) {
if (sli->names[led] == indicator) {
map= &sli->maps[led];
+ *led_return = led;
break;
}
}
}
- *led_return = led;
return map;
}
@@ -4298,9 +4299,12 @@ ProcXkbSetNames(ClientPtr client)
static char *
XkbWriteCountedString(char *wire,char *str,Bool swap)
{
-CARD16 len,*pLen;
+ CARD16 len,*pLen;
+
+ if (!str)
+ return wire;
- len= (str?strlen(str):0);
+ len= strlen(str);
pLen= (CARD16 *)wire;
*pLen= len;
if (swap) {
diff --git a/xorg-server/xkb/xkbLEDs.c b/xorg-server/xkb/xkbLEDs.c
index 59cdba416..6ca80d784 100644
--- a/xorg-server/xkb/xkbLEDs.c
+++ b/xorg-server/xkb/xkbLEDs.c
@@ -745,12 +745,14 @@ XkbFlushLedEvents( DeviceIntPtr dev,
XkbDDXAccessXBeep(dev, _BEEP_LED_OFF, XkbAccessXFeedbackMask);
}
}
- if (ed && (ed->reason)) {
- if ((dev!=kbd)&&(ed->reason&XkbXI_IndicatorStateMask))
- XkbDDXUpdateDeviceIndicators(dev,sli,sli->effectiveState);
- XkbSendExtensionDeviceNotify(dev,cause->client,ed);
+ if (ed) {
+ if (ed->reason) {
+ if ((dev!=kbd)&&(ed->reason&XkbXI_IndicatorStateMask))
+ XkbDDXUpdateDeviceIndicators(dev,sli,sli->effectiveState);
+ XkbSendExtensionDeviceNotify(dev,cause->client,ed);
+ }
+ bzero((char *)ed,sizeof(XkbExtensionDeviceNotify));
}
- bzero((char *)ed,sizeof(XkbExtensionDeviceNotify));
return;
}