summaryrefslogtreecommitdiff
path: root/Xext
AgeCommit message (Collapse)AuthorFilesLines
2011-12-06xv: test correct number of requests. (v2)Dave Airlie1-2/+2
Pointed out by coverity. v2: fix swapped as well, as pointed out by Alan Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-12-06xext: don't free uninitialised pointer when malloc fails. (v2)Dave Airlie1-2/+1
Initialise the pAttr->values to values so if the values allocation fails it just ends up as free(NULL). Pointed out by coverity. v2: use Alan's suggestion. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-12-01Save major/minor opcodes in ClientRec for RecordAReplyKeith Packard2-5/+3
The record extension needs the major and minor opcodes in the reply hook, but the request buffer may have been freed by the time the hook is invoked. Saving the request major and minor codes as the request is executed avoids fetching from the defunct request buffer. This patch also eliminates the public MinorOpcodeOfRequest function, inlining it into Dispatch. Usages of that function have been replaced with direct access to the new ClientRec field. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-12-01Merge remote-tracking branch 'jcristau/for-keith'Keith Packard1-1/+1
2011-11-23Fix gcc -Wwrite-strings warnings in various extensionsAlan Coopersmith4-7/+7
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23Convert strncpy/strncat to strlcpy/strlcatAlan Coopersmith1-4/+2
As long as we're carrying around a compatibility copy in os/strl*.c, might as well use them. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23Convert AllocXTestDevice to use asprintfAlan Coopersmith1-4/+3
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-19Fix ShmPutImage for XYBitmapJulien Cristau1-1/+1
We can't call CopyArea in that case because the image has depth 1, which might not match the target drawable, so we might overrun the shm segment. Commit 11817a881cb93a89788105d1e575a468f2a8d27c apparently fixed a similar bug for XYPixmap, but missed the bitmap case. Fixes: http://bugs.debian.org/629611 Thanks to Alan Curry for diagnosing this and providing a test case. Reported-and-tested-by: Alan Curry <pacman@kosh.dhis.org> Reviewed-by: Peter Harris <pharris@opentext.com> Signed-off-by: Julien Cristau <jcristau@debian.org>
2011-11-10Xext: remove unused variable 'n'Peter Hutterer1-1/+1
xselinux_ext.c: In function 'SELinuxSendItemsToClient': xselinux_ext.c:340:16: warning: unused variable 'n' [-Wunused-variable] Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org>
2011-11-10Xext: don't swap CARD8 in SProcSELinuxQueryVersionPeter Hutterer1-5/+0
xselinux_ext.c: In function 'SELinuxSendItemsToClient': xselinux_ext.c:340:16: warning: unused variable 'n' [-Wunused-variable] xselinux_ext.c: In function 'SProcSELinuxQueryVersion': xselinux_ext.c:532:62: error: call to 'wrong_size' declared with attribute error: wrong sized variable passed to swap xselinux_ext.c:533:62: error: call to 'wrong_size' declared with attribute error: wrong sized variable passed to swap Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org>
2011-09-23Unconditionally #include <stdint.h>Alan Coopersmith1-5/+0
The more recent inclusions of this file haven't been checking for HAVE_STDINT_H, so might as well make the older ones consistent. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-09-21Merge remote-tracking branch 'mattst88/for-keith'Keith Packard16-775/+568
2011-09-21Use correct swap{l,s} (or none at all for CARD8)Matt Turner2-11/+2
Swapping the wrong size was never caught because swap{l,s} are macros. It's clear in the case of Xext/xres.c, that the author believed client_major/minor to be CARD16 from looking at the code in the first hunk. v2: dmx.c fixes from Keith. Reviewed-by: Peter Harris <pharris@opentext.com> Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-09-21Use internal temp variable for swap macrosMatt Turner16-769/+571
Also, fix whitespace, mainly around swaps(&rep.sequenceNumber) Reviewed-by: Peter Harris <pharris@opentext.com> Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-09-19Fix pixmap double-frees on error paths.Jamey Sharp1-5/+1
If AddResource fails, it will automatically free the object that was passed to it by calling the appropriate deleteFunc; and of course FreeResource also calls the deleteFunc. In both cases it's wrong to call the destroy hook manually. Commit by Jamey Sharp and Josh Triplett. Signed-off-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Josh Triplett <josh@joshtriplett.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
2011-09-18XineramaInitData ignores its argument. Quit passing one.Jamey Sharp2-7/+7
Also fix up XineramaInitData's caller, XineramaReinitData. Commit by Jamey Sharp and Josh Triplett. Signed-off-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Josh Triplett <josh@joshtriplett.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-07-01Merge remote-tracking branch 'whot/for-keith'Keith Packard1-1/+8
2011-07-01input: free the EQ allocated memory on shutdown (#38634)Peter Hutterer1-1/+8
mieqFini() already does the right thing, but it needs to be called by the various DDXs and the XTest Extension. X.Org Bug 38634 <http://bugs.freedesktop.org/show_bug.cgi?id=38634> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> Acked-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-06-16Xext: Fix buggy checks.Cyril Brulebois1-5/+6
XvMCScreenKey is defined as XvMCScreenKeyRec's address, so will never be NULL. Use the check proposed by Alan Coopersmith and Jeremy Huddleston instead. Those warnings go away accordingly: | CC xvmc.lo | xvmc.c: In function 'ProcXvMCListSubpictureTypes': | xvmc.c:490:22: warning: the comparison will always evaluate as 'false' for the address of 'XvMCScreenKeyRec' will never be NULL [-Waddress] | xvmc.c: In function 'XvMCExtensionInit': | xvmc.c:671:21: warning: the comparison will always evaluate as 'false' for the address of 'XvMCScreenKeyRec' will never be NULL [-Waddress] | xvmc.c: In function 'XvMCFindXvImage': | xvmc.c:749:22: warning: the comparison will always evaluate as 'false' for the address of 'XvMCScreenKeyRec' will never be NULL [-Waddress] Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Cyril Brulebois <kibi@debian.org>
2011-05-11input: replace EventListPtr with InternalEvent arrayPeter Hutterer1-2/+3
EventListPtr is a relic from pre-1.6, when we had protocol events in the event queue and thus events of varying size. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-04-25Xext: Silence warnings when building with clangJeremy Huddleston1-6/+1
xvmain.c:1113:22: warning: equality comparison with extraneous parentheses [-Wparentheses] if ((pf->depth == pDraw->depth) ~~~~~~~~~~^~~~~~~~~~~~~~~ xvmain.c:1113:22: note: use '=' to turn this equality comparison into an assignment if ((pf->depth == pDraw->depth) ^~ = xvmain.c:1113:22: note: remove extraneous parentheses around the comparison to silence this warning if ((pf->depth == pDraw->depth) ~ ^ ~ 1 warning generated. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-04-18input: remove GetKeyboardValuatorEvents, this is now unnecessary.Peter Hutterer1-1/+1
GetKeyboardValuatorEvents handles NULL valuator masks already, so the GetKeyboardEvents wrapper is not needed. Rename GKVE to GKE. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-04-07Xext: use EXT_MASK macro instead of manual & 0x7fPeter Hutterer1-4/+5
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-04Merge remote-tracking branch 'vignatti/for-keith'Keith Packard1-4/+1
2011-04-04xorg: remove unused pointer values all over the serverTiago Vignatti1-4/+1
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-04-02Xext: fix test on extension number for the swapped case.Matthieu Herrb1-1/+1
Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr> Reviewed-by: Julien Cristau <jcristau@debian.org>
2011-03-23Merge remote-tracking branch 'airlied/xinerama-cleanup'Keith Packard6-45/+46
2011-03-10panoramiX: convert 1->panoramiXNumScreens loops to use macro (v2)Dave Airlie4-6/+6
This converts all the remaining 1->num loops to the macro, this removes nearly all the panoramiXNumScreens usage in loops, and is a step to replacing it. v2: move some from the other patch. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-03-10panoramiX: convert 0->panoramiXNumScreens loops to macro (v3)Dave Airlie3-7/+7
This just uses the FOR_NSCREENS macro instead. v2: remove some of the 1->x loops. v3: drop the 1->0 loop, will rework later. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-03-10panoramiX: consolidate common id assignment code.Dave Airlie4-19/+19
This adds a new FOR_NSCREENS_FORWARD_SKIP, which skips the first element and is a common idiom throughout panoramiX code. It then adds a new inline function to hide id assignment to a panoramiX resource and cleans up lots of common repeated code. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-03-10panoramiX: macro checking if drawable is root (v2)Dave Airlie2-13/+14
this code appears in quite a few places, consolidate it into a macro in a header. v2: align braces with macro just above it, and with lines removed Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-03-08xvmc: Use RESTYPE consistentlyAdam Jackson1-3/+3
Also mark these static since they're not used externally. Reviewed-by: Soren Sandmann <ssp@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-08xinerama: Use RESTYPE consistentlyAdam Jackson2-11/+11
No functional change Reviewed-by: Soren Sandmann <ssp@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-08xv: Use RESTYPE where appropriateAdam Jackson2-14/+12
No functional change. Reviewed-by: Soren Sandmann <ssp@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-03Merge remote branch 'whot/for-keith'Keith Packard2-304/+0
2011-03-03Merge remote branch 'rjy/clientids'Keith Packard1-16/+16
2011-03-01xext: Remove XCALIBRATE extensionAdam Jackson2-304/+0
Nobody can have been using this, it's never called from extension init. XI2 device properties should now be a functional replacement. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-02-02Merge remote branch 'jturney/master'Keith Packard1-45/+44
2011-02-02xselinux: Fix GetDrawableContextAdam Jackson1-4/+2
M_DRAWABLE_PIXMAP is the lookup mask to dixLookupDrawable, and _not_ the type value in the drawable itself. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Eamon Walsh <ewalsh@tycho.nsa.gov> Signed-off-by: Keith Packard <keithp@keithp.com>
2011-01-25Fix compilation of xf86bigfont.cJon TURNEY1-45/+44
xf86bigfont.c: In function 'XFree86BigfontExtensionInit': xf86bigfont.c:146: error: 'ProcXF86BigfontDispatch' undeclared (first use in this function) xf86bigfont.c:147: error: 'SProcXF86BigfontDispatch' undeclared (first use in this function) It seems this has been broken since commit cbd4d5dbb70db62ba1cb79c7b904e6fa11f62d7e "delete pervasively use of DISPATCH_PROC" (2010-09-28), which is a bit worrying as that presumably indicates that no tinderbox is configuring with --enable-xf86bigfont. In a similar fashion to that commit, fix by moving XFree86BigfontExtensionInit() below the definitions of the static dispatch functions it references. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Julien Cristau <jcristau@debian.org>
2011-01-05X Sync CleanupsJames Jones1-56/+86
Various cleanups identified during review of the X Sync Fence Object patches. -Correctly handle failure of AddResource() -Don't assert when data structures are corrupt. Instead, use a new helper function to check for counter sync objects when they're expected, and warn if the type is wrong. -Use the default switch label rather than reimplementing it. -Re-introduce cast of result of dixAllocateObjectWithPrivate() to kill an incompatible pointer type warning. -Remove comments claiming protocol updates are needed. One wasn't true and the other was addressed with a xextproto change. -Return BadFence, not BadCounter from XSyncAwaitFence() Signed-off-by: James Jones <jajones@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-12-31Resources: Move rClient to resource.hDaniel Stone2-4/+0
The definition of rClient was duplicated across three source files, so move it to resource.h. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-12-23Xext: Use general OS functions to determine client command string in SELinux.Rami Ylimäki1-16/+16
Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-12-20Remove SCO supportAdam Jackson1-1/+1
This has never been buildable in any modular server release. Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Mark Kettenis <kettenis@openbsd.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-12-19IDLETIME: Fix edge-case in IdleTimeBlockHandlerChristopher James Halse Rogers1-0/+8
Ensure that if we're called exactly on the threshold of a NegativeTransition trigger that we reshedule to pick up an idle time over the threshold. Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-12-19Xext: Fix edge case with {Positive, Negative}Transition triggers.Christopher James Halse Rogers1-0/+22
The {Positive,Negative}Transition triggers only fire when the counter goes from strictly {below,above} the threshold. If SyncComputeBracketValues gets called exactly at this threshold we may update the bracket values so that the counter is not updated past the threshold. Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-12-06sync: syncObject may be None in SyncInitTriggerKeith Packard1-2/+2
And often is, especially when called from ProcSyncCreateAlarm. Crashing in this case seems unwise. Signed-off-by: Keith Packard <keithp@keithp.com>
2010-12-06Expose Sync Fence Object protocolJames Jones1-0/+24
Add the new protocol handlers for XSync 3.1 to the dispatch tables and report support for Sync protocol version 3.1. Signed-off-by: James Jones <jajones@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-12-06Add XSyncAwaitFence() handlerJames Jones2-32/+152
-Add the actual ProcSyncAwaitFence() dispatch func -Add support for fence sync triggers. Signed-off-by: James Jones <jajones@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-12-06Create/Destroy/Trigger/Reset/Query Fence Sync objsJames Jones3-5/+272
Initial server side implementation of fence sync objects. Allows creation, management, and state queries of binary state objects. Currently they are not very useful as there is no way to wait for them efficiently. The basic trigger operation added here triggers relative to a given X screen's rendering operations. To perform this operation, fence sync objects must be tied to a screen. As Aaron Plattner pointed out, screens are identified but a drawable in X protocol, so a drawable argument is included in XSyncCreateFence(). The screen also could have been specified as part of the trigger operation. However, it is also desireable to associate a screen with fence sync objects at creation time so that the associated screen's driver can allocate any HW- specific resources needed by the fence object up front. Signed-off-by: James Jones <jajones@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com>