summaryrefslogtreecommitdiff
path: root/Xext
AgeCommit message (Collapse)AuthorFilesLines
2012-01-26Xext: Warning fix for shm.cJon TURNEY1-1/+1
shm.c: In function 'CheckForShmSyscall': shm.c:182:5: warning: function declaration isn't a prototype [-Wstrict-prototypes] Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-01-12Revert "dix: Pull client-is-local flag up to the ClientRec"Keith Packard1-2/+2
This reverts commit 49d38b75c8f3276cfce33ffe6b8c4fbeb1081b96. ABI change pended for 1.13
2012-01-06xace: ricer tuning for XaceHookAdam Jackson1-0/+4
gcc doesn't want to hoist the check for XaceHooks[hook] != NULL above the varargs code for some reason, so do it ourselves. Before: 40000000 trep @ 0.0010 msec (1050420.2/sec): PutImage 10x10 square 60000000 trep @ 0.0005 msec (1921147.6/sec): ShmPutImage 10x10 square After: 40000000 trep @ 0.0009 msec (1087458.5/sec): PutImage 10x10 square 60000000 trep @ 0.0005 msec (2012238.6/sec): ShmPutImage 10x10 square Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-01-06dix: Pull client-is-local flag up to the ClientRecAdam Jackson1-2/+2
Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-12-12Add some printf format attributes suggested by gccAlan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12Constify string for authorization protocol namesAlan Coopersmith1-1/+2
gcc was warning from storing string constants in a char *name field: auth.c:64:1: warning: initialization discards qualifiers from pointer target type auth.c:72:1: warning: initialization discards qualifiers from pointer target type auth.c:81:1: warning: initialization discards qualifiers from pointer target type Making the field const requires changing AuthorizationFromID to take a const char ** pointer for the name argument which it sets to point to the matching name entry. Changing that argument requires changing its sole caller in the security extension to pass the address of a const char * variable to it, which it can do, since the only thing it does with the returned name is to pass it back to the RemoveAuthorization function that already expects a const char *name. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12xres.c: Preserve constness of string returned by LookupResourceNameAlan Coopersmith1-2/+2
MakeAtom now accepts a const char * so we don't need to cast down to char * anymore. Fixes gcc warning of: xres.c: In function 'ProcXResQueryClientResources': xres.c:155:6: warning: cast discards qualifiers from pointer target type Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
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>