summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2010-06-21xserver 1.8.1.902xorg-server-1.8.1.902Peter Hutterer1-2/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-06-21Merge branch 'dri2-backports' into server-1.8-branchPeter Hutterer10-139/+184
2010-06-21DRI2/xserver: Don't hang in glXSwapBuffers if drawable moves between crtc's ↵Mario Kleiner1-0/+15
(bug 28383) Detect if a drawable has been moved from an original crtc to a new crtc with a lower current vblank count than the original crtc inbetween glXSwapBuffers() calls. Reinitialize drawable's last_swap_target before scheduling next swap if such a move has taken place. last_swap_target defines the baseline for scheduling the next swap. If a movement between crtc's is not taken into account, the swap may schedule for a vblank count on the new crtc far in the future, resulting in a apparent "hang" of the drawable for a long time. Fixes Bugzilla bug #28383. Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Keith Packard <keithp@keithp.com> (cherry picked from commit 75beadd766fed7b12a76e59e57c244e297c2d2cb)
2010-06-15dix: the default axis mode is Relative, not "0".Peter Hutterer1-1/+1
Yay for readability. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-06-13exa: fix ExaCheckCopyNtoN for exa_classic when source = destÉric Piel1-1/+2
In case you want to copy a region with source = dest, you have the same pixmap as source and dest. At the end of exaPixmapIsOffscreen_classic() the devPrivate.ptr is reset to NULL (look at the sources). Now this is what happens in ExaCheckCopyNtoN: exaPrepareAccess( pDst ); Calls IsOffscreen() sets devPrivate.ptr to NULL sets up devPrivate.ptr to real pointer Everything OK exaPrepareAccess( pSrc ); Calls IsOffscreen() sets devPrivate.ptr to NULL BAILS OUT CAUSE OF NESTED OPERATION SINCE DST EQUALS SRC We end up with devPrivate.ptr as NULL, and that is clearly wrong. In particular this fixes a segfault when using the psb driver (bug 28077) Signed-off-by: Éric Piel <eric.piel@tremplin-utc.net> Reviewed-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Keith Packard <keithp@keithp.com> (cherry picked from commit 7e8f1001217326cc451974bacf25275420c4bb4e)
2010-06-11Xi: don't copy the modifier key count when copying device classes (#25480)Peter Hutterer1-4/+0
The modifier key count is maintained by the XKB layer and increased/decreased for all modifiers that set state. Test case, MD/SD modifier key count in comment: 1. keyboard 1: press and hold Shift_L # SD:1 MD:1 2. keyboard 2: press and release Shift_L # SD:1,0 MD:1,0 <class copy happens> # SD:1 MD:1 3. keyboard 1: release Shift_L # SD:0 MD:1 4. keyboard 1: press and release Shift_L # SD:1,0 MD:2,1 The modifier is now logically down on the MD but not on keyboard 1 or keyboard 2. XKB is layered in before the DIX, it increases/decreases the modifier key count accordingly. In the above example, during (2), the MD gets the key release and thus clears the modifier bit. (3) doesn't forward the release to the MD because it is already cleared. The copy of modifierKeysDown when the lastSlave changes however increases the counter for the held key. On (4), the press and release are both forwarded to the MD, causing a offset by 1 and thus do not clear the logical modifier state. X.Org Bug 25480 <http://bugs.freedesktop.org/show_bug.cgi?id=25480> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Daniel Stone <daniel@fooishbar.org> (cherry picked from commit dc614484f93b67e8b62dbb1bb2fd247fe5a4c850)
2010-06-11DRI2: Don't return junk reply instead of blocking in glXWaitForSbcOML()Peter Hutterer3-21/+8
DRI2WaitSBC() didn't block if requested targetSBC wasn't yet reached. Instead it returned a xreply with uninitialized junk return values, then blocked the connection until targetSBC was reached. Therefore the client didn't block, but continued with bogus return values from glXWaitForSbcOML. This patch fixes the problem by implementing DRI2WaitSBC similar to the clean and proven DRI2WaitMSC implementation. Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Keith Packard <keithp@keithp.com> (cherry picked from commit b3548612c7943011f79a910f9a59bb975984d8a6) Conflicts: hw/xfree86/dri2/dri2ext.c
2010-06-11xkb: fix invalid memory writes in _XkbCopyGeom.Peter Hutterer1-2/+2
Classic strlen/strcpy mistake of foo = malloc(strlen(bar)); strcpy(foo, bar); Testcase: valgrind Xephyr :1 ==8591== Invalid write of size 1 ==8591== at 0x4A0638F: strcpy (mc_replace_strmem.c:311) ==8591== by 0x605593: _XkbCopyGeom (xkbUtils.c:1994) ==8591== by 0x605973: XkbCopyKeymap (xkbUtils.c:2118) ==8591== by 0x6122B3: InitKeyboardDeviceStruct (xkbInit.c:560) ==8591== by 0x4472E2: CoreKeyboardProc (devices.c:577) ==8591== by 0x447162: ActivateDevice (devices.c:530) ==8591== by 0x4475D6: InitCoreDevices (devices.c:672) ==8591== by 0x4449EE: main (main.c:254) ==8591== Address 0x6f96505 is 0 bytes after a block of size 53 alloc'd ==8591== at 0x4A0515D: malloc (vg_replace_malloc.c:195) ==8591== by 0x6054B7: _XkbCopyGeom (xkbUtils.c:1980) ==8591== by 0x605973: XkbCopyKeymap (xkbUtils.c:2118) ==8591== by 0x6122B3: InitKeyboardDeviceStruct (xkbInit.c:560) ==8591== by 0x4472E2: CoreKeyboardProc (devices.c:577) ==8591== by 0x447162: ActivateDevice (devices.c:530) ==8591== by 0x4475D6: InitCoreDevices (devices.c:672) ==8591== by 0x4449EE: main (main.c:254) Reported-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by-and-apologised-for: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com> (cherry picked from commit 7f19a7a6e90a4fd7b7ec0256974f62e575218541) Conflicts: xkb/xkbUtils.c
2010-06-11Fix pixmap validation in miDbePositionWindow.Aaron Plattner1-6/+14
miDbePositionWindow allocates two pixmaps: a front buffer, and a back buffer. If the buffers are supposed to be initialized, it validates a GC against the front buffer, then uses it to fill and/or copy both the front buffer *and* the back buffer, without revalidating. If the acceleration architecture needs different GC funcs for the two pixmaps -- for example if allocation of the front buffer exhausted video memory -- then this can cause crashes because the GC is not validated for the back buffer pixmap. Fix this by performing the rendering for the front buffer first, then revalidating against the back buffer before performing the back buffer rendering. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com> (cherry picked from commit 1304b8b27cb12c803c4f51f04cb6f9d508b82c69)
2010-06-11composite: initialise pOldPixmap to NullPixmap at alloc time.Dave Airlie1-0/+1
We just never initialised the malloced value. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> (cherry picked from commit 91a6359caf24d94343ff76f43ea7b7fc3223203d)
2010-06-11Change keyboard controls on slave keyboards (#27926)Nicolas George1-2/+2
Makes the use of IsMaster in ProcChangeKeyboardControl consistent with other similar loops. Signed-off-by: Nicolas George <nicolas.george@normalesup.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 968a79dcf5e17ac3963953ef56b8f94dbd75323b)
2010-06-11midispcur: Construct Picture objects lazily in case Render is disabled.Jamey Sharp1-7/+6
Reverts part of the effects of 518f3b189b6c8aa28b62837d14309fd06163ccbb, "mi: don't thrash resources when displaying the software cursor across screens". The per-screen cache is preserved, and the GCs are still allocated eagerly, but now it doesn't construct pRootPicture until somebody attempts to draw an ARGB cursor. I noticed crashes in Xnest, which doesn't support the RENDER extension, but I suspect other DDXes that support disabling that extension would have had issues as well. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com> (cherry picked from commit bf78e11839f8278020b604672ff7c3d194232be9)
2010-06-11xnest: Don't ignore errors from DeviceCursorInitialize.Jamey Sharp1-2/+1
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> (cherry picked from commit bf9b64eefbadbf299d3b841c1890bfcaef5aab1b)
2010-06-02dri2: Take an XID for tracking the DRI2 drawablePeter Hutterer8-45/+165
Some pixmaps (window pixmaps and scratch pixmaps) don't have the drawable->id set and thus DRI2 gets confused when using that field for looking up the DRI2 drawable. Go back to using privates for getting at the DRI2 drawable from a DrawablePtr. We need to keep the resource tracking in place so we can remove the DRI2 drawable when the X resource it was created for goes away. Additionally, we also now track the DRI2 drawable using a client XID so we can reclaim the DRI2 drawable even if the client goes before the drawable and doesn't destroy the DRI2 drawable. Tested-by: Owen W. Taylor <otaylor@fishsoup.net> Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> (cherry picked from commit 9de0e31746d5f0d9d39d11c94ec3cbc04a9935fc) Conflicts: hw/xfree86/dri2/dri2.c
2010-06-02Revert "Revert "DRI2: Track DRI2 drawables as resources, not privates""Peter Hutterer3-127/+38
This reverts commit c394b17266301d363a9e234f58f8015f74e01307. Follow-up patch should fix the reason this was reverted in the first place. Conflicts: hw/xfree86/dri2/dri2.c
2010-06-02list.h: Add list_for_each_entry_safe()Kristian Høgsberg1-0/+6
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Adam Jackson <ajax@redhat.com> (cherry picked from commit 32381363cd8f43aeb741bad70bcf96a287dac0c9)
2010-06-02glxdri2: Hard-code the extension version we needKristian Høgsberg1-3/+3
If we use the #define'd version from dri_interface.h, the server will require at least that version of the extension. If we're compiling against a dri_interface.h with a newer version we don't really require, glxdri2 will require a too high version of the extension. The right approach is to just hard-code the version we need instead of using the #defines. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Adam Jackson <ajax@redhat.com> (cherry picked from commit 4a8a615d01b9ed18c272414bd11dc2fc661727e5)
2010-06-02dix: Update element count in FreeResource*()Kristian Høgsberg1-1/+9
FreeResource() keeps clientTable[cid].elements up to date with the number of resources allocated to the client. The other free resource functions (FreeResourceByType(), FreeClientNeverRetainResources() and FreeClientResources()) don't maintain this invariant. Typically, the only consequence is that the element count is too high and we end up allocating the hash table bigger than necessary. However, FreeResource() also relies on the element count to restart the search if the list of resources has been changed during a resource destruction callback. Since FreeResourceByType() doesn't update the count, if we call that from a resource destruction callback from FreeResource(), the loop isn't restarted and we end up following an invalid next pointer. Furthermore, LookupClientResourceComplex() and FreeClientNeverRetainResources() don't use the element count to detect if a callback deleted a resource and may end up following an invalid next pointer if the resource system is called into recursively. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Keith Packard <keithp@keithp.com> (cherry picked from commit 6d7ba5e0fcb5d1bce6bb213dec009f3a0f802d26)
2010-06-02xserver 1.8.1.901xorg-server-1.8.1.901Peter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-25xfree86: fix multiple InputAttributes tag matching.Peter Hutterer1-3/+3
attr->tags is an array of strings (null-terminated). When matching, match against each string instead of each [i,end] substring in the first tag. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com> (cherry picked from commit b5e0f6d8f45c5b24eb50b305c66fa80c783ef488)
2010-05-25Merge branch 'server-1.8-branch' of ↵Peter Hutterer3-39/+90
git://people.freedesktop.org/~alanc/xserver into server-1.8-branch
2010-05-24Add RandR 1.2 README.modes doc to EXTRA_DISTAlan Coopersmith1-0/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> (cherry picked from commit 1805c74d9b0ed46802481bcd6beea5feeb60212c)
2010-05-24Solaris: Use VT_SET_CONSUSER ioctl to set Console User rights profileAaron Zang1-22/+80
When Xorg is started on display :0, this ioctl is called to grant the user the rights traditionally associated with /dev/console (before VT support was added), such as access to local peripheral devices. Also adds a Solaris-specific -C flag to force starting on /dev/console instead of /dev/vt*, allowing programs like xterm -C to access the console device. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> (cherry picked from commit 989db930d739483759087b13b8d9a043299feafb)
2010-05-24Xserver(1) man page updatesAlan Coopersmith1-17/+9
- Note that -br is now default. - Move -bs after -br for alphabetical ordering. - Remove -config option that's been hidden in "ignore" section, since ajax removed the -config code a couple years back. - Add -nocursor option. - Add xinput & xrandr to list of runtime server control programs - Replace XDarwin with Xquartz in list of Xservers Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> (cherry picked from commit 7b09335a46f9428141811230c69eef7968531359)
2010-05-24dix: remove obsolete comment.from EnableDevice.Peter Hutterer1-4/+0
The code this comment was referring to was removed in 8b5086250aa5dae8de8b763408ff480d7beac819 "Eliminate bogus event resizing." Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com> (cherry picked from commit cf4f3d051858aadedd6e333bb317a1daa3987ad7)
2010-05-24Device init: Don't crash when CreateGC fails.Jamey Sharp2-2/+3
ActivateDevice was ignoring errors from DeviceCursorInitialize, so cursor-related calls failed later. Jeremy Huddleston saw that crash in miPointerConstrainCursor, while with Xvfb I saw it in miSpriteRealizeCursor. miDCDeviceCleanup frees any non-NULL GCs. miDCDeviceInitialize calls Cleanup on any failure, but if it failed early then some of the pointers in the miDCBufferPtr were garbage. Switch from malloc to calloc to ensure everything's initialized safely first. With these two fixes, if CreateGC fails then the server gracefully fails in FatalError instead of segfaulting. Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> (cherry-picked from commit b9f48d60bc0c839bd323c582231e8e7e2b810af6)
2010-05-21GLX/DRI2: expose swap control extensions if DDX support is presentJesse Barnes3-14/+19
Export DDX swap control status from the DRI2 module and check for it in GLX when initializing extensions. Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> (cherry picked from commit 165a4a9c7de0fcc6ef6a6421736b412ccb35965e)
2010-05-21DRI2: prevent swap wakes from waking MSC waitersJesse Barnes2-11/+27
If a few swaps were queued leading to a throttle related block on the client, and then the client submitted an MSC wait, one of the previous swap wakeups could have caused the MSC wait to complete early. Add a flag for this to prevent a swap wake from prematurely waking an MSC waiter. Reported-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> (cherry picked from commit 5933b0abc6a76aaea84aa534df89900cd795c888)
2010-05-21DRI2: handle swapsPending betterJesse Barnes1-1/+2
Avoid a potential swapsPending underflow by incrementing it before ScheduleSwap, which may complete it immediately. And be sure to decrement it again in case the schedule failed. Reported-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> (cherry picked from commit b00d435ddf2e9817e33bfd5f7e9b905442dc23c7)
2010-05-21DRI2: throttle swaps at submission time tooJesse Barnes1-0/+7
We need to throttle swaps here in addition to when the context is made current to avoid causing problems with clients that just swap. Throttling here also ensures our swaps get ordered as long as we block the client occasionally. Reported-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> (cherry picked from commit 0294ff2a5cadddc8fcc77ba9a851f979f0b91fc3)
2010-05-21DRI2: advertise lowest supported DRI2 protocol versionJesse Barnes4-6/+17
Update our supported DRI2 protocol version as each driver does DRI2ScreenInit, since depending on available kernel features, each DDX may support different callbacks and therefore protocol. Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> (cherry picked from commit db1c7cb604167baf49e61be4c09ccf7b592c4af3)
2010-05-21DRI2: handle swap_interval of 0 correctlyJesse Barnes1-2/+2
A 0 swap interval means that swaps shouldn't be sync'd to vblank, so just complete the swap immediately in that case. Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> (cherry picked from commit 87ca6320f26eb3129e3c19056e1d8fa5c1784723)
2010-05-21DRI2: drawable lifetime fixesJesse Barnes1-12/+22
Handle drawable destruction and lifetime correctly. Check whether the drawable priv is valid in DRI2SwapInterval(), DRI2WaitSBC() and DRI2WaitMSC(); it may have gone away, so be sure to check it before using it. If more than 1 outstanding swap is queued, we may complete several after an app has exited. If we free it after the first one completes and the refcount reaches 0, we'll crash the server on subsequent completions. So delay freeing until all swaps complete and remove the error message as this is a normal occurence. To do this properly, we must also avoid destroying drawables in DRI2DestroyDrawable() if a swap or wait event is pending. And finally, make sure we free drawables in DRI2WaitMSCComplete() if necessary (i.e. if the refcount has reached 0 and this MSC was the last pending event on the object). Reported-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> (cherry picked from commit 8476d99231cb725c090305d60f1c1c889d25c8dc)
2010-05-21DRI2: fix swapbuffers handling of SBC and target MSCJesse Barnes1-4/+18
Returns expected SBC after completion of swap to caller, as required by OML_sync_control spec, instead of the last_swap_target value. Passes target_msc, divisor, remainder, correctly for glXSwapBuffersMscOML() call, while retaining old behaviour for simple glXSwapBuffers() call. An OML swap can have a 0 target_msc, which just means it needs to satisfy the divisor/remainder equation. Pass this down to the driver as needed so we can support it. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> (cherry picked from commit b180e43977710b56ccfd6780f204ddcc952987a1)
2010-05-21DRI2WaitSbc(): Fixes for correct semantic of glXWaitForSbcOML()Mario Kleiner1-2/+23
Added implementation for case target_sbc == 0. In that case, the function shall schedule a wait until all pending swaps for the drawable have completed. Fix for non-blocking case. Old implementation returned random, uninitialized values for (ust,msc,sbc) if it returned immediately without scheduling a wait due to sbc >= target_sbc. Now if function doesn't schedule a wait, but returns immediately, it returns the (ust,msc,sbc) of the most recently completed swap, i.e., the UST and MSC corresponding to the time when the returned current SBC was reached. Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> (cherry picked from commit 751e8c09d34df4b41e8d8384a3ec1bf5cb8ca028)
2010-05-21DRI2: Fix glitches in DRI2SwapComplete() and DRI2WakeupClient()Mario Kleiner1-4/+4
DRI2SwapComplete(): Increment pPriv->swap_count++; before calling into callback for INTEL_swap_events extension, so the swap event contains the current SBC after swap completion instead of the previous one. DRI2WakeupClient: Check for pPriv->target_sbc <= pPriv->swap_count, had wrong comparison pPriv->target_sbc >= pPriv->swap_count for unblocking of clients of DRI2WaitSBC(). Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> (cherry picked from commit 0de4974b90b10fa6a447cdf980b4a114c6c9e5a8)
2010-05-21DRI2: make target_sbc signedJesse Barnes1-1/+1
We need to track invalid targets as well as 0 targets, so just make it signed so our comparisons work like they should. Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Reported-by: Kristian Høgsberg <krh@bitplanet.net> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> (cherry picked from commit 4c8ec49826a46eb3b36c69d2ad3f82320c179c38)
2010-05-21DRI2: fixup handling of last_swap_targetJesse Barnes1-23/+6
We need to initialize the swap target, which is passed to the driver to schedule events. Rather than using -1 to indicate that the field is uninitialized, just make sure we initialize it at drawable creation time. Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> (cherry picked from commit c4d54816f2ee4883d8f9bcf4595474fb58c95146)
2010-05-18Merge branch 'server-1.8-branch' of ↵Peter Hutterer3-8/+32
git://people.freedesktop.org/~jeremyhu/xserver into server-1.8-branch
2010-05-18Check pixmap allocation return value when creating glyphsKeith Packard1-0/+7
The driver may decide that the pixmap is too large or something and fail to allocate a pixmap; not checking would lead to a segfault. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> (cherry picked from commit 87ea5760f86eb60840e6e2c10012915952df5377)
2010-05-18Fix compiler issues with getifaddrs() call on OpenSolarisAlan Coopersmith1-5/+4
OpenSolaris recently added support for the getifaddrs() API. Building with that uncovered two compiler issues (one warning, one error) in the code that was now being built for the first time in our builds: "access.c", line 768: warning: argument #1 is incompatible with prototype: prototype: pointer to struct sockaddr {unsigned short sa_family, array[14] of char sa_data} : "access.c", line 213 argument : pointer to struct sockaddr_storage {unsigned short ss_family, array[6] of char _ss_pad1, double _ss_align, array[240] of char _ss_pad2} "access.c", line 838: assignment type mismatch: struct sockaddr {unsigned short sa_family, array[14] of char sa_data} "=" struct sockaddr_storage {unsigned short ss_family, array[6] of char _ss_pad1, double _ss_align, array[240] of char _ss_pad2} Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> (cherry picked from commit e42a29d269fadc11e065c63ee369e3165196f2d7)
2010-05-18test/xi2: Initialize predefined atoms before XInputExtensionInit.Jamey Sharp1-0/+1
XInputExtensionInit calls MakeAtom, which doesn't work without the atoms table initialized. Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> (cherry picked from commit c6613cfc26e76b296e620640bf33e756eb4ae178)
2010-05-18Fix null pointer dereference in xf86_reload_cursors().Cyril Brulebois1-1/+1
Upon resume, X may try to dereference a null pointer, which has been reported in Debian bug #507916 (http://bugs.debian.org/507916). Jim Paris came up with a patch which solves the problem for him. Here's a (hopefully) fixed version of his patch (without the typo). Cc: Jim Paris <jim@jtan.com> Signed-off-by: Cyril Brulebois <kibi@debian.org> Reviewed-By: Matthias Hopf <mhopf@suse.de> Signed-off-by: Keith Packard <keithp@keithp.com> (cherry picked from commit fa6c7012572093a82c9389682977efff85590719)
2010-05-18xfree86: dga needs to use the master keyboard state (#27573)Peter Hutterer1-1/+3
GetPairedDevice() may not always return the keyboard, resulting in a null-pointer dereference when accessing the XKB state. For floating devices, the GetMaster() returns the device itself. X.Org Bug 27573 <http://bugs.freedesktop.org/show_bug.cgi?id=27573> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Tested-by: Ben Hutchings <ben@decadent.org.uk> (cherry picked from commit 10de9e8ee37265a35ceeceb2007d711da70d4f2d)
2010-05-18Fix wrong bracket values when startOver = FALSE.David James1-11/+8
Currently, SyncComputeBracketValues reuses old values of bracket_greater and bracket_less when startOver = FALSE. This can result in incorrect bracket values. To fix this issue, the startOver parameter is removed, and we do not reuse old values of bracket_greater and bracket_less. X.Org Bug 27023 <http://bugs.freedesktop.org/show_bug.cgi?id=27023> Signed-off-by: David James <davidjames@google.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> (cherry picked from commit 758b8614477b53dc3de2b884fec5ccaf8a736432)
2010-05-18miPolyPoint bugfix: Check memory allocation before changing the GC.Jamey Sharp1-2/+3
miPolyPoint ought to leave the GC unchanged even if it fails. ajax says: > We have a new winner for the oldest-bug competition! It's actually > been like that since X11R1: > > -rw-r--r--. 1 ajax ajax 2817 1987-09-12 01:20 ddx/mi/mipolypnt.c Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Adam Jackson <ajax@redhat.com> (cherry picked from commit 4080cd42fde8b4c693eab7557581af2622479109)
2010-05-18dmxBERestoreRenderGlyph was passing wrong value to freeKeith Packard1-1/+1
Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Matt Turner <mattst88@gmail.com> (cherry picked from commit c0799779dffeef8cef228bdc57aa6c8b323e7485)
2010-05-18Fix mod() definition.Matthias Hopf1-1/+1
Presumably no implications, especially security-wise. Signed-off-by: Matthias Hopf <mhopf@suse.de> Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> (cherry picked from commit e2e2747f40c4b9e23dba38ea656d4c082e83a794)
2010-05-18dix: make DeviceEvent coordinates signed for Xinerama. #24986Chris Humbert1-2/+2
With Xinerama enabled, event coordinates are relative to Screen 0, so they can be negative. The new DeviceEvent's coordinates are of type uint16_t, making screens above and to the left of Screen 0 unusable. X.Org Bug 24986 <https://bugs.freedesktop.org/show_bug.cgi?id=24986> Signed-off-by: Chris Humbert <freedesktop@mahadri.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> (cherry picked from commit 21ed660f30a3f96c787ab00a16499e0fb034b2ad)
2010-05-18Xi: reset the known properties at the end of the server generation.Peter Hutterer3-0/+13
Properties allocated through XIGetKnownProperty() aren't reset on the second server generation but keep the old value. As a result, wrong Atoms are supplied to the driver, resulting in potential data corruption or weird error message. Reproducible by running "xlsatom | grep FLOAT" twice on a plain X server. The second X server generation won't have the FLOAT atom defined anymore, despite the users of this atom not noticing any errors. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com> (cherry picked from commit 9802839d35aaf788790f1d0e8300db4693a70096)