Commit Graph

733 Commits

Author SHA1 Message Date
Peter Hutterer 9fb08310b5 mi: don't process events from disabled devices (#77884)
Once a device is disabled, it doesn't have a sprite pointer anymore. If an
event is still in the queue and processed after DisableDevice finished, a
dereference causes a crash. Example backtrace (crash forced by injecting an
event at the right time):

(EE) 0: /opt/xorg/bin/Xorg (OsSigHandler+0x3c) [0x48d334]
(EE) 1: /lib64/libpthread.so.0 (__restore_rt+0x0) [0x37fcc0f74f]
(EE) 2: /opt/xorg/bin/Xorg (mieqMoveToNewScreen+0x38) [0x609240]
(EE) 3: /opt/xorg/bin/Xorg (mieqProcessDeviceEvent+0xd4) [0x609389]
(EE) 4: /opt/xorg/bin/Xorg (mieqProcessInputEvents+0x206) [0x609720]
(EE) 5: /opt/xorg/bin/Xorg (ProcessInputEvents+0xd) [0x4aeb58]
(EE) 6: /opt/xorg/bin/Xorg (xf86VTSwitch+0x1a6) [0x4af457]
(EE) 7: /opt/xorg/bin/Xorg (xf86Wakeup+0x2bf) [0x4af0a7]
(EE) 8: /opt/xorg/bin/Xorg (WakeupHandler+0x83) [0x4445cb]
(EE) 9: /opt/xorg/bin/Xorg (WaitForSomething+0x3fe) [0x491bf6]
(EE) 10: /opt/xorg/bin/Xorg (Dispatch+0x97) [0x435748]
(EE) 11: /opt/xorg/bin/Xorg (dix_main+0x61d) [0x4438a9]
(EE) 12: /opt/xorg/bin/Xorg (main+0x28) [0x49ba28]
(EE) 13: /lib64/libc.so.6 (__libc_start_main+0xf5) [0x37fc821d65]
(EE) 14: /opt/xorg/bin/Xorg (_start+0x29) [0x425e69]
(EE) 15: ? (?+0x29) [0x29]

xf86VTSwitch() calls ProcessInputEvents() before disabling a device, and
DisableDevice() calls mieqProcessInputEvents() again when flushing touches and
button events. Between that and disabling the device (which causes new events
to be refused) there is a window where events may be triggered and enqueued.
On the next call to PIE that event is processed on a now defunct device,
causing the crash.

The simplest fix to this is to discard events from disabled devices. We flush
the queue often enough before disabling that when we get here, we really don't
care about the events from this device.

X.Org Bug 77884 <http://bugs.freedesktop.org/show_bug.cgi?id=77884>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reported-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Tested-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-06-04 22:16:28 -07:00
Peter Hutterer d7ac9aff06 mi: start calculating the sprite trace from the first child of root
Introduced in
73698d41e4 "Make XYToWindow a screen function"

Moving the code into miwindow.c changed the start of the loop from
RootWindow()->firstChild to DeepestSpriteWindow(). This function is only
supposed to be called from miXYToWindow which resets spriteTraceGood to 1,
thus DeepestSpriteWindow() is always the root window anyway.
What got dropped was the firstChild as the first window to handle, so we may
end up with the root window twice in the sprite trace.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-05-08 12:59:19 -07:00
Keith Packard 73698d41e4 Make XYToWindow a screen function
This allows DDXen to override the window picking to account for
native windows not seen by the X server.  The bulk of the picking logic
is exposed as a new helper function, miSpriteTrace().  This function
completes the sprite trace filled out by the caller, and can be set up
to start the search from a given toplevel window.

v2: Leave existing XYToWindow API in place for API compatibility

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-01 10:30:42 -07:00
Adam Jackson 8468e24430 mi: Hush extension initialization (#75870)
Printing these as ErrorF is fairly obnoxious, since it means the
non-hardware servers now spew stuff to the console for entirely routine
events.  And actually, printing these at all is fairly obnoxious, since
a) we're printing a line for every extension, whether it's enabled or
not, and b) we're not actually initializing the extension at this point.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-03-29 00:01:11 -07:00
Keith Packard 11e2f0de71 mi: miPutImage with XYPixmap failed at depth 32 on 64-bit machines
The X server still has 'unsigned long' in a few places to hold 32 bit
values. One of those is in miPutImage where it's holding the temporary
planemask for XYPixmap format images.

It computed the highest plane in the source image with 1 << (depth -
1). On 64-bit machines, taking that value and storing it in an
unsigned long promotes it to a signed 64-bit value
(0xffffffff80000000).

Then, it loops over that value, shifting one bit right each time,
waiting for it to go to zero.. That takes 64 iterations, and ends up
with some mystic planemask values *and* walking off the end of the
source image data and out into space.

A simple cast is all that is required to compute the correct initial
plane mask (0x0000000080000000), at which point the loop operates
correctly once again.

Checking the fbPutImage code, I note that this same bug was fixed
in 2006 by Aaron Plattner in commit
f39fd42429

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
2014-03-26 12:58:40 -07:00
Emil Velikov e46820fb89 miinitext: introduce LoadExtensionList() to replace over LoadExtension()
Looping around LoadExtension() meant that ExtensionModuleList was reallocated
on every extension. Using LoadExtensionList() we pass an array thus the
function can do the reallocation in one go, and then loop and setup the
ExtensionModuleList.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Keith Packard <keithp@keithp.com>

v2: Update ephyr [Keith Packard]
v3: Eliminate const warnings in LoadExtensionList [Keith Packard]

Signed-off-by: Keith Packard <keithp@keithp.com>
2014-03-25 16:00:17 -07:00
Emil Velikov d415b9d69f miinitext: avoid allocating a sentinel ExtensionModule
With all the logic now in place there is no need to allocate a separate
ExtensionModule to be used as a sentinel.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-03-23 18:18:56 +00:00
Emil Velikov b421ac8e02 miinitext: constify staticExtensions
The array is readonly and should not be tampered with.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-03-23 18:18:56 +00:00
Emil Velikov 5ff34b5a0b miinitext: drop sentinel detection during LoadExtension
All the sentinels from the extension lists were removed, thus the only
case were this would trigger is when the code is broken badly.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-03-23 18:18:56 +00:00
Emil Velikov 6fea450d41 miinitext: move AddStaticExtensions() to LoadExtension()
Separate the function from NewExtensionModule() as the former does
only memory reallocation. No functional change.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-03-23 18:18:55 +00:00
Peter Hutterer 7b1b7fb3be mi: fix printf warning about size_t format specifier
mieq.c:290:26: warning: format '%u' expects argument of type 'unsigned int',
but argument 2 has type 'size_t' [-Wformat=]

