Merge branch 'server-1.5-branch' into xorg-server-1.5-apple

This commit is contained in:
Jeremy Huddleston 2008-11-05 19:20:26 -08:00
commit fec491e316
17 changed files with 405 additions and 152 deletions

View File

@ -166,6 +166,26 @@ get_prop_string_array(LibHalContext *hal_ctx, const char *udi, const char *prop)
return ret;
}
static BOOL
device_is_duplicate(char *config_info)
{
DeviceIntPtr dev;
for (dev = inputInfo.devices; dev; dev = dev->next)
{
if (dev->config_info && (strcmp(dev->config_info, config_info) == 0))
return TRUE;
}
for (dev = inputInfo.off_devices; dev; dev = dev->next)
{
if (dev->config_info && (strcmp(dev->config_info, config_info) == 0))
return TRUE;
}
return FALSE;
}
static void
device_added(LibHalContext *hal_ctx, const char *udi)
{
@ -227,6 +247,13 @@ device_added(LibHalContext *hal_ctx, const char *udi)
}
sprintf(config_info, "hal:%s", udi);
/* Check for duplicate devices */
if (device_is_duplicate(config_info))
{
LogMessage(X_WARNING, "config/hal: device %s already added. Ignoring.\n", name);
goto unwind;
}
/* ok, grab options from hal.. iterate through all properties
* and lets see if any of them are options that we can add */
set = libhal_device_get_all_properties(hal_ctx, udi, &error);

View File

@ -26,8 +26,9 @@ dnl
dnl Process this file with autoconf to create configure.
AC_PREREQ(2.57)
AC_INIT([xorg-server], 1.5.2, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
RELEASE_DATE="10 October 2008"
AC_INIT([xorg-server], 1.5.3, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
RELEASE_DATE="5 November 2008"
REMEMBER_REMEMBER="The Fifth of November"
AC_CONFIG_SRCDIR([Makefile.am])
AM_INIT_AUTOMAKE([dist-bzip2 foreign])
AM_MAINTAINER_MODE

View File

@ -783,6 +783,10 @@ exaGetPixmapSize(PixmapPtr pPix);
void
exaEnableDisableFBAccess (int index, Bool enable);
Bool
exaDrawableIsOffscreen (DrawablePtr pDrawable);
/* in exa_migration.c */
void
exaMoveInPixmap (PixmapPtr pPixmap);

View File

@ -132,6 +132,7 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
BoxPtr pBox;
int nbox;
Bool access_prepared = FALSE;
Bool need_sync = FALSE;
/* Damaged bits are valid in current copy but invalid in other one */
if (exaPixmapIsOffscreen(pPixmap)) {
@ -223,14 +224,15 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
exaMemcpyBox (pPixmap, pBox,
fallback_src, fallback_srcpitch,
fallback_dst, fallback_dstpitch);
}
} else
need_sync = TRUE;
pBox++;
}
if (access_prepared)
exaFinishAccess(&pPixmap->drawable, fallback_index);
else
else if (need_sync)
sync (pPixmap->drawable.pScreen);
pExaPixmap->offscreen = save_offscreen;

View File

@ -374,9 +374,6 @@ void
exaGetDrawableDeltas (DrawablePtr pDrawable, PixmapPtr pPixmap,
int *xp, int *yp);
Bool
exaDrawableIsOffscreen (DrawablePtr pDrawable);
Bool
exaPixmapIsOffscreen(PixmapPtr p);

View File

