From e135a77b8bad15fb135cd080c1725064f938b790 Mon Sep 17 00:00:00 2001 From: Ander Conselvan de Oliveira Date: Wed, 9 Jul 2008 10:44:19 -0300 Subject: [PATCH 01/24] Fix incorrect test regarding keyboard map. In the map stored in each keyboard device, the first line refers to minimum keycode, i.e., the 0th line refers to keycode 8. When not using XKB the wrong test caused some keys to be interpreted as locks ('m' for instance). The had to be pressed twice to generate both KeyPress and KeyRelease events. Signed-off-by: Peter Hutterer --- dix/getevents.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dix/getevents.c b/dix/getevents.c index bf9331eae..fbead1124 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -408,9 +408,12 @@ GetKeyboardValuatorEvents(xEvent *events, DeviceIntPtr pDev, int type, int numEvents = 0; CARD32 ms = 0; KeySym *map = pDev->key->curKeySyms.map; - KeySym sym = map[key_code * pDev->key->curKeySyms.mapWidth]; + KeySym sym; deviceKeyButtonPointer *kbp = NULL; + sym = map[(key_code - pDev->key->curKeySyms.minKeyCode) + * pDev->key->curKeySyms.mapWidth]; + if (!events) return 0; From 5659f6d31bc4dd2e79d13f4856cbfa3f120958ff Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Mon, 7 Jul 2008 13:14:49 +0200 Subject: [PATCH 02/24] Export xkbfile.h in the SDK It's needed by xkbsrv.h (cherry picked from commit d8af9d9ab1cd98c07fdf42490dcc0cab3c655b89) --- include/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/Makefile.am b/include/Makefile.am index 7d5fee70b..5edefe7b5 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -50,6 +50,7 @@ sdk_HEADERS = \ validate.h \ window.h \ windowstr.h \ + xkbfile.h \ xkbsrv.h \ xkbstr.h \ xorg-server.h @@ -58,4 +59,4 @@ endif AM_CFLAGS = $(DIX_CFLAGS) EXTRA_DIST = $(sdk_HEADERS) do-not-use-config.h dix-config.h xorg-config.h \ - xkb-config.h xkbfile.h + xkb-config.h From 5b546f1c493785c1f24a4f6c69174b70caa64eb1 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 14 Jul 2008 10:20:11 +0930 Subject: [PATCH 03/24] xfree86: append, not prepent, new input devices to xf86InputDevs. If devices are prepended to the list, their wake-up order on resume is not the same as the original initialisation order. Hot-plugged devices, originally inited last, are re-enabled before the xorg.conf devices and in some cases may steal the device files. Result: we have different devices before and after suspend/resume. RedHat Bug 439386 (cherry picked from commit 11ee0ae9390a608a232ff94abcc0cbcf9ed7b70a) --- hw/xfree86/common/xf86Helper.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index 1dd0bbc0d..475628b0c 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -308,12 +308,11 @@ xf86AllocateScrnInfoPrivateIndex(void) return idx; } -/* Allocate a new InputInfoRec and add it to the head xf86InputDevs. */ - +/* Allocate a new InputInfoRec and append it to the tail of xf86InputDevs. */ _X_EXPORT InputInfoPtr xf86AllocateInput(InputDriverPtr drv, int flags) { - InputInfoPtr new; + InputInfoPtr new, *prev = NULL; if (!(new = xcalloc(sizeof(InputInfoRec), 1))) return NULL; @@ -321,8 +320,13 @@ xf86AllocateInput(InputDriverPtr drv, int flags) new->drv = drv; drv->refCount++; new->module = DuplicateModule(drv->module, NULL); - new->next = xf86InputDevs; - xf86InputDevs = new; + + for (prev = &xf86InputDevs; *prev; prev = &(*prev)->next) + ; + + *prev = new; + new->next = NULL; + return new; } From 2b3faf2a75a1acc3b799a2868c55736c94a8183f Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Tue, 15 Jul 2008 10:36:38 -0400 Subject: [PATCH 04/24] Bug #16674: Make sure RANDR reports refresh as 0 if pixel clock is 0. (cherry picked from commit 9111944b292355f7478b4ae75bead8dc25edbbcb) --- hw/xfree86/common/xf86RandR.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/xfree86/common/xf86RandR.c b/hw/xfree86/common/xf86RandR.c index 4ee0d8b24..a55b93d4c 100644 --- a/hw/xfree86/common/xf86RandR.c +++ b/hw/xfree86/common/xf86RandR.c @@ -54,6 +54,8 @@ xf86RandRModeRefresh (DisplayModePtr mode) { if (mode->VRefresh) return (int) (mode->VRefresh + 0.5); + else if (mode->Clock == 0) + return 0; else return (int) (mode->Clock * 1000.0 / mode->HTotal / mode->VTotal + 0.5); } From 5cb38a3fcabb1b46fc24584f5e42d28a9a2dc703 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 23 Apr 2008 11:38:08 +0930 Subject: [PATCH 05/24] xfree86: don't free the config-file related information in DIDR. #15645 In DeleteInputDeviceRequest, leave the conf_idev (which is shared with xf86ConfigLayout.input) alone for devices that were specified in the ServerLayout section of the config file. This way, in the next server generation we are left with what was the original config and can thus re-init the devices. This is an addon to 6d22a9615a0e6ab3d00b0bcb22ff001b6ece02ae, an attempt to fix Bug 14418. X.Org Bug 15645 X.Org Bug 14418 (cherry picked from commit 9ab4e2fd8eaa87dbd16835affb1aa54dcb1a619e) --- hw/xfree86/common/xf86Init.c | 58 ++++++++++++++++------------------ hw/xfree86/common/xf86Xinput.c | 18 ++++++++--- 2 files changed, 42 insertions(+), 34 deletions(-) diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index 6d5eaadc3..68dc38772 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -1123,37 +1123,35 @@ InitInput(argc, argv) xf86Info.vtRequestsPending = FALSE; xf86Info.inputPending = FALSE; - if (serverGeneration == 1) { - /* Call the PreInit function for each input device instance. */ - for (pDev = xf86ConfigLayout.inputs; pDev && *pDev; pDev++) { - /* Replace obsolete keyboard driver with kbd */ - if (!xf86NameCmp((*pDev)->driver, "keyboard")) { - strcpy((*pDev)->driver, "kbd"); - } + /* Call the PreInit function for each input device instance. */ + for (pDev = xf86ConfigLayout.inputs; pDev && *pDev; pDev++) { + /* Replace obsolete keyboard driver with kbd */ + if (!xf86NameCmp((*pDev)->driver, "keyboard")) { + strcpy((*pDev)->driver, "kbd"); + } - if ((pDrv = xf86LookupInputDriver((*pDev)->driver)) == NULL) { - xf86Msg(X_ERROR, "No Input driver matching `%s'\n", (*pDev)->driver); - /* XXX For now, just continue. */ - continue; - } - if (!pDrv->PreInit) { - xf86MsgVerb(X_WARNING, 0, - "Input driver `%s' has no PreInit function (ignoring)\n", - pDrv->driverName); - continue; - } - pInfo = pDrv->PreInit(pDrv, *pDev, 0); - if (!pInfo) { - xf86Msg(X_ERROR, "PreInit returned NULL for \"%s\"\n", - (*pDev)->identifier); - continue; - } else if (!(pInfo->flags & XI86_CONFIGURED)) { - xf86Msg(X_ERROR, "PreInit failed for input device \"%s\"\n", - (*pDev)->identifier); - xf86DeleteInput(pInfo, 0); - continue; - } - } + if ((pDrv = xf86LookupInputDriver((*pDev)->driver)) == NULL) { + xf86Msg(X_ERROR, "No Input driver matching `%s'\n", (*pDev)->driver); + /* XXX For now, just continue. */ + continue; + } + if (!pDrv->PreInit) { + xf86MsgVerb(X_WARNING, 0, + "Input driver `%s' has no PreInit function (ignoring)\n", + pDrv->driverName); + continue; + } + pInfo = pDrv->PreInit(pDrv, *pDev, 0); + if (!pInfo) { + xf86Msg(X_ERROR, "PreInit returned NULL for \"%s\"\n", + (*pDev)->identifier); + continue; + } else if (!(pInfo->flags & XI86_CONFIGURED)) { + xf86Msg(X_ERROR, "PreInit failed for input device \"%s\"\n", + (*pDev)->identifier); + xf86DeleteInput(pInfo, 0); + continue; + } } /* Initialise all input devices. */ diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index d34238edc..710e787fd 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -448,6 +448,8 @@ DeleteInputDeviceRequest(DeviceIntPtr pDev) LocalDevicePtr pInfo = (LocalDevicePtr) pDev->public.devicePrivate; InputDriverPtr drv; IDevRec *idev; + BOOL found; + IDevPtr *it; if (pInfo) /* need to get these before RemoveDevice */ { @@ -464,10 +466,18 @@ DeleteInputDeviceRequest(DeviceIntPtr pDev) else xf86DeleteInput(pInfo, 0); - xfree(idev->driver); - xfree(idev->identifier); - xf86optionListFree(idev->commonOptions); - xfree(idev); + /* devices added through HAL aren't in the config layout */ + it = xf86ConfigLayout.inputs; + while(*it && *it != idev) + it++; + + if (!(*it)) /* end of list, not in the layout */ + { + xfree(idev->driver); + xfree(idev->identifier); + xf86optionListFree(idev->commonOptions); + xfree(idev); + } } /* From 476de585bee851ea592af043652aa7525bc8d3ce Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 24 Apr 2008 13:29:46 +0930 Subject: [PATCH 06/24] dix: NULL out WindowTable after freeing all the windows. CloseDownDevices() tries to send PresenceNotify events. If the windows are already freed, then we are accessing dangling pointers. (cherry picked from commit aec485f2dcc87b340759d67b60e7dee7931aaec5) --- dix/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dix/main.c b/dix/main.c index db4347341..6d9dd3332 100644 --- a/dix/main.c +++ b/dix/main.c @@ -458,7 +458,10 @@ main(int argc, char *argv[], char *envp[]) #endif config_fini(); + + memset(WindowTable, 0, MAXSCREENS * sizeof(WindowPtr)); CloseDownDevices(); + for (i = screenInfo.numScreens - 1; i >= 0; i--) { FreeScratchPixmapsForScreen(i); From 45f274415d8f7dfc18f395783cd7c5dbd4a43c4f Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 24 Apr 2008 13:30:28 +0930 Subject: [PATCH 07/24] Xi: don't attempt to send to a NULL window. Only applicable when the server comes down/restarts. In this case, WindowTable[i] may be NULL. Let's not try to send an event then. (cherry picked from commit f377141912594f87144d6d7f7fdd279a101d8e6c) --- Xi/exevents.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Xi/exevents.c b/Xi/exevents.c index c03f796b5..0b312f504 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -1284,6 +1284,8 @@ SendEventToAllWindows(DeviceIntPtr dev, Mask mask, xEvent * ev, int count) for (i = 0; i < screenInfo.numScreens; i++) { pWin = WindowTable[i]; + if (!pWin) + continue; (void)DeliverEventsToWindow(pWin, ev, count, mask, NullGrab, dev->id); p1 = pWin->firstChild; FindInterestedChildren(dev, p1, mask, ev, count); From a08ea64ded83f3781df769eec074d563b03a718f Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 2 Jun 2008 11:04:41 +0930 Subject: [PATCH 08/24] kdrive: don't post motion event if there was no motion. #16179 Based on the patch by Tomas Janousek. X.Org Bug 16179 (cherry picked from commit 26e7e69ab893d1f2b35213250ada40ec90944f62) --- hw/kdrive/src/kinput.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c index df73942e7..a7eae3f95 100644 --- a/hw/kdrive/src/kinput.c +++ b/hw/kdrive/src/kinput.c @@ -2078,7 +2078,7 @@ KdEnqueuePointerEvent(KdPointerInfo *pi, unsigned long flags, int rx, int ry, int (*matrix)[3] = kdPointerMatrix.matrix; unsigned long button; int n; - int dixflags; + int dixflags = 0; if (!pi) return; @@ -2109,11 +2109,15 @@ KdEnqueuePointerEvent(KdPointerInfo *pi, unsigned long flags, int rx, int ry, z = rz; if (flags & KD_MOUSE_DELTA) - dixflags = POINTER_RELATIVE & POINTER_ACCELERATE; - else - dixflags = POINTER_ABSOLUTE; + { + if (x || y || z) + dixflags = POINTER_RELATIVE & POINTER_ACCELERATE; + } else if (x != pi->dixdev->last.valuators[0] || + y != pi->dixdev->last.valuators[1]) + dixflags = POINTER_ABSOLUTE; - _KdEnqueuePointerEvent(pi, MotionNotify, x, y, z, 0, dixflags, FALSE); + if (dixflags) + _KdEnqueuePointerEvent(pi, MotionNotify, x, y, z, 0, dixflags, FALSE); buttons = flags; From a75cbabc25d67b6e03a0f8e5be82ae5ac3887096 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 17 Jul 2008 08:40:54 +0930 Subject: [PATCH 09/24] Revert "kdrive: don't post motion event if there was no motion. #16179" Just because it compiles on my machine doesn't make it right. Needs backported patch from http://bugs.freedesktop.org/show_bug.cgi?id=16179. This reverts commit a08ea64ded83f3781df769eec074d563b03a718f. --- hw/kdrive/src/kinput.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c index a7eae3f95..df73942e7 100644 --- a/hw/kdrive/src/kinput.c +++ b/hw/kdrive/src/kinput.c @@ -2078,7 +2078,7 @@ KdEnqueuePointerEvent(KdPointerInfo *pi, unsigned long flags, int rx, int ry, int (*matrix)[3] = kdPointerMatrix.matrix; unsigned long button; int n; - int dixflags = 0; + int dixflags; if (!pi) return; @@ -2109,15 +2109,11 @@ KdEnqueuePointerEvent(KdPointerInfo *pi, unsigned long flags, int rx, int ry, z = rz; if (flags & KD_MOUSE_DELTA) - { - if (x || y || z) - dixflags = POINTER_RELATIVE & POINTER_ACCELERATE; - } else if (x != pi->dixdev->last.valuators[0] || - y != pi->dixdev->last.valuators[1]) - dixflags = POINTER_ABSOLUTE; + dixflags = POINTER_RELATIVE & POINTER_ACCELERATE; + else + dixflags = POINTER_ABSOLUTE; - if (dixflags) - _KdEnqueuePointerEvent(pi, MotionNotify, x, y, z, 0, dixflags, FALSE); + _KdEnqueuePointerEvent(pi, MotionNotify, x, y, z, 0, dixflags, FALSE); buttons = flags; From 0baf677da6a724c2d8de46530622e1a186fa749e Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 2 Jun 2008 11:04:41 +0930 Subject: [PATCH 10/24] kdrive: don't post motion event if there was no motion. #16179 Based on the patch by Tomas Janousek. Backported version. X.Org Bug 16179 (cherry picked from commit 26e7e69ab893d1f2b35213250ada40ec90944f62) --- hw/kdrive/src/kinput.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c index df73942e7..80fcdde5a 100644 --- a/hw/kdrive/src/kinput.c +++ b/hw/kdrive/src/kinput.c @@ -2078,7 +2078,7 @@ KdEnqueuePointerEvent(KdPointerInfo *pi, unsigned long flags, int rx, int ry, int (*matrix)[3] = kdPointerMatrix.matrix; unsigned long button; int n; - int dixflags; + int dixflags = 0; if (!pi) return; @@ -2109,11 +2109,15 @@ KdEnqueuePointerEvent(KdPointerInfo *pi, unsigned long flags, int rx, int ry, z = rz; if (flags & KD_MOUSE_DELTA) - dixflags = POINTER_RELATIVE & POINTER_ACCELERATE; - else - dixflags = POINTER_ABSOLUTE; + { + if (x || y || z) + dixflags = POINTER_RELATIVE | POINTER_ACCELERATE; + } else if ((pi->dixdev->valuator) && (x != pi->dixdev->valuator->lastx || + y != pi->dixdev->valuator->lasty)) + dixflags = POINTER_ABSOLUTE; - _KdEnqueuePointerEvent(pi, MotionNotify, x, y, z, 0, dixflags, FALSE); + if (dixflags) + _KdEnqueuePointerEvent(pi, MotionNotify, x, y, z, 0, dixflags, FALSE); buttons = flags; From 7f542ab37fe0795fa04ea647b0ff3b9b886758f6 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 4 Jul 2008 07:29:32 +1000 Subject: [PATCH 11/24] modes: fix initial xorg.conf mode selection. This was all kinds of broken, we ignored user preferred modes for multiple monitors and also for side-by-side configurations. (cherry picked from commit 0b9ef835a0fe900c121b84e43989591e58ab1126) --- hw/xfree86/modes/xf86Crtc.c | 51 +++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index ea452dfd5..91ba1b728 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -997,6 +997,54 @@ xf86DefaultScreenLimits (ScrnInfoPtr scrn, int *widthp, int *heightp, #define POSITION_UNSET -100000 +/* + * check if the user configured any outputs at all + * with either a position or a relative setting or a mode. + */ +static Bool +xf86UserConfiguredOutputs(ScrnInfoPtr scrn, DisplayModePtr *modes) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + int o; + Bool user_conf = FALSE; + + for (o = 0; o < config->num_output; o++) + { + xf86OutputPtr output = config->output[o]; + char *position; + char *relative_name; + OutputOpts relation; + int r; + static const OutputOpts relations[] = { + OPTION_BELOW, OPTION_RIGHT_OF, OPTION_ABOVE, OPTION_LEFT_OF + }; + + position = xf86GetOptValString (output->options, + OPTION_POSITION); + if (position) + user_conf = TRUE; + + relation = 0; + relative_name = NULL; + for (r = 0; r < 4; r++) + { + relation = relations[r]; + relative_name = xf86GetOptValString (output->options, + relation); + if (relative_name) + break; + } + if (relative_name) + user_conf = TRUE; + + modes[o] = xf86OutputHasUserPreferredMode(output); + if (modes[o]) + user_conf = TRUE; + } + + return user_conf; +} + static Bool xf86InitialOutputPositions (ScrnInfoPtr scrn, DisplayModePtr *modes) { @@ -1984,6 +2032,9 @@ xf86TargetUserpref(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, { int o; + if (xf86UserConfiguredOutputs(scrn, modes)) + return xf86TargetFallback(scrn, config, modes, enabled, width, height); + for (o = -1; nextEnabledOutput(config, enabled, &o); ) if (xf86OutputHasUserPreferredMode(config->output[o])) return From ceffece78b828c30a144affa437cd5ae2021a342 Mon Sep 17 00:00:00 2001 From: Eamon Walsh Date: Fri, 20 Jun 2008 23:49:32 -0400 Subject: [PATCH 12/24] Fix "warning: passing argument 1 of `modeIsPresent' from incompatible pointer type". (cherry picked from commit 95d4ede538fbb68049ba3efa0acb0e9712e5cb01) --- hw/xfree86/common/xf86Config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 8e30c84c9..fde3a9c74 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -2418,14 +2418,14 @@ configInput(IDevPtr inputp, XF86ConfInputPtr conf_input, MessageType from) } static Bool -modeIsPresent(char * modename,MonPtr monitorp) +modeIsPresent(DisplayModePtr mode, MonPtr monitorp) { DisplayModePtr knownmodes = monitorp->Modes; /* all I can think of is a linear search... */ while(knownmodes != NULL) { - if(!strcmp(modename,knownmodes->name) && + if(!strcmp(mode->name, knownmodes->name) && !(knownmodes->type & M_T_DEFAULT)) return TRUE; knownmodes = knownmodes->next; From e4cfdc07f4ef2e42762f0296936bbe776b4b7fbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Mon, 21 Jul 2008 15:28:50 -0400 Subject: [PATCH 13/24] Fix embarrasing GLXPixmap leak. (cherry picked from commit d5ae85b5b722821499d5796cf0973ecb6ec125f1) --- glx/glxcmds.c | 4 ---- glx/glxext.c | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/glx/glxcmds.c b/glx/glxcmds.c index dcd83525f..0c2a95ef9 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -1223,10 +1223,6 @@ static int DoDestroyDrawable(__GLXclientState *cl, XID glxdrawable, int type) } } - if (type == GLX_DRAWABLE_PIXMAP) { - ((PixmapPtr) pGlxDraw->pDraw)->refcnt--; - } - FreeResource(glxdrawable, FALSE); return Success; diff --git a/glx/glxext.c b/glx/glxext.c index 85d8debd4..cd92f6d0a 100644 --- a/glx/glxext.c +++ b/glx/glxext.c @@ -107,6 +107,11 @@ static int ContextGone(__GLXcontext* cx, XID id) */ static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid) { + ScreenPtr pScreen = glxPriv->pDraw->pScreen; + + if (glxPriv->type == GLX_DRAWABLE_PIXMAP) + (*pScreen->DestroyPixmap)((PixmapPtr) glxPriv->pDraw); + glxPriv->pDraw = NULL; glxPriv->drawId = 0; __glXUnrefDrawable(glxPriv); From 2d6022bd4001190df97b5320dccb306a78d7ca21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Mon, 21 Jul 2008 16:05:53 -0400 Subject: [PATCH 14/24] Need to unref pixmaps backing pbuffers too. (cherry picked from commit facb255fa9267e343cbc91f841f1b64e5dc99e98) --- glx/glxext.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/glx/glxext.c b/glx/glxext.c index cd92f6d0a..13c65dade 100644 --- a/glx/glxext.c +++ b/glx/glxext.c @@ -109,8 +109,12 @@ static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid) { ScreenPtr pScreen = glxPriv->pDraw->pScreen; - if (glxPriv->type == GLX_DRAWABLE_PIXMAP) + switch (glxPriv->type) { + case GLX_DRAWABLE_PIXMAP: + case GLX_DRAWABLE_PBUFFER: (*pScreen->DestroyPixmap)((PixmapPtr) glxPriv->pDraw); + break; + } glxPriv->pDraw = NULL; glxPriv->drawId = 0; From ff1a9b7fea2cfe00bc02a99b919fa1178d4f0b12 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 23 Jul 2008 16:53:59 +0930 Subject: [PATCH 15/24] xkb: don't send core events for extension devices on SlowKey timeout. RedHat Bug 448604 --- xkb/xkbAccessX.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c index 75b8c5a27..89be839d0 100644 --- a/xkb/xkbAccessX.c +++ b/xkb/xkbAccessX.c @@ -352,7 +352,9 @@ XkbControlsPtr ctrls; XkbSendAccessXNotify(keybd,&ev); if (XkbAX_NeedFeedback(ctrls,XkbAX_SKAcceptFBMask)) XkbDDXAccessXBeep(keybd,_BEEP_SLOW_ACCEPT,XkbSlowKeysMask); - AccessXKeyboardEvent(keybd,KeyPress,xkbi->slowKey,False); + AccessXKeyboardEvent(keybd, + (keybd == inputInfo.keyboard) ? KeyPress : DeviceKeyPress, + xkbi->slowKey,False); /* check for magic sequences */ if ((ctrls->enabled_ctrls&XkbAccessXKeysMask) && ((sym[0]==XK_Shift_R)||(sym[0]==XK_Shift_L))) From 14a033f0321b3869f0cbedd344bc0f71738fd052 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Tue, 10 Jun 2008 15:40:48 +0200 Subject: [PATCH 16/24] glx: copy msaa visual capabilities (cherry picked from commit 49751fee3b82ebc4917bfb168ec78aad7874f1f1) --- glx/glxcmds.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/glx/glxcmds.c b/glx/glxcmds.c index 0c2a95ef9..083113584 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -943,11 +943,11 @@ int __glXDisp_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc) buf[p++] = modes->transparentAlpha; buf[p++] = GLX_TRANSPARENT_INDEX_VALUE; buf[p++] = modes->transparentIndex; - buf[p++] = 0; - buf[p++] = 0; - buf[p++] = 0; - buf[p++] = 0; - buf[p++] = 0; + buf[p++] = GLX_SAMPLES_SGIS; + buf[p++] = modes->samples; + buf[p++] = GLX_SAMPLE_BUFFERS_SGIS; + buf[p++] = modes->sampleBuffers; + buf[p++] = 0; /* copy over visualSelectGroup (GLX_VISUAL_SELECT_GROUP_SGIX)? */ buf[p++] = 0; if (client->swapped) { @@ -959,7 +959,7 @@ int __glXDisp_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc) return Success; } -#define __GLX_TOTAL_FBCONFIG_ATTRIBS (33) +#define __GLX_TOTAL_FBCONFIG_ATTRIBS (35) #define __GLX_FBCONFIG_ATTRIBS_LENGTH (__GLX_TOTAL_FBCONFIG_ATTRIBS * 2) /** * Send the set of GLXFBConfigs to the client. There is not currently @@ -1037,6 +1037,9 @@ DoGetFBConfigs(__GLXclientState *cl, unsigned screen) WRITE_PAIR( GLX_TRANSPARENT_ALPHA_VALUE, modes->transparentAlpha ); WRITE_PAIR( GLX_TRANSPARENT_INDEX_VALUE, modes->transparentIndex ); WRITE_PAIR( GLX_SWAP_METHOD_OML, modes->swapMethod ); + WRITE_PAIR( GLX_SAMPLES_SGIS, modes->samples ); + WRITE_PAIR( GLX_SAMPLE_BUFFERS_SGIS, modes->sampleBuffers ); + /* GLX_VISUAL_SELECT_GROUP_SGIX ? */ WRITE_PAIR( GLX_DRAWABLE_TYPE, modes->drawableType ); WRITE_PAIR( GLX_BIND_TO_TEXTURE_RGB_EXT, modes->bindToTextureRgb ); WRITE_PAIR( GLX_BIND_TO_TEXTURE_RGBA_EXT, modes->bindToTextureRgba ); From c217cb96dccb39ffd689086b6d833a1963dfb661 Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Wed, 23 Jul 2008 01:00:26 +0200 Subject: [PATCH 17/24] [Xephyr] Fix #15839 Make sure the _XSERVER64 macro is not defined in Xlib client code. That macro is meant to be define only on pure server code, when necessary. (cherry picked from commit 5de1867fbb0a336ff3fdc92cbf734849f6111b1b) --- hw/kdrive/ephyr/XF86dri.c | 10 ++++++++++ hw/kdrive/ephyr/ephyrhostglx.c | 11 +++++++++++ hw/kdrive/ephyr/ephyrhostvideo.c | 10 ++++++++++ hw/kdrive/ephyr/hostx.c | 12 ++++++++++++ 4 files changed, 43 insertions(+) diff --git a/hw/kdrive/ephyr/XF86dri.c b/hw/kdrive/ephyr/XF86dri.c index e656ff5a0..63e630c9c 100644 --- a/hw/kdrive/ephyr/XF86dri.c +++ b/hw/kdrive/ephyr/XF86dri.c @@ -45,6 +45,16 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifdef HAVE_CONFIG_H #include #endif +/* + * including some server headers (like kdrive-config.h) + * might define the macro _XSERVER64 + * on 64 bits machines. That macro must _NOT_ be defined for Xlib + * client code, otherwise bad things happen. + * So let's undef that macro if necessary. + */ +#ifdef _XSERVER64 +#undef _XSERVER64 +#endif #ifdef XEPHYR_DRI diff --git a/hw/kdrive/ephyr/ephyrhostglx.c b/hw/kdrive/ephyr/ephyrhostglx.c index f5db5be16..1eec4e02b 100644 --- a/hw/kdrive/ephyr/ephyrhostglx.c +++ b/hw/kdrive/ephyr/ephyrhostglx.c @@ -31,6 +31,17 @@ #include #endif +/* + * including some server headers (like kdrive-config.h) + * might define the macro _XSERVER64 + * on 64 bits machines. That macro must _NOT_ be defined for Xlib + * client code, otherwise bad things happen. + * So let's undef that macro if necessary. + */ +#ifdef _XSERVER64 +#undef _XSERVER64 +#endif + #include #include #include diff --git a/hw/kdrive/ephyr/ephyrhostvideo.c b/hw/kdrive/ephyr/ephyrhostvideo.c index 562c2a4e8..41c0b755b 100644 --- a/hw/kdrive/ephyr/ephyrhostvideo.c +++ b/hw/kdrive/ephyr/ephyrhostvideo.c @@ -28,6 +28,16 @@ #ifdef HAVE_CONFIG_H #include #endif +/* + * including some server headers (like kdrive-config.h) + * might define the macro _XSERVER64 + * on 64 bits machines. That macro must _NOT_ be defined for Xlib + * client code, otherwise bad things happen. + * So let's undef that macro if necessary. + */ +#ifdef _XSERVER64 +#undef _XSERVER64 +#endif #include #include #include diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c index 1a71d0641..c870a291d 100644 --- a/hw/kdrive/ephyr/hostx.c +++ b/hw/kdrive/ephyr/hostx.c @@ -27,6 +27,18 @@ #include #endif +/* + * including some server headers (like kdrive-config.h) + * might define the macro _XSERVER64 + * on 64 bits machines. That macro must _NOT_ be defined for Xlib + * client code, otherwise bad things happen. + * So let's undef that macro if necessary. + */ +#ifdef _XSERVER64 +#undef _XSERVER64 +#endif + + #include "hostx.h" #include From e909a396194e64119d04fc6ecb68ddc4265a3e49 Mon Sep 17 00:00:00 2001 From: "Pierre-Loup A. Griffais" Date: Tue, 22 Jul 2008 17:34:37 -0700 Subject: [PATCH 18/24] Don't return BadAlloc when trying to set a PictureFilter with no parameters when a filter with parameters was previously set. Signed-off-by: Aaron Plattner (cherry picked from commit bc3c03a3f3c091026310f0e8d55321cec570a0c5) --- render/filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/render/filter.c b/render/filter.c index 092313f6e..aa3eb1a9e 100644 --- a/render/filter.c +++ b/render/filter.c @@ -301,7 +301,7 @@ SetPictureFilter (PicturePtr pPicture, char *name, int len, xFixed *params, int if (nparams != pPicture->filter_nparams) { new_params = xalloc (nparams * sizeof (xFixed)); - if (!new_params) + if (!new_params && nparams) return BadAlloc; xfree (pPicture->filter_params); pPicture->filter_params = new_params; From c0c73e9236cffece7c8049515b03facb41f12f0e Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Wed, 23 Jul 2008 14:16:47 -0400 Subject: [PATCH 19/24] xserver 1.4.99.906 You know, Mesa 7.1 could release any day now and that'd be just fine. --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index a9b165117..2a8ef8dd0 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,8 @@ dnl dnl Process this file with autoconf to create configure. AC_PREREQ(2.57) -AC_INIT([xorg-server], 1.4.99.905, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) +RELEASE_DATE="23 July 2008" +AC_INIT([xorg-server], 1.4.99.906, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) AC_CONFIG_SRCDIR([Makefile.am]) AM_INIT_AUTOMAKE([dist-bzip2 foreign]) AM_MAINTAINER_MODE @@ -418,7 +419,6 @@ VENDOR_MAN_VERSION="Version ${PACKAGE_VERSION}" VENDOR_NAME="The X.Org Foundation" VENDOR_NAME_SHORT="X.Org" -RELEASE_DATE="5 September 2007" VENDOR_WEB="http://wiki.x.org" m4_ifdef([AS_HELP_STRING], , [m4_define([AS_HELP_STRING], m4_defn([AC_HELP_STRING]))]) From 37927b8bfa78670b263311ae1f06d2aae973601d Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Tue, 29 Jul 2008 02:51:57 +0300 Subject: [PATCH 20/24] Revert "Xi: event_{x,y} should refer to the extended device (bug #16289)" After discussion with Peter, realised that diverging from 1.3 and 1.4's behaviour was daft and insane. Sorry. This reverts commit 8259d19f7155d82197ecc2aa16b316376c2dcb12. --- Xi/exevents.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Xi/exevents.c b/Xi/exevents.c index 0b312f504..641bead33 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -123,14 +123,9 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr other, int count) deviceValuator *xV = (deviceValuator *) xE; if (xE->u.u.type != DeviceValuator) { - /* Other types already have root{X,Y} filled in. */ - if (xE->u.u.type == DeviceKeyPress || - xE->u.u.type == DeviceKeyRelease) { - GetSpritePosition(&rootX, &rootY); - xE->u.keyButtonPointer.rootX = rootX; - xE->u.keyButtonPointer.rootY = rootY; - } - + GetSpritePosition(&rootX, &rootY); + xE->u.keyButtonPointer.rootX = rootX; + xE->u.keyButtonPointer.rootY = rootY; key = xE->u.u.detail; NoticeEventTime(xE); xE->u.keyButtonPointer.state = inputInfo.keyboard->key->state | From 538942cc65b5a112739fb94e57b3be963cf50873 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 24 Jul 2008 09:56:00 +0930 Subject: [PATCH 21/24] xfree86: if AllowEmptyInput is on, warn the user that we rely on HAL now. (cherry picked from commit f30b0823dbfc5902e54b337b5b6b570ebf216584) --- hw/xfree86/common/xf86Config.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index fde3a9c74..1052e2153 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -2460,6 +2460,13 @@ static void checkInput(serverLayoutPtr layout) { if (!xf86Info.allowEmptyInput) checkCoreInputDevices(layout, FALSE); + else + { + xf86Msg(X_INFO, "AllowEmptyInput is on.\n" + "\tThe server relies on HAL to provide the list of input " + "devices.\n\tIf no devices become available, reconfigure " + "HAL.\n"); + } } /* From d199d800a41f8a6ba044c3f8a3777dec7881e89a Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 24 Jul 2008 12:12:45 +0930 Subject: [PATCH 22/24] xfree86: warn some more about potential missing input devices. Put out a warning if xorg.conf has InputDevice sections, but these aren't referenced in the used ServerLayout. This is only performed if AllowEmptyInput is enabled. The reason behind this is that the server used to auto-add the first mouse/keyboard sections if none where referenced. Now, with HAL and AEI enabled by default, setups that relied on this auto-adding break and are left without input devices. The least we can do is warn them. (cherry picked from commit 47160edec7f0d9129576d83f1593a5549879a893) --- hw/xfree86/common/xf86Config.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 1052e2153..3021cb7cc 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -2466,6 +2466,16 @@ checkInput(serverLayoutPtr layout) { "\tThe server relies on HAL to provide the list of input " "devices.\n\tIf no devices become available, reconfigure " "HAL.\n"); + if (!layout->inputs || !*layout->inputs) + { + /* No input device specified in ServerLayout. */ + if (xf86configptr->conf_input_lst && + xf86configptr->conf_input_lst->inp_identifier) + xf86Msg(X_WARNING, "Input devices specified in xorg.conf, but" + " not referenced in ServerLayout.\n\tThese devices" + " will NOT be available.\n"); + } + } } From da29a25315b5dc0df4f6e221cf81587efffce4c6 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 29 Jul 2008 10:04:24 +0930 Subject: [PATCH 23/24] Require inputproto 1.4.4 for DeviceControlChanged define. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 2a8ef8dd0..4bf86b35e 100644 --- a/configure.ac +++ b/configure.ac @@ -662,7 +662,7 @@ else RENDERPROTO="renderproto" fi -REQUIRED_MODULES="[randrproto >= 1.2] $RENDERPROTO [fixesproto >= 4.0] [damageproto >= 1.1] xcmiscproto xextproto [xproto >= 7.0.9] xtrans [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto [inputproto >= 1.4.2] [kbproto >= 1.0.3]" +REQUIRED_MODULES="[randrproto >= 1.2] $RENDERPROTO [fixesproto >= 4.0] [damageproto >= 1.1] xcmiscproto xextproto [xproto >= 7.0.9] xtrans [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto [inputproto >= 1.4.4] [kbproto >= 1.0.3]" REQUIRED_LIBS="xfont xau fontenc [pixman-1 >= 0.9.5]" dnl HAVE_DBUS is true if we actually have the D-Bus library, whereas From b6024da70404fe1879f1de079e69611fea45a40e Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 29 Jul 2008 10:00:01 +0930 Subject: [PATCH 24/24] Xi: ChangeDeviceControl presence events should set the appropriate devchange. Requires inputproto 1.4.4 or higher. (cherry picked from commit 591ef3c047ab3597fef9d687205e99c254ff2040) --- Xi/chgdctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xi/chgdctl.c b/Xi/chgdctl.c index 89410d68f..8df40fea0 100644 --- a/Xi/chgdctl.c +++ b/Xi/chgdctl.c @@ -287,7 +287,7 @@ out: if (ret == Success) { dpn.type = DevicePresenceNotify; dpn.time = currentTime.milliseconds; - dpn.devchange = 1; + dpn.devchange = DeviceControlChanged; dpn.deviceid = dev->id; dpn.control = stuff->control; SendEventToAllWindows(dev, DevicePresenceNotifyMask,