pnprintf supports size_t since 5ea21560dd

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-02-10 07:02:34 +10:00
Keith Packard 2d2d49dab5 Clean up a few function prototypes to not place formals in /**/
This just removes the comment markers from around the formals in
several function prototypes near where pointer -> void * changes were
made. There are plenty more of these to fix.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-01-12 10:24:12 -08:00
Keith Packard 60014a4a98 Replace 'pointer' type with 'void *'
This lets us stop using the 'pointer' typedef in Xdefs.h as 'pointer'
is used throughout the X server for other things, and having duplicate
names generates compiler warnings.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-12 10:24:11 -08:00
Keith Packard c706fb0db8 Clean up warnings in mi.
A coupel of unused variables, and some debug code with mis-matching
printf format and variable types.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-01-12 10:14:49 -08:00
Adam Jackson 0492deb8f8 mieq: Bump default queue size to 512
Based on some bugzilla scraping I did around November 2012.  Of xserver
bugs in Red Hat bugzilla with an EQ size message in the log, the
distribution looked like:

String                      | Matches
-------------------------------------
Increasing EQ size to 512   | 460
Increasing EQ size to 1024  | 52
Increasing EQ size to 2048  | 6
Increasing EQ size to 4096  | 0

Most of the "512" ones appear to be mostly harmless, some relatively
expensive path in either rendering or resource destruction simply taking
too long due to external pressures like paging or CPU contention.  So
let's raise the initial queue size, both to reduce the number of
spurious abrt reports and to drop fewer events in all but the most
pathological cases.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-11-14 16:35:32 +09:00
Adam Jackson 43e5a43fa8 present: Don't try to initialize when building without present support
There's a --disable-present, so it'd be nice if it worked.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-11-11 15:21:15 -08:00
Keith Packard 5c5c1b7798 present: Add Present extension
Provides both a software implementation using timers and driver hooks
to base everything on vblank intervals.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-10-31 16:59:18 -07:00
Keith Packard 5631382988 dri3: Add DRI3 extension
Adds DRM compatible fences using futexes.
Uses FD passing to get pixmaps from DRM applications.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-10-31 16:58:30 -07:00
Adam Jackson d08966227e damage: Simplify DamageUnregister
You can only register one drawable on a given damage, so there's no
reason to require the caller to specify the drawable, the damage is
enough.  The implementation would do something fairly horrible if you
_did_ pass mismatched drawable and damage, so let's avoid the problem
entirely.

v2: Simplify xf86RotateDestroy even more [anholt]

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-10 14:28:35 -04:00
Adam Jackson e4b15125bb mipointer: Remove deprecated miPointerCurrentScreen
The only remaining use was in some debugging code in DMX.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-10 13:29:21 -04:00
Adam Jackson abbd85742a dix: FIXES is not optional
It's already not optional at configure time, this just makes it so at
build time too.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-10 13:28:24 -04:00
Adam Jackson bb82191bcf misprite: Delete some dead private storage
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-10 13:28:24 -04:00
Adam Jackson 4dca026880 mipointer: Remove EnqueueEvent from miPointerScreenFuncRec
No DDX overrode this, and we never actually called through that slot
anyway.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-10 13:28:23 -04:00
Adam Jackson ad076dc6e8 mipointer: Flatten calls to mieqSwitchScreen
No DDX was overriding this.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-10 13:28:23 -04:00
Peter Harris 20c2a3bcb1 mi: Avoid stack smash when drawing dashed lines
X.org Bug 54013 <https://bugs.freedesktop.org/show_bug.cgi?id=54013>

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Peter Harris <pharris@opentext.com>
2013-09-10 13:26:25 -04:00
Alan Coopersmith 5a36cdd915 Allow disabling XFree86-DGA, DRI, VidModeExtension extensions
Code to recognize these in extension enable/disable options was wrapped
in #ifdef XorgLoader, but that's not defined when building miinitext.c
since the great module merge of 1.13.  Change to an #ifdef that is defined.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Robert Hooker <robert.hooker@canonical.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-08-06 06:39:55 +02:00
Carlos Garnacho 0fbd779a82 mi: Ensure pointer emulating touch events update the sprite
Different miPointerSpriteFuncRec implementations do a varying
business at ultimately calling miPointerUpdateSprite(), this
particularly fails when using the plain mi sprite on touch events,
where the sprite is just moved/updated on cursor changes.

So, ensure miPointerUpdateSprite() is called generically for
pointer emulating touch events as with regular motion events.

Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-01-09 11:23:06 +10:00
Keith Packard 386e4d76ba Merge remote-tracking branch 'alanc/master' 2012-12-19 12:17:59 -08:00
Alan Coopersmith 9ff2e83151 EnableDisableExtensionError: Use ARRAY_SIZE rather than sentinel
d785368e0e converted the other miinitext functions to use ARRAY_SIZE,
and removed the sentinel, but missed EnableDisableExtensionError so
passing an invalid extension name could cause the server to walk off
the end off the list looking for a sentinel that wasn't there.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-12-18 15:35:02 -08:00
Peter Hutterer 78376a9217 mi: rename mipointer's internal event list
Avoid name shadowing warnings, change the event list to a more specific
name.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
2012-12-17 15:03:45 +10:00
Peter Hutterer c50db6faba Xi: fill in barrier root x/y after clamping to RandR outputs
x/y for barrier events should contain the actual pointer position.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
2012-12-17 15:03:18 +10:00
Peter Hutterer 21a15f9a04 Pass the event list through to the pointer barrier code to return it
Instead of having the pointer barrier code enqueue events separately from
GetPointerEvents, pass the event list through and let it add to it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
2012-12-17 15:03:12 +10:00
Jasper St. Pierre e130a46ab4 Add support for XI2.3: Pointer barrier events and releases.
This adds support for clients that would like to get a notification
every time a barrier is hit, and allows clients to temporarily release
a barrier so that pointers can go through them, without having to
destroy and recreate barriers.

Based on work by Chris Halse Rogers <chris.halse.rogers@canonical.com>

Signed-off-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-12-17 15:01:45 +10:00
Jasper St. Pierre 7e16dd3628 barriers: Switch to an explicit hook for barrier constrainment
Rather than riding on the ConstrainCursorHarder hook, which has
several issues, move to an explicit hook, which will help us with
some RANDR interaction issues.

