From 199bb367152d68e784dfbec79ab9b70540d83fc2 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 20 Apr 2009 18:20:52 -0700 Subject: [PATCH 01/25] DRI2: Send the version the code actually supports This prevents building an older server with a new dri2proto.h from resulting in a DRI2 extension module that lies about the version it supports. Signed-off-by: Ian Romanick (cherry picked from commit 44227ef1b77467c76147b9bf79bdd0e6305a522a) Signed-off-by: Keith Packard --- hw/xfree86/dri2/dri2ext.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/dri2/dri2ext.c b/hw/xfree86/dri2/dri2ext.c index 0a1dce49d..1409777e4 100644 --- a/hw/xfree86/dri2/dri2ext.c +++ b/hw/xfree86/dri2/dri2ext.c @@ -80,8 +80,8 @@ ProcDRI2QueryVersion(ClientPtr client) rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; - rep.majorVersion = DRI2_MAJOR; - rep.minorVersion = DRI2_MINOR; + rep.majorVersion = 1; + rep.minorVersion = 0; if (client->swapped) { swaps(&rep.sequenceNumber, n); From 5198ff6f86e4796819c0d1f742de57a69228c93b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Fri, 27 Feb 2009 16:37:28 +0100 Subject: [PATCH 02/25] EXA: Handle separate alpha maps properly in Composite fallback, take two. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Preserve the EXA ABI by introducing a new driver flag EXA_SUPPORTS_PREPARE_AUX. If the driver doesn't set this flag, we have to assume any Prepare/FinishAccess driver hooks can't handle the EXA_PREPARE_AUX* indices, so we move out such pixmaps at PrepareAccess time. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=18710 . Signed-off-by: Michel Dänzer (cherry picked from commit 4cfb36f6ad2df01215028fec48d99239a0e4496b) Signed-off-by: Keith Packard --- exa/exa.c | 13 +++++++++++++ exa/exa.h | 14 ++++++++++++++ exa/exa_unaccel.c | 25 ++++++++++++++++++++++++- 3 files changed, 51 insertions(+), 1 deletion(-) diff --git a/exa/exa.c b/exa/exa.c index 9b7091d1c..270810766 100644 --- a/exa/exa.c +++ b/exa/exa.c @@ -511,6 +511,12 @@ ExaDoPrepareAccess(DrawablePtr pDrawable, int index) if (pExaScr->info->PrepareAccess == NULL) return; + if (index >= EXA_PREPARE_AUX0 && + !(pExaScr->info->flags & EXA_SUPPORTS_PREPARE_AUX)) { + exaMoveOutPixmap (pPixmap); + return; + } + if (!(*pExaScr->info->PrepareAccess) (pPixmap, index)) { ExaPixmapPriv (pPixmap); if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED) @@ -570,6 +576,13 @@ exaFinishAccess(DrawablePtr pDrawable, int index) if (!exaPixmapIsOffscreen (pPixmap)) return; + if (index >= EXA_PREPARE_AUX0 && + !(pExaScr->info->flags & EXA_SUPPORTS_PREPARE_AUX)) { + ErrorF("EXA bug: Trying to call driver FinishAccess hook with " + "unsupported index EXA_PREPARE_AUX*\n"); + return; + } + (*pExaScr->info->FinishAccess) (pPixmap, index); } diff --git a/exa/exa.h b/exa/exa.h index 5982e1ae7..4a96cc6f3 100644 --- a/exa/exa.h +++ b/exa/exa.h @@ -672,6 +672,13 @@ typedef struct _ExaDriver { * from. */ #define EXA_PREPARE_MASK 2 + /** + * EXA_PREPARE_AUX* are additional indices for other purposes, e.g. + * separate alpha maps with Composite operations. + */ + #define EXA_PREPARE_AUX0 3 + #define EXA_PREPARE_AUX1 4 + #define EXA_PREPARE_AUX2 5 /** @} */ /** @@ -742,6 +749,13 @@ typedef struct _ExaDriver { */ #define EXA_HANDLES_PIXMAPS (1 << 3) +/** + * EXA_SUPPORTS_PREPARE_AUX indicates to EXA that the driver can handle the + * EXA_PREPARE_AUX* indices in the Prepare/FinishAccess hooks. If there are no + * such hooks, this flag has no effect. + */ +#define EXA_SUPPORTS_PREPARE_AUX (1 << 4) + /** @} */ /* in exa.c */ diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c index c03048602..2beeb443e 100644 --- a/exa/exa_unaccel.c +++ b/exa/exa_unaccel.c @@ -309,6 +309,15 @@ ExaCheckComposite (CARD8 op, REGION_NULL(pScreen, ®ion); + /* We need to prepare access to any separate alpha maps first, in case the + * driver doesn't support EXA_PREPARE_AUX*, in which case EXA_PREPARE_SRC + * may be used for moving them out. + */ + if (pSrc->alphaMap && pSrc->alphaMap->pDrawable) + exaPrepareAccess(pSrc->alphaMap->pDrawable, EXA_PREPARE_AUX2); + if (pMask && pMask->alphaMap && pMask->alphaMap->pDrawable) + exaPrepareAccess(pMask->alphaMap->pDrawable, EXA_PREPARE_AUX1); + if (!exaOpReadsDestination(op)) { if (!miComputeCompositeRegion (®ion, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, @@ -321,9 +330,17 @@ ExaCheckComposite (CARD8 op, REGION_TRANSLATE(pScreen, ®ion, xoff, yoff); + if (pDst->alphaMap && pDst->alphaMap->pDrawable) + exaPrepareAccessReg(pDst->alphaMap->pDrawable, EXA_PREPARE_AUX0, + ®ion); + exaPrepareAccessReg (pDst->pDrawable, EXA_PREPARE_DEST, ®ion); - } else + } else { + if (pDst->alphaMap && pDst->alphaMap->pDrawable) + exaPrepareAccess(pDst->alphaMap->pDrawable, EXA_PREPARE_AUX0); + exaPrepareAccess (pDst->pDrawable, EXA_PREPARE_DEST); + } EXA_FALLBACK(("from picts %p/%p to pict %p\n", pSrc, pMask, pDst)); @@ -346,9 +363,15 @@ ExaCheckComposite (CARD8 op, height); if (pMask && pMask->pDrawable != NULL) exaFinishAccess (pMask->pDrawable, EXA_PREPARE_MASK); + if (pMask && pMask->alphaMap && pMask->alphaMap->pDrawable) + exaFinishAccess(pMask->alphaMap->pDrawable, EXA_PREPARE_AUX1); if (pSrc->pDrawable != NULL) exaFinishAccess (pSrc->pDrawable, EXA_PREPARE_SRC); + if (pSrc->alphaMap && pSrc->alphaMap->pDrawable) + exaFinishAccess(pSrc->alphaMap->pDrawable, EXA_PREPARE_AUX2); exaFinishAccess (pDst->pDrawable, EXA_PREPARE_DEST); + if (pDst->alphaMap && pDst->alphaMap->pDrawable) + exaFinishAccess(pDst->alphaMap->pDrawable, EXA_PREPARE_AUX0); REGION_UNINIT(pScreen, ®ion); } From 24dc7694a2ba72d45cda7720aeaec8350930edc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Fri, 6 Feb 2009 11:37:53 +0100 Subject: [PATCH 03/25] EXA: Guard empty pending region warning by DEBUG_MIGRATE. It isn't very useful yet while the damage layer calls us for empty operations, mostly confuses users. (cherry picked from commit 3948b523893d3d44b6a088340c4252e969613769) Signed-off-by: Keith Packard --- exa/exa_migration.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/exa/exa_migration.c b/exa/exa_migration.c index 571650c83..4623eccdd 100644 --- a/exa/exa_migration.c +++ b/exa/exa_migration.c @@ -162,6 +162,7 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc, if (pExaScr->optimize_migration) { RegionPtr pending_damage = DamagePendingRegion(pExaPixmap->pDamage); +#if DEBUG_MIGRATE if (REGION_NIL(pending_damage)) { static Bool firsttime = TRUE; @@ -170,6 +171,7 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc, firsttime = FALSE; } } +#endif REGION_INTERSECT(pScreen, &CopyReg, &CopyReg, pending_damage); } From 0df12a3f01c953c0908b4b53a93fd3a5c704f69b Mon Sep 17 00:00:00 2001 From: Ander Conselvan de Oliveira Date: Mon, 6 Apr 2009 16:01:20 -0300 Subject: [PATCH 04/25] xfree86: Remove device from inputInfo.devices if ActivateDevice failed. After the call to xf86ActivateDevice, the new device will be added to inputInfo.devices. However, if the subsequent call to ActivateDevice fails, the correponding InputInfoRec for the device is deleted but an entry still remains in inputInfo.devices. This might lead to a server crash later on (on InitAndStartDevices for instance) when the device control proc would be called for an invalid device. (cherry picked from commit efa31092d6703397121a0ada4f7205a8ecad3d3d) Signed-off-by: Peter Hutterer Signed-off-by: Keith Packard --- hw/xfree86/common/xf86Xinput.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 96352a46d..1f412349c 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -543,7 +543,11 @@ xf86NewInputDevice(IDevPtr idev, DeviceIntPtr *pdev, BOOL enable) dev = pInfo->dev; rval = ActivateDevice(dev); if (rval != Success) + { + xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", idev->identifier); + RemoveDevice(dev); goto unwind; + } /* Enable it if it's properly initialised and we're currently in the VT */ if (enable && dev->inited && dev->startup && xf86Screens[0]->vtSema) From b7b520e3a93fde5579c48eabb9b8c694a7dfbcb1 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Wed, 24 Dec 2008 14:23:37 +0100 Subject: [PATCH 05/25] Add XI 1.5 event and requests to protocol.txt (cherry picked from commit 063833f3a6d9f8f657e3de309c8d6d5c3d606513) Signed-off-by: Keith Packard --- dix/protocol.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dix/protocol.txt b/dix/protocol.txt index c085fde24..985f67b87 100644 --- a/dix/protocol.txt +++ b/dix/protocol.txt @@ -937,6 +937,10 @@ R032 XInputExtension:DeviceBell R033 XInputExtension:SetDeviceValuators R034 XInputExtension:GetDeviceControl R035 XInputExtension:ChangeDeviceControl +R036 XInputExtension:ListDeviceProperties +R037 XInputExtension:ChangeDeviceProperty +R038 XInputExtension:DeleteDeviceProperty +R039 XInputExtension:GetDeviceProperty V000 XInputExtension:DeviceValuator V001 XInputExtension:DeviceKeyPress V002 XInputExtension:DeviceKeyRelease @@ -953,6 +957,7 @@ V012 XInputExtension:ChangeDeviceNotify V013 XInputExtension:DeviceKeystateNotify V014 XInputExtension:DeviceButtonstateNotify V015 XInputExtension:DevicePresenceNotify +V016 XInputExtension:DevicePropertyNotify E000 XInputExtension:BadDevice E001 XInputExtension:BadEvent E002 XInputExtension:BadMode From 96eede556ac9f95204fa54287f74794acdbf3a2b Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Wed, 24 Dec 2008 14:17:27 +0100 Subject: [PATCH 06/25] Add RandR 1.3 requests to protocol.txt (cherry picked from commit 4f86ee61a4abf7a29e565d095aa08abd0ca9dc66) Signed-off-by: Keith Packard --- dix/protocol.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dix/protocol.txt b/dix/protocol.txt index 985f67b87..364f13e31 100644 --- a/dix/protocol.txt +++ b/dix/protocol.txt @@ -296,6 +296,13 @@ R021 RANDR:SetCrtcConfig R022 RANDR:GetCrtcGammaSize R023 RANDR:GetCrtcGamma R024 RANDR:SetCrtcGamma +R025 RANDR:GetScreenResourcesCurrent +R026 RANDR:SetCrtcTransform +R027 RANDR:GetCrtcTransform +R028 RANDR:GetPanning +R029 RANDR:SetPanning +R030 RANDR:SetOutputPrimary +R031 RANDR:GetOutputPrimary V000 RANDR:ScreenChangeNotify V001 RANDR:Notify E000 RANDR:BadRROutput From b3c42e6450b0af97ead4f410983c803a959e1d04 Mon Sep 17 00:00:00 2001 From: Tormod Volden Date: Wed, 1 Apr 2009 19:32:21 +0200 Subject: [PATCH 07/25] xfree86: edid quirk for Philips LCD LP154W01-TLAJ This panel reports its vertical size in cm. X.Org bug#21000 Signed-off-by: Tormod Volden Signed-off-by: Julien Cristau (cherry picked from commit b1dab580bdfb4acfe3feddeda6e760098ec4922a) Signed-off-by: Keith Packard --- hw/xfree86/modes/xf86EdidModes.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c index 5ed61c1d0..92eb196de 100644 --- a/hw/xfree86/modes/xf86EdidModes.c +++ b/hw/xfree86/modes/xf86EdidModes.c @@ -155,6 +155,11 @@ static Bool quirk_detailed_v_in_cm (int scrnIndex, xf86MonPtr DDC) DDC->vendor.prod_id == 13600) return TRUE; + /* Bug #21000: LGPhilipsLCD LP154W01-TLAJ */ + if (memcmp (DDC->vendor.name, "LPL", 4) == 0 && + DDC->vendor.prod_id == 47360) + return TRUE; + return FALSE; } From eac2b3658aacc8a64dc3c0fd7cc8fd77abcc59af Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Wed, 22 Apr 2009 20:01:49 +0200 Subject: [PATCH 08/25] Bug#21324: Add quirk for Iiyama Vision Master 450 Reported-by: Jeremy Henty Signed-off-by: Julien Cristau (cherry picked from commit 0dfb97f15f591f85e079f5829c77d0c328d00464) Signed-off-by: Keith Packard --- hw/xfree86/modes/xf86EdidModes.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c index 92eb196de..54f2c6570 100644 --- a/hw/xfree86/modes/xf86EdidModes.c +++ b/hw/xfree86/modes/xf86EdidModes.c @@ -170,6 +170,11 @@ static Bool quirk_detailed_use_maximum_size (int scrnIndex, xf86MonPtr DDC) (DDC->vendor.prod_id == 0 || DDC->vendor.prod_id == 0x2a00)) return TRUE; + /* Bug #21324: Iiyama Vision Master 450 */ + if (memcmp (DDC->vendor.name, "IVM", 4) == 0 && + DDC->vendor.prod_id == 6400) + return TRUE; + return FALSE; } From fdbb6fd3d3c0ce7078f8faaf089af51cc36cbcb3 Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Mon, 4 May 2009 15:38:22 -0700 Subject: [PATCH 09/25] Don't prepare outputs & crtcs if set_mode_major is present A driver with this hook will take care of preparing the outputs & crtcs, so calling the prepare functions will just cause unnecessary flicker. Fixes bug #21077 (cherry picked from commit 94648bb797d94b025746c60679c584e5be2fae28) Signed-off-by: Keith Packard --- hw/xfree86/modes/xf86Crtc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index 1c2ee499e..84d3cac3e 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -2444,18 +2444,23 @@ _X_EXPORT Bool xf86SetDesiredModes (ScrnInfoPtr scrn) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + xf86CrtcPtr crtc = config->crtc[0]; int c; - xf86PrepareOutputs(scrn); - xf86PrepareCrtcs(scrn); + /* A driver with this hook will take care of this */ + if (!crtc->funcs->set_mode_major) { + xf86PrepareOutputs(scrn); + xf86PrepareCrtcs(scrn); + } for (c = 0; c < config->num_crtc; c++) { - xf86CrtcPtr crtc = config->crtc[c]; xf86OutputPtr output = NULL; int o; RRTransformPtr transform; + crtc = config->crtc[c]; + /* Skip disabled CRTCs */ if (!crtc->enabled) continue; From 4b702526dec35f5cfe5c6baec6a77c02c95c2867 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 25 Mar 2009 13:08:27 +1000 Subject: [PATCH 10/25] dix: ignore non-pointer events in XineramaCheckMotion (#20557) Note that deviceKeyButtonPointer and keyButtonPointer have the same wire layout, so we only need to check for event types. X.Org Bug 20557 Signed-off-by: Peter Hutterer Signed-off-by: Keith Packard --- dix/events.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dix/events.c b/dix/events.c index 6743caed9..63b067435 100644 --- a/dix/events.c +++ b/dix/events.c @@ -625,6 +625,23 @@ XineramaCheckMotion(xEvent *xE, DeviceIntPtr pDev) if (xE && !syncEvents.playingEvents) { + /* GetPointerEvents() guarantees that pointer events have the correct + rootX/Y set already. */ + switch(xE->u.u.type) + { + case ButtonPress: + case ButtonRelease: + case MotionNotify: + break; + default: + if (xE->u.u.type == DeviceButtonPress || + xE->u.u.type == DeviceButtonRelease || + xE->u.u.type == DeviceMotionNotify) + break; + /* all other events return FALSE */ + return FALSE; + } + /* Motion events entering DIX get translated to Screen 0 coordinates. Replayed events have already been translated since they've entered DIX before */ From 3b1ff33587458bad45777b8eb74b81c3e55987ad Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Tue, 28 Apr 2009 12:29:07 +0200 Subject: [PATCH 11/25] Xi: don't send XKB mapping notifications when XKB is disabled Signed-off-by: Pierre Ossman Signed-off-by: Keith Packard --- Xi/exevents.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Xi/exevents.c b/Xi/exevents.c index 482041fd7..398a26b20 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -1778,7 +1778,8 @@ SendDeviceMappingNotify(ClientPtr client, CARD8 request, } #ifdef XKB - if (request == MappingKeyboard || request == MappingModifier) + if (!noXkbExtension && (request == MappingKeyboard || + request == MappingModifier)) XkbApplyMappingChange(dev, request, firstKeyCode, count, client); #endif From e21c9949ac456ba9b162b6244a17e68c5b8112a9 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Tue, 28 Apr 2009 09:34:55 +0200 Subject: [PATCH 12/25] dix: fix calculation of number of fake KeyRelease events Signed-off-by: Pierre Ossman Signed-off-by: Keith Packard --- dix/getevents.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/dix/getevents.c b/dix/getevents.c index 279f49e54..9747b35a6 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -820,11 +820,15 @@ GetKeyboardValuatorEvents(EventList *events, DeviceIntPtr pDev, int type, if (noXkbExtension) #endif { - numEvents += GetKeyboardValuatorEvents(events, pDev, - KeyRelease, key_code, - first_valuator, num_valuators, - valuators); - events += numEvents; + int numReleaseEvents; + + numReleaseEvents = GetKeyboardValuatorEvents(events, pDev, + KeyRelease, key_code, + first_valuator, + num_valuators, + valuators); + numEvents += numReleaseEvents; + events += numReleaseEvents; } } From 01f0210b2ba34f724aa221bbe6b567a5751781a6 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 8 May 2009 22:29:15 -0700 Subject: [PATCH 13/25] xserver 1.6.1.901 Signed-off-by: Keith Packard --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 4c4c797f4..af4ba4fef 100644 --- a/configure.ac +++ b/configure.ac @@ -26,12 +26,12 @@ dnl dnl Process this file with autoconf to create configure. AC_PREREQ(2.57) -AC_INIT([xorg-server], 1.6.1, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) +AC_INIT([xorg-server], 1.6.1.901, [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 -RELEASE_DATE="2009-4-14" +RELEASE_DATE="2009-5-8" dnl this gets generated by autoheader, and thus contains all the defines. we dnl don't ever actually use it, internally. From 31536307703fcffa14a027ec777310c9962f816c Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 2 May 2009 00:26:18 -0700 Subject: [PATCH 14/25] XkbSetNamedIndicator should ignore SD's without LED's When ProcXkbSetNamedIndicator is called on a core device, and we walk the slaves to set the LED's on each of them, ignore any slaves that do not have either a KbdFeedbackCtrl or LedCtrl structure. (This is much more critical in xserver-1.5-branch, where we walk *all* devices, not just the slaves of the specified master, and thus return failure when setting an LED on the Core Keyboard and hit a xf86-input-mouse device with no LED's to set.) Signed-off-by: Alan Coopersmith Acked-by: Peter Hutterer (cherry picked from commit 557dbadf3be273255e8fdb12d9321f4e88bf2b65) Signed-off-by: Keith Packard --- xkb/xkb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xkb/xkb.c b/xkb/xkb.c index 7c1edea1a..15a0f432c 100644 --- a/xkb/xkb.c +++ b/xkb/xkb.c @@ -3438,6 +3438,7 @@ ProcXkbSetNamedIndicator(ClientPtr client) for (other = inputInfo.devices; other; other = other->next) { if ((other != dev) && !other->isMaster && (other->u.master == dev) && + (other->kbdfeed || other->leds) && (XaceHook(XACE_DEVICE_ACCESS, client, other, DixSetAttrAccess) == Success)) { rc = _XkbCreateIndicatorMap(other, stuff->indicator, @@ -3461,6 +3462,7 @@ ProcXkbSetNamedIndicator(ClientPtr client) for (other = inputInfo.devices; other; other = other->next) { if ((other != dev) && !other->isMaster && (other->u.master == dev) && + (other->kbdfeed || other->leds) && (XaceHook(XACE_DEVICE_ACCESS, client, other, DixSetAttrAccess) == Success)) { _XkbSetNamedIndicator(client, other, stuff); From 78eb366c65a953bbc059a989a92dfe28fbe1ae29 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Thu, 12 Feb 2009 16:02:17 +0000 Subject: [PATCH 15/25] Remove long-gone '-co' option from Xserver man page The '-co' option was removed in commit dda10c9066a660b647384179f82e1da8e063264f Signed-off-by: Jon TURNEY (cherry picked from commit b0ad9e1ced9619f37acf77764c395c57b86cf463) Signed-off-by: Keith Packard --- doc/Xserver.man.pre | 4 ---- 1 file changed, 4 deletions(-) diff --git a/doc/Xserver.man.pre b/doc/Xserver.man.pre index 8897e1a1f..eace57d1e 100644 --- a/doc/Xserver.man.pre +++ b/doc/Xserver.man.pre @@ -117,10 +117,6 @@ sets key-click volume (allowable range: 0-100). sets the visual class for the root window of color screens. The class numbers are as specified in the X protocol. Not obeyed by all servers. -.TP 8 -.B \-co \fIfilename\fP -sets name of RGB color database. The default is -.IR __projectroot__/share/X11/rgb . .ig .TP 8 .B \-config \fIfilename\fP From 3f0c73694b9ddc85b82a7a82a5d98fa8b18a01a8 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Thu, 12 Feb 2009 16:03:16 +0000 Subject: [PATCH 16/25] Remove references to rgb.txt from files section of Xserver and Xorg man pages The references to this file in the server code were removed in commit dda10c9066a660b647384179f82e1da8e063264f Signed-off-by: Jon TURNEY (cherry picked from commit d0dd649035fc3698c5b436f9d9d248116aa106a3) Signed-off-by: Keith Packard --- doc/Xserver.man.pre | 3 --- hw/xfree86/doc/man/Xorg.man.pre | 3 --- 2 files changed, 6 deletions(-) diff --git a/doc/Xserver.man.pre b/doc/Xserver.man.pre index eace57d1e..cd5bdbd25 100644 --- a/doc/Xserver.man.pre +++ b/doc/Xserver.man.pre @@ -560,9 +560,6 @@ Bitmap font directories .IR __projectroot__/lib/X11/fonts/TTF , __projectroot__/lib/X11/fonts/Type1 Outline font directories .TP 30 -.I __projectroot__/share/X11/rgb.txt -Color database -.TP 30 .I /tmp/.X11-unix/X\fBn\fP Unix domain socket for display number \fBn\fP .TP 30 diff --git a/hw/xfree86/doc/man/Xorg.man.pre b/hw/xfree86/doc/man/Xorg.man.pre index bf29fcbde..4992dc715 100644 --- a/hw/xfree86/doc/man/Xorg.man.pre +++ b/hw/xfree86/doc/man/Xorg.man.pre @@ -542,9 +542,6 @@ Libraries. .B __projectroot__/lib/X11/fonts/\(** Fonts. .TP 30 -.B __projectroot__/share/X11/rgb.txt -Color names to RGB mapping. -.TP 30 .B __projectroot__/share/X11/XErrorDB Client error message database. .TP 30 From bc95f29441b3daa7b9d91bd3c2b3e502a3a8cc81 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Thu, 23 Apr 2009 08:42:38 -0700 Subject: [PATCH 17/25] Fix byte swapping of XF86VidMode{Get,Set}GammaRamp Fixes OpenSolaris Bug 8315: Xorg segfaults when screensaver fades in cross-endian xdmcp session Signed-off-by: Alan Coopersmith (cherry picked from commit 7d0f7518c2235a9dc783029971259ddaada2db20) Signed-off-by: Keith Packard --- hw/xfree86/dixmods/extmod/xf86vmode.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/hw/xfree86/dixmods/extmod/xf86vmode.c b/hw/xfree86/dixmods/extmod/xf86vmode.c index 6485a0461..aecaf94ff 100644 --- a/hw/xfree86/dixmods/extmod/xf86vmode.c +++ b/hw/xfree86/dixmods/extmod/xf86vmode.c @@ -1543,6 +1543,7 @@ ProcXF86VidModeGetGammaRamp(ClientPtr client) { CARD16 *ramp = NULL; int n, length, i; + size_t ramplen; xXF86VidModeGetGammaRampReply rep; REQUEST(xXF86VidModeGetGammaRampReq); @@ -1557,7 +1558,8 @@ ProcXF86VidModeGetGammaRamp(ClientPtr client) length = (stuff->size + 1) & ~1; if(stuff->size) { - if(!(ramp = xalloc(length * 3 * sizeof(CARD16)))) + ramplen = length * 3 * sizeof(CARD16); + if (!(ramp = xalloc(ramplen))) return BadAlloc; if (!VidModeGetGammaRamp(stuff->screen, stuff->size, @@ -1575,13 +1577,12 @@ ProcXF86VidModeGetGammaRamp(ClientPtr client) swaps(&rep.sequenceNumber, n); swapl(&rep.length, n); swaps(&rep.size, n); - for(i = 0; i < length * 3; i++) - swaps(&ramp[i],n); + SwapShorts(ramp, length * 3); } WriteToClient(client, sizeof(xXF86VidModeGetGammaRampReply), (char *)&rep); if(stuff->size) { - WriteToClient(client, rep.length << 2, (char*)ramp); + WriteToClient(client, ramplen, (char*)ramp); xfree(ramp); } @@ -2062,7 +2063,6 @@ SProcXF86VidModeGetGamma(ClientPtr client) static int SProcXF86VidModeSetGammaRamp(ClientPtr client) { - CARD16 *ramp; int length, n; REQUEST(xXF86VidModeSetGammaRampReq); swaps(&stuff->length, n); @@ -2071,11 +2071,7 @@ SProcXF86VidModeSetGammaRamp(ClientPtr client) swaps(&stuff->screen, n); length = ((stuff->size + 1) & ~1) * 6; REQUEST_FIXED_SIZE(xXF86VidModeSetGammaRampReq, length); - ramp = (CARD16*)&stuff[1]; - while(length--) { - swaps(ramp, n); - ramp++; - } + SwapRestS(stuff); return ProcXF86VidModeSetGammaRamp(client); } From 7cd596e0dd6b9c195d7e395c26bfb00ef544c525 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 15 Apr 2009 18:26:06 +1000 Subject: [PATCH 18/25] randr12: looking up these bits if randr isn't initialised is bad. When xinerama is enabled we don't get randr protocol, but the driver might still want randr internals (cherry picked from commit faf7dfa099f5b42a703313fbd1bf8afdad07a179) Signed-off-by: Keith Packard --- hw/xfree86/modes/xf86RandR12.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c index 6f93a0dc3..454649213 100644 --- a/hw/xfree86/modes/xf86RandR12.c +++ b/hw/xfree86/modes/xf86RandR12.c @@ -752,8 +752,8 @@ _X_EXPORT Bool xf86RandR12CreateScreenResources (ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); - XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); + xf86CrtcConfigPtr config; + XF86RandRInfoPtr randrp; int c; int width, height; int mmWidth, mmHeight; @@ -763,6 +763,8 @@ xf86RandR12CreateScreenResources (ScreenPtr pScreen) return TRUE; #endif + config = XF86_CRTC_CONFIG_PTR(pScrn); + randrp = XF86RANDRINFO(pScreen); /* * Compute size of screen */ From 9c643b1e3ddc4ec9f1a924bd25f24df8536c7ea6 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 16 Apr 2009 16:17:07 +1000 Subject: [PATCH 19/25] os: don't malloc memory in LogVMessageVerb. LogVWrite is limited to a buffer size of 1024, so we don't loose anything here by truncating. This way we can use LogVMessageVerb (and xf86Msg and friends) during signal handlers with the normal message types. Signed-off-by: Peter Hutterer Acked-by: Alan Coopersmith (cherry picked from commit 0e0642ee9466d3268476d0084a83a9d93a4aa555) Signed-off-by: Keith Packard --- os/log.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/os/log.c b/os/log.c index 39bbd6044..692e78ad3 100644 --- a/os/log.c +++ b/os/log.c @@ -312,7 +312,7 @@ _X_EXPORT void LogVMessageVerb(MessageType type, int verb, const char *format, va_list args) { const char *s = X_UNKNOWN_STRING; - char *tmpBuf = NULL; + char tmpBuf[1024]; /* Ignore verbosity for X_ERROR */ if (logVerbosity >= verb || logFileVerbosity >= verb || type == X_ERROR) { @@ -354,21 +354,11 @@ LogVMessageVerb(MessageType type, int verb, const char *format, va_list args) break; } - /* - * Prefix the format string with the message type. We do it this way - * so that LogVWrite() is only called once per message. - */ - if (s) { - tmpBuf = malloc(strlen(format) + strlen(s) + 1 + 1); - /* Silently return if malloc fails here. */ - if (!tmpBuf) - return; - sprintf(tmpBuf, "%s ", s); - strcat(tmpBuf, format); - LogVWrite(verb, tmpBuf, args); - free(tmpBuf); - } else - LogVWrite(verb, format, args); + /* if s is not NULL we need a space before format */ + snprintf(tmpBuf, sizeof(tmpBuf), "%s%s%s", s ? s : "", + s ? " " : "", + format); + LogVWrite(verb, tmpBuf, args); } } From b575af88d0e547a03b164f6f3b2d4b268b9ffc34 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 6 May 2009 22:25:28 +1000 Subject: [PATCH 20/25] Xi: fix copy/paste error causing sizeof against wrong struct. This wrong check may cause BadLength to be returned to the client even if the length is correct. Signed-off-by: Peter Hutterer (cherry picked from commit 8b583ca2b21155359c6255f406c96599b277c762) Signed-off-by: Keith Packard --- Xi/xiproperty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c index 26af3fc00..04b2c8112 100644 --- a/Xi/xiproperty.c +++ b/Xi/xiproperty.c @@ -650,7 +650,7 @@ ProcXChangeDeviceProperty (ClientPtr client) return BadValue; } len = stuff->nUnits; - if (len > ((0xffffffff - sizeof(xChangePropertyReq)) >> 2)) + if (len > ((0xffffffff - sizeof(xChangeDevicePropertyReq)) >> 2)) return BadLength; sizeInBytes = format>>3; totalSize = len * sizeInBytes; From 21f58a2b0d0d96492d2d7c7de1bd654ed0114279 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 6 May 2009 16:55:32 +1000 Subject: [PATCH 21/25] Xi: don't double-swap the XListDeviceProperties reply. Signed-off-by: Peter Hutterer (cherry picked from commit 50cc8adafca4ba3838d468278d6eb8a4692d2488) Signed-off-by: Keith Packard --- Xi/xiproperty.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c index 04b2c8112..b04ee9433 100644 --- a/Xi/xiproperty.c +++ b/Xi/xiproperty.c @@ -602,13 +602,6 @@ ProcXListDeviceProperties (ClientPtr client) rep.length = (numProps * sizeof(Atom)) >> 2; rep.sequenceNumber = client->sequence; rep.nAtoms = numProps; - if (client->swapped) - { - int n; - swaps (&rep.sequenceNumber, n); - swapl (&rep.length, n); - swaps (&rep.nAtoms, n); - } temppAtoms = pAtoms; for (prop = dev->properties.properties; prop; prop = prop->next) *temppAtoms++ = prop->propertyName; From 773e4890b385a229b0919b4a249714d0bb7171a2 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Thu, 26 Mar 2009 22:25:08 -0700 Subject: [PATCH 22/25] Don't leak canonical module name and patterns if module is built-in Signed-off-by: Alan Coopersmith Acked-by: Peter Hutterer (cherry picked from commit 1c101d75d4855b2698e3fc8d2dd662f20585812f) Signed-off-by: Keith Packard --- hw/xfree86/loader/loadmod.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c index e98f013c4..22b540c5d 100644 --- a/hw/xfree86/loader/loadmod.c +++ b/hw/xfree86/loader/loadmod.c @@ -867,7 +867,8 @@ doLoadModule(const char *module, const char *path, const char **subdirlist, if (!strcmp (m, *cim)) { xf86MsgVerb(X_INFO, 3, "Module \"%s\" already built-in\n", m); - return (ModuleDescPtr) 1; + ret = (ModuleDescPtr) 1; + goto LoadModule_exit; } if (!name) { From 0fbf6f30f771e60714fb3003a9bb1a6b79e50c6e Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Thu, 26 Mar 2009 22:22:32 -0700 Subject: [PATCH 23/25] Don't leak default font path when appending built-ins Signed-off-by: Alan Coopersmith (cherry picked from commit 66539cc05d0b017b9feb4a038499907810140623) Signed-off-by: Keith Packard --- hw/xfree86/common/xf86Config.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 17223a123..9e56ca9ce 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -601,7 +601,9 @@ configFiles(XF86ConfFilesPtr fileconf) defaultFontPath = Xprintf("%s%s%s", fileconf->file_fontpath, *temp_path ? "," : "", temp_path); - must_copy = FALSE; + if (defaultFontPath != NULL) { + must_copy = FALSE; + } } else defaultFontPath = fileconf->file_fontpath; @@ -617,7 +619,14 @@ configFiles(XF86ConfFilesPtr fileconf) !((start == temp_path || start[-1] == ',') && (!*end || *end == ','))) { defaultFontPath = Xprintf("%s%sbuilt-ins", temp_path, *temp_path ? "," : ""); - must_copy = FALSE; + if (must_copy == TRUE) { + if (defaultFontPath != NULL) { + must_copy = FALSE; + } + } else { + /* already made a copy of the font path */ + xfree(temp_path); + } } /* xf86ValidateFontPath modifies its argument, but returns a copy of it. */ temp_path = must_copy ? XNFstrdup(defaultFontPath) : defaultFontPath; From a9f85dcefbadfe44d8c58ad08430aaadb8c59d34 Mon Sep 17 00:00:00 2001 From: Eamon Walsh Date: Mon, 11 May 2009 15:27:46 -0400 Subject: [PATCH 24/25] xselinux: Relax ownership restriction on SetSelectionUseContext. Instead, clients should keep track of the selection instances they use. (cherry picked from commit 0952d12717031e9dda9e48123bb922d0f4e81834) Signed-off-by: Eamon Walsh --- Xext/xselinux.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Xext/xselinux.c b/Xext/xselinux.c index 2a32bb857..6c99c2944 100644 --- a/Xext/xselinux.c +++ b/Xext/xselinux.c @@ -1349,15 +1349,6 @@ ProcSELinuxSetCreateContext(ClientPtr client, unsigned offset) goto out; privPtr = &serverClient->devPrivates; } - else if (offset == USE_SEL) { - /* Selection use context currently requires no selections owned */ - Selection *pSel; - for (pSel = CurrentSelections; pSel; pSel = pSel->next) - if (pSel->client == client) { - rc = BadMatch; - goto out; - } - } ptr = dixLookupPrivate(privPtr, subjectKey); pSid = (security_id_t *)(ptr + offset); From 5cd5a01259ba349f1868ca4af04207cf120d69e4 Mon Sep 17 00:00:00 2001 From: Eamon Walsh Date: Tue, 19 May 2009 19:30:33 -0400 Subject: [PATCH 25/25] xace: Fix a bad device access hook call. Add a proper access mode, and reverse the logic of the return value. Zero ("Success") is returned on success from the hook calls. Signed-off-by: Eamon Walsh (cherry picked from commit 3cea176d5abcb0f14eefbdcbe17fed0847524dd4) --- dix/events.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dix/events.c b/dix/events.c index 63b067435..ee6ac9e9d 100644 --- a/dix/events.c +++ b/dix/events.c @@ -4220,10 +4220,10 @@ CoreFocusEvent(DeviceIntPtr dev, int type, int mode, int detail, WindowPtr pWin) { xKeymapEvent ke; ClientPtr client = clients[CLIENT_ID(pWin->drawable.id)]; - if (XaceHook(XACE_DEVICE_ACCESS, client, dev, FALSE)) - memmove((char *)&ke.map[0], (char *)&dev->key->down[1], 31); - else + if (XaceHook(XACE_DEVICE_ACCESS, client, dev, DixReadAccess)) bzero((char *)&ke.map[0], 31); + else + memmove((char *)&ke.map[0], (char *)&dev->key->down[1], 31); ke.type = KeymapNotify; (void)DeliverEventsToWindow(dev, pWin, (xEvent *)&ke, 1,