Commit Graph

9232 Commits

Author SHA1 Message Date
Mikhail Gusarov
96c7ab27c3 Deprecate allocation functions which are plain wrappers for C stdlib
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-13 00:20:32 +07:00
Mikhail Gusarov
a5dba0f5ca Document allocation functions, noting deviations from C library
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-13 00:20:32 +07:00
Mikhail Gusarov
e983848ab4 Clean {X,XNF}{alloc,calloc,realloc,free,strdup} from pre-C89 baggage
C89 guarantees alignment of pointers returned from malloc/calloc/realloc, so
stop fiddling with alignment manually and just pass the arguments to library
functions.

Also convert silent error when negative size is passed into function into
warning in log file.

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-13 00:20:32 +07:00
Kristian Høgsberg
4f0006c220 dri2: Copy front to fake front in swapbuffer
If we don't have a fake front, nothing will happen.  The fix was extracted
from a bigger patch from Francisco Jerez.

https://bugs.freedesktop.org/show_bug.cgi?id=27305
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Pauli Nieminen <suokkos@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-12 10:00:15 -07:00
Jeremy Huddleston
ba1f1f9d9e XQuartz GL: Fix __glXAquaScreenCreateDrawable prototype
Fixes regression introduced in 9de0e31746

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-11 10:46:41 -07:00
Keith Packard
286935c6f4 Remember drawable ID used to find damage target for use in events. Bug 5730.
Using Composite, window pixmaps are given names in the client resource
namespace and yet may not have any XID recorded in the drawable
structure. As such, we need to remember the XID used to lookup the
pixmap in the resource database so that we can report the correct XID
back to the client in damage events.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-11 09:31:10 -07:00
Keith Packard
3df22b293c Merge remote branch 'krh/dri2-resource-fixes' 2010-05-11 08:38:44 -07:00
Cyril Brulebois
fa6c701257 Fix null pointer dereference in xf86_reload_cursors().
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>
2010-05-11 08:35:28 -07:00
Kristian Høgsberg
9de0e31746 dri2: Take an XID for tracking the DRI2 drawable
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>
2010-05-11 11:01:35 -04:00
Kristian Høgsberg
32381363cd list.h: Add list_for_each_entry_safe()
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-11 11:01:35 -04:00
Kristian Høgsberg
4a8a615d01 glxdri2: Hard-code the extension version we need
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>
2010-05-11 11:01:35 -04:00
Kristian Høgsberg
6d7ba5e0fc dix: Update element count in FreeResource*()
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>
2010-05-11 11:01:34 -04:00
Peter Hutterer
10de9e8ee3 xfree86: dga needs to use the master keyboard state (#27573)
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>
2010-05-11 13:33:19 +10:00
David James
758b861447 Fix wrong bracket values when startOver = FALSE.
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>
2010-05-10 15:40:08 -07:00
Keith Packard
95074538cc Merge remote branch 'jamey/for-keith' 2010-05-10 13:49:33 -07:00
Jamey Sharp
2160ff5240 Simplify error-handling in dixChangeGC.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-10 11:16:33 -07:00
Jamey Sharp
4080cd42fd miPolyPoint bugfix: Check memory allocation before changing the GC.
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>
2010-05-10 11:16:33 -07:00
Jamey Sharp
ccdaecc547 Move AppendSpanGroup from miwideline.h to miwideline.c.
Also make it stop being a macro.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-10 11:16:32 -07:00
Jamey Sharp
4272d6722c Expand macros that are used only in miFillPolyHelper.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-10 11:16:32 -07:00
Keith Packard
c0799779df dmxBERestoreRenderGlyph was passing wrong value to free
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-05-08 09:51:03 -07:00
Adam Jackson
946f664b6a mi: Delete wide ellipse arc cache
This does make wide ellipses slower, by a factor of twoish:

946000.0   521000.0 (  0.55)   10-pixel wide ellipse
 98300.0    49900.0 (  0.51)   100-pixel wide ellipse
 17700.0     9310.0 (  0.53)   500-pixel wide ellipse
 16900.0     7980.0 (  0.47)   100-pixel wide dashed ellipse
 16100.0     5370.0 (  0.33)   100-pixel wide double-dashed ellipse

But no one cares, and it's a modest size win:

   text	   data	    bss	    dec	    hex	filename
1773824	  69552	  59288	1902664	 1d0848	hw/vfb/Xvfb.before
1773112	  69552	  58648	1901312	 1d0300	hw/vfb/Xvfb

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-07 22:03:09 -07:00
Jamey Sharp
580b99bb8a Return BadPicture, not BadPixmap, if alpha-map is invalid.
I believe this is what was intended.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-07 21:58:02 -07:00
Jamey Sharp
c677fc611b VERIFY_PICTURE always returns BadPicture. Don't bother specifying.
Same goes for VERIFY_ALPHA, VERIFY_XIN_PICTURE, and VERIFY_XIN_ALPHA.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-07 21:57:19 -07:00
Jamey Sharp
35761d5f81 Introduce dixLookupFontable for "FONT or GC" parameters.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-07 21:56:36 -07:00
Alan Coopersmith
2eab697adb Constify function prototypes in auth & xdmcp code
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Tested-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-07 12:22:58 -07:00
Matthias Hopf
e2e2747f40 Fix mod() definition.
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>
2010-05-07 12:22:02 -07:00
Adam Tkac
626f97688a Export XkbCopyDeviceKeymap from Xorg, it is needed by VNC.
Signed-off-by: Adam Tkac <atkac@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-07 12:17:45 -07:00
Chris Humbert
21ed660f30 dix: make DeviceEvent coordinates signed for Xinerama. #24986
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>
2010-05-07 12:17:22 -07:00
Peter Hutterer
9802839d35 Xi: reset the known properties at the end of the server generation.
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>
2010-05-07 12:16:43 -07:00
Julien Cristau
72758287f7 XQuartz: add new localization files to EXTRA_DIST
commit 206531f75c added localization files
for ar, add them to the Makefile.

Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-05-04 13:08:16 -07:00
Keith Packard
a3f5d30ba6 Make sure XFixes invisible cursor gets freed on server reset
This uses the same hack that dix uses for the rootCursor -- allocate
a resource ID for the invisible cursor so that it gets freed at reset
time. This also allows us to unconditionally create it during
extension initialization; necessary as the privates layout may well be
different on subsequent generations.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-03 10:27:35 -07:00
Keith Packard
cdeb2c23f8 Fix cursor ref counting mistakes with sprites and xf86Cursor.c
A few cursor value assignments weren't getting correctly ref counted,
causing leaks of cursor objects.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-03 10:26:52 -07:00
Keith Packard
a80b1f888f Merge remote branch 'jeremyhu/master' 2010-05-02 16:35:17 -07:00
Jeremy Huddleston
0efd7b8d82 XQuartz GLX: Change around includes for better compatability with different OS versions
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-05-02 15:27:29 -07:00
Jeremy Huddleston
7b506fdc84 rootless: Add some sanity checking to miPaintWindow
This avoids painting the root window when it isn't actually drawable.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-05-02 15:27:29 -07:00
Jeremy Huddleston
4d3789c9b3 rootless: Remove an unneeded comment
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-05-02 15:27:29 -07:00
Oliver McFadden
048d15192a x-list.c: null-returning function malloc() was called without checking
Signed-off-by: Oliver McFadden <oliver.mcfadden@nokia.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-05-02 15:27:29 -07:00
Tiago Vignatti
4971099860 dix: wrap variables with #ifdef when panoramix is not used
this shut up some warnings.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-02 13:55:16 -07:00
Keith Packard
40858960c0 Delete loop with no effect from GlyphUninit
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-04-30 13:05:45 -07:00
Keith Packard
65e961fcc1 Replace some input devPrivates with regular struct fields
In the process, fixes a memory leak in CloseDevice, and an unchecked
memory allocation in InitializePredictableAccelerationProperties.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-04-30 13:05:11 -07:00
Keith Packard
998e982b77 Move callback definitions to their own file
Needed as the privates stuff uses the callbacks before they would have
been defined in dix.h

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-04-30 13:04:44 -07:00
Keith Packard
7dde50c649 Move X_DEPRECATED to misc.h so it can be used outside resource.h
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-04-30 12:50:31 -07:00
Aaron Plattner
5623908aee dix: Improve documentation of the DIX private data functions.
The functions exported by the devPrivates code were poorly documented.  I tried
to spruce it up a little.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-30 12:46:04 -07:00
Keith Packard
986d46144b Merge remote branch 'jamey/for-keith'
Conflicts:
	hw/xfree86/common/xf86xv.c
2010-04-30 12:40:53 -07:00
Keith Packard
a974c8e7cb Merge remote branch 'whot/for-keith' 2010-04-30 12:33:00 -07:00
Keith Packard
6581bc4591 Merge remote branch 'yselkowitz/master' 2010-04-30 12:29:52 -07:00
Keith Packard
0e91e19f78 Merge remote branch 'vignatti/for-keith' 2010-04-30 12:27:51 -07:00
Peter Hutterer
02e86221b8 xfree86: a missing input driver is not an error.
We call NIDR on all devices that make it through the config backend.
Including some that have no driver assigned to them (/dev/input/mouse0 for
example). Those ones then simply get ignored by NIDR, but this should not be
noted as an error in the log file.

X_INFO is sufficient, and it may just prevent some bugreports.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2010-04-30 11:33:25 +10:00
Jon TURNEY
81a081c1f0 Cygwin/X: AIGLX using native WGL
A rewrite of the XWin DDX AIGLX code to actually make it do something useful again

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2010-04-28 14:26:52 +01:00
Rami Ylimäki
262c2c9031 test: Fix linking of wrapped functions in XI2 tests.
Running "make check" will lead to build problems in
scratchbox. Building the first test that wraps dixLookupWindow fails
because symbol __real_dixLookupWindow can't be resolved. Defining
wrapping options as linker options instead of compiler options makes
everything build nicely in scratchbox.

Signed-off-by: Rami Ylimäki <ext-rami.ylimaki@nokia.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-28 15:42:43 +10:00