Signed-off-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-12-17 15:01:33 +10:00
Daniel Stone db83830eef Constify argument to LoadExtension
Since we never modify it.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-11-21 11:13:55 +11:00
Yaakov Selkowitz f02e27e4fc mi: fix shadow warnings
mibitblt.c: In function 'miGetImage':
mibitblt.c:617:20: warning: declaration of 'pt' shadows a previous local
mibitblt.c:609:17: warning: shadowed declaration is here
mispans.c: In function 'miFillUniqueSpanGroup':
mispans.c:456:33: warning: declaration of 'i' shadows a previous local
mispans.c:382:9: warning: shadowed declaration is here
mispans.c:488:17: warning: declaration of 'i' shadows a previous local
mispans.c:382:9: warning: shadowed declaration is here

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-11-05 13:25:02 -06:00
Peter Hutterer f64254d85e mi: drop two useless conditions in miPointerSetPosition
pDev cannot be NULL here since fill_pointer_events is the only caller.
And if the screen is NULL, then the device tries to send events before it is
fully initialised. That certainly shouldn't happen and would be a bug
elsewhere.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2012-10-04 13:24:44 +10:00
Daniel Martin 1cb0261ef5 dix: Delete mibstore.h
Since Nov 2010 (commit c4c4676) the only purpose of mibstore.h was to
define an empty function (miInitializeBackingStore()) for backward
compatibility. Time to say goodbye.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-09-23 10:31:55 -07:00
Daniel Martin 056fd15dea dix: Delete mibstore.c
The only reference to mibstore.c was removed with commit c4c4676. Remove the
file itself too.

Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-09-23 10:30:34 -07:00
Peter Hutterer d53e6e02a2 mi: don't check for core events in miPointerSetPosition (#53568)
As of 81cfe44b1e, miPointerSetPosition now
returns the screen pointer of the device. This broke floating slave devices,
as soon as a motion event was submitted, miPointerSetPosition returned NULL,
crashing the server.

dev->coreEvents is only false if the device is a floating slave, in which
case it has a sprite.

X.Org Bug 53568 <http://bugs.freedesktop.org/show_bug.cgi?id=53568>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2012-08-23 14:48:14 +10:00
Jeremy Huddleston 3b7f313b3d XQuartz: Fix runtime regressions introduced by extension loading changes
* GLX is now loaded
 * PseudoramiX loading is back in miinitext.  It needs to be loaded
   before RandR.

Regression-from: 27a624bee6
Regression-from: 5f5bbbe543

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-07-24 00:32:30 -07:00
Daniel Stone a15dac5509 Remove unused setupFunc from extensions
setupFunc was used as an early callback for half-modular extensions such
as Xv, XvMC and DGA to set up hooks between the core server and the
modular component.  Now we've rid ourselves of that, we can also bin
setupFunc.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-10 00:31:02 -07:00
Daniel Stone 710318e803 Replace NO_HW_ONLY_EXTS with Xorg DDX test
Turns out the only thing we use NO_HW_ONLY_EXTS for is to check whether
or not we're building inside the Xorg DDX.  Replace it with an
XorgLoader test instead, and remove all its users.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-10 00:31:02 -07:00
Daniel Stone 5f5bbbe543 Unify miinitext.c
Rather than having a non-Xorg and an Xorg-specific path which basically
just duplicated each other for no reason, we could ... just have one.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-10 00:31:02 -07:00
Daniel Stone 147967f67d Remove Xorg-specific extensions from non-Xorg miinitext
miinitext.c had a completely separate codepath for non-Xorg servers,
which included tests for Xorg-specific extensions such as
XFree86-VidMode, which were external even to the Xorg DDX.  So we can
just remove them, and the associated #undefs.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-10 00:31:02 -07:00
Daniel Stone 27a624bee6 Quartz: Move PseudoramiX initialisation to DDX
As PseudoramiX is a DDX-specific extension, move its loading and
initialisation to hw/xquartz.  This creates a QuartzExtensionInit()
similar in spirit to xf86ExtensionInit.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-10 00:31:02 -07:00
Daniel Stone 79d14d9fc3 Move the remnants of loadext.c to miinitext.c
There was nothing XFree86-specific or loader-specific about this, aside
from using xf86MsgVerb instead of ErrorF.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-10 00:31:02 -07:00
Daniel Stone a089af3477 Loader: Move ExtensionModule types to DIX
In preparation for gutting loadext.c, move the ExtensionModule struct to
the DIX, and unexport ExtensionModuleList (why, why, why, why was this
ever exported in the first place, tbqh).

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-10 00:31:02 -07:00
Daniel Stone 8171108602 Loader: Remove extension initialisation sorting
Extensions could previously declare initialisation dependencies on other
extensions, which would then get nicely sorted by the loader.  We only
had one user for this, GLX, which had one pointless (Composite) and one
possibly useful dependency (DBE).  As DBE is now a built-in, it will
always be sorted by GLX, so we no longer have any users for it.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-10 00:31:02 -07:00
Daniel Stone 2fba9445a0 Add static extensions before those in modules
Make sure we add static extensions before anything in a module.  This is
more or less a no-op at the moment, but will come in handy later when
extension dependency sorting is removed.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-10 00:31:02 -07:00
Daniel Stone 6fb481d125 Move SELinux from extmod to built-in
Instead of letting it languish in extmod just because we want to
configure bits of it from xf86, move XSELinux to the builtin part of
Xext, and do its configuration from xf86ExtensionInit.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-09 23:28:37 -07:00
Tomas Carnecky 5d92ee4081 Xv: Remove excessive module-induced indirection
Xv used to call XvScreenInit and co. through function pointers, as
XvScreenInit may have been sitting on the other side of a module
boundary from xf86XvScreenInit.  Why this was so is a mystery, but make
it not so any more.

Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-09 23:28:37 -07:00
Tomas Carnecky 7a11b817e7 Move Xv and XvMC from extmod to built-in
Always build these extensions into the core server, rather than letting
them languish in extmod.

Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-09 23:28:37 -07:00
Tomas Carnecky 7d859bd878 Move XRes from extmod to built-in
Always build XRes support into the core server, rather than letting it
languish in extmod.

Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-09 23:28:37 -07:00
Tomas Carnecky ba21fc2958 Move DPMS from extmod to built-in
Always build DPMS support into the core server, rather than letting it
languish in extmod.

Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-09 23:28:36 -07:00
Tomas Carnecky 3ed2c6e112 Move MIT-SCREEN-SAVER from extmod to built-in
If we've built MIT-SCREEN-SAVER support, then just build it into the
main binary, rather than leaving it in extmod.

Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-09 23:28:36 -07:00
Tomas Carnecky b8c9ab0fea Move RECORD from external module to built-in
Rather than languishing in its own special module, move RECORD into the
core server.

Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-09 23:28:36 -07:00
Tomas Carnecky bf61bf69b2 Move DBE from an external module to built-in
If DBE support is compiled in the server, just man up and build it into
the server, rather than having it as an external module.

Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-09 23:28:36 -07:00
Daniel Stone d785368e0e miinitext: Use ARRAY_SIZE rather than sentinel
NULL sentinels are totally lame.

