From 3c28a29e132d6f73c36d4b64818d112b1c6e9a40 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 13 Oct 2010 15:53:59 +1000 Subject: [PATCH 01/80] xfree86: rename parameter names to xf86ScaleAxis. Maybe it's just me but every time I look at it I get confused again and need to work it out from scratch. Rename the parameters to something self-explanatory, to/from and min/max. No functional change. Signed-off-by: Peter Hutterer Reviewed-by: Julien Cristau --- hw/xfree86/common/xf86Xinput.c | 35 ++++++++++++++++++---------------- hw/xfree86/common/xf86Xinput.h | 2 +- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 877eb0382..e71b09cd2 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -1238,40 +1238,43 @@ xf86FirstLocalDevice(void) /* * Cx - raw data from touch screen - * Sxhigh - scaled highest dimension + * to_max - scaled highest dimension * (remember, this is of rows - 1 because of 0 origin) - * Sxlow - scaled lowest dimension - * Rxhigh - highest raw value from touch screen calibration - * Rxlow - lowest raw value from touch screen calibration + * to_min - scaled lowest dimension + * from_max - highest raw value from touch screen calibration + * from_min - lowest raw value from touch screen calibration * * This function is the same for X or Y coordinates. * You may have to reverse the high and low values to compensate for * different orgins on the touch screen vs X. + * + * e.g. to scale from device coordinates into screen coordinates, call + * xf86ScaleAxis(x, 0, screen_width, dev_min, dev_max); */ int xf86ScaleAxis(int Cx, - int Sxhigh, - int Sxlow, - int Rxhigh, - int Rxlow ) + int to_max, + int to_min, + int from_max, + int from_min ) { int X; - int64_t dSx = Sxhigh - Sxlow; - int64_t dRx = Rxhigh - Rxlow; + int64_t to_width = to_max - to_min; + int64_t from_width = from_max - from_min; - if (dRx) { - X = (int)(((dSx * (Cx - Rxlow)) / dRx) + Sxlow); + if (from_width) { + X = (int)(((to_width * (Cx - from_min)) / from_width) + to_min); } else { X = 0; ErrorF ("Divide by Zero in xf86ScaleAxis"); } - if (X > Sxhigh) - X = Sxhigh; - if (X < Sxlow) - X = Sxlow; + if (X > to_max) + X = to_max; + if (X < to_min) + X = to_min; return X; } diff --git a/hw/xfree86/common/xf86Xinput.h b/hw/xfree86/common/xf86Xinput.h index 7b60cdfea..1d013aa67 100644 --- a/hw/xfree86/common/xf86Xinput.h +++ b/hw/xfree86/common/xf86Xinput.h @@ -184,7 +184,7 @@ extern _X_EXPORT void xf86PostKeyboardEvent(DeviceIntPtr device, unsigned int ke int is_down); extern _X_EXPORT int xf86ActivateDevice(LocalDevicePtr local); extern _X_EXPORT LocalDevicePtr xf86FirstLocalDevice(void); -extern _X_EXPORT int xf86ScaleAxis(int Cx, int Sxhigh, int Sxlow, int Rxhigh, int Rxlow); +extern _X_EXPORT int xf86ScaleAxis(int Cx, int to_max, int to_min, int from_max, int from_min); extern _X_EXPORT void xf86XInputSetScreen(LocalDevicePtr local, int screen_number, int x, int y); extern _X_EXPORT void xf86ProcessCommonOptions(InputInfoPtr pInfo, pointer options); extern _X_EXPORT void xf86InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, Atom label, int minval, From e2ada55de3e7ec8724b98c4e4adfec741d415499 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 27 Sep 2010 13:58:40 -0400 Subject: [PATCH 02/80] os: Clean up various xtrans bits that we've never supported Or at least, not supported since xserver 1.0. Reviewed-by: Alan Coopersmith Signed-off-by: Adam Jackson --- os/access.c | 137 ++++-------------------------------------------- os/connection.c | 11 +--- os/xdmcp.c | 2 +- 3 files changed, 13 insertions(+), 137 deletions(-) diff --git a/os/access.c b/os/access.c index 027925927..d9de2649d 100644 --- a/os/access.c +++ b/os/access.c @@ -104,11 +104,7 @@ SOFTWARE. #if defined(TCPCONN) || defined(STREAMSCONN) || defined(__SCO__) #include -#endif /* TCPCONN || STREAMSCONN || ISC || __SCO__ */ -#ifdef DNETCONN -#include -#include -#endif +#endif /* TCPCONN || STREAMSCONN || __SCO__ */ #ifdef HAS_GETPEERUCRED # include @@ -333,7 +329,7 @@ ifioctl (int fd, int cmd, char *arg) } #else /* Case sun, SCO325 and others */ #define ifioctl ioctl -#endif /* ((SVR4 && !sun !SCO325) || ISC) && SIOCGIFCONF */ +#endif /* * DefineSelf (fd): @@ -346,7 +342,7 @@ ifioctl (int fd, int cmd, char *arg) void DefineSelf (int fd) { -#if !defined(TCPCONN) && !defined(STREAMSCONN) && !defined(UNIXCONN) && !defined(MNX_TCPCONN) +#if !defined(TCPCONN) && !defined(STREAMSCONN) && !defined(UNIXCONN) return; #else register int n; @@ -480,7 +476,7 @@ DefineLocalHost: selfhosts = host; } } -#endif /* !TCPCONN && !STREAMSCONN && !UNIXCONN && !MNX_TCPCONN */ +#endif /* !TCPCONN && !STREAMSCONN && !UNIXCONN */ } #else @@ -545,35 +541,6 @@ DefineSelf (int fd) int family; register HOST *host; -#ifdef DNETCONN - struct dn_naddr *dnaddr = getnodeadd(); - /* - * AF_DECnet may not be listed in the interface list. Instead use - * the supported library call to find out the local address (if any). - */ - if (dnaddr) - { - addr = (unsigned char *) dnaddr; - len = dnaddr->a_len + sizeof(dnaddr->a_len); - family = FamilyDECnet; - for (host = selfhosts; - host && !addrEqual (family, addr, len, host); - host = host->next) - ; - if (!host) - { - MakeHost(host,len) - if (host) - { - host->family = family; - host->len = len; - acopy(addr, host->addr, len); - host->next = selfhosts; - selfhosts = host; - } - } - } -#endif /* DNETCONN */ #ifndef HAS_GETIFADDRS len = sizeof(buf); @@ -624,13 +591,6 @@ DefineSelf (int fd) len = ifraddr_size (IFR_IFR_ADDR); family = ConvertAddr ((struct sockaddr *) &IFR_IFR_ADDR, &len, (pointer *)&addr); -#ifdef DNETCONN - /* - * DECnet was handled up above. - */ - if (family == AF_DECnet) - continue; -#endif /* DNETCONN */ if (family == -1 || family == FamilyLocal) continue; #if defined(IPv6) && defined(AF_INET6) @@ -760,10 +720,6 @@ DefineSelf (int fd) for (ifr = ifap; ifr != NULL; ifr = ifr->ifa_next) { if (!ifr->ifa_addr) continue; -#ifdef DNETCONN - if (ifr->ifa_addr.sa_family == AF_DECnet) - continue; -#endif /* DNETCONN */ len = sizeof(*(ifr->ifa_addr)); family = ConvertAddr((struct sockaddr *) ifr->ifa_addr, &len, (pointer *)&addr); @@ -919,21 +875,14 @@ ResetHosts (char *display) FILE *fd; char *ptr; int i, hostlen; -#if ((defined(TCPCONN) || defined(STREAMSCONN) || defined(MNX_TCPCONN)) && \ - (!defined(IPv6) || !defined(AF_INET6))) || defined(DNETCONN) +#if (defined(TCPCONN) || defined(STREAMSCONN) ) && \ + (!defined(IPv6) || !defined(AF_INET6)) union { struct sockaddr sa; -#if defined(TCPCONN) || defined(STREAMSCONN) || defined(MNX_TCPCONN) +#if defined(TCPCONN) || defined(STREAMSCONN) struct sockaddr_in in; #endif /* TCPCONN || STREAMSCONN */ -#ifdef DNETCONN - struct sockaddr_dn dn; -#endif } saddr; -#endif -#ifdef DNETCONN - struct nodeent *np; - struct dn_naddr dnaddr, *dnaddrp, *dnet_addr(); #endif int family = 0; pointer addr; @@ -980,7 +929,7 @@ ResetHosts (char *display) NewHost(family, "", 0, FALSE); LocalHostRequested = TRUE; /* Fix for XFree86 bug #156 */ } -#if defined(TCPCONN) || defined(STREAMSCONN) || defined(MNX_TCPCONN) +#if defined(TCPCONN) || defined(STREAMSCONN) else if (!strncmp("inet:", lhostname, 5)) { family = FamilyInternet; @@ -994,13 +943,6 @@ ResetHosts (char *display) } #endif #endif -#ifdef DNETCONN - else if (!strncmp("dnet:", lhostname, 5)) - { - family = FamilyDECnet; - hostname = ohostname + 5; - } -#endif #ifdef SECURE_RPC else if (!strncmp("nis:", lhostname, 4)) { @@ -1024,32 +966,6 @@ ResetHosts (char *display) } } else -#ifdef DNETCONN - if ((family == FamilyDECnet) || ((family == FamilyWild) && - (ptr = strchr(hostname, ':')) && (*(ptr + 1) == ':') && - !(*ptr = '\0'))) /* bash trailing colons if necessary */ - { - /* node name (DECnet names end in "::") */ - dnaddrp = dnet_addr(hostname); - if (!dnaddrp && (np = getnodebyname (hostname))) - { - /* node was specified by name */ - saddr.sa.sa_family = np->n_addrtype; - len = sizeof(saddr.sa); - if (ConvertAddr (&saddr.sa, &len, (pointer *)&addr) == FamilyDECnet) - { - memset((char *) &dnaddr, 0, sizeof (dnaddr)); - dnaddr.a_len = np->n_length; - acopy (np->n_addr, dnaddr.a_addr, np->n_length); - dnaddrp = &dnaddr; - } - } - if (dnaddrp) - (void) NewHost(FamilyDECnet, (pointer)dnaddrp, - (int)(dnaddrp->a_len + sizeof(dnaddrp->a_len)), FALSE); - } - else -#endif /* DNETCONN */ #ifdef SECURE_RPC if ((family == FamilyNetname) || (strchr(hostname, '@'))) { @@ -1058,7 +974,7 @@ ResetHosts (char *display) } else #endif /* SECURE_RPC */ -#if defined(TCPCONN) || defined(STREAMSCONN) || defined(MNX_TCPCONN) +#if defined(TCPCONN) || defined(STREAMSCONN) { #if defined(IPv6) && defined(AF_INET6) if ( (family == FamilyInternet) || (family == FamilyInternet6) || @@ -1523,7 +1439,7 @@ CheckAddr ( switch (family) { -#if defined(TCPCONN) || defined(STREAMSCONN) || defined(MNX_TCPCONN) +#if defined(TCPCONN) || defined(STREAMSCONN) case FamilyInternet: if (length == sizeof (struct in_addr)) len = length; @@ -1539,21 +1455,6 @@ CheckAddr ( break; #endif #endif -#ifdef DNETCONN - case FamilyDECnet: - { - struct dn_naddr *dnaddr = (struct dn_naddr *) pAddr; - - if ((length < sizeof(dnaddr->a_len)) || - (length < dnaddr->a_len + sizeof(dnaddr->a_len))) - len = -1; - else - len = dnaddr->a_len + sizeof(dnaddr->a_len); - if (len > sizeof(struct dn_naddr)) - len = -1; - } - break; -#endif case FamilyServerInterpreted: len = siCheckAddr(pAddr, length); break; @@ -1631,7 +1532,7 @@ ConvertAddr ( case AF_UNIX: #endif return FamilyLocal; -#if defined(TCPCONN) || defined(STREAMSCONN) || defined(MNX_TCPCONN) +#if defined(TCPCONN) || defined(STREAMSCONN) case AF_INET: #ifdef WIN32 if (16777343 == *(long*)&((struct sockaddr_in *) saddr)->sin_addr) @@ -1655,22 +1556,6 @@ ConvertAddr ( } } #endif -#endif -#ifdef DNETCONN - case AF_DECnet: - { - struct sockaddr_dn *sdn = (struct sockaddr_dn *) saddr; - *len = sdn->sdn_nodeaddrl + sizeof(sdn->sdn_nodeaddrl); - *addr = (pointer) &(sdn->sdn_add); - } - return FamilyDECnet; -#endif -#ifdef CHAOSCONN - case AF_CHAOS: - { - not implemented - } - return FamilyChaos; #endif default: return -1; diff --git a/os/connection.c b/os/connection.c index 28cd1935c..5452ae112 100644 --- a/os/connection.c +++ b/os/connection.c @@ -113,9 +113,6 @@ SOFTWARE. #define Pid_t pid_t -#ifdef DNETCONN -#include -#endif /* DNETCONN */ #ifdef HAS_GETPEERUCRED # include @@ -521,7 +518,7 @@ AuthAudit (ClientPtr client, Bool letin, #endif strcpy(out, "local host"); break; -#if defined(TCPCONN) || defined(STREAMSCONN) || defined(MNX_TCPCONN) +#if defined(TCPCONN) || defined(STREAMSCONN) case AF_INET: sprintf(out, "IP %s", inet_ntoa(((struct sockaddr_in *) saddr)->sin_addr)); @@ -535,12 +532,6 @@ AuthAudit (ClientPtr client, Bool letin, } break; #endif -#endif -#ifdef DNETCONN - case AF_DECnet: - sprintf(out, "DN %s", - dnet_ntoa(&((struct sockaddr_dn *) saddr)->sdn_add)); - break; #endif default: strcpy(out, "unknown address"); diff --git a/os/xdmcp.c b/os/xdmcp.c index 8fd903fe5..877b11c15 100644 --- a/os/xdmcp.c +++ b/os/xdmcp.c @@ -1520,7 +1520,7 @@ get_addr_by_name( #ifdef XTHREADS_NEEDS_BYNAMEPARAMS _Xgethostbynameparams hparams; #endif -#if defined(WIN32) && (defined(TCPCONN) || defined(DNETCONN)) +#if defined(WIN32) && defined(TCPCONN) _XSERVTransWSAStartup(); #endif if (!(hep = _XGethostbyname(namestr, hparams))) From 424b856e8e19f35c24bfc0a9fced9464d2f17c90 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 15 Oct 2010 14:35:22 +1000 Subject: [PATCH 03/80] dix: update comments for GetPointerEvents and friends All these now generate InternalEvents, point this out. Remove XKB/XI references, that's just confusing. This comment referred to the old-style event generation code from server 1.4 to including 1.6 but is now just confusing to newcomers. Remove comment about SwitchCoreKeyboard() for the same reason. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas --- dix/getevents.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/dix/getevents.c b/dix/getevents.c index e5134d34b..ecbf416b1 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -894,20 +894,12 @@ GetKeyboardEvents(EventList *events, DeviceIntPtr pDev, int type, int key_code) /** - * Returns a set of keyboard events for KeyPress/KeyRelease, optionally - * also with valuator events. Handles Xi and XKB. - * - * DOES NOT GENERATE CORE EVENTS! Core events are created when processing the - * event (ProcessOtherEvent). + * Returns a set of InternalEvents for KeyPress/KeyRelease, optionally + * also with valuator events. * * events is not NULL-terminated; the return value is the number of events. * The DDX is responsible for allocating the event structure in the first * place via GetMaximumEventsNum(), and for freeing it. - * - * This function does not change the core keymap to that of the device; - * that is done by SwitchCoreKeyboard, which is called from - * mieqProcessInputEvents. If replacing that function, take care to call - * SetCoreKeyboard before processInputProc, so keymaps are altered to suit. */ int GetKeyboardValuatorEvents(EventList *events, DeviceIntPtr pDev, int type, @@ -1050,11 +1042,8 @@ transformAbsolute(DeviceIntPtr dev, int v[MAX_VALUATORS]) } /** - * Generate a series of xEvents (filled into the EventList) representing - * pointer motion, or button presses. Xi and XKB-aware. - * - * DOES NOT GENERATE CORE EVENTS! Core events are created when processing the - * event (ProcessOtherEvent). + * Generate a series of InternalEvents (filled into the EventList) + * representing pointer motion, or button presses. * * events is not NULL-terminated; the return value is the number of events. * The DDX is responsible for allocating the event structure in the first @@ -1183,7 +1172,8 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons, /** - * Post ProximityIn/ProximityOut events, accompanied by valuators. + * Generate ProximityIn/ProximityOut InternalEvents, accompanied by + * valuators. * * events is not NULL-terminated; the return value is the number of events. * The DDX is responsible for allocating the event structure in the first From e354ccac36a8ee3a23bdc845833c16a5646cc200 Mon Sep 17 00:00:00 2001 From: Joe Shaw Date: Thu, 14 Oct 2010 15:09:20 -0400 Subject: [PATCH 04/80] fix a sign problem with valuator data. Without this patch, any negative valuator value is wrong when returned from XQueryDeviceState(). This is a regression from at least xserver 1.4. Valuator data is set in dix/getevents.c:set_valuators() by copying signed int values into an unsigned int field DeviceEvent.valuators.data. That data is converted into a double with an implicit cast by assignment to axisVal[i] in Xi/exevents.c:UpdateDeviceState(). That double is converted back to a signed int in queryst.c:ProcXQueryDeviceState(). If the original value in set_valuators() is negative, the double value will be > 2^31 and the conversion back to a signed int is undefined. (Although I consistently see the value -2^31.) Fix this by changing the definition of DeviceEvent.valuators.data from uint32_t to int32_t. Signed-off-by: Joe Shaw Reviewed-by: Chase Douglas Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- dix/getevents.c | 2 +- include/eventstr.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dix/getevents.c b/dix/getevents.c index ecbf416b1..3731a4a38 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -210,7 +210,7 @@ set_valuators(DeviceIntPtr dev, DeviceEvent* event, int first_valuator, } memcpy(&event->valuators.data[first_valuator], - valuators, num_valuators * sizeof(uint32_t)); + valuators, num_valuators * sizeof(int32_t)); } diff --git a/include/eventstr.h b/include/eventstr.h index 433227e6e..377cceba2 100644 --- a/include/eventstr.h +++ b/include/eventstr.h @@ -99,7 +99,7 @@ struct _DeviceEvent struct { uint8_t mask[(MAX_VALUATORS + 7)/8]; /**< Valuator mask */ uint8_t mode[(MAX_VALUATORS + 7)/8]; /**< Valuator mode (Abs or Rel)*/ - uint32_t data[MAX_VALUATORS]; /**< Valuator data */ + int32_t data[MAX_VALUATORS]; /**< Valuator data */ int32_t data_frac[MAX_VALUATORS]; /**< Fractional part for data */ } valuators; struct { From 8bb1983a5f2dbf72366de9fb793a46e35912ab61 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 2 Aug 2010 15:22:18 -0400 Subject: [PATCH 05/80] config: Don't look for .o drivers anymore This hasn't worked since we switched to dlloader. Reviewed-by: Jesse Adkins Reviewed-by: Matt Turner Signed-off-by: Adam Jackson --- hw/xfree86/common/xf86Config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 6743b1081..15ff75034 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -549,7 +549,7 @@ GenerateDriverlist(char * dirname) { char **ret; const char *subdirs[] = { dirname, NULL }; - static const char *patlist[] = {"(.*)_drv\\.so", "(.*)_drv\\.o", NULL}; + static const char *patlist[] = {"(.*)_drv\\.so", NULL}; ret = LoaderListDirs(subdirs, patlist); /* fix up the probe order for video drivers */ From 52577ae8eeda64601db8dd425027cf8e4271b873 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 14 Oct 2010 13:22:00 -0400 Subject: [PATCH 06/80] config: Remove atimisc workaround Reviewed-by: Matt Turner Reviewed-by: Mark Kettenis Reviewed-by: Jesse Adkins Signed-off-by: Adam Jackson --- hw/xfree86/common/xf86Config.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 15ff75034..a63f487a9 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -524,24 +524,6 @@ fixup_video_driver_list(char **drivers) } } } - /* - * since the ati wrapper driver is gross and awful, sort ati before - * atimisc, which makes sure all the ati symbols are visible in xorgcfg. - */ - for (drv = drivers; drv != end; drv++) { - if (!strcmp(*drv, "atimisc")) { - atimisc = drv; - for (drv = atimisc; drv != end; drv++) { - if (!strcmp(*drv, "ati")) { - ati = drv; - x = *ati; *ati = *atimisc; *atimisc = x; - return; - } - } - /* if we get here, ati was already ahead of atimisc */ - return; - } - } } static char ** From f8ec71603c796f3b272a0592cbb934c2a6e8d633 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 14 Oct 2010 13:45:31 -0400 Subject: [PATCH 07/80] xfree86: Remove an open-coded strtoul() Reviewed-by: Matt Turner Reviewed-by: Dan Nicholson Signed-off-by: Adam Jackson --- hw/xfree86/parser/scan.c | 49 +--------------------------------------- 1 file changed, 1 insertion(+), 48 deletions(-) diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c index e609bdfd5..97cd79c01 100644 --- a/hw/xfree86/parser/scan.c +++ b/hw/xfree86/parser/scan.c @@ -115,53 +115,6 @@ static int pushToken = LOCK_TOKEN; static int eol_seen = 0; /* private state to handle comments */ LexRec val; -/* - * xf86strToUL -- - * - * A portable, but restricted, version of strtoul(). It only understands - * hex, octal, and decimal. But it's good enough for our needs. - */ -static unsigned int -xf86strToUL (char *str) -{ - int base = 10; - char *p = str; - unsigned int tot = 0; - - if (*p == '0') - { - p++; - if ((*p == 'x') || (*p == 'X')) - { - p++; - base = 16; - } - else - base = 8; - } - while (*p) - { - if ((*p >= '0') && (*p <= ((base == 8) ? '7' : '9'))) - { - tot = tot * base + (*p - '0'); - } - else if ((base == 16) && (*p >= 'a') && (*p <= 'f')) - { - tot = tot * base + 10 + (*p - 'a'); - } - else if ((base == 16) && (*p >= 'A') && (*p <= 'F')) - { - tot = tot * base + 10 + (*p - 'A'); - } - else - { - return tot; - } - p++; - } - return tot; -} - /* * xf86getNextLine -- * @@ -434,7 +387,7 @@ again: configRBuf[i++] = c; configPos--; /* GJA -- one too far */ configRBuf[i] = '\0'; - val.num = xf86strToUL (configRBuf); + val.num = strtoul (configRBuf, NULL, 0); val.realnum = atof (configRBuf); return NUMBER; } From a77458486a7b9d78dcd284e2bcc96c1fda0e862a Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 14 Oct 2010 14:00:53 -0400 Subject: [PATCH 08/80] xfree86: Remove %M expansion from config parser This was to distinguish XFree86 3.x files from XFree86 4.x files. It never really made sense to be looking for xorg.conf-4. Reviewed-by: Matt Turner Reviewed-by: Dan Nicholson Reviewed-by: Jesse Adkins Signed-off-by: Adam Jackson --- hw/xfree86/common/xf86Config.c | 12 ++++++------ hw/xfree86/doc/man/xorg.conf.man.pre | 6 ------ hw/xfree86/parser/scan.c | 14 -------------- 3 files changed, 6 insertions(+), 26 deletions(-) diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index a63f487a9..037064339 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -78,19 +78,19 @@ extern DeviceAssocRec mouse_assoc; "/etc/X11/%R," "%P/etc/X11/%R," \ "%E," "%F," \ "/etc/X11/%F," "%P/etc/X11/%F," \ - "/etc/X11/%X-%M," "/etc/X11/%X," "/etc/%X," \ - "%P/etc/X11/%X.%H," "%P/etc/X11/%X-%M," \ + "/etc/X11/%X," "/etc/%X," \ + "%P/etc/X11/%X.%H," \ "%P/etc/X11/%X," \ - "%P/lib/X11/%X.%H," "%P/lib/X11/%X-%M," \ + "%P/lib/X11/%X.%H," \ "%P/lib/X11/%X" #endif #ifndef USER_CONFIGPATH #define USER_CONFIGPATH "/etc/X11/%S," "%P/etc/X11/%S," \ "/etc/X11/%G," "%P/etc/X11/%G," \ - "/etc/X11/%X-%M," "/etc/X11/%X," "/etc/%X," \ - "%P/etc/X11/%X.%H," "%P/etc/X11/%X-%M," \ + "/etc/X11/%X," "/etc/%X," \ + "%P/etc/X11/%X.%H," \ "%P/etc/X11/%X," \ - "%P/lib/X11/%X.%H," "%P/lib/X11/%X-%M," \ + "%P/lib/X11/%X.%H," \ "%P/lib/X11/%X" #endif #ifndef ROOT_CONFIGDIRPATH diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre index 6b3636fff..cbfea7d98 100644 --- a/hw/xfree86/doc/man/xorg.conf.man.pre +++ b/hw/xfree86/doc/man/xorg.conf.man.pre @@ -39,14 +39,11 @@ server is started as a normal user: .IR __projectroot__/etc/X11/ .IB /etc/X11/ $XORGCONFIG .IB __projectroot__/etc/X11/ $XORGCONFIG -.I /etc/X11/__xconfigfile__\-4 .I /etc/X11/__xconfigfile__ .I /etc/__xconfigfile__ .IR __projectroot__/etc/X11/__xconfigfile__. -.I __projectroot__/etc/X11/__xconfigfile__\-4 .I __projectroot__/etc/X11/__xconfigfile__ .IR __projectroot__/lib/X11/__xconfigfile__. -.I __projectroot__/lib/X11/__xconfigfile__\-4 .I __projectroot__/lib/X11/__xconfigfile__ .fi .RE @@ -74,14 +71,11 @@ search locations are as follows: .B $XORGCONFIG .IB /etc/X11/ $XORGCONFIG .IB __projectroot__/etc/X11/ $XORGCONFIG -.I /etc/X11/__xconfigfile__\-4 .I /etc/X11/__xconfigfile__ .I /etc/__xconfigfile__ .IR __projectroot__/etc/X11/__xconfigfile__. -.I __projectroot__/etc/X11/__xconfigfile__\-4 .I __projectroot__/etc/X11/__xconfigfile__ .IR __projectroot__/lib/X11/__xconfigfile__. -.I __projectroot__/lib/X11/__xconfigfile__\-4 .I __projectroot__/lib/X11/__xconfigfile__ .fi .RE diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c index 97cd79c01..e4fce309f 100644 --- a/hw/xfree86/parser/scan.c +++ b/hw/xfree86/parser/scan.c @@ -554,7 +554,6 @@ xf86pathIsSafe(const char *path) * %P projroot * %C sysconfdir * %D datadir - * %M config file format version number * %% % */ @@ -579,11 +578,6 @@ xf86pathIsSafe(const char *path) #ifndef XCONFENV #define XCONFENV "XORGCONFIG" #endif -/* xorg.conf is based on XF86Config version 4. If we ever break - compatibility of the xorg.conf syntax, we'll bump this version number. */ -#ifndef CONFIG_FILE_VERSION -#define CONFIG_FILE_VERSION 4 -#endif #define BAIL_OUT do { \ free(result); \ @@ -614,7 +608,6 @@ DoSubstitution(const char *template, const char *cmdline, const char *projroot, int i, l; static const char *env = NULL; static char *hostname = NULL; - static char majorvers[3] = ""; if (!template) return NULL; @@ -715,13 +708,6 @@ DoSubstitution(const char *template, const char *cmdline, const char *projroot, case 'D': APPEND_STR(DATADIR); break; - case 'M': - if (!majorvers[0]) { - snprintf(majorvers, sizeof(majorvers), - "%d", CONFIG_FILE_VERSION); - } - APPEND_STR(majorvers); - break; case '%': result[l++] = '%'; CHECK_LENGTH; From 788bfbf18ac19923604b0d676933fdc0d78526a1 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 14 Oct 2010 15:10:43 -0400 Subject: [PATCH 09/80] dri1: Remove "buffers" from the config logic This was only ever used from the glint driver, which has since lost its DRI support. Reviewed-by: Matt Turner Signed-off-by: Adam Jackson --- hw/xfree86/common/xf86Config.c | 22 ------------ hw/xfree86/parser/DRI.c | 64 ---------------------------------- hw/xfree86/parser/xf86Parser.h | 11 ------ hw/xfree86/parser/xf86tokens.h | 1 - 4 files changed, 98 deletions(-) diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 037064339..92fb74da8 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -2211,15 +2211,11 @@ configDevice(GDevPtr devicep, XF86ConfDevicePtr conf_device, Bool active) static void configDRI(XF86ConfDRIPtr drip) { - int count = 0; - XF86ConfBuffersPtr bufs; int i; struct group *grp; xf86ConfigDRI.group = -1; xf86ConfigDRI.mode = 0; - xf86ConfigDRI.bufs_count = 0; - xf86ConfigDRI.bufs = NULL; if (drip) { if (drip->dri_group_name) { @@ -2230,24 +2226,6 @@ configDRI(XF86ConfDRIPtr drip) xf86ConfigDRI.group = drip->dri_group; } xf86ConfigDRI.mode = drip->dri_mode; - for (bufs = drip->dri_buffers_lst; bufs; bufs = bufs->list.next) - ++count; - - xf86ConfigDRI.bufs_count = count; - xf86ConfigDRI.bufs = xnfalloc(count * sizeof(*xf86ConfigDRI.bufs)); - - for (i = 0, bufs = drip->dri_buffers_lst; - i < count; - i++, bufs = bufs->list.next) { - - xf86ConfigDRI.bufs[i].count = bufs->buf_count; - xf86ConfigDRI.bufs[i].size = bufs->buf_size; - /* FIXME: Flags not implemented. These - could be used, for example, to specify a - contiguous block and/or write-combining - cache policy. */ - xf86ConfigDRI.bufs[i].flags = 0; - } } } #endif diff --git a/hw/xfree86/parser/DRI.c b/hw/xfree86/parser/DRI.c index 12b8d1d1a..f51f6b989 100644 --- a/hw/xfree86/parser/DRI.c +++ b/hw/xfree86/parser/DRI.c @@ -41,58 +41,10 @@ static xf86ConfigSymTabRec DRITab[] = { {ENDSECTION, "endsection"}, {GROUP, "group"}, - {BUFFERS, "buffers"}, {MODE, "mode"}, {-1, ""}, }; -#define CLEANUP xf86freeBuffersList - -static void -xf86freeBuffersList (XF86ConfBuffersPtr ptr) -{ - XF86ConfBuffersPtr prev; - - while (ptr) { - TestFree (ptr->buf_flags); - TestFree (ptr->buf_comment); - prev = ptr; - ptr = ptr->list.next; - free (prev); - } -} - -static XF86ConfBuffersPtr -xf86parseBuffers (void) -{ - int token; - parsePrologue (XF86ConfBuffersPtr, XF86ConfBuffersRec) - - if (xf86getSubToken (&(ptr->buf_comment)) != NUMBER) - Error ("Buffers count expected", NULL); - ptr->buf_count = val.num; - - if (xf86getSubToken (&(ptr->buf_comment)) != NUMBER) - Error ("Buffers size expected", NULL); - ptr->buf_size = val.num; - - if ((token = xf86getSubToken (&(ptr->buf_comment))) == STRING) { - ptr->buf_flags = val.str; - if ((token = xf86getToken (NULL)) == COMMENT) - ptr->buf_comment = xf86addComment(ptr->buf_comment, val.str); - else - xf86unGetToken(token); - } - -#ifdef DEBUG - printf ("Buffers parsed\n"); -#endif - - return ptr; -} - -#undef CLEANUP - #define CLEANUP xf86freeDRI XF86ConfDRIPtr @@ -121,10 +73,6 @@ xf86parseDRISection (void) Error (MUST_BE_OCTAL_MSG, val.num); ptr->dri_mode = val.num; break; - case BUFFERS: - HANDLE_LIST (dri_buffers_lst, xf86parseBuffers, - XF86ConfBuffersPtr); - break; case EOF_TOKEN: Error (UNEXPECTED_EOF_MSG, NULL); break; @@ -149,8 +97,6 @@ xf86parseDRISection (void) void xf86printDRISection (FILE * cf, XF86ConfDRIPtr ptr) { - XF86ConfBuffersPtr bufs; - if (ptr == NULL) return; @@ -163,15 +109,6 @@ xf86printDRISection (FILE * cf, XF86ConfDRIPtr ptr) fprintf (cf, "\tGroup %d\n", ptr->dri_group); if (ptr->dri_mode) fprintf (cf, "\tMode 0%o\n", ptr->dri_mode); - for (bufs = ptr->dri_buffers_lst; bufs; bufs = bufs->list.next) { - fprintf (cf, "\tBuffers %d %d", - bufs->buf_count, bufs->buf_size); - if (bufs->buf_flags) fprintf (cf, " \"%s\"", bufs->buf_flags); - if (bufs->buf_comment) - fprintf(cf, "%s", bufs->buf_comment); - else - fprintf (cf, "\n"); - } fprintf (cf, "EndSection\n\n"); } @@ -181,7 +118,6 @@ xf86freeDRI (XF86ConfDRIPtr ptr) if (ptr == NULL) return; - xf86freeBuffersList (ptr->dri_buffers_lst); TestFree (ptr->dri_comment); free (ptr); } diff --git a/hw/xfree86/parser/xf86Parser.h b/hw/xfree86/parser/xf86Parser.h index 337ad0718..9f0a602ed 100644 --- a/hw/xfree86/parser/xf86Parser.h +++ b/hw/xfree86/parser/xf86Parser.h @@ -440,22 +440,11 @@ typedef struct } XF86ConfVendorRec, *XF86ConfVendorPtr; -typedef struct -{ - GenericListRec list; - int buf_count; - int buf_size; - char *buf_flags; - char *buf_comment; -} -XF86ConfBuffersRec, *XF86ConfBuffersPtr; - typedef struct { char *dri_group_name; int dri_group; int dri_mode; - XF86ConfBuffersPtr dri_buffers_lst; char *dri_comment; } XF86ConfDRIRec, *XF86ConfDRIPtr; diff --git a/hw/xfree86/parser/xf86tokens.h b/hw/xfree86/parser/xf86tokens.h index c16a8f551..ec04e4c7d 100644 --- a/hw/xfree86/parser/xf86tokens.h +++ b/hw/xfree86/parser/xf86tokens.h @@ -273,7 +273,6 @@ typedef enum { /* DRI Tokens */ GROUP, - BUFFERS, /* InputClass Tokens */ MATCH_PRODUCT, From 47c91dca8d8eecb429123e8370302831bcd57938 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 18 Oct 2010 15:40:28 -0400 Subject: [PATCH 10/80] xfree86: Drop linux libc5 support from the SIGIO code Reviewed-by: Tiago Vignatti Reviewed-by: Matt Turner Signed-off-by: Adam Jackson --- hw/xfree86/os-support/shared/sigio.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/hw/xfree86/os-support/shared/sigio.c b/hw/xfree86/os-support/shared/sigio.c index aed5654e8..274a8ab7e 100644 --- a/hw/xfree86/os-support/shared/sigio.c +++ b/hw/xfree86/os-support/shared/sigio.c @@ -1,4 +1,3 @@ - /* sigio.c -- Support for SIGIO handler installation and removal * Created: Thu Jun 3 15:39:18 1999 by faith@precisioninsight.com * @@ -67,14 +66,6 @@ # include #endif -/* - * Linux libc5 defines FASYNC, but not O_ASYNC. Don't know if it is - * functional or not. - */ -#if defined(FASYNC) && !defined(O_ASYNC) -# define O_ASYNC FASYNC -#endif - #ifdef MAXDEVICES /* MAXDEVICES represents the maximimum number of input devices usable * at the same time plus one entry for DRM support. From d2064fbb687839c297a851a5d85f32dfbbe4a0d5 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 18 Oct 2010 15:42:54 -0400 Subject: [PATCH 11/80] ddc: Don't probe for DDC/CI or EEPROM For whatever reason, some (broken) monitors will crash if you do this. We're not actually using this information for anything, so let's just not do it. Originally reported as http://bugzilla.redhat.com/620333 Reviewed-by: Alex Deucher Signed-off-by: Adam Jackson --- hw/xfree86/ddc/ddc.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/hw/xfree86/ddc/ddc.c b/hw/xfree86/ddc/ddc.c index 2d9d4dcd2..7c7dc9c6b 100644 --- a/hw/xfree86/ddc/ddc.c +++ b/hw/xfree86/ddc/ddc.c @@ -314,10 +314,6 @@ DDC2Init(int scrnIndex, I2CBusPtr pBus) dev = DDC2MakeDevice(pBus, 0x00A0, "ddc2"); if (xf86I2CProbeAddress(pBus, 0x0060)) DDC2MakeDevice(pBus, 0x0060, "E-EDID segment register"); - if (xf86I2CProbeAddress(pBus, 0x0062)) - DDC2MakeDevice(pBus, 0x0062, "EDID EEPROM interface"); - if (xf86I2CProbeAddress(pBus, 0x006E)) - DDC2MakeDevice(pBus, 0x006E, "DDC control interface"); return dev; } From 6dd775f57d2f94f0ddaee324aeec33b9b66ed5bc Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 18 Oct 2010 15:50:37 -0400 Subject: [PATCH 12/80] composite: Don't backfill non-bg-None windows If there's a defined background then backfilling is a waste of effort, since exposure processing will paint that in for us. But note that we have to backfill if any children are bg=None to preserve semantics with non-composited servers. Reviewed-by: Keith Packard Signed-off-by: Adam Jackson --- composite/compalloc.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/composite/compalloc.c b/composite/compalloc.c index d8ccc1181..253acb31d 100644 --- a/composite/compalloc.c +++ b/composite/compalloc.c @@ -472,6 +472,17 @@ compUnredirectOneSubwindow (WindowPtr pParent, WindowPtr pWin) return Success; } +static int +bgNoneVisitWindow(WindowPtr pWin, void *null) +{ + if (pWin->backgroundState != BackgroundPixmap) + return WT_WALKCHILDREN; + if (pWin->background.pixmap != None) + return WT_WALKCHILDREN; + + return WT_STOPWALKING; +} + static PixmapPtr compNewPixmap (WindowPtr pWin, int x, int y, int w, int h) { @@ -487,7 +498,18 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h) pPixmap->screen_x = x; pPixmap->screen_y = y; - + + /* + * If there's no bg=None in the tree, we're done. + * + * We could optimize this more by collection the regions of all the + * bg=None subwindows and feeding that in as the clip for the + * CopyArea below, but since window trees are shallow these days it + * might not be worth the effort. + */ + if (TraverseTree(pWin, bgNoneVisitWindow, NULL) == WT_NOMATCH) + return pPixmap; + if (pParent->drawable.depth == pWin->drawable.depth) { GCPtr pGC = GetScratchGC (pWin->drawable.depth, pScreen); From db8840600e8e21356241eb87395031388d9b54d2 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 18 Oct 2010 15:52:52 -0400 Subject: [PATCH 13/80] composite: Don't backfill non-MapWindow allocations Reviewed-by: Keith Packard Signed-off-by: Adam Jackson --- composite/compalloc.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/composite/compalloc.c b/composite/compalloc.c index 253acb31d..f0d868ed1 100644 --- a/composite/compalloc.c +++ b/composite/compalloc.c @@ -484,7 +484,7 @@ bgNoneVisitWindow(WindowPtr pWin, void *null) } static PixmapPtr -compNewPixmap (WindowPtr pWin, int x, int y, int w, int h) +compNewPixmap (WindowPtr pWin, int x, int y, int w, int h, Bool map) { ScreenPtr pScreen = pWin->drawable.pScreen; WindowPtr pParent = pWin->parent; @@ -499,6 +499,10 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h) pPixmap->screen_x = x; pPixmap->screen_y = y; + /* resize allocations will update later in compCopyWindow, not here */ + if (!map) + return pPixmap; + /* * If there's no bg=None in the tree, we're done. * @@ -580,7 +584,7 @@ compAllocPixmap (WindowPtr pWin) int y = pWin->drawable.y - bw; int w = pWin->drawable.width + (bw << 1); int h = pWin->drawable.height + (bw << 1); - PixmapPtr pPixmap = compNewPixmap (pWin, x, y, w, h); + PixmapPtr pPixmap = compNewPixmap (pWin, x, y, w, h, TRUE); CompWindowPtr cw = GetCompWindow (pWin); if (!pPixmap) @@ -654,7 +658,7 @@ compReallocPixmap (WindowPtr pWin, int draw_x, int draw_y, pix_h = h + (bw << 1); if (pix_w != pOld->drawable.width || pix_h != pOld->drawable.height) { - pNew = compNewPixmap (pWin, pix_x, pix_y, pix_w, pix_h); + pNew = compNewPixmap (pWin, pix_x, pix_y, pix_w, pix_h, FALSE); if (!pNew) return FALSE; cw->pOldPixmap = pOld; From d6d90a4fccef086e7c7934adea901b2cd9a595bf Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 18 Oct 2010 15:53:43 -0400 Subject: [PATCH 14/80] composite: Move the backfill comment to a more appropriate indent level Reviewed-by: Keith Packard Signed-off-by: Adam Jackson --- composite/compalloc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composite/compalloc.c b/composite/compalloc.c index f0d868ed1..47d5c0a3c 100644 --- a/composite/compalloc.c +++ b/composite/compalloc.c @@ -514,14 +514,14 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h, Bool map) if (TraverseTree(pWin, bgNoneVisitWindow, NULL) == WT_NOMATCH) return pPixmap; + /* + * Copy bits from the parent into the new pixmap so that it will + * have "reasonable" contents in case for background None areas. + */ if (pParent->drawable.depth == pWin->drawable.depth) { GCPtr pGC = GetScratchGC (pWin->drawable.depth, pScreen); - /* - * Copy bits from the parent into the new pixmap so that it will - * have "reasonable" contents in case for background None areas. - */ if (pGC) { ChangeGCVal val; From 7bb653bedceb6180a0361ead1c612839e776ce98 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Mon, 18 Oct 2010 15:59:35 -0400 Subject: [PATCH 15/80] modes: improve aspect ratio match for classic drivers After we infer the aspect ratio for the screen, we pick the largest mode matching that aspect ratio from the best mode pool available. We then clamp virtual size to that mode, and run the resulting mode list through the driver's ValidMode hook. In doing so we might filter away our initial guess. If this happens we shrink the default mode to the next largest mode from _any_ mode pool. This is usually wrong, and we should instead pick the next aspect-matched mode from the best available mode pool (as always, user then driver then default). Reviewed-by: Alex Deucher Signed-off-by: Adam Jackson --- hw/xfree86/common/xf86Mode.c | 64 +++++++++++++++++++++++++++++++++--- 1 file changed, 59 insertions(+), 5 deletions(-) diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c index 7bdf79a68..d03310e20 100644 --- a/hw/xfree86/common/xf86Mode.c +++ b/hw/xfree86/common/xf86Mode.c @@ -1831,8 +1831,6 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, numModes++; } -#undef _VIRTUALX - /* * If we estimated the virtual size above, we may have filtered away all * the modes that maximally match that size; scan again to find out and @@ -1847,13 +1845,69 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, } } if (vx < virtX || vy < virtY) { + const int types[] = { + M_T_BUILTIN | M_T_PREFERRED, + M_T_BUILTIN, + M_T_DRIVER | M_T_PREFERRED, + M_T_DRIVER, + 0 + }; + const int ntypes = sizeof(types) / sizeof(int); + int n; + + /* + * We did not find the estimated virtual size. So now we want to + * find the largest mode available, but we want to search in the + * modes in the order of "types" listed above. + */ + for (n = 0; n < ntypes; n++) { + int type = types[n]; + + vx = 0; vy = 0; + for (p = scrp->modes; p; p = p->next) { + /* scan through the modes in the sort order above */ + if ((p->type & type) != type) + continue; + if (p->HDisplay > vx && p->VDisplay > vy) { + vx = p->HDisplay; + vy = p->VDisplay; + } + } + if (vx && vy) + /* Found one */ + break; + } xf86DrvMsg(scrp->scrnIndex, X_WARNING, "Shrinking virtual size estimate from %dx%d to %dx%d\n", virtX, virtY, vx, vy); - virtX = vx; + virtX = _VIRTUALX(vx); virtY = vy; - linePitch = scanLineWidth(vx, vy, minPitch, apertureSize, - BankFormat, pitchInc); + for (p = scrp->modes; p; p = p->next) { + if (numModes > 0) { + if (p->HDisplay > virtX) + p->status = MODE_VIRTUAL_X; + if (p->VDisplay > virtY) + p->status = MODE_VIRTUAL_Y; + if (p->status != MODE_OK) { + numModes--; + printModeRejectMessage(scrp->scrnIndex, p, p->status); + } + } + } + if (linePitches != NULL) { + for (i = 0; linePitches[i] != 0; i++) { + if ((linePitches[i] >= virtX) && + (linePitches[i] == + scanLineWidth(virtX, virtY, linePitches[i], + apertureSize, BankFormat, pitchInc))) { + linePitch = linePitches[i]; + break; + } + } + } else { + linePitch = scanLineWidth(virtX, virtY, minPitch, + apertureSize, BankFormat, pitchInc); + } } } From 5b98c6267f575ec4ff498ecb651e34dbff030b83 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 18 Oct 2010 16:01:40 -0400 Subject: [PATCH 16/80] randr: Remove mirandr This isn't used anywhere, not least because it's completely nonfunctional. Reviewed-by: Mikhail Gusarov Signed-off-by: Adam Jackson --- randr/Makefile.am | 1 - randr/mirandr.c | 165 ---------------------------------------------- randr/randrstr.h | 37 ----------- 3 files changed, 203 deletions(-) delete mode 100644 randr/mirandr.c diff --git a/randr/Makefile.am b/randr/Makefile.am index 1f1bea082..de338b972 100644 --- a/randr/Makefile.am +++ b/randr/Makefile.am @@ -9,7 +9,6 @@ sdk_HEADERS = randrstr.h rrtransform.h endif librandr_la_SOURCES = \ - mirandr.c \ randr.c \ randrstr.h \ rrcrtc.c \ diff --git a/randr/mirandr.c b/randr/mirandr.c deleted file mode 100644 index 05375e46c..000000000 --- a/randr/mirandr.c +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright © 2000 Compaq Computer Corporation - * Copyright © 2002 Hewlett-Packard Company - * Copyright © 2006 Intel Corporation - * - * 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, and - * that the name of the copyright holders not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. The copyright holders make no representations - * about the suitability of this software for any purpose. It is provided "as - * is" without express or implied warranty. - * - * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL THE COPYRIGHT HOLDERS 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. - * - * Author: Jim Gettys, Hewlett-Packard Company, Inc. - * Keith Packard, Intel Corporation - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "scrnintstr.h" -#include "mi.h" -#include "randrstr.h" -#include - -Bool -miRRGetInfo (ScreenPtr pScreen, Rotation *rotations) -{ - return TRUE; -} - -/* - * Any hardware that can actually change anything will need something - * different here - */ -Bool -miRRCrtcSet (ScreenPtr pScreen, - RRCrtcPtr crtc, - RRModePtr mode, - int x, - int y, - Rotation rotation, - int numOutput, - RROutputPtr *outputs) -{ - return TRUE; -} - -static Bool -miRRCrtcSetGamma (ScreenPtr pScreen, - RRCrtcPtr crtc) -{ - return TRUE; -} - -Bool -miRROutputSetProperty (ScreenPtr pScreen, - RROutputPtr output, - Atom property, - RRPropertyValuePtr value) -{ - return TRUE; -} - -Bool -miRROutputGetProperty (ScreenPtr pScreen, - RROutputPtr output, - Atom property) -{ - return TRUE; -} - -Bool -miRROutputValidateMode (ScreenPtr pScreen, - RROutputPtr output, - RRModePtr mode) -{ - return FALSE; -} - -void -miRRModeDestroy (ScreenPtr pScreen, - RRModePtr mode) -{ -} - -/* - * This function assumes that only a single depth can be - * displayed at a time, but that all visuals of that depth - * can be displayed simultaneously. It further assumes that - * only a single size is available. Hardware providing - * additional capabilties should use different code. - * XXX what to do here.... - */ - -Bool -miRandRInit (ScreenPtr pScreen) -{ - rrScrPrivPtr pScrPriv; -#if RANDR_12_INTERFACE - RRModePtr mode; - RRCrtcPtr crtc; - RROutputPtr output; - xRRModeInfo modeInfo; - char name[64]; -#endif - - if (!RRScreenInit (pScreen)) - return FALSE; - pScrPriv = rrGetScrPriv(pScreen); - pScrPriv->rrGetInfo = miRRGetInfo; -#if RANDR_12_INTERFACE - pScrPriv->rrCrtcSet = miRRCrtcSet; - pScrPriv->rrCrtcSetGamma = miRRCrtcSetGamma; - pScrPriv->rrOutputSetProperty = miRROutputSetProperty; -#if RANDR_13_INTERFACE - pScrPriv->rrOutputGetProperty = miRROutputGetProperty; -#endif - pScrPriv->rrOutputValidateMode = miRROutputValidateMode; - pScrPriv->rrModeDestroy = miRRModeDestroy; - - RRScreenSetSizeRange (pScreen, - pScreen->width, pScreen->height, - pScreen->width, pScreen->height); - - sprintf (name, "%dx%d", pScreen->width, pScreen->height); - memset (&modeInfo, '\0', sizeof (modeInfo)); - modeInfo.width = pScreen->width; - modeInfo.height = pScreen->height; - modeInfo.nameLength = strlen (name); - - mode = RRModeGet (&modeInfo, name); - if (!mode) - return FALSE; - - crtc = RRCrtcCreate (pScreen, NULL); - if (!crtc) - return FALSE; - - output = RROutputCreate (pScreen, "screen", 6, NULL); - if (!output) - return FALSE; - if (!RROutputSetClones (output, NULL, 0)) - return FALSE; - if (!RROutputSetModes (output, &mode, 1, 0)) - return FALSE; - if (!RROutputSetCrtcs (output, &crtc, 1)) - return FALSE; - if (!RROutputSetConnection (output, RR_Connected)) - return FALSE; - RRCrtcNotify (crtc, mode, 0, 0, RR_Rotate_0, NULL, 1, &output); -#endif - return TRUE; -} diff --git a/randr/randrstr.h b/randr/randrstr.h index 03652ef09..7ea608003 100644 --- a/randr/randrstr.h +++ b/randr/randrstr.h @@ -441,43 +441,6 @@ ProcRRGetScreenInfo (ClientPtr client); extern _X_EXPORT void RRDeliverScreenEvent (ClientPtr client, WindowPtr pWin, ScreenPtr pScreen); -/* mirandr.c */ -extern _X_EXPORT Bool -miRandRInit (ScreenPtr pScreen); - -extern _X_EXPORT Bool -miRRGetInfo (ScreenPtr pScreen, Rotation *rotations); - -extern _X_EXPORT Bool -miRRCrtcSet (ScreenPtr pScreen, - RRCrtcPtr crtc, - RRModePtr mode, - int x, - int y, - Rotation rotation, - int numOutput, - RROutputPtr *outputs); - -extern _X_EXPORT Bool -miRROutputSetProperty (ScreenPtr pScreen, - RROutputPtr output, - Atom property, - RRPropertyValuePtr value); - -extern _X_EXPORT Bool -miRROutputGetProperty (ScreenPtr pScreen, - RROutputPtr output, - Atom property); - -extern _X_EXPORT Bool -miRROutputValidateMode (ScreenPtr pScreen, - RROutputPtr output, - RRModePtr mode); - -extern _X_EXPORT void -miRRModeDestroy (ScreenPtr pScreen, - RRModePtr mode); - /* randr.c */ /* * Send all pending events From 9f8f056a21b9480fd9fd43a22c9d6f45a2c1ef87 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Tue, 23 Mar 2010 16:34:26 +0000 Subject: [PATCH 17/80] Cygwin/X: Cleanup some VENDOR_STRING/VENDOR_CONTACT cruft Cleanup some VENDOR_STRING/VENDOR_CONTACT cruft Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/winerror.c | 11 ++++------- hw/xwin/winprocarg.c | 9 +++------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/hw/xwin/winerror.c b/hw/xwin/winerror.c index cb69c57c2..01412dd1d 100644 --- a/hw/xwin/winerror.c +++ b/hw/xwin/winerror.c @@ -31,10 +31,6 @@ #ifdef HAVE_XWIN_CONFIG_H #include #endif -#ifdef XVENDORNAME -#define VENDOR_STRING XVENDORNAME -#define VENDOR_CONTACT BUILDERADDR -#endif #include <../xfree86/common/xorgVersion.h> #include "win.h" @@ -129,11 +125,12 @@ winMessageBoxF (const char *pszError, UINT uType, ...) "%s\n" pszMsgBox = Xprintf (MESSAGEBOXF, - pszErrorF, VENDOR_STRING, + pszErrorF, XVENDORNAME, XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH, XORG_VERSION_SNAP, XORG_VERSION_CURRENT, - VENDOR_CONTACT, + BUILDERADDR, BUILDERSTRING, - g_pszCommandLine); + g_pszCommandLine); + if (!pszMsgBox) goto winMessageBoxF_Cleanup; diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c index 66a0503f2..fea579763 100755 --- a/hw/xwin/winprocarg.c +++ b/hw/xwin/winprocarg.c @@ -30,10 +30,7 @@ from The Open Group. #ifdef HAVE_XWIN_CONFIG_H #include #endif -#ifdef XVENDORNAME -#define VENDOR_STRING XVENDORNAME -#define VENDOR_CONTACT BUILDERADDR -#endif + #include <../xfree86/common/xorgVersion.h> #include "win.h" #include "winconfig.h" @@ -1248,10 +1245,10 @@ winLogVersionInfo (void) s_fBeenHere = TRUE; ErrorF ("Welcome to the XWin X Server\n"); - ErrorF ("Vendor: %s\n", VENDOR_STRING); + ErrorF ("Vendor: %s\n", XVENDORNAME); ErrorF ("Release: %d.%d.%d.%d (%d)\n", XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH, XORG_VERSION_SNAP, XORG_VERSION_CURRENT); ErrorF ("%s\n\n", BUILDERSTRING); - ErrorF ("Contact: %s\n", VENDOR_CONTACT); + ErrorF ("Contact: %s\n", BUILDERADDR); } /* From 9ed70f15eff6a85222b46db1fe7af25154314464 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Mon, 2 Nov 2009 17:37:14 +0000 Subject: [PATCH 18/80] Cygwin/X: Use normal apostrophe in XWin DDX help text Use U+0027 APOSTROPHE in XWin DDX help text, rather than U+2019 RIGHT SINGLE QUOTATION MARK Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/InitOutput.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index 73cc263bd..445549a7f 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -873,7 +873,7 @@ winUseMsg (void) ErrorF ("-silent-dup-error\n" "\tIf another instance of " EXECUTABLE_NAME " with the same display number is running\n" - "\texit silently and don’t display any error message.\n"); + "\texit silently and don't display any error message.\n"); ErrorF ("-swcursor\n" "\tDisable the usage of the Windows cursor and use the X11 software\n" From b2b685e2693ff5f089006f5b3882d6b0c0853862 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Thu, 25 Mar 2010 23:00:48 +0000 Subject: [PATCH 19/80] Cygwin/X: unifdef XFree86Server Remove XFree86Server define, which was always on anyhow, and the code which was guarded by !XFree86Server This completes the process of removal started in 2006 :-) Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/Makefile.am | 1 - hw/xwin/winmouse.c | 9 +------- hw/xwin/winshaddd.c | 48 ------------------------------------------- hw/xwin/winshadddnl.c | 48 ------------------------------------------- hw/xwin/winshadgdi.c | 47 ------------------------------------------ 5 files changed, 1 insertion(+), 152 deletions(-) diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am index 03cb80824..58df308f9 100644 --- a/hw/xwin/Makefile.am +++ b/hw/xwin/Makefile.am @@ -162,7 +162,6 @@ AM_YFLAGS = -d AM_LFLAGS = -i AM_CFLAGS = -DHAVE_XWIN_CONFIG_H $(DIX_CFLAGS) \ $(XWINMODULES_CFLAGS) \ - -DXFree86Server \ -I$(top_srcdir) MAN_SRCS = XWin.man.pre XWinrc.man.pre diff --git a/hw/xwin/winmouse.c b/hw/xwin/winmouse.c index 342f20d56..5e1f756a0 100644 --- a/hw/xwin/winmouse.c +++ b/hw/xwin/winmouse.c @@ -36,14 +36,12 @@ #endif #include "win.h" -#if defined(XFree86Server) #include "inputstr.h" #include "exevents.h" /* for button/axes labels */ #include "xserver-properties.h" /* Peek the internal button mapping */ static CARD8 const *g_winMouseButtonMap = NULL; -#endif /* @@ -123,9 +121,7 @@ winMouseProc (DeviceIntPtr pDeviceInt, int iState) free(map); free(btn_labels); -#if defined(XFree86Server) g_winMouseButtonMap = pDeviceInt->button->map; -#endif break; case DEVICE_ON: @@ -133,9 +129,8 @@ winMouseProc (DeviceIntPtr pDeviceInt, int iState) break; case DEVICE_CLOSE: -#if defined(XFree86Server) g_winMouseButtonMap = NULL; -#endif + case DEVICE_OFF: pDevice->on = FALSE; break; @@ -241,10 +236,8 @@ winMouseButtonsSendEvent (int iEventType, int iButton) EventListPtr events; int i, nevents; -#if defined(XFree86Server) if (g_winMouseButtonMap) iButton = g_winMouseButtonMap[iButton]; -#endif GetEventList(&events); nevents = GetPointerEvents(events, g_pwinPointer, iEventType, iButton, diff --git a/hw/xwin/winshaddd.c b/hw/xwin/winshaddd.c index 8dd1084e6..5752730ff 100644 --- a/hw/xwin/winshaddd.c +++ b/hw/xwin/winshaddd.c @@ -828,7 +828,6 @@ winInitVisualsShadowDD (ScreenPtr pScreen) case 24: case 16: case 15: -#if defined(XFree86Server) /* Create the real visual */ if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth, TrueColorMask, @@ -861,42 +860,9 @@ winInitVisualsShadowDD (ScreenPtr pScreen) return FALSE; } #endif -#else /* XFree86Server */ - /* Create the real visual */ - if (!fbSetVisualTypesAndMasks (pScreenInfo->dwDepth, - TrueColorMask, - pScreenPriv->dwBitsPerRGB, - pScreenPriv->dwRedMask, - pScreenPriv->dwGreenMask, - pScreenPriv->dwBlueMask)) - { - ErrorF ("winInitVisualsShadowDD - fbSetVisualTypesAndMasks " - "failed for TrueColor\n"); - return FALSE; - } - -#ifdef XWIN_EMULATEPSEUDO - if (!pScreenInfo->fEmulatePseudo) - break; - - /* Setup a pseudocolor visual */ - if (!fbSetVisualTypesAndMasks (8, - PseudoColorMask, - 8, - 0, - 0, - 0)) - { - ErrorF ("winInitVisualsShadowDD - fbSetVisualTypesAndMasks " - "failed for PseudoColor\n"); - return FALSE; - } -#endif -#endif /* XFree86Server */ break; case 8: -#if defined(XFree86Server) if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth, pScreenInfo->fFullScreen ? PseudoColorMask : StaticColorMask, @@ -911,20 +877,6 @@ winInitVisualsShadowDD (ScreenPtr pScreen) "failed\n"); return FALSE; } -#else /* XFree86Server */ - if (!fbSetVisualTypesAndMasks (pScreenInfo->dwDepth, - pScreenInfo->fFullScreen - ? PseudoColorMask : StaticColorMask, - pScreenPriv->dwBitsPerRGB, - pScreenPriv->dwRedMask, - pScreenPriv->dwGreenMask, - pScreenPriv->dwBlueMask)) - { - ErrorF ("winInitVisualsShadowDD - fbSetVisualTypesAndMasks " - "failed\n"); - return FALSE; - } -#endif /* XFree86Server */ break; default: diff --git a/hw/xwin/winshadddnl.c b/hw/xwin/winshadddnl.c index 5ca3e4f62..0d59e6a6a 100644 --- a/hw/xwin/winshadddnl.c +++ b/hw/xwin/winshadddnl.c @@ -883,7 +883,6 @@ winInitVisualsShadowDDNL (ScreenPtr pScreen) case 24: case 16: case 15: -#if defined(XFree86Server) /* Setup the real visual */ if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth, TrueColorMask, @@ -916,42 +915,9 @@ winInitVisualsShadowDDNL (ScreenPtr pScreen) return FALSE; } #endif -#else /* XFree86Server */ - /* Setup the real visual */ - if (!fbSetVisualTypesAndMasks (pScreenInfo->dwDepth, - TrueColorMask, - pScreenPriv->dwBitsPerRGB, - pScreenPriv->dwRedMask, - pScreenPriv->dwGreenMask, - pScreenPriv->dwBlueMask)) - { - ErrorF ("winInitVisualsShadowDDNL - fbSetVisualTypesAndMasks " - "failed for TrueColor\n"); - return FALSE; - } - -#ifdef XWIN_EMULATEPSEUDO - if (!pScreenInfo->fEmulatePseudo) - break; - - /* Setup a pseudocolor visual */ - if (!fbSetVisualTypesAndMasks (8, - PseudoColorMask, - 8, - 0, - 0, - 0)) - { - ErrorF ("winInitVisualsShadowDDNL - fbSetVisualTypesAndMasks " - "failed for PseudoColor\n"); - return FALSE; - } -#endif -#endif /* XFree86Server */ break; case 8: -#if defined(XFree86Server) if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth, pScreenInfo->fFullScreen ? PseudoColorMask : StaticColorMask, @@ -966,20 +932,6 @@ winInitVisualsShadowDDNL (ScreenPtr pScreen) "failed\n"); return FALSE; } -#else /* XFree86Server */ - if (!fbSetVisualTypesAndMasks (pScreenInfo->dwDepth, - pScreenInfo->fFullScreen - ? PseudoColorMask : StaticColorMask, - pScreenPriv->dwBitsPerRGB, - pScreenPriv->dwRedMask, - pScreenPriv->dwGreenMask, - pScreenPriv->dwBlueMask)) - { - ErrorF ("winInitVisualsShadowDDNL - fbSetVisualTypesAndMasks " - "failed\n"); - return FALSE; - } -#endif /* XFree86Server */ break; default: diff --git a/hw/xwin/winshadgdi.c b/hw/xwin/winshadgdi.c index 96d149c2b..8af4be478 100644 --- a/hw/xwin/winshadgdi.c +++ b/hw/xwin/winshadgdi.c @@ -715,7 +715,6 @@ winInitVisualsShadowGDI (ScreenPtr pScreen) case 24: case 16: case 15: -#if defined(XFree86Server) /* Setup the real visual */ if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth, TrueColorMask, @@ -748,42 +747,9 @@ winInitVisualsShadowGDI (ScreenPtr pScreen) return FALSE; } #endif -#else /* XFree86Server */ - /* Setup the real visual */ - if (!fbSetVisualTypesAndMasks (pScreenInfo->dwDepth, - TrueColorMask, - pScreenPriv->dwBitsPerRGB, - pScreenPriv->dwRedMask, - pScreenPriv->dwGreenMask, - pScreenPriv->dwBlueMask)) - { - ErrorF ("winInitVisualsShadowGDI - fbSetVisualTypesAndMasks " - "failed for TrueColor\n"); - return FALSE; - } - -#ifdef XWIN_EMULATEPSEUDO - if (!pScreenInfo->fEmulatePseudo) - break; - - /* Setup a pseudocolor visual */ - if (!fbSetVisualTypesAndMasks (8, - PseudoColorMask, - 8, - 0, - 0, - 0)) - { - ErrorF ("winInitVisualsShadowGDI - fbSetVisualTypesAndMasks " - "failed for PseudoColor\n"); - return FALSE; - } -#endif -#endif /* XFree86Server */ break; case 8: -#if defined(XFree86Server) if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth, PseudoColorMask, pScreenPriv->dwBitsPerRGB, @@ -796,19 +762,6 @@ winInitVisualsShadowGDI (ScreenPtr pScreen) "failed\n"); return FALSE; } -#else /* XFree86Server */ - if (!fbSetVisualTypesAndMasks (pScreenInfo->dwDepth, - PseudoColorMask, - pScreenPriv->dwBitsPerRGB, - pScreenPriv->dwRedMask, - pScreenPriv->dwGreenMask, - pScreenPriv->dwBlueMask)) - { - ErrorF ("winInitVisualsShadowGDI - fbSetVisualTypesAndMasks " - "failed\n"); - return FALSE; - } -#endif break; default: From 55e528b6cc6451dbb1e65baec199d4df0441e86d Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Thu, 25 Mar 2010 23:39:37 +0000 Subject: [PATCH 20/80] Cygwin/X: Remove execute permission from source files Remove execute permission from source files Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/XWinrc.man.pre | 0 hw/xwin/glx/glwrap.c | 0 hw/xwin/glx/indirect.c | 0 hw/xwin/winclipboardwrappers.c | 0 hw/xwin/windialogs.c | 0 hw/xwin/winkeyhook.c | 0 hw/xwin/winmultiwindowclass.c | 0 hw/xwin/winmultiwindowclass.h | 0 hw/xwin/winprocarg.c | 0 hw/xwin/winrandr.c | 0 hw/xwin/wintrayicon.c | 0 hw/xwin/winvalargs.c | 0 hw/xwin/winvideo.c | 0 hw/xwin/winwin32rootless.c | 0 hw/xwin/winwin32rootlesswindow.c | 0 hw/xwin/winwin32rootlesswndproc.c | 0 hw/xwin/winwindowswm.c | 0 17 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 hw/xwin/XWinrc.man.pre mode change 100755 => 100644 hw/xwin/glx/glwrap.c mode change 100755 => 100644 hw/xwin/glx/indirect.c mode change 100755 => 100644 hw/xwin/winclipboardwrappers.c mode change 100755 => 100644 hw/xwin/windialogs.c mode change 100755 => 100644 hw/xwin/winkeyhook.c mode change 100755 => 100644 hw/xwin/winmultiwindowclass.c mode change 100755 => 100644 hw/xwin/winmultiwindowclass.h mode change 100755 => 100644 hw/xwin/winprocarg.c mode change 100755 => 100644 hw/xwin/winrandr.c mode change 100755 => 100644 hw/xwin/wintrayicon.c mode change 100755 => 100644 hw/xwin/winvalargs.c mode change 100755 => 100644 hw/xwin/winvideo.c mode change 100755 => 100644 hw/xwin/winwin32rootless.c mode change 100755 => 100644 hw/xwin/winwin32rootlesswindow.c mode change 100755 => 100644 hw/xwin/winwin32rootlesswndproc.c mode change 100755 => 100644 hw/xwin/winwindowswm.c diff --git a/hw/xwin/XWinrc.man.pre b/hw/xwin/XWinrc.man.pre old mode 100755 new mode 100644 diff --git a/hw/xwin/glx/glwrap.c b/hw/xwin/glx/glwrap.c old mode 100755 new mode 100644 diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c old mode 100755 new mode 100644 diff --git a/hw/xwin/winclipboardwrappers.c b/hw/xwin/winclipboardwrappers.c old mode 100755 new mode 100644 diff --git a/hw/xwin/windialogs.c b/hw/xwin/windialogs.c old mode 100755 new mode 100644 diff --git a/hw/xwin/winkeyhook.c b/hw/xwin/winkeyhook.c old mode 100755 new mode 100644 diff --git a/hw/xwin/winmultiwindowclass.c b/hw/xwin/winmultiwindowclass.c old mode 100755 new mode 100644 diff --git a/hw/xwin/winmultiwindowclass.h b/hw/xwin/winmultiwindowclass.h old mode 100755 new mode 100644 diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c old mode 100755 new mode 100644 diff --git a/hw/xwin/winrandr.c b/hw/xwin/winrandr.c old mode 100755 new mode 100644 diff --git a/hw/xwin/wintrayicon.c b/hw/xwin/wintrayicon.c old mode 100755 new mode 100644 diff --git a/hw/xwin/winvalargs.c b/hw/xwin/winvalargs.c old mode 100755 new mode 100644 diff --git a/hw/xwin/winvideo.c b/hw/xwin/winvideo.c old mode 100755 new mode 100644 diff --git a/hw/xwin/winwin32rootless.c b/hw/xwin/winwin32rootless.c old mode 100755 new mode 100644 diff --git a/hw/xwin/winwin32rootlesswindow.c b/hw/xwin/winwin32rootlesswindow.c old mode 100755 new mode 100644 diff --git a/hw/xwin/winwin32rootlesswndproc.c b/hw/xwin/winwin32rootlesswndproc.c old mode 100755 new mode 100644 diff --git a/hw/xwin/winwindowswm.c b/hw/xwin/winwindowswm.c old mode 100755 new mode 100644 From 1f2a57d9e46424a2e0861f55253b91d930d79083 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Fri, 15 Oct 2010 14:12:22 +0100 Subject: [PATCH 21/80] Cygwin/X: Turn off the bad-function-cast warning for XWin code Turn off the bad-function-cast warning for the XWin code, it's near impossible to write code which uses Win32 API calls that doesn't trigger this warning For example, SendMessage(WM_SETICON) returns an LRESULT, but we are supposed to know this is safe to cast this result to a HICON, which gcc considers a non-matching type. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am index 58df308f9..232d65e86 100644 --- a/hw/xwin/Makefile.am +++ b/hw/xwin/Makefile.am @@ -162,7 +162,8 @@ AM_YFLAGS = -d AM_LFLAGS = -i AM_CFLAGS = -DHAVE_XWIN_CONFIG_H $(DIX_CFLAGS) \ $(XWINMODULES_CFLAGS) \ - -I$(top_srcdir) + -I$(top_srcdir) \ + -Wno-bad-function-cast MAN_SRCS = XWin.man.pre XWinrc.man.pre From 44c8b449d281c4d984d65f66bac96a65806b2efa Mon Sep 17 00:00:00 2001 From: Colin Harrison Date: Fri, 15 Oct 2010 14:13:57 +0100 Subject: [PATCH 22/80] Xming: Fix warning in winClipboardErrorHandler() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit winclipboardthread.c: In function ‘winClipboardErrorHandler’: winclipboardthread.c:444: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘long unsigned int’ Signed-off-by: Jon TURNEY Reviewed-by: Jon TURNEY --- hw/xwin/winclipboardthread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xwin/winclipboardthread.c b/hw/xwin/winclipboardthread.c index 5d2b9487e..e7df4527e 100644 --- a/hw/xwin/winclipboardthread.c +++ b/hw/xwin/winclipboardthread.c @@ -437,7 +437,7 @@ winClipboardErrorHandler (Display *pDisplay, XErrorEvent *pErr) pszErrorMsg, sizeof (pszErrorMsg)); ErrorF ("winClipboardErrorHandler - ERROR: \n\t%s\n" - "\tSerial: %d, Request Code: %d, Minor Code: %d\n", + "\tSerial: %lu, Request Code: %d, Minor Code: %d\n", pszErrorMsg, pErr->serial, pErr->request_code, From 20510e51001d1659000c8d8607c0de16022d1c74 Mon Sep 17 00:00:00 2001 From: Colin Harrison Date: Fri, 15 Oct 2010 14:15:51 +0100 Subject: [PATCH 23/80] Xming: Fix warnings in winClipboardFlushXEvents() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit winclipboardxevents.c: In function ‘winClipboardFlushXEvents’: winclipboardxevents.c:225: warning: format ‘%08x’ expects type ‘unsigned int’, but argument 2 has type ‘DWORD’ winclipboardxevents.c:266: warning: format ‘%08x’ expects type ‘unsigned int’, but argument 2 has type ‘DWORD’ winclipboardxevents.c:619: warning: pointer targets in passing argument 1 of ‘strcat’ differ in signedness winclipboardxevents.c:659: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness winclipboardxevents.c:669: warning: pointer targets in passing argument 3 of ‘MultiByteToWideChar’ differ in signedness winclipboardxevents.c:690: warning: pointer targets in passing argument 3 of ‘MultiByteToWideChar’ differ in signedness winclipboardxevents.c:698: warning: pointer targets in passing argument 1 of ‘strdup’ differ in signedness Signed-off-by: Jon TURNEY Reviewed-by: Jon TURNEY --- hw/xwin/winclipboardxevents.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/xwin/winclipboardxevents.c b/hw/xwin/winclipboardxevents.c index edb6ac4bd..2f042fd0b 100644 --- a/hw/xwin/winclipboardxevents.c +++ b/hw/xwin/winclipboardxevents.c @@ -76,7 +76,7 @@ winClipboardFlushXEvents (HWND hwnd, XEvent event; XSelectionEvent eventSelection; unsigned long ulReturnBytesLeft; - unsigned char *pszReturnData = NULL; + char *pszReturnData = NULL; char *pszGlobalData = NULL; int iReturn; HGLOBAL hGlobal = NULL; @@ -221,7 +221,7 @@ winClipboardFlushXEvents (HWND hwnd, if (!OpenClipboard (hwnd)) { ErrorF ("winClipboardFlushXEvents - SelectionRequest - " - "OpenClipboard () failed: %08x\n", + "OpenClipboard () failed: %08lx\n", GetLastError ()); /* Abort */ @@ -262,7 +262,7 @@ winClipboardFlushXEvents (HWND hwnd, if (!hGlobal) { ErrorF ("winClipboardFlushXEvents - SelectionRequest - " - "GetClipboardData () failed: %08x\n", + "GetClipboardData () failed: %08lx\n", GetLastError ()); /* Abort */ From 6d9fb07db210bcfdcdde632fa341c4ee08d44b35 Mon Sep 17 00:00:00 2001 From: Colin Harrison Date: Fri, 15 Oct 2010 14:16:54 +0100 Subject: [PATCH 24/80] Xming: Fix warnings in winNameCompare(), winNormalizeName() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit winconfig.c: In function ‘winNameCompare’: winconfig.c:715: warning: array subscript has type ‘char’ winconfig.c:715: warning: array subscript has type ‘char’ winconfig.c:716: warning: array subscript has type ‘char’ winconfig.c:716: warning: array subscript has type ‘char’ winconfig.c:730: warning: array subscript has type ‘char’ winconfig.c:730: warning: array subscript has type ‘char’ winconfig.c:731: warning: array subscript has type ‘char’ winconfig.c:731: warning: array subscript has type ‘char’ winconfig.c: In function ‘winNormalizeName’: winconfig.c:1092: warning: array subscript has type ‘char’ winconfig.c:1093: warning: array subscript has type ‘char’ Signed-off-by: Jon TURNEY Reviewed-by: Jon TURNEY --- hw/xwin/winconfig.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/xwin/winconfig.c b/hw/xwin/winconfig.c index a88b6f1cf..758c54d89 100644 --- a/hw/xwin/winconfig.c +++ b/hw/xwin/winconfig.c @@ -712,8 +712,8 @@ winNameCompare (const char *s1, const char *s2) while (*s2 == '_' || *s2 == ' ' || *s2 == '\t') s2++; - c1 = (isupper (*s1) ? tolower (*s1) : *s1); - c2 = (isupper (*s2) ? tolower (*s2) : *s2); + c1 = (isupper ((int)*s1) ? tolower ((int)*s1) : *s1); + c2 = (isupper ((int)*s2) ? tolower ((int)*s2) : *s2); while (c1 == c2) { @@ -727,8 +727,8 @@ winNameCompare (const char *s1, const char *s2) while (*s2 == '_' || *s2 == ' ' || *s2 == '\t') s2++; - c1 = (isupper (*s1) ? tolower (*s1) : *s1); - c2 = (isupper (*s2) ? tolower (*s2) : *s2); + c1 = (isupper ((int)*s1) ? tolower ((int)*s1) : *s1); + c2 = (isupper ((int)*s2) ? tolower ((int)*s2) : *s2); } return c1 - c2; } @@ -1089,8 +1089,8 @@ winNormalizeName (const char *s) case '\t': continue; default: - if (isupper (*p)) - *q++ = tolower (*p); + if (isupper ((int)*p)) + *q++ = tolower ((int)*p); else *q++ = *p; } From da5955cc023ae980fdc0397f6fd541e788040c29 Mon Sep 17 00:00:00 2001 From: Colin Harrison Date: Fri, 15 Oct 2010 14:18:53 +0100 Subject: [PATCH 25/80] Xming: Fix warnings in windialogs.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit windialogs.c: In function ‘winDisplayExitDialog’: windialogs.c:327: warning: passing argument 3 of ‘PostMessageA’ makes integer from pointer without a cast windialogs.c: In function ‘winDisplayAboutDialog’: windialogs.c:597: warning: passing argument 3 of ‘PostMessageA’ makes integer from pointer without a cast windialogs.c: In function ‘winAboutDlgProc’: windialogs.c:697: warning: comparison between pointer and integer windialogs.c:701: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘HINSTANCE’ windialogs.c:716: warning: assignment makes integer from pointer without a cast windialogs.c:736: warning: assignment makes integer from pointer without a cast windialogs.c:756: warning: assignment makes integer from pointer without a cast Signed-off-by: Jon TURNEY Reviewed-by: Jon TURNEY --- hw/xwin/windialogs.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/xwin/windialogs.c b/hw/xwin/windialogs.c index 3ec9b78ff..270ff788e 100644 --- a/hw/xwin/windialogs.c +++ b/hw/xwin/windialogs.c @@ -324,7 +324,7 @@ winDisplayExitDialog (winPrivScreenPtr pScreenPriv) /* Set focus to the Cancel button */ PostMessage (g_hDlgExit, WM_NEXTDLGCTL, - GetDlgItem (g_hDlgExit, IDCANCEL), TRUE); + (WPARAM)GetDlgItem (g_hDlgExit, IDCANCEL), TRUE); } #define CONNECTED_CLIENTS_FORMAT "There %s currently %d client%s connected." @@ -594,7 +594,7 @@ winDisplayAboutDialog (winPrivScreenPtr pScreenPriv) /* Set focus to the OK button */ PostMessage (g_hDlgAbout, WM_NEXTDLGCTL, - GetDlgItem (g_hDlgAbout, IDOK), TRUE); + (WPARAM)GetDlgItem (g_hDlgAbout, IDOK), TRUE); } @@ -675,7 +675,7 @@ winAboutDlgProc (HWND hwndDialog, UINT message, case ID_ABOUT_CHANGELOG: { - HINSTANCE iReturn; + int iReturn; #ifdef __CYGWIN__ const char * pszCygPath = "/usr/X11R6/share/doc/" "xorg-x11-xwin/changelog.html"; @@ -688,7 +688,7 @@ winAboutDlgProc (HWND hwndDialog, UINT message, "devel/server/changelog.html"; #endif - iReturn = ShellExecute (NULL, + iReturn = (int)ShellExecute (NULL, "open", pszWinPath, NULL, @@ -708,7 +708,7 @@ winAboutDlgProc (HWND hwndDialog, UINT message, const char * pszPath = __VENDORDWEBSUPPORT__; int iReturn; - iReturn = ShellExecute (NULL, + iReturn = (int)ShellExecute (NULL, "open", pszPath, NULL, @@ -728,7 +728,7 @@ winAboutDlgProc (HWND hwndDialog, UINT message, const char * pszPath = "http://x.cygwin.com/docs/ug/"; int iReturn; - iReturn = ShellExecute (NULL, + iReturn = (int)ShellExecute (NULL, "open", pszPath, NULL, @@ -748,7 +748,7 @@ winAboutDlgProc (HWND hwndDialog, UINT message, const char * pszPath = "http://x.cygwin.com/docs/faq/"; int iReturn; - iReturn = ShellExecute (NULL, + iReturn = (int)ShellExecute (NULL, "open", pszPath, NULL, From fb64414548c437bf52c3dcd0613aab5079faffba Mon Sep 17 00:00:00 2001 From: Colin Harrison Date: Fri, 15 Oct 2010 14:19:57 +0100 Subject: [PATCH 26/80] Xming: Fix warnings in ProcWindowsWMFrameSetTitle() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit winwindowswm.c: In function ‘ProcWindowsWMFrameSetTitle’: winwindowswm.c:516: warning: pointer targets in passing argument 1 of ‘strncpy’ differ in signedness winwindowswm.c:516: warning: pointer targets in passing argument 2 of ‘strncpy’ differ in signedness winwindowswm.c:528: warning: pointer targets in passing argument 2 of ‘SetWindowTextA’ differ in signedness Signed-off-by: Jon TURNEY Reviewed-by: Jon TURNEY --- hw/xwin/winwindowswm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xwin/winwindowswm.c b/hw/xwin/winwindowswm.c index 4027539c2..c255e490f 100644 --- a/hw/xwin/winwindowswm.c +++ b/hw/xwin/winwindowswm.c @@ -483,7 +483,7 @@ ProcWindowsWMFrameSetTitle( ) { unsigned int title_length, title_max; - unsigned char *title_bytes; + char *title_bytes; REQUEST(xWindowsWMFrameSetTitleReq); WindowPtr pWin; win32RootlessWindowPtr pRLWinPriv; From 1ba1b12d24d8f825babd8cf38710c7fa9a94821e Mon Sep 17 00:00:00 2001 From: Colin Harrison Date: Fri, 15 Oct 2010 13:46:09 +0100 Subject: [PATCH 27/80] Xming: Warning fix in winApplyHints() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit winmultiwindowwm.c: In function ‘winApplyHints’: winmultiwindowwm.c:1587: warning: ISO C90 forbids mixed declarations and code Signed-off-by: Jon TURNEY Reviewed-by: Jon TURNEY --- hw/xwin/winmultiwindowwm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c index 2fcad3249..1e21de39f 100644 --- a/hw/xwin/winmultiwindowwm.c +++ b/hw/xwin/winmultiwindowwm.c @@ -1553,6 +1553,7 @@ winApplyHints (Display *pDisplay, Window iWindow, HWND hWnd, HWND *zstyle) int format; unsigned long hint = 0, maxmin = 0, style, nitems = 0 , left = 0; WindowPtr pWin = GetProp (hWnd, WIN_WINDOW_PROP); + MwmHints *mwm_hint = NULL; if (!hWnd) return; if (!IsWindow (hWnd)) return; @@ -1584,7 +1585,6 @@ winApplyHints (Display *pDisplay, Window iWindow, HWND hWnd, HWND *zstyle) } nitems = left = 0; - MwmHints *mwm_hint = NULL; if (XGetWindowProperty(pDisplay, iWindow, motif_wm_hints, 0L, PropMwmHintsElements, False, motif_wm_hints, &type, &format, &nitems, &left, (unsigned char **)&mwm_hint) == Success) From ee2867649d9485f6559f88a973eae6393971ff35 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Sun, 18 Jul 2010 13:20:01 +0100 Subject: [PATCH 28/80] Cygwin/X: Clarify XKB options in XWin man page Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/XWin.man.pre | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/xwin/XWin.man.pre b/hw/xwin/XWin.man.pre index 6b28b51d4..51268f69a 100644 --- a/hw/xwin/XWin.man.pre +++ b/hw/xwin/XWin.man.pre @@ -251,7 +251,7 @@ exit silently and don't display any error message. .B "\-xkbrules \fIrule\fP" .TP 8 .B "\-xkbvariant \fIvariant\fp" -These options implement the xkeyboard extension for loading +These options configure the xkeyboard extension to load a particular keyboard map as the X server starts. The behavior is similar to the \fIsetxkbmap\fP program. The layout data is located at \fI __datadir__/X11/xkb/\fP. Additional information is found in the @@ -264,9 +264,9 @@ the options: Alternatively one may use the \fIsetxkbmap\fP program after \fIXWin\fP is running. -The default is to select a layout matching your current layout as -reported by \fIWindows\fP if known, or the default X server layout -if no matching keyboard layout was found. +The default is to select a configuration matching your current layout as +reported by \fIWindows\fP, if known, or the default X server configuration +if no matching keyboard configuration was found. .SH UNDOCUMENTED OPTIONS These options are undocumented. Do not use them. From cab837a60a7aa653ccea77ff714335186ce38a4b Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Sun, 18 Jul 2010 13:22:46 +0100 Subject: [PATCH 29/80] Cygwin/X: Reformat the keyboard layout mapping table Also remove the out-of-date listing of keyboard layout IDs and which ones have known mappings XXX: layout zh_TW doesn't exist anymore This patch brought to you by C-u M-x align-regexp Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/winlayouts.h | 266 +++++++------------------------------------ 1 file changed, 43 insertions(+), 223 deletions(-) diff --git a/hw/xwin/winlayouts.h b/hw/xwin/winlayouts.h index d1d21a12d..9500689bc 100644 --- a/hw/xwin/winlayouts.h +++ b/hw/xwin/winlayouts.h @@ -42,232 +42,52 @@ typedef struct This table is sorted by low byte of winlayout, then by next byte, etc. */ -WinKBLayoutRec winKBLayouts[] = +WinKBLayoutRec winKBLayouts[] = { - { 0x404, -1, "pc105", "zh_TW", NULL, NULL, "Chinese (Taiwan)"}, - { 0x405, -1, "pc105", "cz", NULL, NULL, "Czech"}, - {0x10405, -1, "pc105", "cz_qwerty", NULL, NULL, "Czech (QWERTY)"}, - { 0x406, -1, "pc105", "dk", NULL, NULL, "Danish"}, - { 0x407, -1, "pc105", "de", NULL, NULL, "German (Germany)"}, - {0x10407, -1, "pc105", "de", NULL, NULL, "German (Germany, IBM)"}, - { 0x807, -1, "pc105", "ch", "de", NULL, "German (Switzerland)"}, - { 0x409, -1, "pc105", "us", NULL, NULL, "English (USA)"}, - {0x10409, -1, "pc105", "dvorak", NULL, NULL, "English (USA, Dvorak)"}, - {0x20409, -1, "pc105", "us_intl", NULL, NULL, "English (USA, International)"}, - { 0x809, -1, "pc105", "gb", NULL, NULL, "English (United Kingdom)"}, - { 0x1809, -1, "pc105", "ie", NULL, NULL, "Irish"}, - { 0x40a, -1, "pc105", "es", NULL, NULL, "Spanish (Spain, Traditional Sort)"}, - { 0x80a, -1, "pc105", "latam", NULL, NULL, "Latin American"}, - { 0x40b, -1, "pc105", "fi", NULL, NULL, "Finnish"}, - { 0x40c, -1, "pc105", "fr", NULL, NULL, "French (Standard)"}, - { 0x80c, -1, "pc105", "be", NULL, NULL, "French (Belgian)"}, - { 0xc0c, -1, "pc105", "ca", "fr", NULL, "French (Canada)"}, - { 0x100c, -1, "pc105", "ch", "fr", NULL, "French (Switzerland)"}, - { 0x40d, -1, "pc105", "il", NULL, NULL, "Hebrew"}, - { 0x40e, -1, "pc105", "hu", NULL, NULL, "Hungarian"}, - { 0x40f, -1, "pc105", "is", NULL, NULL, "Icelandic"}, - { 0x410, -1, "pc105", "it", NULL, NULL, "Italian"}, - {0x10410, -1, "pc105", "it", NULL, NULL, "Italian (142)"}, - {0xa0000410,-1, "macbook79","it", "mac",NULL, "Italiano (Apple)"}, - { 0x411, 7, "jp106", "jp", NULL, NULL, "Japanese"}, - { 0x413, -1, "pc105", "nl", NULL, NULL, "Dutch"}, - { 0x813, -1, "pc105", "be", NULL, NULL, "Dutch (Belgian)"}, - { 0x414, -1, "pc105", "no", NULL, NULL, "Norwegian"}, - { 0x415, -1, "pc105", "pl", NULL, NULL, "Polish (Programmers)"}, - { 0x416, -1, "pc105", "br", NULL, NULL, "Portuguese (Brazil, ABNT)"}, - {0x10416, -1, "abnt2", "br", NULL, NULL, "Portuguese (Brazil, ABNT2)"}, - { 0x816, -1, "pc105", "pt", NULL, NULL, "Portuguese (Portugal)"}, - { 0x41a, -1, "pc105", "hr", NULL, NULL, "Croatian"}, - { 0x41d, -1, "pc105", "se", NULL, NULL, "Swedish (Sweden)"}, - { 0x424, -1, "pc105", "si", NULL, NULL, "Slovenian"}, - { 0x425, -1, "pc105", "ee", NULL, NULL, "Estonian"}, - { 0x452, -1, "pc105", "gb", "intl", NULL, "United Kingdom (Extended)"}, - { -1, -1, NULL, NULL, NULL, NULL, NULL} + { 0x00000404, -1, "pc105", "zh_TW", NULL, NULL, "Chinese (Taiwan)"}, + { 0x00000405, -1, "pc105", "cz", NULL, NULL, "Czech"}, + { 0x00010405, -1, "pc105", "cz_qwerty", NULL, NULL, "Czech (QWERTY)"}, + { 0x00000406, -1, "pc105", "dk", NULL, NULL, "Danish"}, + { 0x00000407, -1, "pc105", "de", NULL, NULL, "German (Germany)"}, + { 0x00010407, -1, "pc105", "de", NULL, NULL, "German (Germany,IBM)"}, + { 0x00000807, -1, "pc105", "ch", "de", NULL, "German (Switzerland)"}, + { 0x00000409, -1, "pc105", "us", NULL, NULL, "English (USA)"}, + { 0x00010409, -1, "pc105", "dvorak", NULL, NULL, "English (USA,Dvorak)"}, + { 0x00020409, -1, "pc105", "us_intl", NULL, NULL, "English (USA,International)"}, + { 0x00000809, -1, "pc105", "gb", NULL, NULL, "English (United Kingdom)"}, + { 0x00001809, -1, "pc105", "ie", NULL, NULL, "Irish"}, + { 0x0000040a, -1, "pc105", "es", NULL, NULL, "Spanish (Spain,Traditional Sort)"}, + { 0x0000080a, -1, "pc105", "latam", NULL, NULL, "Latin American"}, + { 0x0000040b, -1, "pc105", "fi", NULL, NULL, "Finnish"}, + { 0x0000040c, -1, "pc105", "fr", NULL, NULL, "French (Standard)"}, + { 0x0000080c, -1, "pc105", "be", NULL, NULL, "French (Belgian)"}, + { 0x00000c0c, -1, "pc105", "ca", "fr", NULL, "French (Canada)"}, + { 0x0000100c, -1, "pc105", "ch", "fr", NULL, "French (Switzerland)"}, + { 0x0000040d, -1, "pc105", "il", NULL, NULL, "Hebrew"}, + { 0x0000040e, -1, "pc105", "hu", NULL, NULL, "Hungarian"}, + { 0x0000040f, -1, "pc105", "is", NULL, NULL, "Icelandic"}, + { 0x00000410, -1, "pc105", "it", NULL, NULL, "Italian"}, + { 0x00010410, -1, "pc105", "it", NULL, NULL, "Italian (142)"}, + { 0xa0000410, -1, "macbook79", "it", "mac", NULL, "Italiano (Apple)"}, + { 0x00000411, 7, "jp106", "jp", NULL, NULL, "Japanese"}, + { 0x00000413, -1, "pc105", "nl", NULL, NULL, "Dutch"}, + { 0x00000813, -1, "pc105", "be", NULL, NULL, "Dutch (Belgian)"}, + { 0x00000414, -1, "pc105", "no", NULL, NULL, "Norwegian"}, + { 0x00000415, -1, "pc105", "pl", NULL, NULL, "Polish (Programmers)"}, + { 0x00000416, -1, "pc105", "br", NULL, NULL, "Portuguese (Brazil,ABNT)"}, + { 0x00010416, -1, "abnt2", "br", NULL, NULL, "Portuguese (Brazil,ABNT2)"}, + { 0x00000816, -1, "pc105", "pt", NULL, NULL, "Portuguese (Portugal)"}, + { 0x0000041a, -1, "pc105", "hr", NULL, NULL, "Croatian"}, + { 0x0000041d, -1, "pc105", "se", NULL, NULL, "Swedish (Sweden)"}, + { 0x00000424, -1, "pc105", "si", NULL, NULL, "Slovenian"}, + { 0x00000425, -1, "pc105", "ee", NULL, NULL, "Estonian"}, + { 0x00000452, -1, "pc105", "gb", "intl", NULL, "United Kingdom (Extended)"}, + { -1, -1, NULL, NULL, NULL, NULL, NULL} }; -/* Listing of language codes from MSDN */ /* -Support ID XKB Language -==================================================================== - ? 0x0000 Language Neutral - ? 0x0400 Process or User Default Language - ? 0x0800 System Default Language - 0x0401 Arabic (Saudi Arabia) - 0x0801 Arabic (Iraq) - 0x0c01 Arabic (Egypt) - 0x1001 Arabic (Libya) - 0x1401 Arabic (Algeria) - 0x1801 Arabic (Morocco) - 0x1c01 Arabic (Tunisia) - 0x2001 Arabic (Oman) - 0x2401 Arabic (Yemen) - 0x2801 Arabic (Syria) - 0x2c01 Arabic (Jordan) - 0x3001 Arabic (Lebanon) - 0x3401 Arabic (Kuwait) - 0x3801 Arabic (U.A.E.) - 0x3c01 Arabic (Bahrain) - 0x4001 Arabic (Qatar) - Arabic (102) AZERTY - 0x0402 Bulgarian - 0x0403 Catalan - 0x0404 Chinese (Taiwan) - 0x0804 Chinese (PRC) - 0x0c04 Chinese (Hong Kong SAR, PRC) - 0x1004 Chinese (Singapore) - 0x1404 Chinese (Macao SAR) (98/ME,2K/XP) - X 0x0405 cz Czech - X cz_qwerty Czech (QWERTY) - Czech (Programmers) - X 0x0406 dk Danish - X 0x0407 de German (Standard) - X 0x0807 de_CH German (Switzerland) - 0x0c07 German (Austria) - 0x1007 German (Luxembourg) - 0x1407 German (Liechtenstein) - 0x0408 Greek - X 0x0409 us English (United States) - X 0x0809 gb English (United Kingdom) - 0x0c09 English (Australian) - 0x1009 English (Canadian) - 0x1409 English (New Zealand) - X 0x1809 ie English (Ireland) - 0x1c09 English (South Africa) - 0x2009 English (Jamaica) - 0x2409 English (Caribbean) - 0x2809 English (Belize) - 0x2c09 English (Trinidad) - 0x3009 English (Zimbabwe) (98/ME,2K/XP) - 0x3409 English (Philippines) (98/ME,2K/XP) - X 0x040a es Spanish (Spain, Traditional Sort) - 0x080a Spanish (Mexican) - 0x0c0a Spanish (Spain, Modern Sort) - 0x100a Spanish (Guatemala) - 0x140a Spanish (Costa Rica) - 0x180a Spanish (Panama) - 0x1c0a Spanish (Dominican Republic) - 0x200a Spanish (Venezuela) - 0x240a Spanish (Colombia) - 0x280a Spanish (Peru) - 0x2c0a Spanish (Argentina) - 0x300a Spanish (Ecuador) - 0x340a Spanish (Chile) - 0x380a Spanish (Uruguay) - 0x3c0a Spanish (Paraguay) - 0x400a Spanish (Bolivia) - 0x440a Spanish (El Salvador) - 0x480a Spanish (Honduras) - 0x4c0a Spanish (Nicaragua) - 0x500a Spanish (Puerto Rico) - X 0x040b fi Finnish - Finnish (with Sami) - X 0x040c fr French (Standard) - X 0x080c be French (Belgian) - . 0x0c0c French (Canadian) - French (Canadian, Legacy) - Canadian (Multilingual) - X 0x100c fr_CH French (Switzerland) - 0x140c French (Luxembourg) - 0x180c French (Monaco) (98/ME,2K/XP) - 0x040d Hebrew - X 0x040e hu Hungarian - . 0x040f Icelandic - X 0x0410 it Italian (Standard) - 0x0810 Italian (Switzerland) - X 0x0411 jp Japanese - 0x0412 Korean - 0x0812 Korean (Johab) (95,NT) - . 0x0413 Dutch (Netherlands) - X 0x0813 be Dutch (Belgium) - X 0x0414 no Norwegian (Bokmal) - 0x0814 Norwegian (Nynorsk) - . 0x0415 Polish - X 0x0416 br Portuguese (Brazil) - X 0x0816 pt Portuguese (Portugal) - . 0x0418 Romanian - 0x0419 Russian - . 0x041a Croatian - . 0x081a Serbian (Latin) - . 0x0c1a Serbian (Cyrillic) - 0x101a Croatian (Bosnia and Herzegovina) - 0x141a Bosnian (Bosnia and Herzegovina) - 0x181a Serbian (Latin, Bosnia, and Herzegovina) - 0x1c1a Serbian (Cyrillic, Bosnia, and Herzegovina) - . 0x041b Slovak - . 0x041c Albanian - X 0x041d se Swedish - 0x081d Swedish (Finland) - 0x041e Thai - 0x041f Turkish - 0x0420 Urdu (Pakistan) (98/ME,2K/XP) - 0x0820 Urdu (India) - 0x0421 Indonesian - 0x0422 Ukrainian - 0x0423 Belarusian - . 0x0424 Slovenian - 0x0425 Estonian - 0x0426 Latvian - 0x0427 Lithuanian - 0x0827 Lithuanian (Classic) (98) - 0x0429 Farsi - 0x042a Vietnamese (98/ME,NT,2K/XP) - 0x042b Armenian. This is Unicode only. (2K/XP) - Armenian Eastern - Armenian Western - 0x042c Azeri (Latin) - 0x082c Azeri (Cyrillic) - 0x042d Basque - 0x042f Macedonian (FYROM) - 0x0430 Sutu - 0x0432 Setswana/Tswana (South Africa) - 0x0434 isiXhosa/Xhosa (South Africa) - 0x0435 isiZulu/Zulu (South Africa) - 0x0436 Afrikaans - 0x0437 Georgian. This is Unicode only. (2K/XP) - . 0x0438 Faeroese - 0x0439 Hindi. This is Unicode only. (2K/XP) - 0x043a Maltese (Malta) - 0x043b Sami, Northern (Norway) - 0x083b Sami, Northern (Sweden) - 0x0c3b Sami, Northern (Finland) - 0x103b Sami, Lule (Norway) - 0x143b Sami, Lule (Sweden) - 0x183b Sami, Southern (Norway) - 0x1c3b Sami, Southern (Sweden) - 0x203b Sami, Skolt (Finland) - 0x243b Sami, Inari (Finland) - 0x043e Malay (Malaysian) - 0x083e Malay (Brunei Darussalam) - 0x0440 Kyrgyz. (XP) - 0x0441 Swahili (Kenya) - 0x0443 Uzbek (Latin) - 0x0843 Uzbek (Cyrillic) - 0x0444 Tatar (Tatarstan) - 0x0445 Bengali (India) - Bengali (Inscript) - 0x0446 Punjabi. This is Unicode only. (XP) - 0x0447 Gujarati. This is Unicode only. (XP) - 0x0449 Tamil. This is Unicode only. (2K/XP) - 0x044a Telugu. This is Unicode only. (XP) - 0x044b Kannada. This is Unicode only. (XP) - 0x044c Malayalam (India) - 0x044e Marathi. This is Unicode only. (2K/XP) - 0x044f Sanskrit. This is Unicode only. (2K/XP) - 0x0450 Mongolian (XP) - 0x0452 Welsh (United Kingdom) - 0x0455 Burmese - 0x0456 Galician (XP) - 0x0457 Konkani. This is Unicode only. (2K/XP) - 0x045a Syriac. This is Unicode only. (XP) - 0x0465 Divehi. This is Unicode only. (XP) - Divehi (Phonetic) - Divehi (Typewriter) - 0x046b Quechua (Bolivia) - 0x086b Quechua (Ecuador) - 0x0c6b Quechua (Peru) - 0x046c Sesotho sa Leboa/Northern Sotho (South Africa) - 0x007f LOCALE_INVARIANT. See MAKELCID. - 0x0481 Maori (New Zealand) -*/ + See http://technet.microsoft.com/en-us/library/cc766503%28WS.10%29.aspx + for a listing of input locale (keyboard layout) codes +*/ From 10bf8345cf15c6030147a9edb7f6a093c8db8099 Mon Sep 17 00:00:00 2001 From: Colin Harrison Date: Mon, 12 Oct 2009 13:50:00 +0100 Subject: [PATCH 30/80] Xming: Warning fix in winDeviceCursorCleanup() return statement with an expression in a function whose return-type is void Signed-off-by: Jon TURNEY Reviewed-by: Jon TURNEY --- hw/xwin/wincursor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xwin/wincursor.c b/hw/xwin/wincursor.c index 7f1935a5d..076d4756c 100644 --- a/hw/xwin/wincursor.c +++ b/hw/xwin/wincursor.c @@ -557,7 +557,7 @@ static void winDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScr) { winScreenPriv(pScr); - return pScreenPriv->cursor.spriteFuncs->DeviceCursorCleanup(pDev, pScr); + pScreenPriv->cursor.spriteFuncs->DeviceCursorCleanup(pDev, pScr); } static miPointerSpriteFuncRec winSpriteFuncsRec = { From d11761c6a6dd2a9963dfd3bcb313f1b2525387fc Mon Sep 17 00:00:00 2001 From: Colin Harrison Date: Fri, 26 Feb 2010 13:31:18 +0000 Subject: [PATCH 31/80] Xming: Casts to remove warnings on event pointers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit winkeybd.c: In function ‘winSendKeyEvent’: winkeybd.c:489: warning: passing argument 2 of ‘mieqEnqueue’ from incompatible pointer type winmouse.c: In function ‘winMouseButtonsSendEvent’: winmouse.c:247: warning: passing argument 2 of ‘mieqEnqueue’ from incompatible pointer type winmouse.c: In function ‘winEnqueueMotion’: winmouse.c:380: warning: passing argument 2 of ‘mieqEnqueue’ from incompatible pointer type Signed-off-by: Jon TURNEY Reviewed-by: Jon TURNEY --- hw/xwin/winkeybd.c | 2 +- hw/xwin/winmouse.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/xwin/winkeybd.c b/hw/xwin/winkeybd.c index 6d91ce0d6..83fea21cd 100644 --- a/hw/xwin/winkeybd.c +++ b/hw/xwin/winkeybd.c @@ -486,7 +486,7 @@ winSendKeyEvent (DWORD dwKey, Bool fDown) nevents = GetKeyboardEvents(events, g_pwinKeyboard, fDown ? KeyPress : KeyRelease, dwKey + MIN_KEYCODE); for (i = 0; i < nevents; i++) - mieqEnqueue(g_pwinKeyboard, events[i].event); + mieqEnqueue(g_pwinKeyboard, (InternalEvent*)events[i].event); #if CYGDEBUG ErrorF("winSendKeyEvent: dwKey: %d, fDown: %d, nEvents %d\n", diff --git a/hw/xwin/winmouse.c b/hw/xwin/winmouse.c index 5e1f756a0..af499d94b 100644 --- a/hw/xwin/winmouse.c +++ b/hw/xwin/winmouse.c @@ -244,7 +244,7 @@ winMouseButtonsSendEvent (int iEventType, int iButton) POINTER_RELATIVE, 0, 0, NULL); for (i = 0; i < nevents; i++) - mieqEnqueue(g_pwinPointer, events[i].event); + mieqEnqueue(g_pwinPointer, (InternalEvent*)events[i].event); #if CYGDEBUG ErrorF("winMouseButtonsSendEvent: iEventType: %d, iButton: %d, nEvents %d\n", @@ -377,5 +377,5 @@ void winEnqueueMotion(int x, int y) POINTER_ABSOLUTE | POINTER_SCREEN, 0, 2, valuators); for (i = 0; i < nevents; i++) - mieqEnqueue(g_pwinPointer, events[i].event); + mieqEnqueue(g_pwinPointer, (InternalEvent*)events[i].event); } From 8e723108151136f115e8e6d4b97ed4e2fa685dbf Mon Sep 17 00:00:00 2001 From: Colin Harrison Date: Wed, 29 Sep 2010 14:18:27 +0100 Subject: [PATCH 32/80] Xming: Remove uses of register keyword I'm pretty sure the compiler has a better idea how to optimize this Signed-off-by: Jon TURNEY Reviewed-by: Jon TURNEY --- hw/xwin/winwindowswm.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/hw/xwin/winwindowswm.c b/hw/xwin/winwindowswm.c index c255e490f..71384097f 100644 --- a/hw/xwin/winwindowswm.c +++ b/hw/xwin/winwindowswm.c @@ -77,10 +77,10 @@ make_box (int x, int y, int w, int h) } static int -ProcWindowsWMQueryVersion(register ClientPtr client) +ProcWindowsWMQueryVersion(ClientPtr client) { xWindowsWMQueryVersionReply rep; - register int n; + int n; REQUEST_SIZE_MATCH(xWindowsWMQueryVersionReq); rep.type = X_Reply; @@ -158,7 +158,7 @@ WMFreeEvents (pointer data, XID id) } static int -ProcWindowsWMSelectInput (register ClientPtr client) +ProcWindowsWMSelectInput (ClientPtr client) { REQUEST(xWindowsWMSelectInputReq); WMEventPtr pEvent, pNewEvent, *pHead; @@ -298,7 +298,7 @@ winWindowsWMSendEvent (int type, unsigned int mask, int which, int arg, /* general utility functions */ static int -ProcWindowsWMDisableUpdate (register ClientPtr client) +ProcWindowsWMDisableUpdate (ClientPtr client) { REQUEST_SIZE_MATCH(xWindowsWMDisableUpdateReq); @@ -308,7 +308,7 @@ ProcWindowsWMDisableUpdate (register ClientPtr client) } static int -ProcWindowsWMReenableUpdate (register ClientPtr client) +ProcWindowsWMReenableUpdate (ClientPtr client) { REQUEST_SIZE_MATCH(xWindowsWMReenableUpdateReq); @@ -321,7 +321,7 @@ ProcWindowsWMReenableUpdate (register ClientPtr client) /* window functions */ static int -ProcWindowsWMSetFrontProcess (register ClientPtr client) +ProcWindowsWMSetFrontProcess (ClientPtr client) { REQUEST_SIZE_MATCH(xWindowsWMSetFrontProcessReq); @@ -334,7 +334,7 @@ ProcWindowsWMSetFrontProcess (register ClientPtr client) /* frame functions */ static int -ProcWindowsWMFrameGetRect (register ClientPtr client) +ProcWindowsWMFrameGetRect (ClientPtr client) { xWindowsWMFrameGetRectReply rep; BoxRec ir; @@ -388,7 +388,7 @@ ProcWindowsWMFrameGetRect (register ClientPtr client) static int -ProcWindowsWMFrameDraw (register ClientPtr client) +ProcWindowsWMFrameDraw (ClientPtr client) { REQUEST(xWindowsWMFrameDrawReq); WindowPtr pWin; @@ -478,9 +478,7 @@ ProcWindowsWMFrameDraw (register ClientPtr client) } static int -ProcWindowsWMFrameSetTitle( - register ClientPtr client - ) +ProcWindowsWMFrameSetTitle(ClientPtr client) { unsigned int title_length, title_max; char *title_bytes; @@ -540,7 +538,7 @@ ProcWindowsWMFrameSetTitle( /* dispatch */ static int -ProcWindowsWMDispatch (register ClientPtr client) +ProcWindowsWMDispatch (ClientPtr client) { REQUEST(xReq); @@ -586,16 +584,16 @@ SNotifyEvent (xWindowsWMNotifyEvent *from, xWindowsWMNotifyEvent *to) } static int -SProcWindowsWMQueryVersion (register ClientPtr client) +SProcWindowsWMQueryVersion (ClientPtr client) { - register int n; + int n; REQUEST(xWindowsWMQueryVersionReq); swaps(&stuff->length, n); return ProcWindowsWMQueryVersion(client); } static int -SProcWindowsWMDispatch (register ClientPtr client) +SProcWindowsWMDispatch (ClientPtr client) { REQUEST(xReq); From 1de5db73d31411798ae93619d9e626fa32e0c4bd Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Thu, 14 Oct 2010 22:46:09 +0100 Subject: [PATCH 33/80] Cygwin/X: Drop several unneeded includes of winprefs.h Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/winmultiwindowwindow.c | 1 - hw/xwin/winprocarg.c | 1 - hw/xwin/winwin32rootless.c | 1 - 3 files changed, 3 deletions(-) diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c index 95d9d71fc..731235042 100644 --- a/hw/xwin/winmultiwindowwindow.c +++ b/hw/xwin/winmultiwindowwindow.c @@ -38,7 +38,6 @@ #include "win.h" #include "dixevents.h" #include "winmultiwindowclass.h" -#include "winprefs.h" /* * External global variables diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c index fea579763..edbd4bea0 100644 --- a/hw/xwin/winprocarg.c +++ b/hw/xwin/winprocarg.c @@ -34,7 +34,6 @@ from The Open Group. #include <../xfree86/common/xorgVersion.h> #include "win.h" #include "winconfig.h" -#include "winprefs.h" #include "winmsg.h" /* diff --git a/hw/xwin/winwin32rootless.c b/hw/xwin/winwin32rootless.c index fbe419132..75142f15b 100644 --- a/hw/xwin/winwin32rootless.c +++ b/hw/xwin/winwin32rootless.c @@ -41,7 +41,6 @@ #include #include "dixevents.h" #include "winmultiwindowclass.h" -#include "winprefs.h" #include From 9952b51f6822aeaa19c27caf85698741eb4c27d8 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Fri, 15 Oct 2010 13:01:45 +0100 Subject: [PATCH 34/80] Cygwin/X: Fix typos in comments Fix a few typos in comments Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/InitOutput.c | 4 ++-- hw/xwin/winmultiwindowwm.c | 2 +- hw/xwin/winshaddd.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index 445549a7f..5ed3e74e5 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -266,7 +266,7 @@ ddxGiveUp (void) g_fpDirectDrawCreateClipper = NULL; } - /* Unload our TrackMouseEvent funtion pointer */ + /* Unload our TrackMouseEvent function pointer */ if (g_hmodCommonControls != NULL) { FreeLibrary (g_hmodCommonControls); @@ -437,7 +437,7 @@ winFixupPaths (void) int needs_sep = TRUE; int comment_block = FALSE; - /* get defautl fontpath */ + /* get default fontpath */ char *fontpath = strdup(defaultFontPath); size_t size = strlen(fontpath); diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c index 1e21de39f..c9b1584f8 100644 --- a/hw/xwin/winmultiwindowwm.c +++ b/hw/xwin/winmultiwindowwm.c @@ -634,7 +634,7 @@ winMultiWindowWMProc (void *pArg) ErrorF ("winMultiWindowWMProc ()\n"); #endif - /* Loop until we explicity break out */ + /* Loop until we explicitly break out */ for (;;) { WMMsgNodePtr pNode; diff --git a/hw/xwin/winshaddd.c b/hw/xwin/winshaddd.c index 5752730ff..2de496c09 100644 --- a/hw/xwin/winshaddd.c +++ b/hw/xwin/winshaddd.c @@ -55,7 +55,7 @@ extern const char *g_pszLogFile; /* - * FIXME: Headers are broken, IID_IDirectDraw4 has to be defined + * FIXME: Headers are broken, IID_IDirectDraw2 has to be defined * here manually. Should be handled by ddraw.h */ #ifndef IID_IDirectDraw2 From 6f12277e37d16a7de9d3f3079688c43b07921b0a Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Thu, 14 Oct 2010 22:44:53 +0100 Subject: [PATCH 35/80] Cygwin/X: Make g_hhookKeyboardLL static Make g_hhookKeyboardLL static, it's only used in winkeyhook.c Also remove unused externs Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/winglobals.c | 1 - hw/xwin/winkeyhook.c | 8 +------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/hw/xwin/winglobals.c b/hw/xwin/winglobals.c index f3f01d7da..55b0f16d4 100644 --- a/hw/xwin/winglobals.c +++ b/hw/xwin/winglobals.c @@ -73,7 +73,6 @@ char * g_pszCommandLine = NULL; Bool g_fSilentFatalError = FALSE; DWORD g_dwCurrentThreadID = 0; Bool g_fKeyboardHookLL = FALSE; -HHOOK g_hhookKeyboardLL = NULL; HWND g_hwndKeyboardFocus = NULL; Bool g_fNoHelpMessageBox = FALSE; Bool g_fSoftwareCursor = FALSE; diff --git a/hw/xwin/winkeyhook.c b/hw/xwin/winkeyhook.c index 2d6ed18b7..fe1156dcf 100644 --- a/hw/xwin/winkeyhook.c +++ b/hw/xwin/winkeyhook.c @@ -34,13 +34,7 @@ #include "win.h" -/* - * References to external symbols - */ - -extern HHOOK g_hhookKeyboardLL; -extern DWORD g_dwCurrentThreadID; -extern HWND g_hwndKeyboardFocus; +static HHOOK g_hhookKeyboardLL = NULL; /* From 49b996faadf0fedcee25d4a8f96f4c4007c29f5f Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Fri, 15 Oct 2010 13:00:46 +0100 Subject: [PATCH 36/80] Cygwin/X: Make g_hmodDirectDraw static Add winReleaseDDProcAddresses() for releasing the direct draw module handle, so g_hmodDirectDraw can be made static Remove unneeded duplicate extern definitions of g_fpDirectDrawCreate and g_fpDirectDrawCreateClipper, and move the definition from winglobals.c to winengine.c Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/InitOutput.c | 12 +----------- hw/xwin/win.h | 4 +++- hw/xwin/winengine.c | 26 +++++++++++++++++++++----- hw/xwin/winglobals.c | 4 ---- 4 files changed, 25 insertions(+), 21 deletions(-) diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index 5ed3e74e5..63fca3abb 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -90,10 +90,6 @@ extern HWND g_hwndClipboard; extern Bool g_fClipboard; #endif -extern HMODULE g_hmodDirectDraw; -extern FARPROC g_fpDirectDrawCreate; -extern FARPROC g_fpDirectDrawCreateClipper; - extern HMODULE g_hmodCommonControls; extern FARPROC g_fpTrackMouseEvent; extern Bool g_fNoHelpMessageBox; @@ -258,13 +254,7 @@ ddxGiveUp (void) * At this point we aren't creating any new screens, so * we are guaranteed to not need the DirectDraw functions. */ - if (g_hmodDirectDraw != NULL) - { - FreeLibrary (g_hmodDirectDraw); - g_hmodDirectDraw = NULL; - g_fpDirectDrawCreate = NULL; - g_fpDirectDrawCreateClipper = NULL; - } + winReleaseDDProcAddresses(); /* Unload our TrackMouseEvent function pointer */ if (g_hmodCommonControls != NULL) diff --git a/hw/xwin/win.h b/hw/xwin/win.h index 1b1358cda..f197def56 100644 --- a/hw/xwin/win.h +++ b/hw/xwin/win.h @@ -653,7 +653,6 @@ extern DeviceIntPtr g_pwinKeyboard; * Extern declares for dynamically loaded libraries and function pointers */ -extern HMODULE g_hmodDirectDraw; extern FARPROC g_fpDirectDrawCreate; extern FARPROC g_fpDirectDrawCreateClipper; @@ -859,6 +858,9 @@ winSetEngine (ScreenPtr pScreen); Bool winGetDDProcAddresses (void); +void +winReleaseDDProcAddresses(void); + /* * winerror.c diff --git a/hw/xwin/winengine.c b/hw/xwin/winengine.c index fb9aed8a0..e866e1ea1 100644 --- a/hw/xwin/winengine.c +++ b/hw/xwin/winengine.c @@ -34,13 +34,17 @@ #include "win.h" #include "winmsg.h" +/* + * Global variables for function pointers into + * dynamically loaded libraries + */ +FARPROC g_fpDirectDrawCreate = NULL; +FARPROC g_fpDirectDrawCreateClipper = NULL; /* - * External global variables - */ - -extern const GUID _IID_IDirectDraw4; - + module handle for dynamically loaded directdraw library +*/ +static HMODULE g_hmodDirectDraw = NULL; /* * Detect engines supported by current Windows version @@ -334,3 +338,15 @@ winGetDDProcAddresses (void) return fReturn; } + +void +winReleaseDDProcAddresses(void) +{ + if (g_hmodDirectDraw != NULL) + { + FreeLibrary (g_hmodDirectDraw); + g_hmodDirectDraw = NULL; + g_fpDirectDrawCreate = NULL; + g_fpDirectDrawCreateClipper = NULL; + } +} diff --git a/hw/xwin/winglobals.c b/hw/xwin/winglobals.c index 55b0f16d4..da1712988 100644 --- a/hw/xwin/winglobals.c +++ b/hw/xwin/winglobals.c @@ -84,10 +84,6 @@ Bool g_fNativeGl = FALSE; * their function pointers */ -HMODULE g_hmodDirectDraw = NULL; -FARPROC g_fpDirectDrawCreate = NULL; -FARPROC g_fpDirectDrawCreateClipper = NULL; - HMODULE g_hmodCommonControls = NULL; FARPROC g_fpTrackMouseEvent = (FARPROC) (void (*)(void))NoopDDA; From 5e896e425fe14022b0714301531bd54151c763f0 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Thu, 14 Oct 2010 22:43:51 +0100 Subject: [PATCH 37/80] Cygwin/X: Make g_hmodCommonControls static Make g_hmodCommonControls static, it's only used in InitOutput.c Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/InitOutput.c | 7 ++++++- hw/xwin/win.h | 1 - hw/xwin/winglobals.c | 2 -- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index 63fca3abb..ae1d4154b 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -90,12 +90,17 @@ extern HWND g_hwndClipboard; extern Bool g_fClipboard; #endif -extern HMODULE g_hmodCommonControls; + extern FARPROC g_fpTrackMouseEvent; extern Bool g_fNoHelpMessageBox; extern Bool g_fSilentDupError; extern Bool g_fNativeGl; +/* + module handle for dynamically loaded comctl32 library +*/ +static HMODULE g_hmodCommonControls = NULL; + /* * Function prototypes */ diff --git a/hw/xwin/win.h b/hw/xwin/win.h index f197def56..4d6771ca5 100644 --- a/hw/xwin/win.h +++ b/hw/xwin/win.h @@ -656,7 +656,6 @@ extern DeviceIntPtr g_pwinKeyboard; extern FARPROC g_fpDirectDrawCreate; extern FARPROC g_fpDirectDrawCreateClipper; -extern HMODULE g_hmodCommonControls; extern FARPROC g_fpTrackMouseEvent; diff --git a/hw/xwin/winglobals.c b/hw/xwin/winglobals.c index da1712988..d7ea2e39a 100644 --- a/hw/xwin/winglobals.c +++ b/hw/xwin/winglobals.c @@ -83,8 +83,6 @@ Bool g_fNativeGl = FALSE; * Global variables for dynamically loaded libraries and * their function pointers */ - -HMODULE g_hmodCommonControls = NULL; FARPROC g_fpTrackMouseEvent = (FARPROC) (void (*)(void))NoopDDA; From 04d11abcf2ea2f36d899428e9c885b69e4f779ad Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Thu, 14 Oct 2010 22:45:31 +0100 Subject: [PATCH 38/80] Cygwin/X: Remove g_hwndKeyboardFocus It's set but it's value is never used Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/winglobals.c | 2 -- hw/xwin/winwndproc.c | 7 ------- 2 files changed, 9 deletions(-) diff --git a/hw/xwin/winglobals.c b/hw/xwin/winglobals.c index d7ea2e39a..2b6c8a8ad 100644 --- a/hw/xwin/winglobals.c +++ b/hw/xwin/winglobals.c @@ -73,7 +73,6 @@ char * g_pszCommandLine = NULL; Bool g_fSilentFatalError = FALSE; DWORD g_dwCurrentThreadID = 0; Bool g_fKeyboardHookLL = FALSE; -HWND g_hwndKeyboardFocus = NULL; Bool g_fNoHelpMessageBox = FALSE; Bool g_fSoftwareCursor = FALSE; Bool g_fSilentDupError = FALSE; @@ -120,7 +119,6 @@ void winInitializeGlobals (void) { g_dwCurrentThreadID = GetCurrentThreadId (); - g_hwndKeyboardFocus = NULL; #ifdef XWIN_CLIPBOARD g_fClipboardLaunched = FALSE; g_fClipboardStarted = FALSE; diff --git a/hw/xwin/winwndproc.c b/hw/xwin/winwndproc.c index 5e8451082..4e4eff22c 100644 --- a/hw/xwin/winwndproc.c +++ b/hw/xwin/winwndproc.c @@ -57,7 +57,6 @@ Bool g_fButton[3] = { FALSE, FALSE, FALSE }; extern Bool g_fClipboard; extern HWND g_hDlgDepthChange; extern Bool g_fKeyboardHookLL; -extern HWND g_hwndKeyboardFocus; extern Bool g_fSoftwareCursor; extern DWORD g_dwCurrentThreadID; @@ -964,9 +963,6 @@ winWindowProc (HWND hwnd, UINT message, if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput) break; - /* Save handle of our main window that last received focus */ - g_hwndKeyboardFocus = hwnd; - /* Restore the state of all mode keys */ winRestoreModeKeyStates (); @@ -979,9 +975,6 @@ winWindowProc (HWND hwnd, UINT message, if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput) break; - /* Clear handle of our main window that last received focus */ - g_hwndKeyboardFocus = NULL; - /* Release any pressed keys */ winKeybdReleaseKeys (); From 25801a2556ca9b42646023e5a95a3cbf7309e852 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Thu, 14 Oct 2010 22:38:17 +0100 Subject: [PATCH 39/80] Cygwin/X: Move duplicate extern variable declarations from various .c files to a new header file For the global variables defined in winglobals.c, remove duplicate extern declarations from the beginning of various .c files, and move most of them into a new header file, winglobals.h Leave some clipboard related variables alone for the moment, they need treating more carefully, to avoid mixing client and server type definitions. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/InitInput.c | 15 ------ hw/xwin/InitOutput.c | 25 --------- hw/xwin/win.h | 9 ++-- hw/xwin/winblock.c | 10 ---- hw/xwin/wincursor.c | 2 - hw/xwin/windialogs.c | 12 ----- hw/xwin/winerror.c | 7 --- hw/xwin/winglobals.c | 1 + hw/xwin/winglobals.h | 88 +++++++++++++++++++++++++++++++ hw/xwin/winmultiwindowicons.c | 7 --- hw/xwin/winmultiwindowwindow.c | 9 ---- hw/xwin/winmultiwindowwndproc.c | 9 ---- hw/xwin/winnativegdi.c | 7 --- hw/xwin/winpfbdd.c | 8 --- hw/xwin/winprefs.c | 11 ---- hw/xwin/winprefs.h | 3 +- hw/xwin/winprocarg.c | 16 ------ hw/xwin/winscrinit.c | 8 --- hw/xwin/winshaddd.c | 7 --- hw/xwin/winshadddnl.c | 7 --- hw/xwin/winshadgdi.c | 10 ---- hw/xwin/winvalargs.c | 7 --- hw/xwin/winwakeup.c | 10 ---- hw/xwin/winwin32rootlesswndproc.c | 8 --- hw/xwin/winwndproc.c | 11 ---- 25 files changed, 94 insertions(+), 213 deletions(-) create mode 100644 hw/xwin/winglobals.h diff --git a/hw/xwin/InitInput.c b/hw/xwin/InitInput.c index 0ffa94092..e9a9b11b4 100644 --- a/hw/xwin/InitInput.c +++ b/hw/xwin/InitInput.c @@ -52,21 +52,6 @@ int winProcSetSelectionOwner(ClientPtr /* client */); DeviceIntPtr g_pwinPointer; DeviceIntPtr g_pwinKeyboard; - -/* - * References to external symbols - */ - -#ifdef HAS_DEVWINDOWS -extern int g_fdMessageQueue; -#endif -extern Bool g_fXdmcpEnabled; -#ifdef XWIN_CLIPBOARD -extern winDispatchProcPtr winProcEstablishConnectionOrig; -extern winDispatchProcPtr winProcQueryTreeOrig; -#endif - - /* Called from dix/devices.c */ /* * All of our keys generate up and down transition notifications, diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index ae1d4154b..38a658d77 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -58,29 +58,9 @@ typedef HRESULT (*SHGETFOLDERPATHPROC)( ); #endif - /* * References to external symbols */ - -extern int g_iNumScreens; -extern winScreenInfo * g_ScreenInfo; -extern char * g_pszCommandLine; -extern Bool g_fSilentFatalError; - -extern const char * g_pszLogFile; -extern Bool g_fLogFileChanged; -extern int g_iLogVerbose; -Bool g_fLogInited; - -extern Bool g_fXdmcpEnabled; -extern Bool g_fAuthEnabled; -#ifdef HAS_DEVWINDOWS -extern int g_fdMessageQueue; -#endif -extern const char * g_pszQueryHost; -extern HINSTANCE g_hInstance; - #ifdef XWIN_CLIPBOARD extern Bool g_fUnicodeClipboard; extern Bool g_fClipboardLaunched; @@ -91,11 +71,6 @@ extern Bool g_fClipboard; #endif -extern FARPROC g_fpTrackMouseEvent; -extern Bool g_fNoHelpMessageBox; -extern Bool g_fSilentDupError; -extern Bool g_fNativeGl; - /* module handle for dynamically loaded comctl32 library */ diff --git a/hw/xwin/win.h b/hw/xwin/win.h index 4d6771ca5..f22a2d576 100644 --- a/hw/xwin/win.h +++ b/hw/xwin/win.h @@ -314,9 +314,6 @@ typedef Bool (*winFinishCreateWindowsWindowProcPtr)(WindowPtr pWin); typedef Bool (*winCreateScreenResourcesProc)(ScreenPtr); -/* Typedef for DIX wrapper functions */ -typedef int (*winDispatchProcPtr) (ClientPtr); - /* * GC (graphics context) privates @@ -622,6 +619,8 @@ typedef struct { * Extern declares for general global variables */ +#include "winglobals.h" + extern winScreenInfo * g_ScreenInfo; extern miPointerScreenFuncRec g_winPointerCursorFuncs; extern DWORD g_dwEvents; @@ -648,14 +647,12 @@ extern const char * g_pszQueryHost; extern DeviceIntPtr g_pwinPointer; extern DeviceIntPtr g_pwinKeyboard; - /* - * Extern declares for dynamically loaded libraries and function pointers + * Extern declares for dynamically loaded library function pointers */ extern FARPROC g_fpDirectDrawCreate; extern FARPROC g_fpDirectDrawCreateClipper; - extern FARPROC g_fpTrackMouseEvent; diff --git a/hw/xwin/winblock.c b/hw/xwin/winblock.c index abea60e0f..e165d5488 100644 --- a/hw/xwin/winblock.c +++ b/hw/xwin/winblock.c @@ -34,16 +34,6 @@ #include "win.h" #include "winmsg.h" - -/* - * References to external symbols - */ - -extern HWND g_hDlgDepthChange; -extern HWND g_hDlgExit; -extern HWND g_hDlgAbout; - - /* See Porting Layer Definition - p. 6 */ void winBlockHandler (int nScreen, diff --git a/hw/xwin/wincursor.c b/hw/xwin/wincursor.c index 076d4756c..0ed1d1349 100644 --- a/hw/xwin/wincursor.c +++ b/hw/xwin/wincursor.c @@ -41,8 +41,6 @@ #include #include "misc.h" -extern Bool g_fSoftwareCursor; - #define BRIGHTNESS(x) (x##Red * 0.299 + x##Green * 0.587 + x##Blue * 0.114) #if 0 diff --git a/hw/xwin/windialogs.c b/hw/xwin/windialogs.c index 270ff788e..22d8cd7f7 100644 --- a/hw/xwin/windialogs.c +++ b/hw/xwin/windialogs.c @@ -44,21 +44,9 @@ * References to external globals */ -extern Bool g_fCursor; -extern HWND g_hDlgDepthChange; -extern HWND g_hDlgExit; -extern HWND g_hDlgAbout; -extern WINPREFS pref; #ifdef XWIN_CLIPBOARD extern Bool g_fClipboardStarted; #endif -extern Bool g_fSoftwareCursor; - -#if defined(XWIN_MULTIWINDOW) -extern HICON g_hIconX; -extern HICON g_hSmallIconX; -#endif - /* * Local function prototypes */ diff --git a/hw/xwin/winerror.c b/hw/xwin/winerror.c index 01412dd1d..aadfd2858 100644 --- a/hw/xwin/winerror.c +++ b/hw/xwin/winerror.c @@ -35,13 +35,6 @@ #include <../xfree86/common/xorgVersion.h> #include "win.h" -/* References to external symbols */ -extern char * g_pszCommandLine; -extern const char * g_pszLogFile; -extern Bool g_fSilentFatalError; -extern Bool g_fLogInited; - - #ifdef DDXOSVERRORF /* Prototype */ void diff --git a/hw/xwin/winglobals.c b/hw/xwin/winglobals.c index 2b6c8a8ad..2909f371b 100644 --- a/hw/xwin/winglobals.c +++ b/hw/xwin/winglobals.c @@ -82,6 +82,7 @@ Bool g_fNativeGl = FALSE; * Global variables for dynamically loaded libraries and * their function pointers */ + FARPROC g_fpTrackMouseEvent = (FARPROC) (void (*)(void))NoopDDA; diff --git a/hw/xwin/winglobals.h b/hw/xwin/winglobals.h new file mode 100644 index 000000000..89926796c --- /dev/null +++ b/hw/xwin/winglobals.h @@ -0,0 +1,88 @@ +/* + File: winglobals.h + Purpose: declarations for global variables + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice (including the next + paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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. + +*/ + +#ifndef WINGLOBALS_H +#define WINGLOBALS_H + +/* + * References to external symbols + */ + +extern int g_iNumScreens; +extern int g_iLastScreen; +extern char * g_pszCommandLine; +extern Bool g_fSilentFatalError; +extern const char * g_pszLogFile; +#ifdef RELOCATE_PROJECTROOT +extern Bool g_fLogFileChanged; +#endif +extern int g_iLogVerbose; +extern Bool g_fLogInited; + +extern Bool g_fAuthEnabled; +extern Bool g_fXdmcpEnabled; + +extern Bool g_fNoHelpMessageBox; +extern Bool g_fSilentDupError; +extern Bool g_fNativeGl; + +extern HWND g_hDlgDepthChange; +extern HWND g_hDlgExit; +extern HWND g_hDlgAbout; + +extern Bool g_fSoftwareCursor; +extern Bool g_fCursor; + +#ifdef XWIN_CLIPBOARD + +/* Typedef for DIX wrapper functions */ +typedef int (*winDispatchProcPtr) (ClientPtr); + +/* + * Wrapped DIX functions + */ +extern winDispatchProcPtr winProcEstablishConnectionOrig; +extern winDispatchProcPtr winProcQueryTreeOrig; +extern winDispatchProcPtr winProcSetSelectionOwnerOrig; +#endif + +/* The global X default icons */ +#if defined(XWIN_MULTIWINDOW) +extern HICON g_hIconX; +extern HICON g_hSmallIconX; +#endif + +#ifdef XWIN_MULTIWINDOW +extern DWORD g_dwCurrentThreadID; +#endif + +extern Bool g_fKeyboardHookLL; +extern Bool g_fButton[3]; + +#ifdef XWIN_MULTIWINDOWEXTWM +extern Bool g_fNoConfigureWindow; +#endif + +#endif /* WINGLOBALS_H */ diff --git a/hw/xwin/winmultiwindowicons.c b/hw/xwin/winmultiwindowicons.c index cb27d2fe3..1ca3f9141 100644 --- a/hw/xwin/winmultiwindowicons.c +++ b/hw/xwin/winmultiwindowicons.c @@ -41,13 +41,6 @@ #include "propertyst.h" #include "windowstr.h" -/* - * External global variables - */ - -extern HICON g_hIconX; -extern HICON g_hSmallIconX; - /* * Prototypes for local functions diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c index 731235042..7efc360a4 100644 --- a/hw/xwin/winmultiwindowwindow.c +++ b/hw/xwin/winmultiwindowwindow.c @@ -39,15 +39,6 @@ #include "dixevents.h" #include "winmultiwindowclass.h" -/* - * External global variables - */ - -extern HICON g_hIconX; -extern HICON g_hSmallIconX; -extern HWND g_hDlgDepthChange; -extern Bool g_fNativeGl; - /* * Prototypes for local functions */ diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c index d14ceee9c..b559cd8cf 100644 --- a/hw/xwin/winmultiwindowwndproc.c +++ b/hw/xwin/winmultiwindowwndproc.c @@ -42,15 +42,6 @@ #include "winmsg.h" #include "inputstr.h" -/* - * External global variables - */ - -extern Bool g_fCursor; -extern Bool g_fKeyboardHookLL; -extern Bool g_fSoftwareCursor; -extern Bool g_fButton[3]; - extern void winUpdateWindowPosition (HWND hWnd, Bool reshape, HWND *zstyle); diff --git a/hw/xwin/winnativegdi.c b/hw/xwin/winnativegdi.c index 48a467a2c..b8d2d351b 100644 --- a/hw/xwin/winnativegdi.c +++ b/hw/xwin/winnativegdi.c @@ -34,13 +34,6 @@ #include "win.h" -/* - * External symbols - */ - -extern HWND g_hDlgExit; - - /* * Local function prototypes */ diff --git a/hw/xwin/winpfbdd.c b/hw/xwin/winpfbdd.c index 13fc1058d..7859c6b19 100644 --- a/hw/xwin/winpfbdd.c +++ b/hw/xwin/winpfbdd.c @@ -37,14 +37,6 @@ #include "win.h" -/* - * External symbols - */ - -extern const GUID _IID_IDirectDraw2; -extern HWND g_hDlgExit; - - /* * Local function prototypes */ diff --git a/hw/xwin/winprefs.c b/hw/xwin/winprefs.c index 1996ef0ef..4ccb4ffc2 100644 --- a/hw/xwin/winprefs.c +++ b/hw/xwin/winprefs.c @@ -49,22 +49,11 @@ /* Where will the custom menu commands start counting from? */ #define STARTMENUID WM_USER -/* External global variables */ -#ifdef XWIN_MULTIWINDOW -extern DWORD g_dwCurrentThreadID; -#endif - extern const char *winGetBaseDir(void); /* From winmultiwindowflex.l, the real parser */ extern void parse_file (FILE *fp); -/* From winprefyacc.y, the pref structure loaded by the parser */ -extern WINPREFS pref; - -/* The global X default icon */ -extern HICON g_hIconX; -extern HICON g_hSmallIconX; /* Currently in use command ID, incremented each new menu item created */ static int g_cmdid = STARTMENUID; diff --git a/hw/xwin/winprefs.h b/hw/xwin/winprefs.h index 4daf47401..33b496df8 100644 --- a/hw/xwin/winprefs.h +++ b/hw/xwin/winprefs.h @@ -151,7 +151,8 @@ typedef struct WINPREFS } WINPREFS; - +/* The global pref settings structure loaded by the winprefyacc.y parser */ +extern WINPREFS pref; /* Functions */ diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c index edbd4bea0..1ce5c2dca 100644 --- a/hw/xwin/winprocarg.c +++ b/hw/xwin/winprocarg.c @@ -40,26 +40,10 @@ from The Open Group. * References to external symbols */ -extern int g_iNumScreens; -extern winScreenInfo * g_ScreenInfo; #ifdef XWIN_CLIPBOARD extern Bool g_fUnicodeClipboard; extern Bool g_fClipboard; #endif -extern int g_iLogVerbose; -extern const char * g_pszLogFile; -#ifdef RELOCATE_PROJECTROOT -extern Bool g_fLogFileChanged; -#endif -extern Bool g_fXdmcpEnabled; -extern Bool g_fAuthEnabled; -extern char * g_pszCommandLine; -extern Bool g_fKeyboardHookLL; -extern Bool g_fNoHelpMessageBox; -extern Bool g_fSoftwareCursor; -extern Bool g_fSilentDupError; -extern Bool g_fNativeGl; - /* globals required by callback function for monitor information */ struct GetMonitorInfoData { int requestedMonitor; diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c index cf65881fe..57a08846b 100644 --- a/hw/xwin/winscrinit.c +++ b/hw/xwin/winscrinit.c @@ -65,14 +65,6 @@ winMWExtWMProcs = { }; #endif - -/* - * References to external symbols - */ - -extern Bool g_fSoftwareCursor; - - /* * Prototypes */ diff --git a/hw/xwin/winshaddd.c b/hw/xwin/winshaddd.c index 2de496c09..4e284b9c1 100644 --- a/hw/xwin/winshaddd.c +++ b/hw/xwin/winshaddd.c @@ -37,13 +37,6 @@ #include "win.h" -/* - * External symbols - */ - -extern HWND g_hDlgExit; -extern const char *g_pszLogFile; - /* * FIXME: Headers are broken, DEFINE_GUID doesn't work correctly, * so we have to redefine it here. diff --git a/hw/xwin/winshadddnl.c b/hw/xwin/winshadddnl.c index 0d59e6a6a..82fe4be36 100644 --- a/hw/xwin/winshadddnl.c +++ b/hw/xwin/winshadddnl.c @@ -37,13 +37,6 @@ #include "win.h" -/* - * External symbols - */ - -extern HWND g_hDlgExit; - - /* * FIXME: Headers are broken, DEFINE_GUID doesn't work correctly, * so we have to redefine it here. diff --git a/hw/xwin/winshadgdi.c b/hw/xwin/winshadgdi.c index 8af4be478..4971851e5 100644 --- a/hw/xwin/winshadgdi.c +++ b/hw/xwin/winshadgdi.c @@ -34,16 +34,6 @@ #include "win.h" -/* - * External symbols - */ - -#ifdef XWIN_MULTIWINDOW -extern DWORD g_dwCurrentThreadID; -#endif -extern HWND g_hDlgExit; - - /* * Local function prototypes */ diff --git a/hw/xwin/winvalargs.c b/hw/xwin/winvalargs.c index 6f8d1c994..357d3d70a 100644 --- a/hw/xwin/winvalargs.c +++ b/hw/xwin/winvalargs.c @@ -35,13 +35,6 @@ #include "winmsg.h" -/* - * References to external symbols - */ - -extern int g_iNumScreens; -extern winScreenInfo * g_ScreenInfo; -extern Bool g_fXdmcpEnabled; /* diff --git a/hw/xwin/winwakeup.c b/hw/xwin/winwakeup.c index e1eece34a..b512b29e8 100644 --- a/hw/xwin/winwakeup.c +++ b/hw/xwin/winwakeup.c @@ -36,16 +36,6 @@ #endif #include "win.h" - -/* - * References to external symbols - */ - -extern HWND g_hDlgDepthChange; -extern HWND g_hDlgExit; -extern HWND g_hDlgAbout; - - /* See Porting Layer Definition - p. 7 */ void winWakeupHandler (int nScreen, diff --git a/hw/xwin/winwin32rootlesswndproc.c b/hw/xwin/winwin32rootlesswndproc.c index 4d7afee42..21506df15 100644 --- a/hw/xwin/winwin32rootlesswndproc.c +++ b/hw/xwin/winwin32rootlesswndproc.c @@ -52,14 +52,6 @@ #define RAISE_ON_CLICK_DEFAULT FALSE -/* - * Global variables - */ - -extern Bool g_fNoConfigureWindow; -extern Bool g_fSoftwareCursor; - - /* * Local globals */ diff --git a/hw/xwin/winwndproc.c b/hw/xwin/winwndproc.c index 4e4eff22c..6d2270a20 100644 --- a/hw/xwin/winwndproc.c +++ b/hw/xwin/winwndproc.c @@ -50,17 +50,6 @@ Bool g_fCursor = TRUE; Bool g_fButton[3] = { FALSE, FALSE, FALSE }; -/* - * References to external symbols - */ - -extern Bool g_fClipboard; -extern HWND g_hDlgDepthChange; -extern Bool g_fKeyboardHookLL; -extern Bool g_fSoftwareCursor; -extern DWORD g_dwCurrentThreadID; - - /* * Called by winWakeupHandler * Processes current Windows message From c7e436e9987a6fb0876c63e96f59ff4c20b4bef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Thu, 14 Oct 2010 15:49:50 +0200 Subject: [PATCH 40/80] kdrive: Fix tslib check fallback to set TSLIB_LIBS. #30599 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If pkg-config is unable to find tslib but the fallback check does find it, the compilation continues with tslib support enabled though TSLIB_LIBS are unset. Thus, the compilation fails with a linking error on tslib functions. This patch sets TSLIB_LIBS to '-lts' whenever the tslib fallback check succeeds. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=30599 Signed-off-by: Michał Górny Reviewed-by: Daniel Stone Signed-off-by: Keith Packard --- configure.ac | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index c0bf98f30..6d6366328 100644 --- a/configure.ac +++ b/configure.ac @@ -2034,7 +2034,10 @@ if test "$KDRIVE" = yes; then PKG_CHECK_MODULES([TSLIB], [tslib-0.0], [HAVE_TSLIB="yes"], [HAVE_TSLIB="no"]) if test "x$HAVE_TSLIB" = xno; then - AC_CHECK_LIB(ts, ts_open, [HAVE_TSLIB="yes"]) + AC_CHECK_LIB(ts, ts_open, [ + HAVE_TSLIB="yes" + TSLIB_LIBS="-lts" + ]) fi if test "xTSLIB" = xauto; then From 8806a04f7f028dd9f6a7ff5c36e460d3895c7deb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Thu, 14 Oct 2010 15:49:51 +0200 Subject: [PATCH 41/80] kdrive: Fix linking with tslib, with -Wl, --as-needed. #30600 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change the library order in TSLIB_LIBS variable, placing ${TSLIB_LIBS} after the local static libraries. This fixes linking with -Wl,--as-needed. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=30600 Signed-off-by: Michał Górny Reviewed-by: Daniel Stone Signed-off-by: Keith Packard --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 6d6366328..e8f947316 100644 --- a/configure.ac +++ b/configure.ac @@ -2122,7 +2122,7 @@ if test "$KDRIVE" = yes; then KDRIVE_LOCAL_LIBS="$MAIN_LIB $DIX_LIB $KDRIVE_LIB $KDRIVE_STUB_LIB" KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $FB_LIB $MI_LIB $KDRIVE_PURE_LIBS" KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $KDRIVE_OS_LIB $OS_LIB" - KDRIVE_LIBS="$TSLIB_LIBS $KDRIVE_LOCAL_LIBS $XSERVER_SYS_LIBS $GLX_SYS_LIBS $DLOPEN_LIBS" + KDRIVE_LIBS="$KDRIVE_LOCAL_LIBS $XSERVER_SYS_LIBS $GLX_SYS_LIBS $DLOPEN_LIBS $TSLIB_LIBS" AC_SUBST([XEPHYR_LIBS]) AC_SUBST([XEPHYR_INCS]) From ca21a266224b6eff4fd817c2082d2e144f1ea58c Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 11 Oct 2010 15:38:38 +1000 Subject: [PATCH 42/80] xkb: init mapWidth and symsPerKey arrays to 0. Helps debugging greatly, random 8 or 16 bit values can sometimes look like valid values, causing much excitement on the client front. Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone --- xkb/xkb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xkb/xkb.c b/xkb/xkb.c index 4105c1c6b..7d95bc0e3 100644 --- a/xkb/xkb.c +++ b/xkb/xkb.c @@ -2343,8 +2343,8 @@ _XkbSetMapChecks(ClientPtr client, DeviceIntPtr dev, xkbSetMapReq *req, char* va XkbDescPtr xkb; int error; int nTypes = 0, nActions; - CARD8 mapWidths[XkbMaxLegalKeyCode + 1]; - CARD16 symsPerKey[XkbMaxLegalKeyCode + 1]; + CARD8 mapWidths[XkbMaxLegalKeyCode + 1] = {0}; + CARD16 symsPerKey[XkbMaxLegalKeyCode + 1] = {0}; xkbi= dev->key->xkbInfo; xkb = xkbi->desc; From 649293f6b634e6305b6737a841d6e9d0f0065d6c Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 11 Oct 2010 16:09:18 +1000 Subject: [PATCH 43/80] xkb: always fill the symsPerKey array, regardless of client flags (#30527) Even if a client does not modify the symbols, symsPerKey and mapWidths must be filled from the current configuration. Both arrays are then passed into other functions (pending the right flag), thus they must contain valid values regardless of the XkbKeySymsMask flag in req->present. X.Org Bug 30527 Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone --- xkb/xkb.c | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/xkb/xkb.c b/xkb/xkb.c index 7d95bc0e3..bbb1d9df8 100644 --- a/xkb/xkb.c +++ b/xkb/xkb.c @@ -1677,20 +1677,6 @@ xkbSymMapWireDesc* wire = *wireRtrn; if (!(XkbKeySymsMask&req->present)) return 1; CHK_REQ_KEY_RANGE2(0x11,req->firstKeySym,req->nKeySyms,req,(*errorRtrn),0); - map = &xkb->map->key_sym_map[xkb->min_key_code]; - for (i=xkb->min_key_code;i<(unsigned)req->firstKeySym;i++,map++) { - register int g,ng,w; - ng= XkbNumGroups(map->group_info); - for (w=g=0;gkt_index[g]>=(unsigned)nTypes) { - *errorRtrn = _XkbErrCode4(0x13,i,g,map->kt_index[g]); - return 0; - } - if (mapWidths[map->kt_index[g]]>w) - w= mapWidths[map->kt_index[g]]; - } - symsPerKey[i] = w*ng; - } for (i=0;inKeySyms;i++) { KeySym *pSyms; register unsigned nG; @@ -2345,6 +2331,8 @@ _XkbSetMapChecks(ClientPtr client, DeviceIntPtr dev, xkbSetMapReq *req, char* va int nTypes = 0, nActions; CARD8 mapWidths[XkbMaxLegalKeyCode + 1] = {0}; CARD16 symsPerKey[XkbMaxLegalKeyCode + 1] = {0}; + XkbSymMapPtr map; + int i; xkbi= dev->key->xkbInfo; xkb = xkbi->desc; @@ -2373,6 +2361,23 @@ _XkbSetMapChecks(ClientPtr client, DeviceIntPtr dev, xkbSetMapReq *req, char* va client->errorValue = nTypes; return BadValue; } + + /* symsPerKey/mapWidths must be filled regardless of client-side flags */ + map = &xkb->map->key_sym_map[xkb->min_key_code]; + for (i=xkb->min_key_code;imax_key_code;i++,map++) { + register int g,ng,w; + ng= XkbNumGroups(map->group_info); + for (w=g=0;gkt_index[g]>=(unsigned)nTypes) { + client->errorValue = _XkbErrCode4(0x13,i,g,map->kt_index[g]); + return 0; + } + if (mapWidths[map->kt_index[g]]>w) + w= mapWidths[map->kt_index[g]]; + } + symsPerKey[i] = w*ng; + } + if ((req->present & XkbKeySymsMask) && (!CheckKeySyms(client,xkb,req,nTypes,mapWidths,symsPerKey, (xkbSymMapWireDesc **)&values,&error))) { From 9872e0f0115cd7d0543e55a1831facddf3aff90c Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 13 Oct 2010 10:31:51 +1000 Subject: [PATCH 44/80] xfree86: set mask for valuators 0/1 when emulating core events (#30267) EventToCore as of the commit below won't generate core motion events if the valuator mask for x/y isn't set. For DGA, we work around this check by forcibly setting the mask in the event we pass down. commit de8be07cc0a8163b6ef04455706fd5ca2cebe587 Author: Peter Hutterer Date: Tue Aug 17 12:08:52 2010 +1000 dix: don't create core motion events for non-x/y valuators. X.Org Bug 30267 Signed-off-by: Peter Hutterer Tested-by: Andrew Randrianasulu Tested-by: Andy Furniss Reviewed-by: Daniel Stone --- hw/xfree86/common/xf86DGA.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c index c468c6038..1058a466c 100644 --- a/hw/xfree86/common/xf86DGA.c +++ b/hw/xfree86/common/xf86DGA.c @@ -1133,6 +1133,10 @@ DGAProcessPointerEvent (ScreenPtr pScreen, DGAEvent *event, DeviceIntPtr mouse) ev.root_x = event->dx; ev.root_y = event->dy; ev.corestate = event->state; + /* DGA is core only, so valuators.data doesn't actually matter. + * Mask must be set for EventToCore to create motion events. */ + SetBit(ev.valuators.mask, 0); + SetBit(ev.valuators.mask, 1); DeliverGrabbedEvent ((InternalEvent*)&ev, mouse, FALSE); } } From 1a0d9324b3d9fd93e685066e0e5cea0611878c0d Mon Sep 17 00:00:00 2001 From: Aaron Plattner Date: Sun, 17 Oct 2010 09:58:50 -0700 Subject: [PATCH 45/80] Revert "Set DamageSetReportAfterOp to true for the damage extension" (#30260) This commit breaks the Compiz "Wallpaper" plugin. This reverts commit 8d7b7a0d71e0b89321b3341b781bc8845386def6. Reviewed-by: Keith Packard Signed-off-by: Keith Packard --- damageext/damageext.c | 1 - 1 file changed, 1 deletion(-) diff --git a/damageext/damageext.c b/damageext/damageext.c index b4bb478dd..f5265ddfc 100644 --- a/damageext/damageext.c +++ b/damageext/damageext.c @@ -217,7 +217,6 @@ ProcDamageCreate (ClientPtr client) if (!AddResource (stuff->damage, DamageExtType, (pointer) pDamageExt)) return BadAlloc; - DamageSetReportAfterOp (pDamageExt->pDamage, TRUE); DamageRegister (pDamageExt->pDrawable, pDamageExt->pDamage); if (pDrawable->type == DRAWABLE_WINDOW) From 8990b31214bcbc08090604147287455bfde91c11 Mon Sep 17 00:00:00 2001 From: Paulius Zaleckas Date: Mon, 18 Oct 2010 00:02:01 +0300 Subject: [PATCH 46/80] KDrive: Fix error handlig in tslib driver If ts_open() fails and return NULL, then next call to ts_fd() segfaults because of NULL dereference. There is no need to check output of ts_fd() as ts_open() did this internally. Signed-off-by: Paulius Zaleckas Reviewed-by: Daniel Stone Reviewed-by: Keith Packard Signed-off-by: Peter Hutterer --- hw/kdrive/linux/tslib.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/hw/kdrive/linux/tslib.c b/hw/kdrive/linux/tslib.c index 48a084220..570cbf99a 100644 --- a/hw/kdrive/linux/tslib.c +++ b/hw/kdrive/linux/tslib.c @@ -117,15 +117,22 @@ TslibEnable (KdPointerInfo *pi) pi->path = strdup("/dev/input/touchscreen0"); ErrorF("[tslib/TslibEnable] no device path given, trying %s\n", pi->path); } + private->tsDev = ts_open(pi->path, 0); - private->fd = ts_fd(private->tsDev); - if (!private->tsDev || ts_config(private->tsDev) || private->fd < 0) { + if (!private->tsDev) { ErrorF("[tslib/TslibEnable] failed to open %s\n", pi->path); - if (private->fd >= 0) - close(private->fd); return BadAlloc; } + if (ts_config(private->tsDev)) { + ErrorF("[tslib/TslibEnable] failed to load configuration\n"); + ts_close(private->tsDev); + private->tsDev = NULL; + return BadValue; + } + + private->fd = ts_fd(private->tsDev); + KdRegisterFd(private->fd, TsRead, pi); return Success; From 290af0418f8c94355e42ad81aa7779b90e173fc9 Mon Sep 17 00:00:00 2001 From: Chase Douglas Date: Thu, 21 Oct 2010 22:41:09 -0400 Subject: [PATCH 47/80] test: input - set valuators mask for event to core conversion Commit de8be07cc0a8163b6ef04455706fd5ca2cebe587 adds a requirement to event to core conversion that at least one of the X or Y valuators are set in the valuator mask. This commit fixes the event conversion test to be compliant. Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- test/input.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/input.c b/test/input.c index b90d3b4fd..f08e13b9e 100644 --- a/test/input.c +++ b/test/input.c @@ -182,6 +182,8 @@ static void dix_event_to_core(int type) ev.time = time; ev.root_y = x; ev.root_x = y; + SetBit(ev.valuators.mask, 0); + SetBit(ev.valuators.mask, 1); ev.root = ROOT_WINDOW_ID; ev.corestate = state; ev.detail.key = detail; From f72aadd38b730c46c0a027dacbbb57f03068383d Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 23 Oct 2010 22:42:33 +0200 Subject: [PATCH 48/80] hurd: Fix use of deprecated iopl device Fix Xserver on GNU/Hurd into using the "mem" device instead of the deprecated "iopl" device. Reviewed-by: Olaf Buddenhagen Signed-off-by: Samuel Thibault --- hw/xfree86/os-support/hurd/hurd_mmap.c | 12 ++++++------ hw/xfree86/os-support/hurd/hurd_video.c | 18 +++++++++--------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/hw/xfree86/os-support/hurd/hurd_mmap.c b/hw/xfree86/os-support/hurd/hurd_mmap.c index ccef5f218..3f942aaca 100644 --- a/hw/xfree86/os-support/hurd/hurd_mmap.c +++ b/hw/xfree86/os-support/hurd/hurd_mmap.c @@ -39,8 +39,8 @@ int xf86ReadBIOS(unsigned long Base,unsigned long Offset,unsigned char *Buf,int Len) { - mach_port_t device,iopl_dev; - memory_object_t iopl_mem; + mach_port_t device,mem_dev; + memory_object_t mem_obj; vm_address_t addr = (vm_address_t)0; /* serach starting address */ kern_return_t err; @@ -51,14 +51,14 @@ xf86ReadBIOS(unsigned long Base,unsigned long Offset,unsigned char *Buf,int Len) errno = err; FatalError("xf86ReadBIOS() can't get_privileged_ports. (%s)\n",strerror(errno)); } - err = device_open(device,D_READ|D_WRITE,"iopl",&iopl_dev); + err = device_open(device,D_READ|D_WRITE,"mem",&mem_dev); mach_port_deallocate (mach_task_self (), device); if( err ) { errno = err; FatalError("xf86ReadBIOS() can't device_open. (%s)\n",strerror(errno)); } - err = device_map(iopl_dev,VM_PROT_READ|VM_PROT_WRITE, Base , BIOS_SIZE ,&iopl_mem,0); + err = device_map(mem_dev,VM_PROT_READ|VM_PROT_WRITE, Base , BIOS_SIZE ,&mem_obj,0); if( err ) { errno = err; @@ -69,13 +69,13 @@ xf86ReadBIOS(unsigned long Base,unsigned long Offset,unsigned char *Buf,int Len) BIOS_SIZE, 0, TRUE, - iopl_mem, + mem_obj, Base, FALSE, VM_PROT_READ|VM_PROT_WRITE, VM_PROT_READ|VM_PROT_WRITE, VM_INHERIT_SHARE); - mach_port_deallocate(mach_task_self(),iopl_mem); + mach_port_deallocate(mach_task_self(),mem_obj); if( err ) { errno = err; diff --git a/hw/xfree86/os-support/hurd/hurd_video.c b/hw/xfree86/os-support/hurd/hurd_video.c index 4a99db375..3d7af404d 100644 --- a/hw/xfree86/os-support/hurd/hurd_video.c +++ b/hw/xfree86/os-support/hurd/hurd_video.c @@ -44,8 +44,8 @@ static pointer mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int Flags) { - mach_port_t device,iopl_dev; - memory_object_t iopl_mem; + mach_port_t device,mem_dev; + memory_object_t mem_obj; kern_return_t err; vm_address_t addr=(vm_address_t)0; @@ -55,7 +55,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int Flags) errno = err; FatalError("xf86MapVidMem() can't get_privileged_ports. (%s)\n",strerror(errno)); } - err = device_open(device,D_READ|D_WRITE,"iopl",&iopl_dev); + err = device_open(device,D_READ|D_WRITE,"mem",&mem_dev); mach_port_deallocate (mach_task_self(), device); if( err ) { @@ -63,7 +63,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int Flags) FatalError("xf86MapVidMem() can't device_open. (%s)\n",strerror(errno)); } - err = device_map(iopl_dev,VM_PROT_READ|VM_PROT_WRITE, Base , Size ,&iopl_mem,0); + err = device_map(mem_dev,VM_PROT_READ|VM_PROT_WRITE, Base , Size ,&mem_obj,0); if( err ) { errno = err; @@ -74,23 +74,23 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int Flags) Size, 0, /* mask */ TRUE, /* anywhere */ - iopl_mem, + mem_obj, (vm_offset_t)Base, FALSE, /* copy on write */ VM_PROT_READ|VM_PROT_WRITE, VM_PROT_READ|VM_PROT_WRITE, VM_INHERIT_SHARE); - mach_port_deallocate(mach_task_self(),iopl_mem); + mach_port_deallocate(mach_task_self(),mem_obj); if( err ) { errno = err; - FatalError("xf86MapVidMem() can't vm_map.(iopl_mem) (%s)\n",strerror(errno)); + FatalError("xf86MapVidMem() can't vm_map.(mem_obj) (%s)\n",strerror(errno)); } - mach_port_deallocate(mach_task_self(),iopl_dev); + mach_port_deallocate(mach_task_self(),mem_dev); if( err ) { errno = err; - FatalError("xf86MapVidMem() can't mach_port_deallocate.(iopl_dev) (%s)\n",strerror(errno)); + FatalError("xf86MapVidMem() can't mach_port_deallocate.(mem_dev) (%s)\n",strerror(errno)); } return (pointer)addr; } From 04a04e162886ca9bc3977d3a7509def876487921 Mon Sep 17 00:00:00 2001 From: Mikhail Gusarov Date: Mon, 25 Oct 2010 01:27:46 +0400 Subject: [PATCH 49/80] Remove now-misleading comment Signed-off-by: Mikhail Gusarov Reviewed-by: Alan Coopersmith --- os/log.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/os/log.c b/os/log.c index ee4b45fa4..3435da6f0 100644 --- a/os/log.c +++ b/os/log.c @@ -302,10 +302,6 @@ LogVWrite(int verb, const char *f, va_list args) #endif } } else if (needBuffer) { - /* - * Note, this code is used before OsInit() has been called, so - * malloc() and friends can't be used. - */ if (len > bufferUnused) { bufferSize += 1024; bufferUnused += 1024; From 433dddcf29d257310e95e4215dceef8b0b976e2d Mon Sep 17 00:00:00 2001 From: Mikhail Gusarov Date: Mon, 25 Oct 2010 01:28:38 +0400 Subject: [PATCH 50/80] Replace "if(buf) realloc(buf, size) else malloc(size)" with realloc() Signed-off-by: Mikhail Gusarov Reviewed-by: Alan Coopersmith --- os/log.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/os/log.c b/os/log.c index 3435da6f0..d18f9b3aa 100644 --- a/os/log.c +++ b/os/log.c @@ -305,10 +305,7 @@ LogVWrite(int verb, const char *f, va_list args) if (len > bufferUnused) { bufferSize += 1024; bufferUnused += 1024; - if (saveBuffer) - saveBuffer = realloc(saveBuffer, bufferSize); - else - saveBuffer = malloc(bufferSize); + saveBuffer = realloc(saveBuffer, bufferSize); if (!saveBuffer) FatalError("realloc() failed while saving log messages\n"); } From 44e81654147065b7b907ce0d14fdc2e74a638f79 Mon Sep 17 00:00:00 2001 From: Mikhail Gusarov Date: Mon, 25 Oct 2010 01:30:33 +0400 Subject: [PATCH 51/80] Remove now-misleading comment Signed-off-by: Mikhail Gusarov Reviewed-by: Alan Coopersmith --- os/log.c | 1 - 1 file changed, 1 deletion(-) diff --git a/os/log.c b/os/log.c index d18f9b3aa..76b6b84a1 100644 --- a/os/log.c +++ b/os/log.c @@ -177,7 +177,6 @@ LogInit(const char *fname, const char *backup) char *logFileName = NULL; if (fname && *fname) { - /* malloc() can't be used yet. */ logFileName = malloc(strlen(fname) + strlen(display) + 1); if (!logFileName) FatalError("Cannot allocate space for the log file name\n"); From a210068c5222acbdb04db17cb8cef314735bf977 Mon Sep 17 00:00:00 2001 From: Tiago Vignatti Date: Tue, 26 Oct 2010 20:50:13 +0300 Subject: [PATCH 52/80] dix: advance parent window pointer when no node is found Signed-off-by: Tiago Vignatti Signed-off-by: Pauli Nieminen Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- dix/window.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dix/window.c b/dix/window.c index 1913030cf..edb146e97 100644 --- a/dix/window.c +++ b/dix/window.c @@ -3660,9 +3660,9 @@ WindowParentHasDeviceCursor(WindowPtr pWin, &pParentNode, &pParentPrev)) { /* if there is a node in the list, the win has a dev cursor */ - if (!pParentNode->cursor) /* inherited. loop needs to cont. */ - { - } else if (pParentNode->cursor == pCursor) /* inherit */ + if (!pParentNode->cursor) /* inherited. */ + pParent = pParent->parent; + else if (pParentNode->cursor == pCursor) /* inherit */ return TRUE; else /* different cursor */ return FALSE; From fe8d122b133a43125cc961d2c3c811fa776f29c8 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 28 Oct 2010 16:13:09 +1000 Subject: [PATCH 53/80] Xi: reshuffle conditions for labeling a device as IsXExtensionKeyboard (#29046) From the original bug reporter Ezra Reeves: "I did some more digging on this today, and I found that an HP branded wireless USB mouse has the same issue. With this mouse (as well as the logitech wireless mouse), the return from: xdev = XListInputDevices(GDK_WINDOW_XDISPLAY(rootwin), &ndevices_return); lists the USB device twice, but both have xdev[num].use == 3 (IsXExtensionKeyboard as defined in X11/XI.h). [...] Swapping the order of the test in Xi/listdev.c that determines whether a device is a pointer or a keyboard properly detects my devices (OEM USB wireless mouse/kb combo) -- one as a keyboard and one as a pointer." X.Org Bug 29046 Reported-by: Erik Kilfoil Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- Xi/listdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Xi/listdev.c b/Xi/listdev.c index 3b2272bc3..b38fbd1c0 100644 --- a/Xi/listdev.c +++ b/Xi/listdev.c @@ -180,10 +180,10 @@ CopySwapDevice(ClientPtr client, DeviceIntPtr d, int num_classes, dev->use = IsXKeyboard; else if (IsMaster(d) && IsPointerDevice(d)) dev->use = IsXPointer; - else if (d->key && d->kbdfeed) - dev->use = IsXExtensionKeyboard; else if (d->valuator && d->button) dev->use = IsXExtensionPointer; + else if (d->key && d->kbdfeed) + dev->use = IsXExtensionKeyboard; else dev->use = IsXExtensionDevice; From 6118346d64e3c2fbe1fe2f041ea773dd2a3c0438 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Sandmann=20Pedersen?= Date: Mon, 1 Nov 2010 22:04:49 -0400 Subject: [PATCH 54/80] Delete unused fbWalkCompositeRegion() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This function has not been used since most of the compositing was moved to pixman. The only reason it has survived until now is that it was part of the server ABI. Reviewed-by: Aaron Plattner Reviewed-by: Mikhail Gusarov Signed-off-by: Søren Sandmann --- fb/fbpict.c | 106 ------------------------------------------------- fb/fbpict.h | 17 -------- fb/wfbrename.h | 1 - 3 files changed, 124 deletions(-) diff --git a/fb/fbpict.c b/fb/fbpict.c index f7f120002..3bc141bcd 100644 --- a/fb/fbpict.c +++ b/fb/fbpict.c @@ -35,112 +35,6 @@ #include "mipict.h" #include "fbpict.h" -#define mod(a,b) ((b) == 1 ? 0 : (a) >= 0 ? (a) % (b) : (b) - (-a) % (b)) - -void -fbWalkCompositeRegion (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height, - Bool srcRepeat, - Bool maskRepeat, - CompositeFunc compositeRect) -{ - RegionRec region; - int n; - BoxPtr pbox; - int w, h, w_this, h_this; - int x_msk, y_msk, x_src, y_src, x_dst, y_dst; - - xDst += pDst->pDrawable->x; - yDst += pDst->pDrawable->y; - if (pSrc->pDrawable) - { - xSrc += pSrc->pDrawable->x; - ySrc += pSrc->pDrawable->y; - } - if (pMask && pMask->pDrawable) - { - xMask += pMask->pDrawable->x; - yMask += pMask->pDrawable->y; - } - - if (!miComputeCompositeRegion (®ion, pSrc, pMask, pDst, xSrc, ySrc, - xMask, yMask, xDst, yDst, width, height)) - return; - - n = RegionNumRects (®ion); - pbox = RegionRects (®ion); - while (n--) - { - h = pbox->y2 - pbox->y1; - y_src = pbox->y1 - yDst + ySrc; - y_msk = pbox->y1 - yDst + yMask; - y_dst = pbox->y1; - while (h) - { - h_this = h; - w = pbox->x2 - pbox->x1; - x_src = pbox->x1 - xDst + xSrc; - x_msk = pbox->x1 - xDst + xMask; - x_dst = pbox->x1; - if (maskRepeat) - { - y_msk = mod (y_msk - pMask->pDrawable->y, pMask->pDrawable->height); - if (h_this > pMask->pDrawable->height - y_msk) - h_this = pMask->pDrawable->height - y_msk; - y_msk += pMask->pDrawable->y; - } - if (srcRepeat) - { - y_src = mod (y_src - pSrc->pDrawable->y, pSrc->pDrawable->height); - if (h_this > pSrc->pDrawable->height - y_src) - h_this = pSrc->pDrawable->height - y_src; - y_src += pSrc->pDrawable->y; - } - while (w) - { - w_this = w; - if (maskRepeat) - { - x_msk = mod (x_msk - pMask->pDrawable->x, pMask->pDrawable->width); - if (w_this > pMask->pDrawable->width - x_msk) - w_this = pMask->pDrawable->width - x_msk; - x_msk += pMask->pDrawable->x; - } - if (srcRepeat) - { - x_src = mod (x_src - pSrc->pDrawable->x, pSrc->pDrawable->width); - if (w_this > pSrc->pDrawable->width - x_src) - w_this = pSrc->pDrawable->width - x_src; - x_src += pSrc->pDrawable->x; - } - (*compositeRect) (op, pSrc, pMask, pDst, - x_src, y_src, x_msk, y_msk, x_dst, y_dst, - w_this, h_this); - w -= w_this; - x_src += w_this; - x_msk += w_this; - x_dst += w_this; - } - h -= h_this; - y_src += h_this; - y_msk += h_this; - y_dst += h_this; - } - pbox++; - } - RegionUninit(®ion); -} - void fbComposite (CARD8 op, PicturePtr pSrc, diff --git a/fb/fbpict.h b/fb/fbpict.h index b89f90ff1..896cd01a9 100644 --- a/fb/fbpict.h +++ b/fb/fbpict.h @@ -442,23 +442,6 @@ typedef void (*CompositeFunc) (CARD8 op, CARD16 width, CARD16 height); -extern _X_EXPORT void -fbWalkCompositeRegion (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height, - Bool srcRepeat, - Bool maskRepeat, - CompositeFunc compositeRect); - /* fbtrap.c */ extern _X_EXPORT void diff --git a/fb/wfbrename.h b/fb/wfbrename.h index c8e98c85c..f3beed8f6 100644 --- a/fb/wfbrename.h +++ b/fb/wfbrename.h @@ -179,7 +179,6 @@ #define fbUnmapWindow wfbUnmapWindow #define fbUnrealizeFont wfbUnrealizeFont #define fbValidateGC wfbValidateGC -#define fbWalkCompositeRegion wfbWalkCompositeRegion #define fbWinPrivateKeyRec wfbWinPrivateKeyRec #define fbZeroLine wfbZeroLine #define fbZeroSegment wfbZeroSegment From 74bc2d8c6bafc5373ff9c14eed12e26b5b965953 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Sandmann=20Pedersen?= Date: Mon, 1 Nov 2010 22:12:03 -0400 Subject: [PATCH 55/80] render: Delete renderedge.[ch] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The functions in these files have not been used since trap rasterization was moved to pixman. They survived until now to preserve the server abi. Reviewed-by: Aaron Plattner Reviewed-by: Mikhail Gusarov Signed-off-by: Søren Sandmann --- fb/fbpict.h | 3 - fb/fbtrap.c | 1 - hw/xfree86/loader/sdksyms.sh | 1 - render/Makefile.am | 5 +- render/renderedge.c | 91 ------------------------------ render/renderedge.h | 105 ----------------------------------- 6 files changed, 2 insertions(+), 204 deletions(-) delete mode 100644 render/renderedge.c delete mode 100644 render/renderedge.h diff --git a/fb/fbpict.h b/fb/fbpict.h index 896cd01a9..34a3eae2a 100644 --- a/fb/fbpict.h +++ b/fb/fbpict.h @@ -28,9 +28,6 @@ #ifndef _FBPICT_H_ #define _FBPICT_H_ -#include "renderedge.h" - - #if defined(__GNUC__) #define INLINE __inline__ #else diff --git a/fb/fbtrap.c b/fb/fbtrap.c index 9f5c39f65..c309ceb27 100644 --- a/fb/fbtrap.c +++ b/fb/fbtrap.c @@ -28,7 +28,6 @@ #include "picturestr.h" #include "mipict.h" -#include "renderedge.h" #include "fbpict.h" void diff --git a/hw/xfree86/loader/sdksyms.sh b/hw/xfree86/loader/sdksyms.sh index 6ca368ed5..3804324c7 100755 --- a/hw/xfree86/loader/sdksyms.sh +++ b/hw/xfree86/loader/sdksyms.sh @@ -19,7 +19,6 @@ cat > sdksyms.c << EOF #include "mipict.h" #include "glyphstr.h" #include "picturestr.h" -#include "renderedge.h" /* fb/Makefile.am -- module */ diff --git a/render/Makefile.am b/render/Makefile.am index 216c6134e..d02028b3b 100644 --- a/render/Makefile.am +++ b/render/Makefile.am @@ -13,9 +13,8 @@ librender_la_SOURCES = \ mitrap.c \ mitri.c \ picture.c \ - render.c \ - renderedge.c + render.c if XORG -sdk_HEADERS = picture.h mipict.h glyphstr.h picturestr.h renderedge.h +sdk_HEADERS = picture.h mipict.h glyphstr.h picturestr.h endif diff --git a/render/renderedge.c b/render/renderedge.c deleted file mode 100644 index 8771fe164..000000000 --- a/render/renderedge.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright © 2004 Keith Packard - * - * 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, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD 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. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "renderedge.h" - -/* - * Compute the smallest value no less than y which is on a - * grid row - */ - -xFixed -RenderSampleCeilY (xFixed y, int n) -{ - return pixman_sample_ceil_y (y, n); -} - -#define _div(a,b) ((a) >= 0 ? (a) / (b) : -((-(a) + (b) - 1) / (b))) - -/* - * Compute the largest value no greater than y which is on a - * grid row - */ -xFixed -RenderSampleFloorY (xFixed y, int n) -{ - return pixman_sample_floor_y (y, n); -} - -/* - * Step an edge by any amount (including negative values) - */ -void -RenderEdgeStep (RenderEdge *e, int n) -{ - pixman_edge_step (e, n); -} - -/* - * Initialize one edge structure given the line endpoints and a - * starting y value - */ -void -RenderEdgeInit (RenderEdge *e, - int n, - xFixed y_start, - xFixed x_top, - xFixed y_top, - xFixed x_bot, - xFixed y_bot) -{ - pixman_edge_init (e, n, y_start, x_top, y_top, x_bot, y_bot); -} - -/* - * Initialize one edge structure given a line, starting y value - * and a pixel offset for the line - */ -void -RenderLineFixedEdgeInit (RenderEdge *e, - int n, - xFixed y, - xLineFixed *line, - int x_off, - int y_off) -{ - pixman_line_fixed_edge_init (e, n, y, (pixman_line_fixed_t *)line, x_off, y_off); -} - diff --git a/render/renderedge.h b/render/renderedge.h deleted file mode 100644 index 6585aeb90..000000000 --- a/render/renderedge.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright © 2004 Keith Packard - * - * 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, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD 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. - */ - -#ifndef _RENDEREDGE_H_ -#define _RENDEREDGE_H_ - -#include "picturestr.h" - -#define MAX_ALPHA(n) ((1 << (n)) - 1) -#define N_Y_FRAC(n) ((n) == 1 ? 1 : (1 << ((n)/2)) - 1) -#define N_X_FRAC(n) ((1 << ((n)/2)) + 1) - -#define STEP_Y_SMALL(n) (xFixed1 / N_Y_FRAC(n)) -#define STEP_Y_BIG(n) (xFixed1 - (N_Y_FRAC(n) - 1) * STEP_Y_SMALL(n)) - -#define Y_FRAC_FIRST(n) (STEP_Y_SMALL(n) / 2) -#define Y_FRAC_LAST(n) (Y_FRAC_FIRST(n) + (N_Y_FRAC(n) - 1) * STEP_Y_SMALL(n)) - -#define STEP_X_SMALL(n) (xFixed1 / N_X_FRAC(n)) -#define STEP_X_BIG(n) (xFixed1 - (N_X_FRAC(n) - 1) * STEP_X_SMALL(n)) - -#define X_FRAC_FIRST(n) (STEP_X_SMALL(n) / 2) -#define X_FRAC_LAST(n) (X_FRAC_FIRST(n) + (N_X_FRAC(n) - 1) * STEP_X_SMALL(n)) - -#define RenderSamplesX(x,n) ((n) == 1 ? 0 : (xFixedFrac (x) + X_FRAC_FIRST(n)) / STEP_X_SMALL(n)) - -/* - * An edge structure. This represents a single polygon edge - * and can be quickly stepped across small or large gaps in the - * sample grid - */ -typedef pixman_edge_t RenderEdge; - -/* - * Step across a small sample grid gap - */ -#define RenderEdgeStepSmall(edge) { \ - edge->x += edge->stepx_small; \ - edge->e += edge->dx_small; \ - if (edge->e > 0) \ - { \ - edge->e -= edge->dy; \ - edge->x += edge->signdx; \ - } \ -} - -/* - * Step across a large sample grid gap - */ -#define RenderEdgeStepBig(edge) { \ - edge->x += edge->stepx_big; \ - edge->e += edge->dx_big; \ - if (edge->e > 0) \ - { \ - edge->e -= edge->dy; \ - edge->x += edge->signdx; \ - } \ -} - -extern _X_EXPORT xFixed -RenderSampleCeilY (xFixed y, int bpp); - -extern _X_EXPORT xFixed -RenderSampleFloorY (xFixed y, int bpp); - -extern _X_EXPORT void -RenderEdgeStep (RenderEdge *e, int n); - -extern _X_EXPORT void -RenderEdgeInit (RenderEdge *e, - int bpp, - xFixed y_start, - xFixed x_top, - xFixed y_top, - xFixed x_bot, - xFixed y_bot); - -extern _X_EXPORT void -RenderLineFixedEdgeInit (RenderEdge *e, - int bpp, - xFixed y, - xLineFixed *line, - int x_off, - int y_off); - -#endif /* _RENDEREDGE_H_ */ From 0dae479e16590e767df35985150c5acf696e5df2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Sandmann=20Pedersen?= Date: Mon, 1 Nov 2010 22:17:08 -0400 Subject: [PATCH 56/80] fb: Delete fbCompositeGeneral() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This function was an unused and trivial wrapper around fbComposite(). Reviewed-by: Aaron Plattner Reviewed-by: Mikhail Gusarov Signed-off-by: Søren Sandmann --- fb/fbpict.c | 19 ------------------- fb/fbpict.h | 16 ---------------- 2 files changed, 35 deletions(-) diff --git a/fb/fbpict.c b/fb/fbpict.c index 3bc141bcd..7636040c6 100644 --- a/fb/fbpict.c +++ b/fb/fbpict.c @@ -76,25 +76,6 @@ fbComposite (CARD8 op, free_pixman_pict (pDst, dest); } -void -fbCompositeGeneral (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height) -{ - fbComposite (op, pSrc, pMask, pDst, - xSrc, ySrc, xMask, yMask, xDst, yDst, - width, height); -} - static pixman_image_t * create_solid_fill_image (PicturePtr pict) { diff --git a/fb/fbpict.h b/fb/fbpict.h index 34a3eae2a..b02b95068 100644 --- a/fb/fbpict.h +++ b/fb/fbpict.h @@ -395,22 +395,6 @@ typedef struct _FbComposeFunctions { CombineMaskU combineMaskU; } FbComposeFunctions; -/* fbcompose.c */ - -extern _X_EXPORT void -fbCompositeGeneral (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height); - /* fbpict.c */ extern _X_EXPORT void fbComposite (CARD8 op, From 565b5e2b0261d1148cc2707ffcbb915414dd3e02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Sandmann=20Pedersen?= Date: Mon, 1 Nov 2010 22:14:29 -0400 Subject: [PATCH 57/80] wfb: Delete unused renamings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These functions haven't existed in a while. Reviewed-by: Aaron Plattner Reviewed-by: Mikhail Gusarov Signed-off-by: Søren Sandmann --- fb/wfbrename.h | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/fb/wfbrename.h b/fb/wfbrename.h index f3beed8f6..58460527d 100644 --- a/fb/wfbrename.h +++ b/fb/wfbrename.h @@ -39,20 +39,6 @@ #define fbClearVisualTypes wfbClearVisualTypes #define fbCloseScreen wfbCloseScreen #define fbComposite wfbComposite -#define fbCompositeGeneral wfbCompositeGeneral -#define fbCompositeSolidMask_nx1xn wfbCompositeSolidMask_nx1xn -#define fbCompositeSolidMask_nx8888x0565C wfbCompositeSolidMask_nx8888x0565C -#define fbCompositeSolidMask_nx8888x8888C wfbCompositeSolidMask_nx8888x8888C -#define fbCompositeSolidMask_nx8x0565 wfbCompositeSolidMask_nx8x0565 -#define fbCompositeSolidMask_nx8x0888 wfbCompositeSolidMask_nx8x0888 -#define fbCompositeSolidMask_nx8x8888 wfbCompositeSolidMask_nx8x8888 -#define fbCompositeSrc_0565x0565 wfbCompositeSrc_0565x0565 -#define fbCompositeSrc_8888x0565 wfbCompositeSrc_8888x0565 -#define fbCompositeSrc_8888x0888 wfbCompositeSrc_8888x0888 -#define fbCompositeSrc_8888x8888 wfbCompositeSrc_8888x8888 -#define fbCompositeSrcAdd_1000x1000 wfbCompositeSrcAdd_1000x1000 -#define fbCompositeSrcAdd_8000x8000 wfbCompositeSrcAdd_8000x8000 -#define fbCompositeSrcAdd_8888x8888 wfbCompositeSrcAdd_8888x8888 #define fbCopy1toN wfbCopy1toN #define fbCopyArea wfbCopyArea #define fbCopyNto1 wfbCopyNto1 @@ -149,7 +135,6 @@ #define fbPutXYImage wfbPutXYImage #define fbPutZImage wfbPutZImage #define fbQueryBestSize wfbQueryBestSize -#define fbRasterizeEdges wfbRasterizeEdges #define fbRasterizeTrapezoid wfbRasterizeTrapezoid #define fbRealizeFont wfbRealizeFont #define fbReduceRasterOp wfbReduceRasterOp From 3dc3aefb88c167d365795dcd44017742c52e4967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Sandmann=20Pedersen?= Date: Mon, 1 Nov 2010 22:23:05 -0400 Subject: [PATCH 58/80] fb: Delete a bunch more left-overs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All of these definitions were unused since compositing moved to pixman. Reviewed-by: Aaron Plattner Reviewed-by: Mikhail Gusarov Signed-off-by: Søren Sandmann --- fb/fbpict.h | 380 ------------------------------------------------- fb/wfbrename.h | 1 - 2 files changed, 381 deletions(-) diff --git a/fb/fbpict.h b/fb/fbpict.h index b02b95068..9abced17f 100644 --- a/fb/fbpict.h +++ b/fb/fbpict.h @@ -28,373 +28,6 @@ #ifndef _FBPICT_H_ #define _FBPICT_H_ -#if defined(__GNUC__) -#define INLINE __inline__ -#else -#define INLINE -#endif - -#define FbIntMult(a,b,t) ( (t) = (a) * (b) + 0x80, ( ( ( (t)>>8 ) + (t) )>>8 ) ) -#define FbIntDiv(a,b) (((CARD16) (a) * 255) / (b)) - -#define FbGet8(v,i) ((CARD16) (CARD8) ((v) >> i)) - -/* - * There are two ways of handling alpha -- either as a single unified value or - * a separate value for each component, hence each macro must have two - * versions. The unified alpha version has a 'U' at the end of the name, - * the component version has a 'C'. Similarly, functions which deal with - * this difference will have two versions using the same convention. - */ - -#define FbOverU(x,y,i,a,t) ((t) = FbIntMult(FbGet8(y,i),(a),(t)) + FbGet8(x,i),\ - (CARD32) ((CARD8) ((t) | (0 - ((t) >> 8)))) << (i)) - -#define FbOverC(x,y,i,a,t) ((t) = FbIntMult(FbGet8(y,i),FbGet8(a,i),(t)) + FbGet8(x,i),\ - (CARD32) ((CARD8) ((t) | (0 - ((t) >> 8)))) << (i)) - -#define FbInU(x,i,a,t) ((CARD32) FbIntMult(FbGet8(x,i),(a),(t)) << (i)) - -#define FbInC(x,i,a,t) ((CARD32) FbIntMult(FbGet8(x,i),FbGet8(a,i),(t)) << (i)) - -#define FbGen(x,y,i,ax,ay,t,u,v) ((t) = (FbIntMult(FbGet8(y,i),ay,(u)) + \ - FbIntMult(FbGet8(x,i),ax,(v))),\ - (CARD32) ((CARD8) ((t) | \ - (0 - ((t) >> 8)))) << (i)) - -#define FbAdd(x,y,i,t) ((t) = FbGet8(x,i) + FbGet8(y,i), \ - (CARD32) ((CARD8) ((t) | (0 - ((t) >> 8)))) << (i)) - - -#define Alpha(x) ((x) >> 24) -#define Red(x) (((x) >> 16) & 0xff) -#define Green(x) (((x) >> 8) & 0xff) -#define Blue(x) ((x) & 0xff) - -/** - * Returns TRUE if the fbComposeGetSolid can be used to get a single solid - * color representing every source sampling location of the picture. - */ -static INLINE Bool -fbCanGetSolid(PicturePtr pict) -{ - if (pict->pDrawable == NULL || - pict->pDrawable->width != 1 || - pict->pDrawable->height != 1) - { - return FALSE; - } - if (pict->repeat != RepeatNormal) - return FALSE; - - switch (pict->format) { - case PICT_a8r8g8b8: - case PICT_x8r8g8b8: - case PICT_a8b8g8r8: - case PICT_x8b8g8r8: - case PICT_b8g8r8a8: - case PICT_b8g8r8x8: - case PICT_r8g8b8: - case PICT_b8g8r8: - case PICT_r5g6b5: - case PICT_b5g6r5: - return TRUE; - default: - return FALSE; - } -} - -#define fbComposeGetSolid(pict, bits, fmt) { \ - FbBits *__bits__; \ - FbStride __stride__; \ - int __bpp__; \ - int __xoff__,__yoff__; \ -\ - fbGetDrawable((pict)->pDrawable,__bits__,__stride__,__bpp__,__xoff__,__yoff__); \ - switch (__bpp__) { \ - case 32: \ - (bits) = READ((CARD32 *) __bits__); \ - break; \ - case 24: \ - (bits) = Fetch24 ((CARD8 *) __bits__); \ - break; \ - case 16: \ - (bits) = READ((CARD16 *) __bits__); \ - (bits) = cvt0565to0888(bits); \ - break; \ - case 8: \ - (bits) = READ((CARD8 *) __bits__); \ - (bits) = (bits) << 24; \ - break; \ - case 1: \ - (bits) = READ((CARD32 *) __bits__); \ - (bits) = FbLeftStipBits((bits),1) ? 0xff000000 : 0x00000000;\ - break; \ - default: \ - return; \ - } \ - /* If necessary, convert RGB <--> BGR. */ \ - if (PICT_FORMAT_TYPE((pict)->format) != PICT_FORMAT_TYPE(fmt)) \ - { \ - (bits) = (((bits) & 0xff000000) | \ - (((bits) & 0x00ff0000) >> 16) | \ - (((bits) & 0x0000ff00) >> 0) | \ - (((bits) & 0x000000ff) << 16)); \ - } \ - /* manage missing src alpha */ \ - if ((pict)->pFormat->direct.alphaMask == 0) \ - (bits) |= 0xff000000; \ - fbFinishAccess ((pict)->pDrawable); \ -} - -#define fbComposeGetStart(pict,x,y,type,stride,line,mul) {\ - FbBits *__bits__; \ - FbStride __stride__; \ - int __bpp__; \ - int __xoff__,__yoff__; \ -\ - fbGetDrawable((pict)->pDrawable,__bits__,__stride__,__bpp__,__xoff__,__yoff__); \ - (stride) = __stride__ * sizeof (FbBits) / sizeof (type); \ - (line) = ((type *) __bits__) + (stride) * ((y) + __yoff__) + (mul) * ((x) + __xoff__); \ -} -#define cvt8888to0565(s) ((((s) >> 3) & 0x001f) | \ - (((s) >> 5) & 0x07e0) | \ - (((s) >> 8) & 0xf800)) -#define cvt0565to0888(s) (((((s) << 3) & 0xf8) | (((s) >> 2) & 0x7)) | \ - ((((s) << 5) & 0xfc00) | (((s) >> 1) & 0x300)) | \ - ((((s) << 8) & 0xf80000) | (((s) << 3) & 0x70000))) - -#if IMAGE_BYTE_ORDER == MSBFirst -#define Fetch24(a) ((unsigned long) (a) & 1 ? \ - ((READ(a) << 16) | READ((CARD16 *) ((a)+1))) : \ - ((READ((CARD16 *) (a)) << 8) | READ((a)+2))) -#define Store24(a,v) ((unsigned long) (a) & 1 ? \ - (WRITE(a, (CARD8) ((v) >> 16)), \ - WRITE((CARD16 *) ((a)+1), (CARD16) (v))) : \ - (WRITE((CARD16 *) (a), (CARD16) ((v) >> 8)), \ - WRITE((a)+2, (CARD8) (v)))) -#else -#define Fetch24(a) ((unsigned long) (a) & 1 ? \ - (READ(a) | (READ((CARD16 *) ((a)+1)) << 8)) : \ - (READ((CARD16 *) (a)) | (READ((a)+2) << 16))) -#define Store24(a,v) ((unsigned long) (a) & 1 ? \ - (WRITE(a, (CARD8) (v)), \ - WRITE((CARD16 *) ((a)+1), (CARD16) ((v) >> 8))) : \ - (WRITE((CARD16 *) (a), (CARD16) (v)),\ - WRITE((a)+2, (CARD8) ((v) >> 16)))) -#endif - -/* - The methods below use some tricks to be able to do two color - components at the same time. -*/ - -/* - x_c = (x_c * a) / 255 -*/ -#define FbByteMul(x, a) do { \ - CARD32 t = ((x & 0xff00ff) * a) + 0x800080; \ - t = (t + ((t >> 8) & 0xff00ff)) >> 8; \ - t &= 0xff00ff; \ - \ - x = (((x >> 8) & 0xff00ff) * a) + 0x800080; \ - x = (x + ((x >> 8) & 0xff00ff)); \ - x &= 0xff00ff00; \ - x += t; \ - } while (0) - -/* - x_c = (x_c * a) / 255 + y -*/ -#define FbByteMulAdd(x, a, y) do { \ - CARD32 t = ((x & 0xff00ff) * a) + 0x800080; \ - t = (t + ((t >> 8) & 0xff00ff)) >> 8; \ - t &= 0xff00ff; \ - t += y & 0xff00ff; \ - t |= 0x1000100 - ((t >> 8) & 0xff00ff); \ - t &= 0xff00ff; \ - \ - x = (((x >> 8) & 0xff00ff) * a) + 0x800080; \ - x = (x + ((x >> 8) & 0xff00ff)) >> 8; \ - x &= 0xff00ff; \ - x += (y >> 8) & 0xff00ff; \ - x |= 0x1000100 - ((x >> 8) & 0xff00ff); \ - x &= 0xff00ff; \ - x <<= 8; \ - x += t; \ - } while (0) - -/* - x_c = (x_c * a + y_c * b) / 255 -*/ -#define FbByteAddMul(x, a, y, b) do { \ - CARD32 t; \ - CARD32 r = (x >> 24) * a + (y >> 24) * b + 0x80; \ - r += (r >> 8); \ - r >>= 8; \ - \ - t = (x & 0xff00) * a + (y & 0xff00) * b; \ - t += (t >> 8) + 0x8000; \ - t >>= 16; \ - \ - t |= r << 16; \ - t |= 0x1000100 - ((t >> 8) & 0xff00ff); \ - t &= 0xff00ff; \ - t <<= 8; \ - \ - r = ((x >> 16) & 0xff) * a + ((y >> 16) & 0xff) * b + 0x80; \ - r += (r >> 8); \ - r >>= 8; \ - \ - x = (x & 0xff) * a + (y & 0xff) * b + 0x80; \ - x += (x >> 8); \ - x >>= 8; \ - x |= r << 16; \ - x |= 0x1000100 - ((x >> 8) & 0xff00ff); \ - x &= 0xff00ff; \ - x |= t; \ -} while (0) - -/* - x_c = (x_c * a + y_c *b) / 256 -*/ -#define FbByteAddMul_256(x, a, y, b) do { \ - CARD32 t = (x & 0xff00ff) * a + (y & 0xff00ff) * b; \ - t >>= 8; \ - t &= 0xff00ff; \ - \ - x = ((x >> 8) & 0xff00ff) * a + ((y >> 8) & 0xff00ff) * b; \ - x &= 0xff00ff00; \ - x += t; \ -} while (0) -/* - x_c = (x_c * a_c) / 255 -*/ -#define FbByteMulC(x, a) do { \ - CARD32 t; \ - CARD32 r = (x & 0xff) * (a & 0xff); \ - r |= (x & 0xff0000) * ((a >> 16) & 0xff); \ - r += 0x800080; \ - r = (r + ((r >> 8) & 0xff00ff)) >> 8; \ - r &= 0xff00ff; \ - \ - x >>= 8; \ - t = (x & 0xff) * ((a >> 8) & 0xff); \ - t |= (x & 0xff0000) * (a >> 24); \ - t += 0x800080; \ - t = t + ((t >> 8) & 0xff00ff); \ - x = r | (t & 0xff00ff00); \ - \ - } while (0) - -/* - x_c = (x_c * a) / 255 + y -*/ -#define FbByteMulAddC(x, a, y) do { \ - CARD32 t; \ - CARD32 r = (x & 0xff) * (a & 0xff); \ - r |= (x & 0xff0000) * ((a >> 16) & 0xff); \ - r += 0x800080; \ - r = (r + ((r >> 8) & 0xff00ff)) >> 8; \ - r &= 0xff00ff; \ - r += y & 0xff00ff; \ - r |= 0x1000100 - ((r >> 8) & 0xff00ff); \ - r &= 0xff00ff; \ - \ - x >>= 8; \ - t = (x & 0xff) * ((a >> 8) & 0xff); \ - t |= (x & 0xff0000) * (a >> 24); \ - t += 0x800080; \ - t = (t + ((t >> 8) & 0xff00ff)) >> 8; \ - t &= 0xff00ff; \ - t += (y >> 8) & 0xff00ff; \ - t |= 0x1000100 - ((t >> 8) & 0xff00ff); \ - t &= 0xff00ff; \ - x = r | (t << 8); \ - } while (0) - -/* - x_c = (x_c * a_c + y_c * b) / 255 -*/ -#define FbByteAddMulC(x, a, y, b) do { \ - CARD32 t; \ - CARD32 r = (x >> 24) * (a >> 24) + (y >> 24) * b; \ - r += (r >> 8) + 0x80; \ - r >>= 8; \ - \ - t = (x & 0xff00) * ((a >> 8) & 0xff) + (y & 0xff00) * b; \ - t += (t >> 8) + 0x8000; \ - t >>= 16; \ - \ - t |= r << 16; \ - t |= 0x1000100 - ((t >> 8) & 0xff00ff); \ - t &= 0xff00ff; \ - t <<= 8; \ - \ - r = ((x >> 16) & 0xff) * ((a >> 16) & 0xff) + ((y >> 16) & 0xff) * b + 0x80; \ - r += (r >> 8); \ - r >>= 8; \ - \ - x = (x & 0xff) * (a & 0xff) + (y & 0xff) * b + 0x80; \ - x += (x >> 8); \ - x >>= 8; \ - x |= r << 16; \ - x |= 0x1000100 - ((x >> 8) & 0xff00ff); \ - x &= 0xff00ff; \ - x |= t; \ - } while (0) - -/* - x_c = min(x_c + y_c, 255) -*/ -#define FbByteAdd(x, y) do { \ - CARD32 t; \ - CARD32 r = (x & 0xff00ff) + (y & 0xff00ff); \ - r |= 0x1000100 - ((r >> 8) & 0xff00ff); \ - r &= 0xff00ff; \ - \ - t = ((x >> 8) & 0xff00ff) + ((y >> 8) & 0xff00ff); \ - t |= 0x1000100 - ((t >> 8) & 0xff00ff); \ - r |= (t & 0xff00ff) << 8; \ - x = r; \ - } while (0) - -#define div_255(x) (((x) + 0x80 + (((x) + 0x80) >> 8)) >> 8) - -#if defined(__i386__) && defined(__GNUC__) -#define FASTCALL __attribute__((regparm(3))) -#else -#define FASTCALL -#endif - -typedef struct _FbComposeData { - CARD8 op; - PicturePtr src; - PicturePtr mask; - PicturePtr dest; - INT16 xSrc; - INT16 ySrc; - INT16 xMask; - INT16 yMask; - INT16 xDest; - INT16 yDest; - CARD16 width; - CARD16 height; -} FbComposeData; - -extern _X_EXPORT void -fbCompositeRect (const FbComposeData *data, CARD32 *scanline_buffer); - -typedef FASTCALL void (*CombineMaskU) (CARD32 *src, const CARD32 *mask, int width); -typedef FASTCALL void (*CombineFuncU) (CARD32 *dest, const CARD32 *src, int width); -typedef FASTCALL void (*CombineFuncC) (CARD32 *dest, CARD32 *src, CARD32 *mask, int width); - -typedef struct _FbComposeFunctions { - CombineFuncU *combineU; - CombineFuncC *combineC; - CombineMaskU combineMaskU; -} FbComposeFunctions; - /* fbpict.c */ extern _X_EXPORT void fbComposite (CARD8 op, @@ -410,19 +43,6 @@ fbComposite (CARD8 op, CARD16 width, CARD16 height); -typedef void (*CompositeFunc) (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height); - /* fbtrap.c */ extern _X_EXPORT void diff --git a/fb/wfbrename.h b/fb/wfbrename.h index 58460527d..e855edd0b 100644 --- a/fb/wfbrename.h +++ b/fb/wfbrename.h @@ -169,4 +169,3 @@ #define fbZeroSegment wfbZeroSegment #define free_pixman_pict wfb_free_pixman_pict #define image_from_pict wfb_image_from_pict -#define composeFunctions wfbComposeFunctions From 0799f0771cca335d6400a8494ba236a0d10e122b Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 4 Nov 2010 12:53:18 +1000 Subject: [PATCH 59/80] xfree86: remove two unused variables from Makefile.am Signed-off-by: Peter Hutterer Reviewed-by: Julien Cristau --- hw/xfree86/common/Makefile.am | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/xfree86/common/Makefile.am b/hw/xfree86/common/Makefile.am index 821a2b500..989208f4e 100644 --- a/hw/xfree86/common/Makefile.am +++ b/hw/xfree86/common/Makefile.am @@ -17,8 +17,6 @@ if DGA DGASOURCES = xf86DGA.c endif -XISOURCES = xf86Xinput.c xisb.c -XISDKINCS = xf86Xinput.h xisb.h RANDRSOURCES = xf86RandR.c BUSSOURCES = xf86pciBus.c xf86fbBus.c xf86noBus.c $(SBUS_SOURCES) From 6b982d73bb8878238ed46665b220a94a591e11a9 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 21 Oct 2010 13:53:35 +1000 Subject: [PATCH 60/80] xfree86: fix two compiler warnings - unused variable ati, atimisc ../../../../hw/xfree86/common/xf86Config.c: In function 'fixup_video_driver_list': ../../../../hw/xfree86/common/xf86Config.c:507:19: warning: unused variable 'atimisc' ../../../../hw/xfree86/common/xf86Config.c:507:12: warning: unused variable 'ati' Introduced in 52577ae8eeda64601db8dd425027cf8e4271b873. Signed-off-by: Peter Hutterer Reviewed-by: Matt Turner --- hw/xfree86/common/xf86Config.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 92fb74da8..dea3c9b73 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -504,7 +504,6 @@ fixup_video_driver_list(char **drivers) static const char *fallback[4] = { "vesa", "fbdev", "wsfb", NULL }; char **end, **drv; char *x; - char **ati, **atimisc; int i; /* walk to the end of the list */ From 4132b1c591bd01c29df91b88afbd144647da9ed8 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 21 Oct 2010 14:04:42 +1000 Subject: [PATCH 61/80] xfree86: fix compiler warnings - unused variable i ../../../../hw/xfree86/common/xf86Config.c: In function 'configDRI': ../../../../hw/xfree86/common/xf86Config.c:2213:9: warning: unused variable 'i' Introduced in 788bfbf18ac19923604b0d676933fdc0d78526a1 Signed-off-by: Peter Hutterer Reviewed-by: Matt Turner --- hw/xfree86/common/xf86Config.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index dea3c9b73..e3b2831c2 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -2210,7 +2210,6 @@ configDevice(GDevPtr devicep, XF86ConfDevicePtr conf_device, Bool active) static void configDRI(XF86ConfDRIPtr drip) { - int i; struct group *grp; xf86ConfigDRI.group = -1; From 9b89b91c685426c9944f7fc8890f436c18b7583c Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 5 Nov 2010 11:47:43 +1000 Subject: [PATCH 62/80] Xi: split hierarchy manipulation into static functions. No functional changes, just code cleanup to improve readability. Signed-off-by: Peter Hutterer Reviewed-by: Julien Cristau --- Xi/xichangehierarchy.c | 518 ++++++++++++++++++++++------------------- 1 file changed, 275 insertions(+), 243 deletions(-) diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c index c1899e109..5818d2cab 100644 --- a/Xi/xichangehierarchy.c +++ b/Xi/xichangehierarchy.c @@ -136,12 +136,282 @@ int SProcXIChangeHierarchy(ClientPtr client) return (ProcXIChangeHierarchy(client)); } +static int +add_master(ClientPtr client, xXIAddMasterInfo *c, int flags[MAXDEVICES]) +{ + DeviceIntPtr ptr, keybd, XTestptr, XTestkeybd; + char* name; + int rc; + + name = calloc(c->name_len + 1, sizeof(char)); + strncpy(name, (char*)&c[1], c->name_len); + + rc = AllocDevicePair(client, name, &ptr, &keybd, + CorePointerProc, CoreKeyboardProc, TRUE); + if (rc != Success) + goto unwind; + + if (!c->send_core) + ptr->coreEvents = keybd->coreEvents = FALSE; + + /* Allocate virtual slave devices for xtest events */ + rc = AllocXTestDevice(client, name, &XTestptr, &XTestkeybd, ptr, keybd); + if (rc != Success) + goto unwind; + + ActivateDevice(ptr, FALSE); + ActivateDevice(keybd, FALSE); + flags[ptr->id] |= XIMasterAdded; + flags[keybd->id] |= XIMasterAdded; + + ActivateDevice(XTestptr, FALSE); + ActivateDevice(XTestkeybd, FALSE); + flags[XTestptr->id] |= XISlaveAdded; + flags[XTestkeybd->id] |= XISlaveAdded; + + if (c->enable) + { + EnableDevice(ptr, FALSE); + EnableDevice(keybd, FALSE); + flags[ptr->id] |= XIDeviceEnabled; + flags[keybd->id] |= XIDeviceEnabled; + + EnableDevice(XTestptr, FALSE); + EnableDevice(XTestkeybd, FALSE); + flags[XTestptr->id] |= XIDeviceEnabled; + flags[XTestkeybd->id] |= XIDeviceEnabled; + } + + /* Attach the XTest virtual devices to the newly + created master device */ + AttachDevice(NULL, XTestptr, ptr); + AttachDevice(NULL, XTestkeybd, keybd); + flags[XTestptr->id] |= XISlaveAttached; + flags[XTestkeybd->id] |= XISlaveAttached; + +unwind: + free(name); + return rc; +} + +static int +remove_master(ClientPtr client, xXIRemoveMasterInfo *r, + int flags[MAXDEVICES]) +{ + DeviceIntPtr ptr, keybd, XTestptr, XTestkeybd; + int rc = Success; + + if (r->return_mode != XIAttachToMaster && + r->return_mode != XIFloating) + return BadValue; + + rc = dixLookupDevice(&ptr, r->deviceid, client, DixDestroyAccess); + if (rc != Success) + goto unwind; + + if (!IsMaster(ptr)) + { + client->errorValue = r->deviceid; + rc = BadDevice; + goto unwind; + } + + /* XXX: For now, don't allow removal of VCP, VCK */ + if (ptr == inputInfo.pointer || ptr == inputInfo.keyboard) + { + rc = BadDevice; + goto unwind; + } + + + ptr = GetMaster(ptr, MASTER_POINTER); + rc = dixLookupDevice(&ptr, ptr->id, client, DixDestroyAccess); + if (rc != Success) + goto unwind; + keybd = GetMaster(ptr, MASTER_KEYBOARD); + rc = dixLookupDevice(&keybd, keybd->id, client, DixDestroyAccess); + if (rc != Success) + goto unwind; + + XTestptr = GetXTestDevice(ptr); + rc = dixLookupDevice(&XTestptr, XTestptr->id, client, DixDestroyAccess); + if (rc != Success) + goto unwind; + + XTestkeybd = GetXTestDevice(keybd); + rc = dixLookupDevice(&XTestkeybd, XTestkeybd->id, client, + DixDestroyAccess); + if (rc != Success) + goto unwind; + + /* Disabling sends the devices floating, reattach them if + * desired. */ + if (r->return_mode == XIAttachToMaster) + { + DeviceIntPtr attached, + newptr, + newkeybd; + + rc = dixLookupDevice(&newptr, r->return_pointer, client, DixAddAccess); + if (rc != Success) + goto unwind; + + if (!IsMaster(newptr)) + { + client->errorValue = r->return_pointer; + rc = BadDevice; + goto unwind; + } + + rc = dixLookupDevice(&newkeybd, r->return_keyboard, + client, DixAddAccess); + if (rc != Success) + goto unwind; + + if (!IsMaster(newkeybd)) + { + client->errorValue = r->return_keyboard; + rc = BadDevice; + goto unwind; + } + + for (attached = inputInfo.devices; attached; attached = attached->next) + { + if (!IsMaster(attached)) { + if (attached->u.master == ptr) + { + AttachDevice(client, attached, newptr); + flags[attached->id] |= XISlaveAttached; + } + if (attached->u.master == keybd) + { + AttachDevice(client, attached, newkeybd); + flags[attached->id] |= XISlaveAttached; + } + } + } + } + + /* can't disable until we removed pairing */ + keybd->spriteInfo->paired = NULL; + ptr->spriteInfo->paired = NULL; + XTestptr->spriteInfo->paired = NULL; + XTestkeybd->spriteInfo->paired = NULL; + + /* disable the remove the devices, XTest devices must be done first + else the sprites they rely on will be destroyed */ + DisableDevice(XTestptr, FALSE); + DisableDevice(XTestkeybd, FALSE); + DisableDevice(keybd, FALSE); + DisableDevice(ptr, FALSE); + flags[XTestptr->id] |= XIDeviceDisabled | XISlaveDetached; + flags[XTestkeybd->id] |= XIDeviceDisabled | XISlaveDetached; + flags[keybd->id] |= XIDeviceDisabled; + flags[ptr->id] |= XIDeviceDisabled; + + RemoveDevice(XTestptr, FALSE); + RemoveDevice(XTestkeybd, FALSE); + RemoveDevice(keybd, FALSE); + RemoveDevice(ptr, FALSE); + flags[XTestptr->id] |= XISlaveRemoved; + flags[XTestkeybd->id] |= XISlaveRemoved; + flags[keybd->id] |= XIMasterRemoved; + flags[ptr->id] |= XIMasterRemoved; + +unwind: + return rc; +} + +static int +detach_slave(ClientPtr client, xXIDetachSlaveInfo *c, int flags[MAXDEVICES]) +{ + DeviceIntPtr ptr; + int rc; + + rc = dixLookupDevice(&ptr, c->deviceid, client, DixManageAccess); + if (rc != Success) + goto unwind; + + if (IsMaster(ptr)) + { + client->errorValue = c->deviceid; + rc = BadDevice; + goto unwind; + } + + /* Don't allow changes to XTest Devices, these are fixed */ + if (IsXTestDevice(ptr, NULL)) + { + client->errorValue = c->deviceid; + rc = BadDevice; + goto unwind; + } + + AttachDevice(client, ptr, NULL); + flags[ptr->id] |= XISlaveDetached; + +unwind: + return rc; +} + +static int +attach_slave(ClientPtr client, xXIAttachSlaveInfo *c, + int flags[MAXDEVICES]) +{ + DeviceIntPtr ptr; + DeviceIntPtr newmaster; + int rc; + + rc = dixLookupDevice(&ptr, c->deviceid, client, DixManageAccess); + if (rc != Success) + goto unwind; + + if (IsMaster(ptr)) + { + client->errorValue = c->deviceid; + rc = BadDevice; + goto unwind; + } + + /* Don't allow changes to XTest Devices, these are fixed */ + if (IsXTestDevice(ptr, NULL)) + { + client->errorValue = c->deviceid; + rc = BadDevice; + goto unwind; + } + + rc = dixLookupDevice(&newmaster, c->new_master, client, DixAddAccess); + if (rc != Success) + goto unwind; + if (!IsMaster(newmaster)) + { + client->errorValue = c->new_master; + rc = BadDevice; + goto unwind; + } + + if (!((IsPointerDevice(newmaster) && IsPointerDevice(ptr)) || + (IsKeyboardDevice(newmaster) && IsKeyboardDevice(ptr)))) + { + rc = BadDevice; + goto unwind; + } + + AttachDevice(client, ptr, newmaster); + flags[ptr->id] |= XISlaveAttached; + +unwind: + return rc; +} + + + #define SWAPIF(cmd) if (client->swapped) { cmd; } int ProcXIChangeHierarchy(ClientPtr client) { - DeviceIntPtr ptr, keybd, XTestptr, XTestkeybd; xXIAnyHierarchyChangeInfo *any; int required_len = sizeof(xXIChangeHierarchyReq); char n; @@ -169,276 +439,38 @@ ProcXIChangeHierarchy(ClientPtr client) case XIAddMaster: { xXIAddMasterInfo* c = (xXIAddMasterInfo*)any; - char* name; - SWAPIF(swaps(&c->name_len, n)); - name = calloc(c->name_len + 1, sizeof(char)); - strncpy(name, (char*)&c[1], c->name_len); - - rc = AllocDevicePair(client, name, &ptr, &keybd, - CorePointerProc, CoreKeyboardProc, - TRUE); + rc = add_master(client, c, flags); if (rc != Success) - { - free(name); goto unwind; - } - - if (!c->send_core) - ptr->coreEvents = keybd->coreEvents = FALSE; - - /* Allocate virtual slave devices for xtest events */ - rc = AllocXTestDevice(client, name, &XTestptr, &XTestkeybd, - ptr, keybd); - if (rc != Success) - { - - free(name); - goto unwind; - } - - ActivateDevice(ptr, FALSE); - ActivateDevice(keybd, FALSE); - flags[ptr->id] |= XIMasterAdded; - flags[keybd->id] |= XIMasterAdded; - - ActivateDevice(XTestptr, FALSE); - ActivateDevice(XTestkeybd, FALSE); - flags[XTestptr->id] |= XISlaveAdded; - flags[XTestkeybd->id] |= XISlaveAdded; - - if (c->enable) - { - EnableDevice(ptr, FALSE); - EnableDevice(keybd, FALSE); - flags[ptr->id] |= XIDeviceEnabled; - flags[keybd->id] |= XIDeviceEnabled; - - EnableDevice(XTestptr, FALSE); - EnableDevice(XTestkeybd, FALSE); - flags[XTestptr->id] |= XIDeviceEnabled; - flags[XTestkeybd->id] |= XIDeviceEnabled; - } - - /* Attach the XTest virtual devices to the newly - created master device */ - AttachDevice(NULL, XTestptr, ptr); - AttachDevice(NULL, XTestkeybd, keybd); - flags[XTestptr->id] |= XISlaveAttached; - flags[XTestkeybd->id] |= XISlaveAttached; - - free(name); } break; case XIRemoveMaster: { xXIRemoveMasterInfo* r = (xXIRemoveMasterInfo*)any; - if (r->return_mode != XIAttachToMaster && - r->return_mode != XIFloating) - return BadValue; - - rc = dixLookupDevice(&ptr, r->deviceid, client, - DixDestroyAccess); + rc = remove_master(client, r, flags); if (rc != Success) goto unwind; - - if (!IsMaster(ptr)) - { - client->errorValue = r->deviceid; - rc = BadDevice; - goto unwind; - } - - /* XXX: For now, don't allow removal of VCP, VCK */ - if (ptr == inputInfo.pointer || - ptr == inputInfo.keyboard) - { - rc = BadDevice; - goto unwind; - } - - - ptr = GetMaster(ptr, MASTER_POINTER); - rc = dixLookupDevice(&ptr, - ptr->id, - client, - DixDestroyAccess); - if (rc != Success) - goto unwind; - keybd = GetMaster(ptr, MASTER_KEYBOARD); - rc = dixLookupDevice(&keybd, - keybd->id, - client, - DixDestroyAccess); - if (rc != Success) - goto unwind; - - XTestptr = GetXTestDevice(ptr); - rc = dixLookupDevice(&XTestptr, XTestptr->id, client, - DixDestroyAccess); - if (rc != Success) - goto unwind; - - XTestkeybd = GetXTestDevice(keybd); - rc = dixLookupDevice(&XTestkeybd, XTestkeybd->id, client, - DixDestroyAccess); - if (rc != Success) - goto unwind; - - /* Disabling sends the devices floating, reattach them if - * desired. */ - if (r->return_mode == XIAttachToMaster) - { - DeviceIntPtr attached, - newptr, - newkeybd; - - rc = dixLookupDevice(&newptr, r->return_pointer, - client, DixAddAccess); - if (rc != Success) - goto unwind; - - if (!IsMaster(newptr)) - { - client->errorValue = r->return_pointer; - rc = BadDevice; - goto unwind; - } - - rc = dixLookupDevice(&newkeybd, r->return_keyboard, - client, DixAddAccess); - if (rc != Success) - goto unwind; - - if (!IsMaster(newkeybd)) - { - client->errorValue = r->return_keyboard; - rc = BadDevice; - goto unwind; - } - - for (attached = inputInfo.devices; - attached; - attached = attached->next) - { - if (!IsMaster(attached)) { - if (attached->u.master == ptr) - { - AttachDevice(client, attached, newptr); - flags[attached->id] |= XISlaveAttached; - } - if (attached->u.master == keybd) - { - AttachDevice(client, attached, newkeybd); - flags[attached->id] |= XISlaveAttached; - } - } - } - } - - /* can't disable until we removed pairing */ - keybd->spriteInfo->paired = NULL; - ptr->spriteInfo->paired = NULL; - XTestptr->spriteInfo->paired = NULL; - XTestkeybd->spriteInfo->paired = NULL; - - /* disable the remove the devices, XTest devices must be done first - else the sprites they rely on will be destroyed */ - DisableDevice(XTestptr, FALSE); - DisableDevice(XTestkeybd, FALSE); - DisableDevice(keybd, FALSE); - DisableDevice(ptr, FALSE); - flags[XTestptr->id] |= XIDeviceDisabled | XISlaveDetached; - flags[XTestkeybd->id] |= XIDeviceDisabled | XISlaveDetached; - flags[keybd->id] |= XIDeviceDisabled; - flags[ptr->id] |= XIDeviceDisabled; - - RemoveDevice(XTestptr, FALSE); - RemoveDevice(XTestkeybd, FALSE); - RemoveDevice(keybd, FALSE); - RemoveDevice(ptr, FALSE); - flags[XTestptr->id] |= XISlaveRemoved; - flags[XTestkeybd->id] |= XISlaveRemoved; - flags[keybd->id] |= XIMasterRemoved; - flags[ptr->id] |= XIMasterRemoved; } break; case XIDetachSlave: { xXIDetachSlaveInfo* c = (xXIDetachSlaveInfo*)any; - rc = dixLookupDevice(&ptr, c->deviceid, client, - DixManageAccess); + rc = detach_slave(client, c, flags); if (rc != Success) goto unwind; - - if (IsMaster(ptr)) - { - client->errorValue = c->deviceid; - rc = BadDevice; - goto unwind; - } - - /* Don't allow changes to XTest Devices, these are fixed */ - if (IsXTestDevice(ptr, NULL)) - { - client->errorValue = c->deviceid; - rc = BadDevice; - goto unwind; - } - - AttachDevice(client, ptr, NULL); - flags[ptr->id] |= XISlaveDetached; } break; case XIAttachSlave: { xXIAttachSlaveInfo* c = (xXIAttachSlaveInfo*)any; - DeviceIntPtr newmaster; - rc = dixLookupDevice(&ptr, c->deviceid, client, - DixManageAccess); + rc = attach_slave(client, c, flags); if (rc != Success) goto unwind; - - if (IsMaster(ptr)) - { - client->errorValue = c->deviceid; - rc = BadDevice; - goto unwind; - } - - /* Don't allow changes to XTest Devices, these are fixed */ - if (IsXTestDevice(ptr, NULL)) - { - client->errorValue = c->deviceid; - rc = BadDevice; - goto unwind; - } - - rc = dixLookupDevice(&newmaster, c->new_master, - client, DixAddAccess); - if (rc != Success) - goto unwind; - if (!IsMaster(newmaster)) - { - client->errorValue = c->new_master; - rc = BadDevice; - goto unwind; - } - - if (!((IsPointerDevice(newmaster) && - IsPointerDevice(ptr)) || - (IsKeyboardDevice(newmaster) && - IsKeyboardDevice(ptr)))) - { - rc = BadDevice; - goto unwind; - } - AttachDevice(client, ptr, newmaster); - flags[ptr->id] |= XISlaveAttached; } break; } From 5a455e0c80d433adc4109ebf313fd92afa194545 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 5 Nov 2010 11:49:12 +1000 Subject: [PATCH 63/80] Xi: rename two variables from ptr to dev. They were named ptr when everything was in one function to save one more variable. Now that the stuff is split out, "dev" makes more sense. Signed-off-by: Peter Hutterer Reviewed-by: Julien Cristau --- Xi/xichangehierarchy.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c index 5818d2cab..b7140d5e5 100644 --- a/Xi/xichangehierarchy.c +++ b/Xi/xichangehierarchy.c @@ -325,14 +325,14 @@ unwind: static int detach_slave(ClientPtr client, xXIDetachSlaveInfo *c, int flags[MAXDEVICES]) { - DeviceIntPtr ptr; + DeviceIntPtr dev; int rc; - rc = dixLookupDevice(&ptr, c->deviceid, client, DixManageAccess); + rc = dixLookupDevice(&dev, c->deviceid, client, DixManageAccess); if (rc != Success) goto unwind; - if (IsMaster(ptr)) + if (IsMaster(dev)) { client->errorValue = c->deviceid; rc = BadDevice; @@ -340,15 +340,15 @@ detach_slave(ClientPtr client, xXIDetachSlaveInfo *c, int flags[MAXDEVICES]) } /* Don't allow changes to XTest Devices, these are fixed */ - if (IsXTestDevice(ptr, NULL)) + if (IsXTestDevice(dev, NULL)) { client->errorValue = c->deviceid; rc = BadDevice; goto unwind; } - AttachDevice(client, ptr, NULL); - flags[ptr->id] |= XISlaveDetached; + AttachDevice(client, dev, NULL); + flags[dev->id] |= XISlaveDetached; unwind: return rc; @@ -358,15 +358,15 @@ static int attach_slave(ClientPtr client, xXIAttachSlaveInfo *c, int flags[MAXDEVICES]) { - DeviceIntPtr ptr; + DeviceIntPtr dev; DeviceIntPtr newmaster; int rc; - rc = dixLookupDevice(&ptr, c->deviceid, client, DixManageAccess); + rc = dixLookupDevice(&dev, c->deviceid, client, DixManageAccess); if (rc != Success) goto unwind; - if (IsMaster(ptr)) + if (IsMaster(dev)) { client->errorValue = c->deviceid; rc = BadDevice; @@ -374,7 +374,7 @@ attach_slave(ClientPtr client, xXIAttachSlaveInfo *c, } /* Don't allow changes to XTest Devices, these are fixed */ - if (IsXTestDevice(ptr, NULL)) + if (IsXTestDevice(dev, NULL)) { client->errorValue = c->deviceid; rc = BadDevice; @@ -391,15 +391,15 @@ attach_slave(ClientPtr client, xXIAttachSlaveInfo *c, goto unwind; } - if (!((IsPointerDevice(newmaster) && IsPointerDevice(ptr)) || - (IsKeyboardDevice(newmaster) && IsKeyboardDevice(ptr)))) + if (!((IsPointerDevice(newmaster) && IsPointerDevice(dev)) || + (IsKeyboardDevice(newmaster) && IsKeyboardDevice(dev)))) { rc = BadDevice; goto unwind; } - AttachDevice(client, ptr, newmaster); - flags[ptr->id] |= XISlaveAttached; + AttachDevice(client, dev, newmaster); + flags[dev->id] |= XISlaveAttached; unwind: return rc; From 9e999d18b004b8ead9c6c5d79b4a3d4bbf0e3152 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 5 Nov 2010 12:08:11 +1000 Subject: [PATCH 64/80] Xi: if XTEST device creation fails, fail the master devices. When getting close to the MAXDEVICES limit, the creation of XTEST devices may fail due to device id exhaustion. In that case, fail the creation of master devices too and return an error to the client. Theoretically, we could alloc the MDs without the XTEST devices but that will get interesting when a client starts sending XTEST events through those devices. Signed-off-by: Peter Hutterer Reviewed-by: Julien Cristau --- Xi/xichangehierarchy.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c index b7140d5e5..b9cdedf77 100644 --- a/Xi/xichangehierarchy.c +++ b/Xi/xichangehierarchy.c @@ -157,7 +157,11 @@ add_master(ClientPtr client, xXIAddMasterInfo *c, int flags[MAXDEVICES]) /* Allocate virtual slave devices for xtest events */ rc = AllocXTestDevice(client, name, &XTestptr, &XTestkeybd, ptr, keybd); if (rc != Success) + { + DeleteInputDeviceRequest(ptr); + DeleteInputDeviceRequest(keybd); goto unwind; + } ActivateDevice(ptr, FALSE); ActivateDevice(keybd, FALSE); From 99275ad2fa99778afaefc54b62c8638afc59e755 Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Wed, 10 Nov 2010 16:06:10 +0100 Subject: [PATCH 65/80] Remove superfluous if(p!=NULL) checks around free(p); p=NULL; This patch has been generated by the following Coccinelle semantic patch: @@ expression E; @@ - if (E != NULL) { - free(E); ( - E = NULL; | - E = 0; ) - } + free(E); + E = NULL; Signed-off-by: Cyril Brulebois Reviewed-by: Mikhail Gusarov Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- dix/ptrveloc.c | 8 +++----- hw/kdrive/fake/fake.c | 7 ++----- hw/xwin/wincmap.c | 7 ++----- hw/xwin/winpixmap.c | 7 ++----- miext/rootless/rootlessWindow.c | 6 ++---- render/miindex.c | 14 ++++---------- render/picture.c | 7 ++----- xkb/XKBAlloc.c | 6 ++---- xkb/XKBGAlloc.c | 30 ++++++++++------------------- xkb/XKBMAlloc.c | 34 ++++++++++++--------------------- 10 files changed, 41 insertions(+), 85 deletions(-) diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c index 30e14b17e..8f0332161 100644 --- a/dix/ptrveloc.c +++ b/dix/ptrveloc.c @@ -952,11 +952,9 @@ SetAccelerationProfile( if(profile == NULL && profile_num != PROFILE_UNINITIALIZE) return FALSE; - if(vel->profile_private != NULL){ - /* Here one could free old profile-private data */ - free(vel->profile_private); - vel->profile_private = NULL; - } + /* Here one could free old profile-private data */ + free(vel->profile_private); + vel->profile_private = NULL; /* Here one could init profile-private data */ vel->Profile = profile; vel->statistics.profile_number = profile_num; diff --git a/hw/kdrive/fake/fake.c b/hw/kdrive/fake/fake.c index b8306db0a..ba05234dc 100644 --- a/hw/kdrive/fake/fake.c +++ b/hw/kdrive/fake/fake.c @@ -215,11 +215,8 @@ fakeUnmapFramebuffer (KdScreenInfo *screen) { FakePriv *priv = screen->card->driver; KdShadowFbFree (screen); - if (priv->base) - { - free (priv->base); - priv->base = 0; - } + free(priv->base); + priv->base = NULL; return TRUE; } diff --git a/hw/xwin/wincmap.c b/hw/xwin/wincmap.c index 9da03888d..d526a9201 100644 --- a/hw/xwin/wincmap.c +++ b/hw/xwin/wincmap.c @@ -516,11 +516,8 @@ winGetPaletteDD (ScreenPtr pScreen, ColormapPtr pcmap) pScreen->blackPixel = 0; /* Free colormap */ - if (ppeColors != NULL) - { - free (ppeColors); - ppeColors = NULL; - } + free(ppeColors); + ppeColors = NULL; /* Free the DC */ if (hdc != NULL) diff --git a/hw/xwin/winpixmap.c b/hw/xwin/winpixmap.c index 050c71a7f..8bd8e3478 100644 --- a/hw/xwin/winpixmap.c +++ b/hw/xwin/winpixmap.c @@ -163,11 +163,8 @@ winDestroyPixmapNativeGDI (PixmapPtr pPixmap) if (pPixmapPriv->hBitmap) DeleteObject (pPixmapPriv->hBitmap); /* Free the bitmap info header memory */ - if (pPixmapPriv->pbmih != NULL) - { - free (pPixmapPriv->pbmih); - pPixmapPriv->pbmih = NULL; - } + free(pPixmapPriv->pbmih); + pPixmapPriv->pbmih = NULL; /* Free the pixmap memory */ free (pPixmap); diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c index 42ab8dab2..c4a32aa0d 100644 --- a/miext/rootless/rootlessWindow.c +++ b/miext/rootless/rootlessWindow.c @@ -1140,10 +1140,8 @@ FinishFrameResize(WindowPtr pWin, Bool gravity, int oldX, int oldY, } } - if (gResizeDeathBits != NULL) { - free(gResizeDeathBits); - gResizeDeathBits = NULL; - } + free(gResizeDeathBits); + gResizeDeathBits = NULL; if (gravity) { pScreen->CopyWindow = gResizeOldCopyWindowProc; diff --git a/render/miindex.c b/render/miindex.c index 5e2e06c35..4603136a4 100644 --- a/render/miindex.c +++ b/render/miindex.c @@ -322,16 +322,10 @@ void miCloseIndexed (ScreenPtr pScreen, PictFormatPtr pFormat) { - if (pFormat->index.devPrivate) - { - free(pFormat->index.devPrivate); - pFormat->index.devPrivate = 0; - } - if (pFormat->index.pValues) - { - free(pFormat->index.pValues); - pFormat->index.pValues = 0; - } + free(pFormat->index.devPrivate); + pFormat->index.devPrivate = NULL; + free(pFormat->index.pValues); + pFormat->index.pValues = NULL; } void diff --git a/render/picture.c b/render/picture.c index 7fda6b93a..896eaa7be 100644 --- a/render/picture.c +++ b/render/picture.c @@ -1391,11 +1391,8 @@ SetPictureTransform (PicturePtr pPicture, } else { - if (pPicture->transform) - { - free(pPicture->transform); - pPicture->transform = 0; - } + free(pPicture->transform); + pPicture->transform = NULL; } pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT; diff --git a/xkb/XKBAlloc.c b/xkb/XKBAlloc.c index c52e091da..bffd60fce 100644 --- a/xkb/XKBAlloc.c +++ b/xkb/XKBAlloc.c @@ -212,10 +212,8 @@ XkbNamesPtr names; register XkbKeyTypePtr type; type= map->types; for (i=0;inum_types;i++,type++) { - if (type->level_names!=NULL) { - free(type->level_names); - type->level_names= NULL; - } + free(type->level_names); + type->level_names = NULL; } } } diff --git a/xkb/XKBGAlloc.c b/xkb/XKBGAlloc.c index d1adea34e..3ec9edab8 100644 --- a/xkb/XKBGAlloc.c +++ b/xkb/XKBGAlloc.c @@ -50,10 +50,8 @@ _XkbFreeGeomLeafElems( Bool freeAll, { if ((freeAll)||(*elems==NULL)) { *num_inout= *sz_inout= 0; - if (*elems!=NULL) { - free(*elems); - *elems= NULL; - } + free(*elems); + *elems = NULL; return; } @@ -373,22 +371,16 @@ XkbDoodadPtr doodad= (XkbDoodadPtr)doodad_in; switch (doodad->any.type) { case XkbTextDoodad: { - if (doodad->text.text!=NULL) { - free(doodad->text.text); - doodad->text.text= NULL; - } - if (doodad->text.font!=NULL) { - free(doodad->text.font); - doodad->text.font= NULL; - } + free(doodad->text.text); + doodad->text.text = NULL; + free(doodad->text.font); + doodad->text.font = NULL; } break; case XkbLogoDoodad: { - if (doodad->logo.logo_name!=NULL) { - free(doodad->logo.logo_name); - doodad->logo.logo_name= NULL; - } + free(doodad->logo.logo_name); + doodad->logo.logo_name = NULL; } break; } @@ -434,10 +426,8 @@ XkbFreeGeometry(XkbGeometryPtr geom,unsigned which,Bool freeMap) if ((which&XkbGeomKeyAliasesMask)&&(geom->key_aliases!=NULL)) XkbFreeGeomKeyAliases(geom,0,geom->num_key_aliases,TRUE); if (freeMap) { - if (geom->label_font!=NULL) { - free(geom->label_font); - geom->label_font= NULL; - } + free(geom->label_font); + geom->label_font = NULL; free(geom); } return; diff --git a/xkb/XKBMAlloc.c b/xkb/XKBMAlloc.c index 6b186c1ad..e85a8af95 100644 --- a/xkb/XKBMAlloc.c +++ b/xkb/XKBMAlloc.c @@ -321,9 +321,9 @@ KeyCode matchingKeys[XkbMaxKeyCount],nMatchingKeys; return BadAlloc; } } - else if (type->preserve!=NULL) { + else { free(type->preserve); - type->preserve= NULL; + type->preserve = NULL; } type->map_count= map_count; } @@ -807,19 +807,13 @@ XkbClientMapPtr map; register int i; XkbKeyTypePtr type; for (i=0,type=map->types;inum_types;i++,type++) { - if (type->map!=NULL) { - free(type->map); - type->map= NULL; - } - if (type->preserve!=NULL) { - free(type->preserve); - type->preserve= NULL; - } + free(type->map); + type->map = NULL; + free(type->preserve); + type->preserve = NULL; type->map_count= 0; - if (type->level_names!=NULL) { - free(type->level_names); - type->level_names= NULL; - } + free(type->level_names); + type->level_names = NULL; } } free(map->types); @@ -828,10 +822,8 @@ XkbClientMapPtr map; } } if (what&XkbKeySymsMask) { - if (map->key_sym_map!=NULL) { - free(map->key_sym_map); - map->key_sym_map= NULL; - } + free(map->key_sym_map); + map->key_sym_map = NULL; if (map->syms!=NULL) { free(map->syms); map->size_syms= map->num_syms= 0; @@ -864,10 +856,8 @@ XkbServerMapPtr map; map->explicit= NULL; } if (what&XkbKeyActionsMask) { - if (map->key_acts!=NULL) { - free(map->key_acts); - map->key_acts= NULL; - } + free(map->key_acts); + map->key_acts = NULL; if (map->acts!=NULL) { free(map->acts); map->num_acts= map->size_acts= 0; From 0649ac0afdb3f8ed11c2634563d6b9df161cb9ec Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Mon, 8 Nov 2010 23:35:32 +0100 Subject: [PATCH 66/80] Remove more superfluous if(p) checks around free(p). This patch has been generated by the following Coccinelle semantic patch: @@ expression E; @@ - if (E) - free(E); + free(E); Signed-off-by: Cyril Brulebois Reviewed-by: Matt Turner Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- hw/dmx/glxProxy/glxcmds.c | 2 +- hw/dmx/glxProxy/glxext.c | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/hw/dmx/glxProxy/glxcmds.c b/hw/dmx/glxProxy/glxcmds.c index a9744e186..760212865 100644 --- a/hw/dmx/glxProxy/glxcmds.c +++ b/hw/dmx/glxProxy/glxcmds.c @@ -2565,7 +2565,7 @@ int __glXClientInfo(__GLXclientState *cl, GLbyte *pc) cl->GLClientmajorVersion = req->major; cl->GLClientminorVersion = req->minor; - if (cl->GLClientextensions) free(cl->GLClientextensions); + free(cl->GLClientextensions); buf = (const char *)(req+1); cl->GLClientextensions = strdup(buf); diff --git a/hw/dmx/glxProxy/glxext.c b/hw/dmx/glxProxy/glxext.c index a8fc0a88d..886b317c6 100644 --- a/hw/dmx/glxProxy/glxext.c +++ b/hw/dmx/glxProxy/glxext.c @@ -77,10 +77,10 @@ static void ResetClientState(int clientIndex) Display **keep_be_displays; int i; - if (cl->returnBuf) free(cl->returnBuf); - if (cl->currentContexts) free(cl->currentContexts); - if (cl->currentDrawables) free(cl->currentDrawables); - if (cl->largeCmdBuf) free(cl->largeCmdBuf); + free(cl->returnBuf); + free(cl->currentContexts); + free(cl->currentDrawables); + free(cl->largeCmdBuf); for (i=0; i< screenInfo.numScreens; i++) { if (cl->be_displays[i]) @@ -97,7 +97,7 @@ static void ResetClientState(int clientIndex) */ cl->GLClientmajorVersion = 1; cl->GLClientminorVersion = 0; - if (cl->GLClientextensions) free(cl->GLClientextensions); + free(cl->GLClientextensions); memset(cl->be_displays, 0, screenInfo.numScreens * sizeof(Display *)); } @@ -222,10 +222,10 @@ GLboolean __glXFreeContext(__GLXcontext *cx) { if (cx->idExists || cx->isCurrent) return GL_FALSE; - if (cx->feedbackBuf) free(cx->feedbackBuf); - if (cx->selectBuf) free(cx->selectBuf); - if (cx->real_ids) free(cx->real_ids); - if (cx->real_vids) free(cx->real_vids); + free(cx->feedbackBuf); + free(cx->selectBuf); + free(cx->real_ids); + free(cx->real_vids); if (cx->pGlxPixmap) { /* From b142b0d27442191d628762604f4eb1f65263d717 Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Mon, 8 Nov 2010 23:35:33 +0100 Subject: [PATCH 67/80] Remove more superfluous if(p!=NULL) checks around free(p). This patch has been generated by the following Coccinelle semantic patch: @@ expression E; @@ - if (E != NULL) - free(E); + free(E); Signed-off-by: Cyril Brulebois Reviewed-by: Matt Turner Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- dix/grabs.c | 7 ++----- glx/single2.c | 3 +-- hw/xfree86/modes/xf86Crtc.c | 3 +-- mi/mispans.c | 2 +- miext/rootless/rootlessScreen.c | 3 +-- os/log.c | 6 ++---- xkb/XKBMAlloc.c | 6 ++---- xkb/ddxLoad.c | 6 ++---- 8 files changed, 12 insertions(+), 24 deletions(-) diff --git a/dix/grabs.c b/dix/grabs.c index f850e3d84..69c58dff9 100644 --- a/dix/grabs.c +++ b/dix/grabs.c @@ -117,11 +117,8 @@ CreateGrab( static void FreeGrab(GrabPtr pGrab) { - if (pGrab->modifiersDetail.pMask != NULL) - free(pGrab->modifiersDetail.pMask); - - if (pGrab->detail.pMask != NULL) - free(pGrab->detail.pMask); + free(pGrab->modifiersDetail.pMask); + free(pGrab->detail.pMask); if (pGrab->cursor) FreeCursor(pGrab->cursor, (Cursor)0); diff --git a/glx/single2.c b/glx/single2.c index 56ad86dc6..f93ce6e4a 100644 --- a/glx/single2.c +++ b/glx/single2.c @@ -377,8 +377,7 @@ int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap) __GLX_SEND_HEADER(); WriteToClient(client, length, (char *) string); - if (buf != NULL) - free(buf); + free(buf); return Success; } diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index b2daec72e..7fc2a60f7 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -2964,8 +2964,7 @@ xf86OutputSetEDID (xf86OutputPtr output, xf86MonPtr edid_mon) int size; #endif - if (output->MonInfo != NULL) - free(output->MonInfo); + free(output->MonInfo); output->MonInfo = edid_mon; diff --git a/mi/mispans.c b/mi/mispans.c index 9f56e3c3d..53539e515 100644 --- a/mi/mispans.c +++ b/mi/mispans.c @@ -215,7 +215,7 @@ void miAppendSpans(SpanGroup *spanGroup, SpanGroup *otherGroup, Spans *spans) void miFreeSpanGroup(SpanGroup *spanGroup) { - if (spanGroup->group != NULL) free(spanGroup->group); + free(spanGroup->group); } static void QuickSortSpansX( diff --git a/miext/rootless/rootlessScreen.c b/miext/rootless/rootlessScreen.c index 43b9cbb53..61d2f5dab 100644 --- a/miext/rootless/rootlessScreen.c +++ b/miext/rootless/rootlessScreen.c @@ -92,8 +92,7 @@ RootlessUpdateScreenPixmap(ScreenPtr pScreen) rowbytes = PixmapBytePad(pScreen->width, pScreen->rootDepth); if (s->pixmap_data_size < rowbytes) { - if (s->pixmap_data != NULL) - free(s->pixmap_data); + free(s->pixmap_data); s->pixmap_data_size = rowbytes; s->pixmap_data = malloc(s->pixmap_data_size); diff --git a/os/log.c b/os/log.c index ee4b45fa4..7d1078355 100644 --- a/os/log.c +++ b/os/log.c @@ -489,8 +489,7 @@ AuditFlush(OsTimerPtr timer, CARD32 now, pointer arg) ErrorF("%slast message repeated %d times\n", prefix != NULL ? prefix : "", nrepeat); nrepeat = 0; - if (prefix != NULL) - free(prefix); + free(prefix); return AUDIT_TIMEOUT; } else { /* if the timer expires without anything to print, flush the message */ @@ -523,8 +522,7 @@ VAuditF(const char *f, va_list args) nrepeat = 0; auditTimer = TimerSet(auditTimer, 0, AUDIT_TIMEOUT, AuditFlush, NULL); } - if (prefix != NULL) - free(prefix); + free(prefix); } void diff --git a/xkb/XKBMAlloc.c b/xkb/XKBMAlloc.c index e85a8af95..2681ba3c3 100644 --- a/xkb/XKBMAlloc.c +++ b/xkb/XKBMAlloc.c @@ -292,11 +292,9 @@ KeyCode matchingKeys[XkbMaxKeyCount],nMatchingKeys; } type= &xkb->map->types[type_ndx]; if (map_count==0) { - if (type->map!=NULL) - free(type->map); + free(type->map); type->map= NULL; - if (type->preserve!=NULL) - free(type->preserve); + free(type->preserve); type->preserve= NULL; type->map_count= 0; } diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c index 5e6ab8770..cfc6198fd 100644 --- a/xkb/ddxLoad.c +++ b/xkb/ddxLoad.c @@ -267,8 +267,7 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb, strncpy(nameRtrn,keymap,nameRtrnLen); nameRtrn[nameRtrnLen-1]= '\0'; } - if (buf != NULL) - free(buf); + free(buf); return TRUE; } else @@ -287,8 +286,7 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb, } if (nameRtrn) nameRtrn[0]= '\0'; - if (buf != NULL) - free(buf); + free(buf); return FALSE; } From 68e4a628d65312df93cc71f3e76241584c4bbd23 Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Wed, 10 Nov 2010 15:28:29 +0100 Subject: [PATCH 68/80] Remove more superfluous if(p!=NULL) checks around free(p). This patch has been generated by the following Coccinelle semantic patch: @@ expression E; @@ - if (E != NULL) { - free(E); - } + free(E); Signed-off-by: Cyril Brulebois Reviewed-by: Mark Kettenis Reviewed-by: Matt Turner Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- glx/glxdri.c | 4 +--- glx/glxdri2.c | 4 +--- glx/single2.c | 4 +--- hw/xwin/glx/indirect.c | 5 +---- 4 files changed, 4 insertions(+), 13 deletions(-) diff --git a/glx/glxdri.c b/glx/glxdri.c index 41482c913..ec9343463 100644 --- a/glx/glxdri.c +++ b/glx/glxdri.c @@ -1160,9 +1160,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) */ buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL); if (buffer_size > 0) { - if (screen->base.GLXextensions != NULL) { - free(screen->base.GLXextensions); - } + free(screen->base.GLXextensions); screen->base.GLXextensions = xnfalloc(buffer_size); (void) __glXGetExtensionString(screen->glx_enable_bits, diff --git a/glx/glxdri2.c b/glx/glxdri2.c index c2305ad90..0b6920151 100644 --- a/glx/glxdri2.c +++ b/glx/glxdri2.c @@ -792,9 +792,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) */ buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL); if (buffer_size > 0) { - if (screen->base.GLXextensions != NULL) { - free(screen->base.GLXextensions); - } + free(screen->base.GLXextensions); screen->base.GLXextensions = xnfalloc(buffer_size); (void) __glXGetExtensionString(screen->glx_enable_bits, diff --git a/glx/single2.c b/glx/single2.c index f93ce6e4a..07b89a823 100644 --- a/glx/single2.c +++ b/glx/single2.c @@ -346,9 +346,7 @@ int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap) cl->GLClientextensions); buf = __glXcombine_strings(buf1, cx->pGlxScreen->GLextensions); - if (buf1 != NULL) { - free(buf1); - } + free(buf1); string = buf; } else if ( name == GL_VERSION ) { diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c index 38918859a..5d7391d4c 100644 --- a/hw/xwin/glx/indirect.c +++ b/hw/xwin/glx/indirect.c @@ -682,10 +682,7 @@ glxWinScreenProbe(ScreenPtr pScreen) unsigned int buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL); if (buffer_size > 0) { - if (screen->base.GLXextensions != NULL) - { - free(screen->base.GLXextensions); - } + free(screen->base.GLXextensions); screen->base.GLXextensions = xnfalloc(buffer_size); __glXGetExtensionString(screen->glx_enable_bits, screen->base.GLXextensions); From 383dfe23f1641435c0713f8a56424814a156af8e Mon Sep 17 00:00:00 2001 From: Pauli Nieminen Date: Mon, 25 Oct 2010 17:13:57 +0300 Subject: [PATCH 69/80] DRI2: Avoid call to NULL pointer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DDX driver may implement schedule swap without GetMSC. In that case we can't call GetMSC in DRI2SwapBuffers. Signed-off-by: Pauli Nieminen Reviewed-by: Mario Kleiner CC: Keith Packard CC: Kristian Høgsberg Reviewed-by: Jesse Barnes Signed-off-by: Keith Packard --- hw/xfree86/dri2/dri2.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c index 34f735f52..e4693d92e 100644 --- a/hw/xfree86/dri2/dri2.c +++ b/hw/xfree86/dri2/dri2.c @@ -828,11 +828,14 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc, * is moved to a crtc with a lower refresh rate, or a crtc that just * got enabled. */ - if (!(*ds->GetMSC)(pDraw, &ust, ¤t_msc)) - pPriv->last_swap_target = 0; + if (ds->GetMSC) { + if (!(*ds->GetMSC)(pDraw, &ust, ¤t_msc)) + pPriv->last_swap_target = 0; - if (current_msc < pPriv->last_swap_target) - pPriv->last_swap_target = current_msc; + if (current_msc < pPriv->last_swap_target) + pPriv->last_swap_target = current_msc; + + } /* * Swap target for this swap is last swap target + swap interval since From 69e8e1b0b95a325da3e3a2d76d092e7131baa9ad Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Mon, 17 May 2010 19:39:54 +0200 Subject: [PATCH 70/80] os: include dix-config.h, not xorg-config.h os/strlc{at,py}.c were trying to include xorg-config.h, which is not available in dix. Signed-off-by: Julien Cristau Acked-by: Peter Hutterer Signed-off-by: Peter Hutterer --- os/strlcat.c | 4 ++-- os/strlcpy.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/os/strlcat.c b/os/strlcat.c index 91ceabb1c..7d53b0a6a 100644 --- a/os/strlcat.c +++ b/os/strlcat.c @@ -15,8 +15,8 @@ */ -#ifdef HAVE_XORG_CONFIG_H -#include +#ifdef HAVE_DIX_CONFIG_H +#include #endif #include diff --git a/os/strlcpy.c b/os/strlcpy.c index e8e1b0217..2e55b2e63 100644 --- a/os/strlcpy.c +++ b/os/strlcpy.c @@ -14,8 +14,8 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifdef HAVE_XORG_CONFIG_H -#include +#ifdef HAVE_DIX_CONFIG_H +#include #endif #include From a6c64d96456d794b2f3ce40915922a3fba636b95 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 24 Oct 2010 15:18:28 +0200 Subject: [PATCH 71/80] Do not trap access to timer and keyboard Disable timer/keyboard trapping on GNU/Hurd for now Trapping disabled for now, as some VBIOSes (mga-g450 notably) use these ports, and the int10 wrapper is not emulating them. It's effectively what happens in the Linux variant too, as iopl() is used there, making the ioperm() meaningless. Signed-off-by: Olaf Buddenhagen Signed-off-by: Samuel Thibault Reviewed-by: Adam Jackson Signed-off-by: Keith Packard --- hw/xfree86/os-support/hurd/hurd_video.c | 9 +++++++++ hw/xfree86/os-support/linux/lnx_video.c | 2 ++ 2 files changed, 11 insertions(+) diff --git a/hw/xfree86/os-support/hurd/hurd_video.c b/hw/xfree86/os-support/hurd/hurd_video.c index 3d7af404d..39f353bd3 100644 --- a/hw/xfree86/os-support/hurd/hurd_video.c +++ b/hw/xfree86/os-support/hurd/hurd_video.c @@ -124,8 +124,17 @@ xf86EnableIO() FatalError("xf86EnableIO: ioperm() failed (%s)\n", strerror(errno)); return FALSE; } +#if 0 + /* + * Trapping disabled for now, as some VBIOSes (mga-g450 notably) use these + * ports, and the int10 wrapper is not emulating them. (Note that it's + * effectively what happens in the Linux variant too, as iopl() is used + * there, making the ioperm() meaningless.) + * + * Reenable this when int10 gets fixed. */ ioperm(0x40,4,0); /* trap access to the timer chip */ ioperm(0x60,4,0); /* trap access to the keyboard controller */ +#endif return TRUE; } diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c index b97757c9b..39c728d9e 100644 --- a/hw/xfree86/os-support/linux/lnx_video.c +++ b/hw/xfree86/os-support/linux/lnx_video.c @@ -530,6 +530,8 @@ xf86EnableIO(void) return FALSE; } # if !defined(__alpha__) + /* XXX: this is actually not trapping anything because of iopl(3) + * above */ ioperm(0x40,4,0); /* trap access to the timer chip */ ioperm(0x60,4,0); /* trap access to the keyboard controller */ # endif From be7cf14c365c8ee0d69c4335e01316bcfcba69a4 Mon Sep 17 00:00:00 2001 From: Siddhesh Poyarekar Date: Tue, 26 Oct 2010 09:11:53 +0530 Subject: [PATCH 72/80] mi: Integer overflow for dashed lines longer than 46340. #31093 Lines of length greater than 46340 can be drawn with one of the coordinates being negative. However for dashed lines, miPolyBuildPoly overflows the int type when setting up edges for a section of the dashed line. This results in the dashed segments not being drawn at all. Signed-off-by: Siddhesh Poyarekar Reviewed-by: Keith Packard Signed-off-by: Keith Packard --- mi/miwideline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mi/miwideline.c b/mi/miwideline.c index b11b40bd2..bc5ee74c2 100644 --- a/mi/miwideline.c +++ b/mi/miwideline.c @@ -403,7 +403,7 @@ miPolyBuildPoly ( i = top; j = StepAround (top, -1, count); - if (slopes[j].dy * slopes[i].dx > slopes[i].dy * slopes[j].dx) + if ((int64_t)slopes[j].dy * slopes[i].dx > (int64_t)slopes[i].dy * slopes[j].dx) { clockwise = -1; slopeoff = -1; From cc2c73ddcb4370a7c3ad439cda4da825156c26c9 Mon Sep 17 00:00:00 2001 From: Luc Verhaegen Date: Sun, 24 Oct 2010 23:57:06 +0200 Subject: [PATCH 73/80] x86emu: fix jump_near_IMM to handle DATA: flag correctly. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=24348 Before (data flag ignored -> broken): 66 DATA: e944f1 JMP 1ff6 After (fixed): 66 DATA: e944f1ffff JMP 00001ff8 This subtle difference in the length of decoded instruction meant that the VBE call jumped to the routine setting AX=0x14F (VBE Failed) instead of the routine that set AX=0x4F (VBE success). The ability to run the same code in vm86 significantly aided the debugging of this issue. Those X.org developers who would like to drop vm86 better take special care towards _all_ vesa bugs, as those will expose further issues. Patch applies easily to even xserver 1.4.2. Signed-off-by: Luc Verhaegen Tested-by: Luc Verhaegen Reviewed-by: Adam Jackson Signed-off-by: Keith Packard --- hw/xfree86/x86emu/ops.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/hw/xfree86/x86emu/ops.c b/hw/xfree86/x86emu/ops.c index 21a034712..c6b2f0a4b 100644 --- a/hw/xfree86/x86emu/ops.c +++ b/hw/xfree86/x86emu/ops.c @@ -9691,15 +9691,23 @@ Handles opcode 0xe9 ****************************************************************************/ static void x86emuOp_jump_near_IMM(u8 X86EMU_UNUSED(op1)) { - int ip; + u32 ip; START_OF_INSTR(); DECODE_PRINTF("JMP\t"); - ip = (s16)fetch_word_imm(); - ip += (s16)M.x86.R_IP; - DECODE_PRINTF2("%04x\n", (u16)ip); - TRACE_AND_STEP(); - M.x86.R_IP = (u16)ip; + if (M.x86.mode & SYSMODE_PREFIX_DATA) { + ip = (u32)fetch_long_imm(); + ip += (u32)M.x86.R_EIP; + DECODE_PRINTF2("%08x\n", (u32)ip); + TRACE_AND_STEP(); + M.x86.R_EIP = (u32)ip; + } else { + ip = (s16)fetch_word_imm(); + ip += (s16)M.x86.R_IP; + DECODE_PRINTF2("%04x\n", (u16)ip); + TRACE_AND_STEP(); + M.x86.R_IP = (u16)ip; + } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } From c80c41767eb101e9dbd8393d8cca7764b4e248a4 Mon Sep 17 00:00:00 2001 From: Aaron Plattner Date: Mon, 25 Oct 2010 22:01:32 -0700 Subject: [PATCH 74/80] os: Fix BigReq ignoring when another request is pending Commit cf88363db0ebb42df7cc286b85d30d7898aea840 fixed the handling of BigReq requests that are way too large and handles the case where the read() syscall returns a short read. However, it neglected to handle the case where it returns a long read, which happens when the client has another request in the queue after the bogus large one. Handle the long read case by subtracting the smaller of 'needed' and 'gotnow' from oci->ignoreBytes. If needed < gotnow, simply subtract the two, leaving gotnow equal to the number of extra bytes read. Since the code immediately following the (oci->ignoreBytes > 0) block tries to handle the next request, advance oci->bufptr immediately instead of setting oci->lenLastReq and letting the next call to ReadRequestFromClient do it. Fixes the XTS pChangeKeyboardMapping-3 test. CASES TESTS PASS UNSUP UNTST NOTIU WARN FIP FAIL UNRES UNIN ABORT -Xproto 122 389 367 2 19 0 0 0 1 0 0 0 +Xproto 122 389 368 2 19 0 0 0 0 0 0 0 Signed-off-by: Aaron Plattner Reviewed-by: Adam Jackson Signed-off-by: Keith Packard --- os/io.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/os/io.c b/os/io.c index fb9f76207..421023807 100644 --- a/os/io.c +++ b/os/io.c @@ -410,16 +410,29 @@ ReadRequestFromClient(ClientPtr client) else needed = sizeof(xReq); } - oci->lenLastReq = needed; /* If there are bytes to ignore, ignore them now. */ if (oci->ignoreBytes > 0) { assert(needed == oci->ignoreBytes || needed == oci->size); - oci->ignoreBytes -= gotnow; - needed = gotnow = 0; + /* + * The _XSERVTransRead call above may return more or fewer bytes than we + * want to ignore. Ignore the smaller of the two sizes. + */ + if (gotnow < needed) { + oci->ignoreBytes -= gotnow; + oci->bufptr += gotnow; + gotnow = 0; + } else { + oci->ignoreBytes -= needed; + oci->bufptr += needed; + gotnow -= needed; + } + needed = 0; } + oci->lenLastReq = needed; + /* * Check to see if client has at least one whole request in the * buffer beyond the request we're returning to the caller. From f36153e3ef6b13a87d016caab09cc9be274b0dd5 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 28 Oct 2010 20:46:22 -0700 Subject: [PATCH 75/80] Replace usage of DamageRegionAppend with DamageDamageRegion to fix reportAfter. In all these cases, any rendering implied by this damage has already occurred, and we want to get the damage out to the client. Some of the DamageRegionAppend calls were explicitly telling damage to flush the reportAfter damage out, but not all. Bug #30260. Fixes the compiz wallpaper plugin with client damage changed to reportAfter. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard Signed-off-by: Keith Packard --- composite/compalloc.c | 2 +- composite/compwindow.c | 4 ++-- damageext/damageext.c | 4 ++-- exa/exa.c | 3 +-- glx/glxdri.c | 4 +--- hw/xfree86/modes/xf86Rotate.c | 2 +- 6 files changed, 8 insertions(+), 11 deletions(-) diff --git a/composite/compalloc.c b/composite/compalloc.c index 47d5c0a3c..c86eb9b69 100644 --- a/composite/compalloc.c +++ b/composite/compalloc.c @@ -238,7 +238,7 @@ compFreeClientWindow (WindowPtr pWin, XID id) DamageRegister (&pWin->drawable, cw->damage); cw->damageRegistered = TRUE; pWin->redirectDraw = RedirectDrawAutomatic; - DamageRegionAppend(&pWin->drawable, &pWin->borderSize); + DamageDamageRegion(&pWin->drawable, &pWin->borderSize); } if (wasMapped && !pWin->mapped) { diff --git a/composite/compwindow.c b/composite/compwindow.c index 8849dc317..d17ff771f 100644 --- a/composite/compwindow.c +++ b/composite/compwindow.c @@ -519,7 +519,7 @@ compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) RegionTranslate(prgnSrc, pWin->drawable.x - ptOldOrg.x, pWin->drawable.y - ptOldOrg.y); - DamageRegionAppend(&pWin->drawable, prgnSrc); + DamageDamageRegion(&pWin->drawable, prgnSrc); } cs->CopyWindow = pScreen->CopyWindow; pScreen->CopyWindow = compCopyWindow; @@ -598,7 +598,7 @@ compSetRedirectBorderClip (WindowPtr pWin, RegionPtr pRegion) /* * Report that as damaged so it will be redrawn */ - DamageRegionAppend(&pWin->drawable, &damage); + DamageDamageRegion(&pWin->drawable, &damage); RegionUninit(&damage); /* * Save the new border clip region diff --git a/damageext/damageext.c b/damageext/damageext.c index f5265ddfc..4aa0ff3a1 100644 --- a/damageext/damageext.c +++ b/damageext/damageext.c @@ -222,7 +222,7 @@ ProcDamageCreate (ClientPtr client) if (pDrawable->type == DRAWABLE_WINDOW) { pRegion = &((WindowPtr) pDrawable)->borderClip; - DamageRegionAppend(pDrawable, pRegion); + DamageDamageRegion(pDrawable, pRegion); } return Success; @@ -292,7 +292,7 @@ ProcDamageAdd (ClientPtr client) * screen coordinates like damage expects. */ RegionTranslate(pRegion, pDrawable->x, pDrawable->y); - DamageRegionAppend(pDrawable, pRegion); + DamageDamageRegion(pDrawable, pRegion); RegionTranslate(pRegion, -pDrawable->x, -pDrawable->y); return Success; diff --git a/exa/exa.c b/exa/exa.c index fc15c2471..8adf8473c 100644 --- a/exa/exa.c +++ b/exa/exa.c @@ -159,8 +159,7 @@ exaPixmapDirty (PixmapPtr pPix, int x1, int y1, int x2, int y2) return; RegionInit(®ion, &box, 1); - DamageRegionAppend(&pPix->drawable, ®ion); - DamageRegionProcessPending(&pPix->drawable); + DamageDamageRegion(&pPix->drawable, ®ion); RegionUninit(®ion); } diff --git a/glx/glxdri.c b/glx/glxdri.c index 41482c913..6458ef928 100644 --- a/glx/glxdri.c +++ b/glx/glxdri.c @@ -834,9 +834,7 @@ static void __glXReportDamage(__DRIdrawable *driDraw, RegionInit(®ion, (BoxPtr) rects, num_rects); RegionTranslate(®ion, pDraw->x, pDraw->y); - DamageRegionAppend(pDraw, ®ion); - /* This is wrong, this needs a seperate function. */ - DamageRegionProcessPending(pDraw); + DamageDamageRegion(pDraw, ®ion); RegionUninit(®ion); __glXleaveServer(GL_FALSE); diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c index fdc38c5a6..57c3499ac 100644 --- a/hw/xfree86/modes/xf86Rotate.c +++ b/hw/xfree86/modes/xf86Rotate.c @@ -168,7 +168,7 @@ xf86CrtcDamageShadow (xf86CrtcPtr crtc) if (damage_box.x2 > pScreen->width) damage_box.x2 = pScreen->width; if (damage_box.y2 > pScreen->height) damage_box.y2 = pScreen->height; RegionInit(&damage_region, &damage_box, 1); - DamageRegionAppend (&(*pScreen->GetScreenPixmap)(pScreen)->drawable, + DamageDamageRegion (&(*pScreen->GetScreenPixmap)(pScreen)->drawable, &damage_region); RegionUninit(&damage_region); crtc->shadowClear = TRUE; From 333b6ed26e36735ef72f314a3f8c4ec565af223f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Thu, 28 Oct 2010 20:46:23 -0700 Subject: [PATCH 76/80] Set DamageSetReportAfterOp to true for the damage extension MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change the damage extension reporter to queue up events after we chain to the wrapped functions. Damage events are typically sent out after the rendering happens anyway, since we submit batch buffers from the flush callback chain and then flush client io buffers. Compositing managers relie on this order, and there is no way we could reliably provide damage events to clients before the rendering happens anyway. By queueing up the damage events before the rendering happens, there's a risk that the client io buffer may overflow and send the damage events to the client before the driver has even seen the rendering request. Reporting damage events after the rendering fixes this corner case and better corresponds with how we expect this to work. Signed-off-by: Kristian Høgsberg Reviewed-by: Keith Packard (cherry picked from commit 8d7b7a0d71e0b89321b3341b781bc8845386def6) [anholt: re-applied to revert the revert, now that the cause of the revert is fixed] Signed-off-by: Keith Packard --- damageext/damageext.c | 1 + 1 file changed, 1 insertion(+) diff --git a/damageext/damageext.c b/damageext/damageext.c index 4aa0ff3a1..754383d49 100644 --- a/damageext/damageext.c +++ b/damageext/damageext.c @@ -217,6 +217,7 @@ ProcDamageCreate (ClientPtr client) if (!AddResource (stuff->damage, DamageExtType, (pointer) pDamageExt)) return BadAlloc; + DamageSetReportAfterOp (pDamageExt->pDamage, TRUE); DamageRegister (pDamageExt->pDrawable, pDamageExt->pDamage); if (pDrawable->type == DRAWABLE_WINDOW) From f0b4df99486066ad0e638b3b5debc905bc8ef1c4 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Sat, 11 Sep 2010 17:55:57 -0400 Subject: [PATCH 77/80] shadow: Optimize shadowUpdatePacked(). (#26973) Signed-off-by: Matt Turner Reviewed-by: Soren Sandmann Reviewed-by: Matt Turner Signed-off-by: Keith Packard --- miext/shadow/shpacked.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/miext/shadow/shpacked.c b/miext/shadow/shpacked.c index 20d2ea19e..06606bcf3 100644 --- a/miext/shadow/shpacked.c +++ b/miext/shadow/shpacked.c @@ -102,8 +102,8 @@ shadowUpdatePacked (ScreenPtr pScreen, width -= i; scr += i; #define PickBit(a,i) (((a) >> (i)) & 1) - while (i--) - *win++ = *sha++; + memcpy(win, sha, i * sizeof(FbBits)); + sha += i; } shaLine += shaStride; y++; From 291c39dfef84d1b204d7f5e63e925dee2dbdaca7 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Tue, 9 Nov 2010 13:33:55 -0800 Subject: [PATCH 78/80] DOC: Only build dtrace documentation with --enable-docs Signed-off-by: Jeremy Huddleston Reviewed-by: Alan Coopersmith Signed-off-by: Keith Packard --- configure.ac | 1 + doc/xml/dtrace/Makefile.am | 2 ++ 2 files changed, 3 insertions(+) diff --git a/configure.ac b/configure.ac index e8f947316..bd027cd07 100644 --- a/configure.ac +++ b/configure.ac @@ -714,6 +714,7 @@ fi dnl Handle building documentation AM_CONDITIONAL(BUILDDOCS, test "x$BUILDDOCS" = xyes) +XORG_ENABLE_DOCS XORG_ENABLE_DEVEL_DOCS XORG_WITH_XMLTO(0.0.20) XORG_WITH_FOP diff --git a/doc/xml/dtrace/Makefile.am b/doc/xml/dtrace/Makefile.am index 0e25e5d43..a95d37418 100644 --- a/doc/xml/dtrace/Makefile.am +++ b/doc/xml/dtrace/Makefile.am @@ -25,11 +25,13 @@ XML_FILES = Xserver-DTrace.xml include ../xmlrules.in +if ENABLE_DOCS if XSERVER_DTRACE doc_DATA = $(BUILT_DOC_FILES) else noinst_DATA = $(BUILT_DOC_FILES) endif +endif CLEANFILES = $(CLEAN_DOC_FILES) From cbaa6a66e0f9e3b7e305606924ecda0147b59e96 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 9 Nov 2010 15:21:23 +1000 Subject: [PATCH 79/80] config: remove mention of AllowEmptyInput "You will probably want to add the following option to the ServerFlags of your xorg.conf: Option "AllowEmptyInput" "True"" I can't imagine why you would want to do that. My life is painful enough already. Signed-off-by: Peter Hutterer Reviewed-by: Julien Cristau Reviewed-by: Dan Nicholson --- config/x11-input.fdi | 5 ----- 1 file changed, 5 deletions(-) diff --git a/config/x11-input.fdi b/config/x11-input.fdi index 9e629cbd0..b263f36cb 100644 --- a/config/x11-input.fdi +++ b/config/x11-input.fdi @@ -45,11 +45,6 @@ See the evdev documentation for more information. - You will probably want to add the following option to the ServerFlags of - your xorg.conf: - - Option "AllowEmptyInput" "True" - FIXME: Support tablets too. TODO: I think its fixed, can't test From ec1bfbc66926130e1153facc3b92ee175f1cb6b6 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 9 Nov 2010 15:27:26 +1000 Subject: [PATCH 80/80] xfree86: remove user-configured AllowEmptyInput An estimated 100% (rounded down to the nearest percent) of the people who have this in their configuration don't actually know what this option does. Protect the users from themselves. IIRC, AEI on was useful for some time between 1.4 and 1.5 and never since. Signed-off-by: Peter Hutterer Reviewed-by: Dan Nicholson --- hw/xfree86/common/xf86Config.c | 11 +++++------ hw/xfree86/doc/man/xorg.conf.man.pre | 9 --------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index e3b2831c2..88e2e8d3b 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -742,8 +742,6 @@ static OptionInfoRec FlagOptions[] = { {0}, FALSE }, { FLAG_AIGLX, "AIGLX", OPTV_BOOLEAN, {0}, FALSE }, - { FLAG_ALLOW_EMPTY_INPUT, "AllowEmptyInput", OPTV_BOOLEAN, - {0}, FALSE }, { FLAG_IGNORE_ABI, "IgnoreABI", OPTV_BOOLEAN, {0}, FALSE }, { FLAG_USE_DEFAULT_FONT_PATH, "UseDefaultFontPath", OPTV_BOOLEAN, @@ -956,7 +954,6 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) /* AllowEmptyInput is automatically true if we're hotplugging */ xf86Info.allowEmptyInput = (xf86Info.autoAddDevices && xf86Info.autoEnableDevices); - xf86GetOptValBool(FlagOptions, FLAG_ALLOW_EMPTY_INPUT, &xf86Info.allowEmptyInput); /* AEI on? Then we're not using kbd, so use the evdev rules set. */ #if defined(linux) @@ -1437,8 +1434,10 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) "reconfigure %s or disable AutoAddDevices.\n", config_backend, config_backend); #else - xf86Msg(X_INFO, "Hotplugging is disabled and no input devices were configured.\n" - "\tTry disabling AllowEmptyInput.\n"); + xf86Msg(X_WARNING, "Hotplugging requested but the server was " + "compiled without a config backend. " + "No input devices were configured, the server " + "will start without any input devices.\n"); #endif } @@ -2353,7 +2352,7 @@ checkInput(serverLayoutPtr layout, Bool implicit_layout) { IDevPtr *current; if (!warned) { - xf86Msg(X_WARNING, "AllowEmptyInput is on, devices using " + xf86Msg(X_WARNING, "Hotplugging is on, devices using " "drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.\n"); warned = TRUE; } diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre index cbfea7d98..a7259fb8b 100644 --- a/hw/xfree86/doc/man/xorg.conf.man.pre +++ b/hw/xfree86/doc/man/xorg.conf.man.pre @@ -558,9 +558,6 @@ Default: off. This tells the mousedrv(__drivermansuffix__) and vmmouse(__drivermansuffix__) drivers to not report failure if the mouse device can't be opened/initialised. It has no effect on the evdev(__drivermansuffix__) or other drivers. -The previous functionality of allowing the server to start up even if -the mouse device can't be opened/initialised is now handled by the -AllowEmptyInput option. Default: false. .TP 7 .BI "Option \*qVTSysReq\*q \*q" boolean \*q @@ -677,12 +674,6 @@ default. Allow modules built for a different, potentially incompatible version of the X server to load. Disabled by default. .TP 7 -.BI "Option \*qAllowEmptyInput\*q \*q" boolean \*q -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, mouse or vmmouse 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. Enabled by default.