@ -189,6 +189,8 @@ __glXDRIdoReleaseTexImage(__GLXDRIscreen *screen, __GLXDRIdrawable *drawable)
for (i = 0; i < lastOverride; i++) {
if (texOffsetOverride[i] == drawable) {
if (screen->texOffsetFinish)
screen->texOffsetFinish((PixmapPtr)drawable->base.pDraw);
texOffsetOverride[i] = NULL;

View File

@ -67,6 +67,13 @@ static void ErrorF(char*, ...);
#include "os.h"
#endif
#ifndef IF_MASK
#define IF_MASK X86_EFLAGS_IF
#endif
#ifndef IOPL_MASK
#define IOPL_MASK X86_EFLAGS_IOPL
#endif
typedef unsigned char U8;
typedef unsigned short U16;
typedef unsigned int U32;

View File

@ -24,7 +24,8 @@ BUSSOURCES = xf86isaBus.c xf86pciBus.c xf86fbBus.c xf86noBus.c $(SBUS_SOURCES)
MODEDEFSOURCES = $(srcdir)/vesamodes $(srcdir)/extramodes
xf86DefModeSet.c: $(srcdir)/modeline2c.awk $(MODEDEFSOURCES)
cat $(MODEDEFSOURCES) | $(AWK) -f $(srcdir)/modeline2c.awk > $@
cat $(MODEDEFSOURCES) | LC_ALL=C $(AWK) -f $(srcdir)/modeline2c.awk > $@
echo >> $@
BUILT_SOURCES = xf86DefModeSet.c

View File

@ -56,6 +56,7 @@
/* General parameters */
extern int xf86DoConfigure;
extern Bool xf86DoModalias;
extern Bool xf86DoConfigurePass1;
extern DevPrivateKey xf86ScreenKey;
extern DevPrivateKey xf86CreateRootWindowKey;

View File

@ -1340,7 +1340,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
}
/* 4. First pointer with 'mouse' as the driver. */
if (!foundPointer && (!xf86Info.allowEmptyInput || implicitLayout)) {
if (!foundPointer && !xf86Info.allowEmptyInput) {
confInput = xf86findInput(CONF_IMPLICIT_POINTER,
xf86configptr->conf_input_lst);
if (!confInput) {
@ -1480,7 +1480,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
}
/* 4. First keyboard with 'keyboard' or 'kbd' as the driver. */
if (!foundKeyboard && (!xf86Info.allowEmptyInput || implicitLayout)) {
if (!foundKeyboard && !xf86Info.allowEmptyInput) {
confInput = xf86findInput(CONF_IMPLICIT_KEYBOARD,
xf86configptr->conf_input_lst);
if (!confInput) {
@ -2481,6 +2481,41 @@ addDefaultModes(MonPtr monitorp)
static void
checkInput(serverLayoutPtr layout, Bool implicit_layout) {
checkCoreInputDevices(layout, implicit_layout);
/* AllowEmptyInput and the "kbd" and "mouse" drivers are mutually
* exclusive. Trawl the list for mouse/kbd devices and disable them.
*/
if (xf86Info.allowEmptyInput && layout->inputs)
{
IDevPtr *dev = layout->inputs;
BOOL warned = FALSE;
while(*dev)
{
if (strcmp((*dev)->driver, "kbd") == 0 ||
strcmp((*dev)->driver, "mouse") == 0)
{
IDevPtr *current;
if (!warned)
{
xf86Msg(X_WARNING, "AllowEmptyInput is on, devices using "
"drivers 'kbd' or 'mouse' will be disabled.\n");
warned = TRUE;
}
xf86Msg(X_WARNING, "Disabling %s\n", (*dev)->identifier);
current = dev;
xfree(*dev);
do {
*current = *(current + 1);
current++;
} while(*current);
} else
dev++;
}
}
}
/*

View File

@ -149,6 +149,7 @@ Bool xf86Resetting = FALSE;
Bool xf86Initialising = FALSE;
Bool xf86DoProbe = FALSE;
Bool xf86DoConfigure = FALSE;
Bool xf86DoModalias = FALSE;
DriverPtr *xf86DriverList = NULL;
int xf86NumDrivers = 0;
InputDriverPtr *xf86InputDriverList = NULL;

View File

@ -1486,6 +1486,8 @@ xf86MatchDevice(const char *drivername, GDevPtr **sectlist)
if (sectlist)
*sectlist = NULL;
if (xf86DoModalias) return 0;
if (xf86DoProbe) return 1;
if (xf86DoConfigure && xf86DoConfigurePass1) return 1;

View File

@ -131,6 +131,207 @@ static int numFormats = 6;
#endif
static Bool formatsDone = FALSE;
#ifndef OSNAME
#define OSNAME " unknown"
#endif
#ifndef OSVENDOR
#define OSVENDOR ""
#endif
#ifndef PRE_RELEASE
#define PRE_RELEASE XORG_VERSION_SNAP
#endif
static void
xf86PrintBanner()
{
#if PRE_RELEASE
ErrorF("\n"
"This is a pre-release version of the X server from " XVENDORNAME ".\n"
"It is not supported in any way.\n"
"Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/.\n"
"Select the \"xorg\" product for bugs you find in this release.\n"
"Before reporting bugs in pre-release versions please check the\n"
"latest version in the X.Org Foundation git repository.\n"
"See http://wiki.x.org/wiki/GitPage for git access instructions.\n");
#endif
ErrorF("\nX.Org X Server %d.%d.%d",
XORG_VERSION_MAJOR,
XORG_VERSION_MINOR,
XORG_VERSION_PATCH);
#if XORG_VERSION_SNAP > 0
ErrorF(".%d", XORG_VERSION_SNAP);
#endif
#if XORG_VERSION_SNAP >= 900
/* When the minor number is 99, that signifies that the we are making
* a release candidate for a major version. (X.0.0)
* When the patch number is 99, that signifies that the we are making
* a release candidate for a minor version. (X.Y.0)
* When the patch number is < 99, then we are making a release
* candidate for the next point release. (X.Y.Z)
*/
#if XORG_VERSION_MINOR >= 99
ErrorF(" (%d.0.0 RC %d)", XORG_VERSION_MAJOR+1, XORG_VERSION_SNAP - 900);
#elif 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
#endif
#ifdef XORG_CUSTOM_VERSION
ErrorF(" (%s)", XORG_CUSTOM_VERSION);
#endif
#ifndef XORG_DATE
#define XORG_DATE XF86_DATE
#endif
ErrorF("\nRelease Date: %s\n", XORG_DATE);
ErrorF("X Protocol Version %d, Revision %d\n",
X_PROTOCOL, X_PROTOCOL_REVISION);
ErrorF("Build Operating System: %s %s\n", OSNAME, OSVENDOR);
#ifdef HAS_UTSNAME
{
struct utsname name;
/* Linux & BSD state that 0 is success, SysV (including Solaris, HP-UX,
and Irix) and Single Unix Spec 3 just say that non-negative is success.
All agree that failure is represented by a negative number.
*/
if (uname(&name) >= 0) {
ErrorF("Current Operating System: %s %s %s %s %s\n",
name.sysname, name.nodename, name.release, name.version, name.machine);
}
}
#endif
#if defined(BUILD_DATE) && (BUILD_DATE > 19000000)
{
struct tm t;
char buf[100];
bzero(&t, sizeof(t));
bzero(buf, sizeof(buf));
t.tm_mday = BUILD_DATE % 100;
t.tm_mon = (BUILD_DATE / 100) % 100 - 1;
t.tm_year = BUILD_DATE / 10000 - 1900;
#if defined(BUILD_TIME)
t.tm_sec = BUILD_TIME % 100;
t.tm_min = (BUILD_TIME / 100) % 100;
t.tm_hour = (BUILD_TIME / 10000) % 100;
if (strftime(buf, sizeof(buf), "%d %B %Y %I:%M:%S%p", &t))
ErrorF("Build Date: %s\n", buf);
#else
if (strftime(buf, sizeof(buf), "%d %B %Y", &t))
ErrorF("Build Date: %s\n", buf);
#endif
}
#endif
#if defined(CLOG_DATE) && (CLOG_DATE > 19000000)
{
struct tm t;
char buf[100];
bzero(&t, sizeof(t));
bzero(buf, sizeof(buf));
t.tm_mday = CLOG_DATE % 100;
t.tm_mon = (CLOG_DATE / 100) % 100 - 1;
t.tm_year = CLOG_DATE / 10000 - 1900;
if (strftime(buf, sizeof(buf), "%d %B %Y", &t))
ErrorF("Changelog Date: %s\n", buf);
}
#endif
#if defined(BUILDERSTRING)
ErrorF("%s \n",BUILDERSTRING);
#endif
ErrorF("\tBefore reporting problems, check "__VENDORDWEBSUPPORT__"\n"
"\tto make sure that you have the latest version.\n");
}
static void
xf86PrintMarkers()
{
LogPrintMarkers();
}
static void
DoModalias()
{
int i = -1;
char **vlist;
/* Get all the drivers */
vlist = xf86DriverlistFromCompile();
if (!vlist) {
ErrorF("Missing output drivers. PCI Access dump failed.\n");
goto bail;
}
/* Load all the drivers that were found. */
xf86LoadModules(vlist, NULL);
xfree(vlist);
/* Iterate through each driver */
for (i = 0; i < xf86NumDrivers; i++) {
struct pci_id_match *match;
/* Iterate through each pci id match data, dumping it to the screen */
for (match = (struct pci_id_match *) xf86DriverList[i]->supported_devices ;
match && !(!match->vendor_id && !match->device_id) ; match++) {
/* Prefix */
ErrorF("alias pci:");
/* Vendor */
if (match->vendor_id == ~0)
ErrorF("v*");
else
ErrorF("v%08X", match->vendor_id);
/* Device */
if (match->device_id == ~0)
ErrorF("d*");
else
ErrorF("d%08X", match->device_id);
/* Subvendor */
if (match->subvendor_id == ~0)
ErrorF("sv*");
else
ErrorF("sv%08X", match->subvendor_id);
/* Subdevice */
if (match->subdevice_id == ~0)
ErrorF("sd*");
else
ErrorF("sd%08X", match->subdevice_id);
/* Class */
if ((match->device_class_mask >> 16 & 0xFF) == 0xFF)
ErrorF("bc%02X", match->device_class >> 16 & 0xFF);
else
ErrorF("bc*");
if ((match->device_class_mask >> 8 & 0xFF) == 0xFF)
ErrorF("sc%02X", match->device_class >> 8 & 0xFF);
else
ErrorF("sc*");
if ((match->device_class_mask & 0xFF) == 0xFF)
ErrorF("i%02X*", match->device_class & 0xFF);
else
ErrorF("i*");
/* Suffix (driver) */
ErrorF(" %s\n", xf86DriverList[i]->driverName);
}
}
bail:
OsCleanup(TRUE);
AbortDDX();
fflush(stderr);
exit(0);
}
static Bool
xf86CreateRootWindow(WindowPtr pWin)
{
@ -488,19 +689,21 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
else
xf86ServerName = argv[0];
xf86PrintBanner();
xf86PrintMarkers();
if (xf86LogFile) {
time_t t;
const char *ct;
t = time(NULL);
ct = ctime(&t);
xf86MsgVerb(xf86LogFileFrom, 0, "Log file: \"%s\", Time: %s",
xf86LogFile, ct);
if (!xf86DoModalias) {
xf86PrintBanner();
xf86PrintMarkers();
if (xf86LogFile) {
time_t t;
const char *ct;
t = time(NULL);
ct = ctime(&t);
xf86MsgVerb(xf86LogFileFrom, 0, "Log file: \"%s\", Time: %s",
xf86LogFile, ct);
}
}
/* Read and parse the config file */
if (!xf86DoProbe && !xf86DoConfigure) {
if (!xf86DoProbe && !xf86DoConfigure && !xf86DoModalias) {
switch (xf86HandleConfigFile(FALSE)) {
case CONFIG_OK:
break;
@ -537,6 +740,10 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
if (xf86DoConfigure)
DoConfigure();
/* Do the PCI Access dump */
if (xf86DoModalias)
DoModalias();
if (autoconfig) {
if (!xf86AutoConfig()) {
xf86Msg(X_ERROR, "Auto configuration failed\n");
@ -1678,6 +1885,12 @@ ddxProcessArgument(int argc, char **argv, int i)
xf86AllowMouseOpenFail = TRUE;
return 1;
}
if (!strcmp(argv[i], "-modalias"))
{
xf86DoModalias = TRUE;
xf86AllowMouseOpenFail = TRUE;
return 1;
}
if (!strcmp(argv[i], "-isolateDevice"))
{
int bus, device, func;
@ -1722,6 +1935,7 @@ ddxUseMsg()
ErrorF("-logfile file specify a log file name\n");
ErrorF("-configure probe for devices and write an "__XCONFIGFILE__"\n");
}
ErrorF("-modalias output a modalias-style filter for each driver installed\n");
ErrorF("-config file specify a configuration file, relative to the\n");
ErrorF(" "__XCONFIGFILE__" search path, only root can use absolute\n");
ErrorF("-probeonly probe for devices, then exit\n");
@ -1764,131 +1978,6 @@ ddxUseMsg()
ErrorF("\n");
}
#ifndef OSNAME
#define OSNAME " unknown"
#endif
#ifndef OSVENDOR
#define OSVENDOR ""
#endif
#ifndef PRE_RELEASE
#define PRE_RELEASE XORG_VERSION_SNAP
#endif
static void
xf86PrintBanner()
{
#if PRE_RELEASE
ErrorF("\n"
"This is a pre-release version of the X server from " XVENDORNAME ".\n"
"It is not supported in any way.\n"
"Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/.\n"
"Select the \"xorg\" product for bugs you find in this release.\n"
"Before reporting bugs in pre-release versions please check the\n"
"latest version in the X.Org Foundation git repository.\n"
"See http://wiki.x.org/wiki/GitPage for git access instructions.\n");
#endif
ErrorF("\nX.Org X Server %d.%d.%d",
XORG_VERSION_MAJOR,
XORG_VERSION_MINOR,
XORG_VERSION_PATCH);
#if XORG_VERSION_SNAP > 0
ErrorF(".%d", XORG_VERSION_SNAP);
#endif
#if XORG_VERSION_SNAP >= 900
/* When the minor number is 99, that signifies that the we are making
* a release candidate for a major version. (X.0.0)
* When the patch number is 99, that signifies that the we are making
* a release candidate for a minor version. (X.Y.0)
* When the patch number is < 99, then we are making a release
* candidate for the next point release. (X.Y.Z)
*/
#if XORG_VERSION_MINOR >= 99
ErrorF(" (%d.0.0 RC %d)", XORG_VERSION_MAJOR+1, XORG_VERSION_SNAP - 900);
#elif 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
#endif
#ifdef XORG_CUSTOM_VERSION
ErrorF(" (%s)", XORG_CUSTOM_VERSION);
#endif
#ifndef XORG_DATE
#define XORG_DATE XF86_DATE
#endif
ErrorF("\nRelease Date: %s\n", XORG_DATE);
ErrorF("X Protocol Version %d, Revision %d\n",
X_PROTOCOL, X_PROTOCOL_REVISION);
ErrorF("Build Operating System: %s %s\n", OSNAME, OSVENDOR);
#ifdef HAS_UTSNAME
{
struct utsname name;
/* Linux & BSD state that 0 is success, SysV (including Solaris, HP-UX,
and Irix) and Single Unix Spec 3 just say that non-negative is success.
All agree that failure is represented by a negative number.
*/
if (uname(&name) >= 0) {
ErrorF("Current Operating System: %s %s %s %s %s\n",
name.sysname, name.nodename, name.release, name.version, name.machine);
}
}
#endif
#if defined(BUILD_DATE) && (BUILD_DATE > 19000000)
{
struct tm t;
char buf[100];
bzero(&t, sizeof(t));
bzero(buf, sizeof(buf));
t.tm_mday = BUILD_DATE % 100;
t.tm_mon = (BUILD_DATE / 100) % 100 - 1;
t.tm_year = BUILD_DATE / 10000 - 1900;
#if defined(BUILD_TIME)
t.tm_sec = BUILD_TIME % 100;
t.tm_min = (BUILD_TIME / 100) % 100;
t.tm_hour = (BUILD_TIME / 10000) % 100;
if (strftime(buf, sizeof(buf), "%d %B %Y %I:%M:%S%p", &t))
ErrorF("Build Date: %s\n", buf);
#else
if (strftime(buf, sizeof(buf), "%d %B %Y", &t))
ErrorF("Build Date: %s\n", buf);
#endif
}
#endif
#if defined(CLOG_DATE) && (CLOG_DATE > 19000000)
{
struct tm t;
char buf[100];
bzero(&t, sizeof(t));
bzero(buf, sizeof(buf));
t.tm_mday = CLOG_DATE % 100;
t.tm_mon = (CLOG_DATE / 100) % 100 - 1;
t.tm_year = CLOG_DATE / 10000 - 1900;
if (strftime(buf, sizeof(buf), "%d %B %Y", &t))
ErrorF("Changelog Date: %s\n", buf);
}
#endif
#if defined(BUILDERSTRING)
ErrorF("%s \n",BUILDERSTRING);
#endif
ErrorF("\tBefore reporting problems, check "__VENDORDWEBSUPPORT__"\n"
"\tto make sure that you have the latest version.\n");
ErrorF("Module Loader present\n");
}
static void
xf86PrintMarkers()
{
LogPrintMarkers();
}
static void
xf86PrintDefaultModulePath(void)
{

View File

@ -698,6 +698,7 @@ the X server to load. Disabled by default.
If enabled, don't add the standard keyboard and mouse drivers, if there are no
input devices in the config file. Enabled by default if AutoAddDevices and
AutoEnableDevices is enabled, otherwise disabled.
If AllowEmptyInput is on, devices using the kbd or mouse driver are ignored.
.TP 7
.BI "Option \*qAutoAddDevices\*q \*q" boolean \*q
If this option is disabled, then no devices will be added from HAL events.

View File

@ -53,6 +53,8 @@ static int activeVT = -1;
static int vtPermSave[4];
static char vtname[11];
static struct termios tty_attr; /* tty state to restore */
static int tty_mode; /* kbd mode to restore */
static int
saveVtPerms(void)
@ -83,6 +85,14 @@ restoreVtPerms(void)
chown(vtname, vtPermSave[2], vtPermSave[3]);
}
static void *console_handler;
static void
drain_console(int fd, void *closure)
{
tcflush(fd, TCIOFLUSH);
}
void
xf86OpenConsole(void)
{
@ -272,6 +282,38 @@ xf86OpenConsole(void)
FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed %s\n",
strerror(errno));
/* Set the keyboard to RAW mode. If we're using the keyboard
* driver, the driver does it for us. If we have AEI on, then
* we're expecting the devices to be added (i.e. evdev) and we
* have to set it manually.
*/
if (xf86Info.allowEmptyInput)
{
struct termios nTty;
tcgetattr(xf86Info.consoleFd, &tty_attr);
ioctl(xf86Info.consoleFd, KDGKBMODE, &tty_mode);
if (ioctl(xf86Info.consoleFd, KDSKBMODE, K_RAW) < 0)
FatalError("xf86OpenConsole: KDSKBMODE K_RAW failed %s\n",
strerror(errno));
nTty = tty_attr;
nTty.c_iflag = (IGNPAR | IGNBRK) & (~PARMRK) & (~ISTRIP);
nTty.c_oflag = 0;
nTty.c_cflag = CREAD | CS8;
nTty.c_lflag = 0;
nTty.c_cc[VTIME]=0;
nTty.c_cc[VMIN]=1;
cfsetispeed(&nTty, 9600);
cfsetospeed(&nTty, 9600);
tcsetattr(xf86Info.consoleFd, TCSANOW, &nTty);
/* need to keep the buffer clean, else the kernel gets angry */
console_handler = xf86AddGeneralHandler(xf86Info.consoleFd,
drain_console, NULL);
}
/* we really should have a InitOSInputDevices() function instead
* of Init?$#*&Device(). So I just place it here */
@ -316,6 +358,11 @@ xf86CloseConsole()
if (ShareVTs) return;
if (console_handler) {
xf86RemoveGeneralHandler(console_handler);
console_handler = NULL;
};
#if defined(DO_OS_FONTRESTORE)
if (ioctl(xf86Info.consoleFd, VT_GETSTATE, &vts) < 0)
xf86Msg(X_WARNING, "xf86CloseConsole: VT_GETSTATE failed: %s\n",
@ -328,7 +375,10 @@ xf86CloseConsole()
if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT) < 0)
xf86Msg(X_WARNING, "xf86CloseConsole: KDSETMODE failed: %s\n",
strerror(errno));
ioctl(xf86Info.consoleFd, KDSKBMODE, tty_mode);
tcsetattr(xf86Info.consoleFd, TCSANOW, &tty_attr);
if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0)
xf86Msg(X_WARNING, "xf86CloseConsole: VT_GETMODE failed: %s\n",
strerror(errno));

View File

@ -401,6 +401,7 @@ void AbortServer(void) __attribute__((noreturn));
void
AbortServer(void)
{
CloseWellKnownConnections();
OsCleanup(TRUE);
CloseDownDevices();
AbortDDX();

View File

@ -24,10 +24,42 @@
#include "propertyst.h"
#include "swaprep.h"
static void
RRDeliverEvent (ScreenPtr pScreen, xEvent *event, CARD32 mask)
static int
DeliverPropertyEvent(WindowPtr pWin, void *value)
{
xRROutputPropertyNotifyEvent *event = value;
RREventPtr *pHead, pRREvent;
ClientPtr client;
pHead = LookupIDByType(pWin->drawable.id, RREventType);
if (!pHead)
return WT_WALKCHILDREN;
for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next)
{
client = pRREvent->client;
if (client == serverClient || client->clientGone)
continue;
if (!(pRREvent->mask & RROutputPropertyNotifyMask))
continue;
event->sequenceNumber = client->sequence;
event->window = pRREvent->window->drawable.id;
if (client->swapped) {
int n;
swaps(&event->sequenceNumber, n);
swapl(&event->window, n);
}
WriteEventsToClient(pRREvent->client, 1, (xEvent *)event);
}
return WT_WALKCHILDREN;
}
static void RRDeliverPropertyEvent(ScreenPtr pScreen, xEvent *event)
{
WalkTree(pScreen, DeliverPropertyEvent, event);
}
void
@ -45,7 +77,7 @@ RRDeleteAllOutputProperties (RROutputPtr output)
event.state = PropertyDelete;
event.atom = prop->propertyName;
event.timestamp = currentTime.milliseconds;
RRDeliverEvent (output->pScreen, (xEvent *) &event, RROutputPropertyNotifyMask);
RRDeliverPropertyEvent (output->pScreen, (xEvent *)&event);
if (prop->current.data)
xfree(prop->current.data);
if (prop->pending.data)
@ -113,7 +145,7 @@ RRDeleteOutputProperty (RROutputPtr output, Atom property)
event.state = PropertyDelete;
event.atom = prop->propertyName;
event.timestamp = currentTime.milliseconds;
RRDeliverEvent (output->pScreen, (xEvent *) &event, RROutputPropertyNotifyMask);
RRDeliverPropertyEvent (output->pScreen, (xEvent *)&event);
RRDestroyOutputProperty (prop);
}
}
@ -238,7 +270,7 @@ RRChangeOutputProperty (RROutputPtr output, Atom property, Atom type,
event.state = PropertyNewValue;
event.atom = prop->propertyName;
event.timestamp = currentTime.milliseconds;
RRDeliverEvent (output->pScreen, (xEvent *) &event, RROutputPropertyNotifyMask);
RRDeliverPropertyEvent (output->pScreen, (xEvent *)&event);
}
return(Success);
}
@ -700,7 +732,7 @@ ProcRRGetOutputProperty (ClientPtr client)
event.state = PropertyDelete;
event.atom = prop->propertyName;
event.timestamp = currentTime.milliseconds;
RRDeliverEvent (output->pScreen, (xEvent *) &event, RROutputPropertyNotifyMask);
RRDeliverPropertyEvent (output->pScreen, (xEvent *)&event);
}
if (client->swapped) {