v2: numExtensionModules isn't public, so keep using the provided
    sentinal - Keith Packard <keithp@keithp.com>

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Stéphane Marchesin <stephane.marchesin@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-09 23:28:23 -07:00
Daniel Stone a1d41e311c Move extension initialisation prototypes into extinit.h
Create extinit.h (and xf86Extensions.h, for Xorg-specific extensions) to
hold all our extension initialisation prototypes, rather than
duplicating them everywhere.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-09 23:06:41 -07:00
Daniel Stone b86aa74caf GLX: Insert swrast provider from GlxExtensionInit
Rather than making poor old miinitext.c do it, including making DMX
have fake symbols just to keep it happy.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Stéphane Marchesin <stephane.marchesin@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-09 23:06:41 -07:00
Daniel Stone 13552a5c47 Reorder extension initialisation for non-Xorg
Reorder static extension initialisation in miinitext for non-Xorg
servers to match Xorg's order.

Tested with Xephyr; checked that the extension list was identical before
and after.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-09 23:06:41 -07:00
Tomas Carnecky 5079db78ae Replace INITARGS with void
INITARGS was a hardcoded define to void.  Since knowing the function
signature for your extensions is kinda useful, just replace it with a
hardcoded void, but leave the define there for API compatibility.

Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Cyril Brulebois <kibi@debian.org>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-09 23:06:41 -07:00
Alan Coopersmith 0af79b124e Use C99 designated initializers in dix Events
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-07-09 22:52:30 -07:00
Alan Coopersmith cdf5bcd420 Use calloc to zero fill buffers being allocated for replies & events
Ensures padding bytes are zero-filled

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-07-09 19:58:29 -07:00
Keith Packard f38b2b6283 mi: Don't save midispcur rendering resources for each cursor
Instead, only save them for the most recently drawn cursor. This saves
a bunch of storage for idle cursors.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-07-05 13:40:23 -07:00
Keith Packard 24525d96a3 Merge branch 'sigsafe-logging-varargs'
This merge includes a minor fixup for '%p' arguments; must cast to
uintptr_t instead of uint64_t as we use -Werror=pointer-to-int-cast
which complains when doing a cast (even explicitly) from a pointer
to an integer of different size.
2012-07-02 22:35:39 -07:00
Chase Douglas 6fd5add005 Log mieq enqueue overflow in a signal safe manner
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-07-02 22:34:33 -07:00
Dave Airlie 957bf959fb dix/render: consolidate window format matching code.
This code existed in 3 different forms, perhaps it should be
consolidated.

Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-06-28 10:43:35 -07:00
Dave Airlie 1f0e8bd5eb api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.

Its been squashed to make bisection easier.

Full patch log below:

commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Mon May 14 15:16:11 2012 -0700

    xfree86: Bump video ABI to 13.0

    The ABI was broken by changes to convert from screen index numbers to ScreenPtr
    / ScrnInfoPtr in various structures and function signatures.

    Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Dave Airlie <airlied@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date:   Thu May 24 10:56:57 2012 +0100

    xf86: xf86ClearEntityListForScreen should take a pScrn

    When adding GPU screens this make life easier.

    (also fix comment, as pointed out by Alan)

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date:   Thu May 24 07:07:32 2012 +0100

    xf86i2c: add pscrn for drivers to use

    This just adds a pScrn pointer into the struct for the drivers to use
    instead of scrnIndex. Mostly scrnIndex is used for logging, but some
    drivers use it to lookup xf86Screens, so let them stash a pScrn instead.

    Removing the scrnIndex is a bit more involved and I'm not sure its worth
    the effort. Doing i2c in the X server is legacy code as far as I'm concerned.

    Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date:   Wed May 23 19:25:20 2012 +0100

    dix/gc: consolidate GC object creation in one place

    The standard GC create and scratch GC create were 90% the same really,
    and I have a need in the future for creating GC objects without the
    other bits, so wanted to avoid a third copy.

    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date:   Wed May 23 10:24:06 2012 +0100

    xf86: add a define to denote the new non-index interfaces are being used

    This can be used by drivers to provide compatible APIs.

    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date:   Wed May 23 15:09:12 2012 +0100

    dix: make Create/Free scratch pixmaps take a ScreenPtr

    While technically an API/ABI change I doubt anyone uses it,
    but it helps in splitting screens up.

    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date:   Wed May 23 14:57:55 2012 +0100

    xf86/xv: remove scrnIndexfrom xf86FindXvOptions.

    Move this interface to taking an ScrnInfoPtr.

    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date:   Wed May 23 14:53:59 2012 +0100

    xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)

    stop passing indices into this function.

    v2: drop flags argument.

    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date:   Wed May 23 14:48:09 2012 +0100

    xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)

    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 14:18:59 2012 +0100

    xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)

    Instead of passing an index, pass the actual ScreenPtr. This allows
    more moving towards not abusing xf86Screens + screenInfo.

    v2: drop the blockData/wakeupData args as per ajax's suggestion.,
    fix docs.

    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date:   Wed Apr 11 09:53:14 2012 +0100

    xf86/common: remove some more pScrn->pScreen uses

    remove some more conversions that appeared after api cleanups.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 16:34:53 2012 +0100

    ddc: change API to take ScrnInfoPtr (v2)

    This removes all xf86Screens usage from ddc code,
    it modifies the API for some functions to avoid taking indices.

    v2: address Alan's comments about dropping DDC2Init parameter.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 16:31:26 2012 +0100

    vbe: don't use index for VBEInterpretPanelID (API)

    Remove use of xf86screens from vbe module.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 16:25:11 2012 +0100

    int10/vbe: don't use xf86Screens. (ABI) (v3)

    Pass the ScrnInfoPtr instead of the index in the int10 struct.

    This saves us using it to dereference xf86Screens.

    v2: address Alan's comment to fix struct alignment.

    v3: squash in all the int10 fixes, test the vm86 code builds,
    after comments by Keith.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 15:30:18 2012 +0100

    xserver: drop index argument to ScreenInit (ABI/API) (v2)

    This drops the index argument, its the same as pScreen->myNum,
    and its the last major index abuse I can find.

    v2: address Alan's review - update docs, fix xwin/xnest/darwin

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 15:23:01 2012 +0100

    xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)

    This migrates PointerMoved from an index to ScrnInfoPtr.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 15:20:46 2012 +0100

    xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)

    This migrates the PMEvent from index to ScrnInfoPtr.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 15:18:30 2012 +0100

    xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)

    This migrates the SetDGAMode callback from an index to ScrnInfoPtr.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 15:14:11 2012 +0100

    xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)

    This migrates the ChangeGamma interface to avoid passing a index.

    v2: fix xf86RandR12.c + xf86cmap.c call

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 15:11:09 2012 +0100

    xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)

    The EXA interface migrates to ScreenPtr,
    and the xf86 interface migrated to ScrnInfoPtr.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 15:02:11 2012 +0100

    xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)

    This migrates the ValidMode to passing a ScrnInfoPtr instead
    of an index.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 14:59:46 2012 +0100

    xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)

    This migrate the SwitchMode interface to take a ScrnInfoPtr
    instead of an index.

    v2: drop flags.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 14:50:37 2012 +0100

    xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)

    This converts AdjustFrame code paths to passing a ScrnInfoPtr
    instead of an integer index.

    v2: drop flags args.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 14:41:27 2012 +0100

    xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)

    Another index->pScrn conversion.

    v2: drop flags arg.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 14:35:41 2012 +0100

    xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)

    This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
    instead of an index into xf86Screens. This allows dropping more
    public dereferences of the xf86Screens and screenInfo.

    v2: drop flags args as suggested by Keith, fix docs.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 14:04:59 2012 +0100

    xserver: remove index from CloseScreen (API/ABI breakage)

    This drops the index from the CloseScreen callback,
    its always been useless really, since the pScreen contains it.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 13:22:18 +01:00
Michal Suchanek 6699f54fe0 mi: Remove redundant declarations.
Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-14 13:17:01 +01:00
Keith Packard 9838b7032e Introduce a consistent coding style
This is strictly the application of the script 'x-indent-all.sh'
from util/modular. Compared to the patch that Daniel posted in
January, I've added a few indent flags:

	-bap
	-psl
	-T PrivatePtr
	-T pmWait
	-T _XFUNCPROTOBEGIN
	-T _XFUNCPROTOEND
	-T _X_EXPORT

The typedefs were needed to make the output of sdksyms.sh match the
previous output, otherwise, the code is formatted badly enough that
sdksyms.sh generates incorrect output.

The generated code was compared with the previous version and found to
be essentially identical -- "assert" line numbers and BUILD_TIME were
the only differences found.

The comparison was done with this script:

dir1=$1
dir2=$2

for dir in $dir1 $dir2; do
	(cd $dir && find . -name '*.o' | while read file; do
		dir=`dirname $file`
		base=`basename $file .o`
		dump=$dir/$base.dump
		objdump -d $file > $dump
	done)
done

find $dir1 -name '*.dump' | while read dump; do
	otherdump=`echo $dump | sed "s;$dir1;$dir2;"`
	diff -u $dump $otherdump
done

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-03-21 13:54:42 -07:00
Zhigang Gong f4956faab9 mi/mibitblt: Fix an overflow bug of bit shift.
When depth equal to 32 and planeMask equal to 0, the overflow will
occur and cause the pixmap can't be cleared. There are some test
cases in XTS hit this bug, and this fix can eliminate the corresponding
failures.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-01-09 13:09:49 -08:00
Peter Hutterer 8a32c39c00 mi: handle screen switching on pointer emulated touch events
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-21 14:16:36 +10:00
Peter Hutterer 48547068b1 mi: split move to new screen logic to a helper function
No functional changes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-21 14:16:36 +10:00
Peter Hutterer 93c2a1628a Hook up the ownership events
This patch applies most of the protocol conversions and the internal event
type for ownership events.

Note that ownership events are generated by the DIX only, they do not pass
through the event queue.

Co-authored-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-19 09:08:32 +10:00
Peter Hutterer 3390d3fc03 Xi: process raw touch events
No-one can generated them yet, but if they could, we'd be processing them
like there was no tomorrow.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-16 11:18:47 +10:00
Peter Hutterer 84db813b9d Hook up TouchBegin/Update/End events
The are the same as device events internally but require the touch ID
separately from the detail.button field (the protocol uses the detail field
for the touch id).
For simpler integration of pointer emulation we need to set the
detail.button field while keeping the touchid around.

Add the three new touch event types to the various places in the server
where they need to be handled. The actual handling of the events is somewhat
more complicated in most places.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-16 11:18:47 +10:00
Alan Coopersmith d829a7c5cb Move to autoconf standard function name checks & defines
Replace multiple methods of checking for functions with AC_CHECK_FUNCS
Replace multiple methods of selecting fallback funcs with AC_REPLACE_FUNCS
Replace HAS_* and NEED_* #defines with autogenerated HAVE_*

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
2011-12-05 14:32:45 -08:00
Alan Coopersmith 05f589d464 Fix gcc -Wwrite-strings warnings in various extensions
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23 12:15:07 -08:00
Keith Packard d91aa0e660 Merge remote-tracking branch 'whot/two-screen-coordinates' 2011-11-02 21:20:07 -07:00
Jeremy Huddleston ad450d76e4 mieq: Reserve some space in EQ for release and other special events
The last 64 events in the event queue will be reserved for release
events in order to help return the system to a cleaner state when
it comes back from a soft wedge.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-21 00:32:03 -07:00
Jeremy Huddleston 7d153f25be mieq: Provide better adaptability and diagnostics during mieq overflow
This patch changes from a static length event queue (512) to one that
starts at 128 and grows to 4096 as it overflows, logging each time it
grows.

This change also allows for multiple backtraces to be printed when the
server is wedged rather than just one.  This increased sampling should
help identify the true hog in cases where one backtrace might be
insufficient.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-21 00:32:03 -07:00
Peter Hutterer 401150d7dc input: change pointer screen crossing behaviour for multiple ScreenRecs
miPointerSetPosition traditionally took coordinates on a per-screen basis,
triggering a screen switch when these went out-of-bounds. For absolute
devices, this prevented screen crossing in the negative x/y direction.

This patch changes the event generation patch to handle screen coordinates
in a desktop range (i.e. all screens together). Screen switches are
triggered when these coordinates are not on the current screen.

This unifies the pointer behaviour of single ScreenRec multihead and
multiple ScreenRecs multihead in that the cursor by default moves about the
whole screen rather than be confined to one single screen. The
transformation matrix may then be used to actually confine the cursor to the
screen again.

Note: fill_pointer_events has to deal with several different coordinate
systems. Make sure you read the comment before trying to understand the code.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-13 11:34:43 +10:00
Peter Hutterer 3b36fd1b49 mi: switch miPointerSetPosition to take doubles
Don't switch between doubles and ints in the caller, instead take doubles in
miPointerSetPosition and do the conversion there. For full feature we should
change everything down from here for doubles too.

Functional change: previously we'd restore the remainder regardless of
screen switching/confinement (despite what the comment said). Now,
screen changing or cursor constraints will cause the remainder be clipped
off. This should happen for cursor constraints but arguably not for screen
crossing.

This also corrects a currently wrong comment about miPointerSetPosition's
input coordinates.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-11 12:06:56 +10:00
Peter Hutterer 81cfe44b1e mi: return the screen from miPointerSetPosition
miPointerSetPosition may switch screens. Always return the screen the sprite
is on instead of relying on callers to call miPointerGetScreen().

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-11 12:06:53 +10:00
Keith Packard afb1fe695d Merge remote-tracking branch 'whot/next' 2011-09-26 20:24:15 -07:00
Matt Turner 9eab5b3443 Replace Fabs() macro with fabs() function
gcc generates better code with fabs() anyway.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-09-21 17:12:04 -04:00
Peter Hutterer 6fd2adc179 mi: fix compiler warnings ("foo" set but not used)
misprite.c: In function 'miSpriteSaveUnderCursor':
misprite.c:940:12: warning: variable 'y' set but not used
[-Wunused-but-set-variable]
misprite.c:940:9: warning: variable 'x' set but not used
[-Wunused-but-set-variable]

mivaltree.c: In function 'miComputeClips':
mivaltree.c:226:10: warning: variable 'resized' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:52 +10:00
Peter Hutterer b3c76b0c53 mi: fix comment typo, whitespace in miPointerSetPosition
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:51 +10:00
Peter Hutterer c9562bed0d dix: rename mieqSwitchScreen argument fromDix → set_dequeue_screen, document
fromDIX is neither exactly true nor particularly helpful in understanding
what this parameter triggers. Rename to set_dequeue_screen, because that's
exactly what happens.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:51 +10:00
Ville Syrjälä 9504caf1c3 composite: Inhibit window background paint with manual subwindow redirection
The composite extension spec says that window background painting
should be inhibited when the subwindow redirection mode is set to
manual.

This eliminates the ugly flashing effect when compiz unredirects a
fullscreen window.

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
Reviewed-by: Owen Taylor <otaylor@fishsoup.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-08-03 20:46:36 -07:00
Peter Hutterer 23a7832789 input: add POINTER_NORAW to avoid generation of raw events (#30068)
RawEvents are supposed to be events coming from the driver. When warping the
pointer, this should not generate a raw event.

X.Org Bug 30068 <http://bugs.freedesktop.org/show_bug.cgi?id=30068>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-07-01 08:46:28 +10:00
Jeremy Huddleston 4c4df3ac0d input: Don't implicitly define verify_internal_event
Fixes regression introduced by 5690199802

mieq.c:159:5: error: implicit declaration of function 'verify_internal_event' is invalid in C99 [-Wimplicit-function-declaration,Semantic Issue]
    verify_internal_event(e);
    ^
1 error generated.

Also includes some other warning cleanups in events.c we're there.

events.c:2198:24: warning: equality comparison with extraneous parentheses [-Wparentheses,Semantic Issue]
        else if ((type == MotionNotify))
                  ~~~~~^~~~~~~~~~~~~~~
events.c:2198:24: note: remove extraneous parentheses around the comparison to silence this warning [Semantic Issue]
        else if ((type == MotionNotify))
                 ~     ^              ~
events.c:2198:24: note: use '=' to turn this equality comparison into an assignment [Semantic Issue]
        else if ((type == MotionNotify))
                       ^~
                       =
events.c:2487:5: error: implicit declaration of function 'verify_internal_event' is invalid in C99 [-Wimplicit-function-declaration,Semantic Issue]
    verify_internal_event(event);
    ^
events.c:5909:22: warning: declaration shadows a local variable [-Wshadow,Semantic Issue]
        DeviceIntPtr it = inputInfo.devices;
                     ^
events.c:5893:18: note: previous declaration is here
    DeviceIntPtr it = inputInfo.devices;
                 ^
3 warnings and 1 error generated.

events.c:2836:27: warning: incompatible pointer types passing 'DeviceEvent *' (aka 'struct _DeviceEvent *') to parameter of type
      'const InternalEvent *' (aka 'const union _InternalEvent *')
    verify_internal_event(ev);
                          ^~
../include/inpututils.h:40:56: note: passing argument to parameter 'ev' here
extern void verify_internal_event(const InternalEvent *ev);
                                                       ^
1 warning generated.

Found-by: yuffie tinderbox (-Werror=implicit)
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-05-24 14:08:13 +10:00
Jeremy Huddleston 25191648b8 XQuartz: Don't call mieqEnqueue during server shutdown
Found-by: GuardMalloc
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-05-14 19:15:27 -07:00
Peter Hutterer 8670c46bdf input: replace EventListPtr with InternalEvent array
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-05-11 14:27:36 +10:00
Peter Hutterer 5690199802 input: change CHECKEVENT macro to verify_internal_event function
The macro is sufficient if called during a development cycle, but not
sufficient information when triggered by a user (e.g.
https://bugzilla.redhat.com/show_bug.cgi?id=688693).

Expand what this does to print the event content and a backtrace, so at
least we know where we're coming from. Only the first 32 bytes are printed
since if something goes wrong, the event we have is almost certainly an
xEvent or xError, both restricted to 32 bytes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-05-06 09:58:08 +10:00
Tiago Vignatti 90e03ab026 mi: fix memory leak in miZeroLine
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
2011-04-04 15:47:58 +03:00
Tiago Vignatti 7ae46b69ba mi: fix memory leak in miFillUniqueSpanGroup
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-04 15:41:13 +03:00
Tiago Vignatti dce2f10cf7 mi: fix memory leak in miInitVisuals
Free the pointers inside miInitVisuals, so the callers of this function
(fboverlay.c and fbscreen.c) don't need to worry with deallocation in the case
of failure.

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-04 15:41:13 +03:00
Tiago Vignatti aa7096ca6f xorg: remove unused pointer values all over the server
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-04 15:41:13 +03:00
Erkki Seppälä f985a7319e mi/misprite: use memory management provided by dixRegisterPrivateKey
The record allocated by miSpriteDeviceCursorInitialize was not being
released.

This patch makes misprite use dixRegisterPrivateKey with the record
size argument, which handles the memory management issues.
miSpriteDeviceCursorInitialize is restructured to initialize pCursorInfo
only if miDCDeviceInitialize succeeds. The record itself is zeroed on
cleanup to ensure that the assumptions in the code still hold.

Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
2011-03-14 14:01:01 -04:00
Adam Jackson 810fbfa446 mi: Call pScreen->ConstrainCursorHarder from the position update path
v2: Cover more paths, spotted by Daniel Stone.
v3: pass down the mode field for movement mode.

Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-03-14 13:35:51 -04:00
Peter Hutterer 769531b9cc Add mode field to pointer movement hooks.
Preparation work for pointer barriers.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-03-14 13:25:14 -04:00
Peter Hutterer 17265ccb02 Move master/lastSlave out of the union into separate fields.
The removal of the double-use will cause some suble bugs as some conditions
to check for the dev->u.master case were broken and also evaluated as true
if lastSlave was set (instead of master).

Also breaks the input ABI.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22 14:35:45 +10:00
Peter Hutterer 77113dd3ee input: Change a bunch of direct dev->u.master accesses to use GetMaster()
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22 14:35:45 +10:00
Peter Hutterer 0ba526deeb mi: check for MASTER_POINTER instead of manual checks.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22 14:35:45 +10:00
Peter Hutterer 52c13896ce mi: update macro to search for MASTER_POINTER
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22 14:35:45 +10:00
Peter Hutterer dc57f89959 Switch to use IsFloating()
This is not a straightforward search/replacement due to a long-standing
issue.

dev->u.master is the same field as dev->u.lastSlave. Thus, if dev is a master
device, a check for dev->u.master may give us false positives and false
negatives.
The switch to IsFloating() spells out these cases and modifies the
conditions accordingly to cover both cases.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22 14:35:44 +10:00
Peter Hutterer dc32a23890 Fix two incorrect checks for master devices.
These two were sideeffects of lastSlave being in the same field as the
master. For devices generated by the master device directly, lastSlave was 0
and the device would (with the old checks) be interpreted as floating.

Add the required checks to safeguard against master devices.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22 14:35:44 +10:00
Peter Hutterer c2a9e0a969 mi: simplify a "check for keyboard" condition
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22 14:35:44 +10:00
Peter Hutterer 3a6160b408 mi: remove if 0 code.
Note sure why this is in if 0 but it's been that way since 2007.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22 14:35:44 +10:00
Peter Hutterer d9987c8c45 mi: Add a few comments explaining various cursor move functions.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22 14:35:44 +10:00
Peter Hutterer 15fe86e69f mi: remove static GenerateEvent variable.
Push into the respective devices. This should have no functional changes
since we never warp more than one device at a time. In the glorious future
with true multithreading, still the better thing to do.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22 14:35:43 +10:00
Tomas Carnecky aa30a86583 NO_PANORAMIX preprocessor symbol is nowhere defined
Which makes it useless, so remove it.

Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-01-07 09:30:45 +10:00
Ville Syrjälä 0998574699 Call SourceValidate even if src == dst
The extra SourceValidate calls from damageCopyArea and damageCopyPlane
can be removed.

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-01-05 11:56:42 -08:00
Ville Syrjälä e41e907b3c Add subWindowMode parameter to SourceValidate
Pass the subWindowMode from the GC/source Picture to SourceValidate.

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-01-05 11:56:28 -08:00
Pauli Nieminen 13ac3deedb mi: Only register sprite block handler when needed
miSpriteBlockHandler takes about 10us in arm each time BlockHandlers are
called. To eliminate that overhead from xserver side only register the
BlockHandler when there actually is any cursor down.

Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-12-31 12:52:51 +00:00
Pauli Nieminen 4f6e3b0f37 mi: Register sprite damage handler only when required
There is no need to have damage handler registered when there isn't any
pointer in the screen. This avoids some overhead from damage handling
which takes tens of microseconds on arm.

Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-12-31 12:52:51 +00:00
Pauli Nieminen bf48082f30 mi: Fix the debug message
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-12-31 12:52:51 +00:00
Pauli Nieminen 8fb43b8bf9 mi: Fix wrapping for sprite screen
SCREEN_EPILOGUE should read the current function pointer from screen
after calling wrapped function in case the pointer changes.

Passing pPriv to macros instead of asking dix each time makes sense when
both macros need same pointer.

Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-12-31 12:52:51 +00:00
Pauli Nieminen 4be2a6d1b3 mi: Add GetSpriteScreen macro to hide dixLookupPrivate
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-12-31 12:52:51 +00:00
Alan Coopersmith 2db6951763 Sun's copyrights now belong to Oracle
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2010-12-07 11:10:35 -08:00
Peter Hutterer 31ab9f8860 mi: handle DGA subtypes when determining the master device.
The subtype in the DGA event is the core type and all ET_ event types (where
applicable) are identical to the core types. Thus the switch statement below
will work as required and assign the right master device.

Fixes a crasher bug on keyboard devices with valuators. If a device sends a
motion event while grabbed and a DGA client is active (but has not selected
input through DGA), the valuator event is posted through the VCK and
eventually results in a NULL-pointer dereference on dev->valuator.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-12-07 08:07:54 +10:00
Adam Jackson 63b9d67d7f mi: Remove unused miAllocateGCPrivateIndex
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-11-30 13:46:09 -05:00
Adam Jackson fba5c8154d dix: Remove unused ChangeSaveUnder hooks
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-11-30 13:46:09 -05:00
Adam Jackson c4c4676e68 dix: Remove the backing store leftovers
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-11-30 13:46:08 -05:00
Peter Hutterer 88cb61e1e5 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-api
Conflicts:
	dix/getevents.c
	hw/xfree86/common/xf86Xinput.h

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-11-11 12:54:46 +10:00
Keith Packard 4ed4915bc0 Merge remote branch 'whot/for-keith' 2010-11-10 16:58:21 -08:00
Siddhesh Poyarekar be7cf14c36 mi: Integer overflow for dashed lines longer than 46340. #31093
Lines of length greater than 46340 can be drawn with one of the
coordinates being negative. However for dashed lines, miPolyBuildPoly
overflows the int type when setting up edges for a section of the
dashed line. This results in the dashed segments not being drawn at
all.

Signed-off-by: Siddhesh Poyarekar <siddhesh.poyarekar@gmail.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-11-10 14:55:21 -08:00
Cyril Brulebois b142b0d274 Remove more superfluous if(p!=NULL) checks around free(p).
This patch has been generated by the following Coccinelle semantic patch:

@@
expression E;
@@
- if (E != NULL)
-   free(E);
+ free(E);

Signed-off-by: Cyril Brulebois <kibi@debian.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-11-11 08:29:54 +10:00
Peter Hutterer 675f4a8525 Abstract valuator masks through a set of APIs.
This commit introduces an abstraction API for handling masked valuators. The
intent is that drivers just allocate a mask, set the data and pass the mask
to the server. The actual storage type of the mask is hidden from the
drivers.

The new calls for drivers are:
    valuator_mask_new()     /* to allocate a valuator mask */
    valuator_mask_zero()    /* to reset a mask to zero */
    valuator_mask_set()     /* to set a valuator value */

The new interface to the server is
    xf86PostMotionEventM()
    xf86PostButtonEventM()
    xf86PostKeyboardEventM()
    xf86PostProximityEventM()

all taking a mask instead of the valuator array.

The ValuatorMask is currently defined for MAX_VALUATORS fixed size due to
memory allocation restrictions in SIGIO handlers.

For easier review, a lot of the code still uses separate valuator arrays.
This will be fixed in a later patch.

This patch was initially written by Chase Douglas.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2010-10-22 11:02:48 +10:00
Jon TURNEY da4eebe58e event_size is currently never assigned to in mieqProcessInputEvents().
event_size is never assigned to in mieqProcessInputEvents(), so realloc()
is always called.  This is benign, but I'm guessing not intended.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-10-13 09:46:26 -07:00
Jamey Sharp 402942cdbc Introduce per-object per-screen privates.
This replaces dixCreatePrivateKey and the only uses, which were in
midispcur.

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: Keith Packard <keithp@keithp.com>
2010-09-18 11:17:18 +02:00
Jamey Sharp ccdf156890 miPolyGlyphBlt: Delete redundant ValidateGC.
The caller is required to have validated the GC for the drawable before
calling any ops, including PolyGlyphBlt.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-09-13 15:58:08 -07:00
Tiago Vignatti 5098801b3a mi: delete unused code
pBSReg is always NULL, so the statement after the conditional will never be
reached.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2010-09-10 21:49:29 +03:00
Jesse Barnes 02b11509b2 miModifyPixmapHeader: always update serialNumber
We should update the serial number even if we just change a single field.

Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-07-09 16:13:03 -07:00
Peter Hutterer b46ffd25d3 mi: rename miPointerMoved to miPointerMoveNoEvent.
Having miPointerMove and miPointerMoved is confusing, especially since both
do the same thing bar the event delivery. Also, miPointerMove calls
miPointerMoved which indicates some confusion in the temporal alignment of
cause and effect.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-07-07 13:29:45 +10:00
Peter Hutterer dbd621705a mi: De-duplicate some code in mipointer.c
miPointerMoved already has the same code.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-07-07 13:27:09 +10:00
Alan Coopersmith 3d9079b898 Add API to update setting of waitForUpdate screen private in miPointer
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-07-02 14:27:49 +10:00
Keith Packard e2918b6739 Revert "mi: Remove unused overlay support"
This reverts commit 9120e58556.

 Whoops, please revert this patch -- overlay is in use in nvidia drivers,
 and it's too late in release cycle to remove it.

 I feel really sorry that I kept this patch in my tree. I will submit
another one, removing only XAA overlay hooks which are not used at all.
2010-06-22 12:11:20 -07:00
Mikhail Gusarov 9120e58556 mi: Remove unused overlay support
The only reference to it in server and drivers is in XAA overlay code which
would segfault as no miInitOverlay is called ever. No segfaults were observed
"in wild", so XAA overlay is probably also unused.

XAA code is modified to act as if miOverlayCopyUnderlay always returned false,
because XAACopyWindow8_32 could only set doUnderlay to true if it's called from
miOverlayMoveWindow or miOverlayResizeWindow, which can only be called if
miInitOverlay has hooked those functions, and no driver (on fd.o) or server code
calls that.

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-06-20 05:36:22 +07:00
Mikhail Gusarov 91b5aadbdf mi: do not use X11/extensions/shape.h header from libXext
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Tested-by: Dan Nicholson <dbn.lists@gmail.com>
2010-06-20 05:36:22 +07:00
Mikhail Gusarov 7287ef9e6c Remove unnecessary parentheses around return values in functions
This patch was generated by the following Perl code:

perl -i -pe 's/([^_])return\s*\(\s*([^(]+?)\s*\)s*;(\s+(\n))?/$1return $2;$4/g;'

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-10 06:42:42 -07:00
Mikhail Gusarov 0a4d8cbdcd Remove more superfluous if(p) checks around free(p)
This patch has been generated by the following Coccinelle semantic patch:

@@
expression E;
@@

-if(E) { free(E); }
+free(E);

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-06-06 20:27:18 +07:00
Mikhail Gusarov 5a0fc0ad21 Replace deprecated bzero with memset
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Marcin Baczyński <marbacz@gmail.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-06-06 15:07:27 +07:00
Jamey Sharp a0fe6987b5 Clean up after removal of screen parameters from region macros.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-06-05 22:07:21 -07:00
Keith Packard ab07e2b8ed Allocate per-screen device/cursor-bits private keys in midispcur
midispcur was abusing the CursorScreenKey to index the cursor_bits
privates, it also had a MAXSCREENS array of keys to index device
privates. Switch both of these to the new dixCreatePrivateKey API and
store a pointer to that in the screen private.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-06-05 19:31:37 -07:00
Keith Packard faeebead7b Change the devPrivates API to require dixRegisterPrivateKey
This patch only changes the API, not the implementation of the
devPrivates infrastructure. This will permit a new devPrivates
implementation to be layed into the server without requiring
simultaneous changes in every devPrivates user.

Signed-off-by: Keith Packard <keithp@keithp.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-06-05 19:23:03 -07:00
Keith Packard c865a24401 Create separate private key for midispcur cursor bits
The CursorScreenKey array is supposed to be used by the DDX for cursor
private data, but midispcur was abusing it to hold cursor bits private
information. Create a separate set of privates for the dispcur cursor
bits information.

This also renames the device private index and macros to better
reflect their usage:

	miDCSpriteKey -> miDCDeviceKey
	MIDCBUFFER -> miGetDCDevice

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-06-05 19:16:56 -07:00