Commit Graph

62 Commits

Author SHA1 Message Date
Povilas Kanapickas 5eb985e353 mi: Add a callback to notify driver about input event submission
This is useful for mock input drivers that control the server in
integration tests. Given that input submission happens on a different
thread than processing, it's otherwise impossible for the driver to
synchronize with the completion of the processing of submitted events.

Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2020-09-24 17:33:22 +00:00
Adam Jackson ff310903f3 mi: Add a default no-op miSourceValidate
Slightly simplifies the callers since they don't need to check for
non-NULL anymore.

I do extremely hate the workarounds here to suppress misprite taking the
cursor down though. Surely there's a better way.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2019-10-30 16:26:01 +00:00
Peter Hutterer 732fd7e571 Drop trailing whitespaces
sed -i "s/[ ]\+$//g" **/*.(c|h)

happy reviewing...
git diff -w is an empty diff.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-12 10:25:00 +10:00
Adam Jackson 21b041ef48 mi: Fold mipoly{con,gen}.c into mipoly.c
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:26 -04:00
Adam Jackson 9ed83a694b mi: miSlideAndSizeWindow -> miResizeWindow
Make the function name match the screen slot name.

Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-09 11:14:53 +02:00
Adam Jackson 1e56b2dfc6 mi: Move pScreen->SendGraphicsExpose up to dix
No DDX is overriding this and it's fairly absurd to expose it as a
screen operation anyway.

Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-09 11:14:53 +02:00
Adam Jackson 5d3bd8a3dc mi: Drop plane argument from miHandleExposures
This existed to be passed to the bs recovery routine; since we back all
planes, we don't care.

Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-09 11:14:53 +02:00
Adam Jackson 7eddc80bc4 mi: Simplify composite border clip redirection interface
There's not really a good reason for mi to not just call the composite
code directly.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-09 11:14:53 +02:00
Adam Jackson 0d30d44a8c dix: Drop the third argument from WindowExposuresProcPtr
A careful read shows that it was always NULL.  It hasn't always been; as
the DDX spec indicates, it was the "occluded region that has backing
store", but since that backing store code is long gone, we can nuke it.

mi{,Overlay}WindowExposures get slightly simpler here, and will get even
simpler in just a moment.

Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-09 11:14:44 +02:00
Adam Jackson 35eabf2e52 mi: Remove apparently unused miSegregateChildren
This came in between XFree86 4.3 and 4.4, I'm not entirely sure what it
was meant to do.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-07-29 09:51:43 -04:00
Eric Anholt 6d49548849 Merge remote-tracking branch 'origin/master' into glamor-next
I've done this merge manually to resolve the minor conflict in glamor.c.

Signed-off-by: Eric Anholt <eric@anholt.net>
2014-07-17 18:07:26 -07:00
Peter Harris 5eb77697ea Avoid starting a comment with */*
Even though -Wcomment doesn't mind it (in gcc or clang), the appearance
of */* confuses the syntax highlighter of some editors (eg. vim), and
causes warnings in MSVC.

Signed-off-by: Peter Harris <pharris@opentext.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-07-17 10:19:52 -07:00
Keith Packard a7fce36aff mi: Make miPolyArc draw fast zero-width when possible
Instead of forcing drivers to figure out when to call miZeroPolyArc,
have miPolyArc call that when possible.

This involved renaming the existing miPolyArc call to miWideArc and
creating a new miPolyArc wrapper function as miZeroPolyArc falls back
to miWideArc when the arc is too large to be drawn with the zero-width
code (ellipses larger than 800x800).

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-06-12 22:52:49 -07:00
Keith Packard bf1429b203 mi: Create miPolylines as a general-purpose line drawing function
Instead of requiring all drivers to figure out which mi function to
call for each of the four cases, create a single wrapper in mi that
handles them correctly. Now drivers can simply use miPolylines in all
cases.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-06-12 22:52:47 -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
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 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
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
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
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 2dc138922b Rename region macros to eliminate screen argument
This is a combination of a huge mechanical patch and a few small
fixups required to finish the job. They were reviewed separately, but
because the server does not build without both pieces, I've merged
them together at this time.

The mechanical changes were performed by running the included
'fix-region' script over the whole tree:

$ git ls-files | grep -v '^fix-' | xargs ./fix-region

And then, the white space errors in the resulting patch were fixed
using the provided fix-patch-whitespace script.

$ sh ./fix-patch-whitespace

Thanks to Jamey Sharp for the mighty fine sed-generating sed script.

The hand-done changes involve removing functions from dix/region.c
that duplicate inline functions in include/regionstr.h, along with
their declarations in regionstr.h, mi.h and mispans.h.

Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-05 18:59:00 -07:00
Keith Packard 9b6f5f549d Change region implementation names to eliminate the 'mi' prefix
This prepares the file to be moved from mi to dix. This patch
was done mechanically with the included scripts 'fix-miregion' run over
the entire X server and 'fix-miregion-private' run over
include/regionstr.h and mi/miregion.c.

Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-05 17:47:32 -07:00
Pierre-Loup A. Griffais 643cb6e87c Only deal with input code when changing the input shape.
Propagate the shape kind all the way to SetShape to avoid performing non-input
operations such as revalidating the tree and generating exposures when only
changing a window's input shape.

Signed-off-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com>
Acked-by: Aaron Plattner<aplattner@nvidia.com>
Reviewed-by: Daniel Stone<daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-02 21:11:31 -07:00
Keith Packard 8b5086250a Eliminate bogus event resizing.
Now that all event queues hold internal events only, they never need
to be resized. Resizing them led to memory corruption as they would
get sized for an appropriate xEvent, not an internal event.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-20 20:45:24 +10:00
Peter Hutterer 3d3b8babd1 mi: update master event copying to InternalEvents.
This is long overdue. The device events are InternalEvents now (and only one
at a time), diminishing the need for an EventList for the master event.
Furthermore, don't make masterEvent a static since this will interfere if
mieqProcessDeviceEvent is called from somewhere else (e.g. XKB actions).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-30 08:43:13 +10:00
Peter Hutterer ebe45e1a72 input: introduce partial class copying depending on the event.
Copying all classes into the master device has drawbacks for hybrid devices
(devices that are both mice and keyboards). If such a device posts an event,
it's key classes are moved into the VCP. The key event itself is unaffected
by keyboard grabs and the like.

Partial class copying copies depending on the event and copies the classes
into the right master device (i.e. the VCK for key events, the VCP for
pointer events).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-22 15:44:57 +10:00
Peter Hutterer f2e957c534 mi: add prototype for CopyGetMasterEvent.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-19 22:18:15 +10:00
Peter Hutterer 36583a4996 mi: split EQ popping and event processing into two functions.
mieqProcessInputEvents() - pop an event off the EQ and pass it to
mieqProcessDeviceEvent() - process the event according to the MD/SD hierarchy.

This way, we can use mieqPDE() from Xtest, xkb, and others to post an event.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:40 +10:00
Peter Hutterer 47f136ed6f mi: change custom handlers to internal events
This should re-enable DGA, but XQuartz needs to be changed to internal events
too now.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:40 +10:00
Peter Hutterer 4026c63e4e mi: switch the EQ to contain InternalEvents only.
This gets rid of the nevents parameter, InternalEvents are always a single
item per event. Also remove the special DeviceValuator handling in both
enqueueing and dequeueing.

Custom callback handlers are now broken until fixed.

For bisectability, we copy the InternalEvent back into the XI required during
POE and friends. Consider this a temporary solution.

Note: Because of misc linker bonghits, Xvfb won't link in this revision.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:39 +10:00
Maarten Maathuis 2e76958d30 fb: move some code to mi 2009-02-06 18:42:39 +01:00
Paulo Cesar Pereira de Andrade 49f77fff14 Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.

  This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)

  LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.

  xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 05:43:34 -02:00
Adam Jackson f5bbc54a93 Fix compile for miSetScreenPixmap prototype. 2008-10-03 18:18:02 -04:00
Adam Jackson 14d98b4a2f miFindMaxBand is dead code 2008-10-03 17:51:20 -04:00
Adam Jackson bd0e87c747 Remove a bunch of unused API from the mi export list. 2008-10-03 17:51:20 -04:00
Adam Jackson 0ce687634f Eviscerate save-under support.
Use a compositing manager already.  Plus I really wanted to use 'eviscerate'
in a commit message.
2008-08-13 17:28:08 -04:00
Peter Hutterer f9edecd1b5 mi: sync declaration and definition of mieqResizeEvents. 2008-05-20 11:07:17 +09:30
Peter Hutterer a0e6a7d4f5 dix: resize EQ to minimum size to avoid reallocs during SIGIO.
When a new device is added, calculate the event size needed if a DCCE event is
sent and set the EQ's event size to this minimum. This avoids reallocs when a
event is sent (which may happen during a SIGIO).
2008-04-30 17:57:48 +09:30
Peter Hutterer 8da83836b6 Merge branch 'master' into mpx
Conflicts:

	XTrap/xtrapddmi.c
	Xext/security.c
	Xext/xprint.c
	Xext/xtest.c
	Xext/xvdisp.c
	Xi/exevents.c
	Xi/grabdevb.c
	Xi/grabdevk.c
	Xi/opendev.c
	Xi/ungrdev.c
	Xi/ungrdevb.c
	Xi/ungrdevk.c
	dix/cursor.c
	dix/devices.c
	dix/dixutils.c
	dix/events.c
	dix/getevents.c
	dix/main.c
	dix/window.c
	hw/xfree86/ramdac/xf86Cursor.c
	include/dix.h
	include/input.h
	include/inputstr.h
	mi/midispcur.c
	mi/miinitext.c
	mi/misprite.c
	render/animcur.c
	xfixes/cursor.c
	xkb/xkbAccessX.c
2008-01-03 17:04:54 +10:30
Eamon Walsh 4017d31902 devPrivates rework: since API is already broken, switch everything
over to new system.

Need to update documentation and address some remaining vestiges of
old system such as CursorRec structure, fb "offman" structure, and
FontRec privates.
2007-08-28 09:28:25 -04:00
Paulo Ricardo Zanoni 82f97e1c0c Enable event delivery for multiple heads.
Requires moving the spriteTrace into the DeviceIntRec and adjusting a few
functions to take in device argument, most notably XYToWindow().

Cursor rendering on the second screen is busted.
2007-04-26 15:58:50 +09:30
Peter Hutterer e8777a91f3 Merge branch 'master' into mpx
Conflicts:

	Xi/closedev.c
	Xi/exevents.c
	Xi/extinit.c
	Xi/listdev.c
	dix/window.c
	hw/xfree86/common/xf86Xinput.c
	include/extinit.h
	mi/mipointer.c
2007-04-02 15:36:26 +09:30
Adam Jackson af769892a9 Static and dead code cleanup from mi/ 2007-03-25 17:56:32 -04:00
Daniel Stone 80d29475b9 mieq: Allow event handlers for arbitrary events to be set
Allow arbitrary events to use mieq by letting custom handlers be set.
2007-03-21 00:10:38 +02:00
Peter Hutterer 1c7568b8a1 mi: closing memory leak, miPointer is freed in miPointerCloseScreen
bugfix: uninitialized pPointer in miPointerGetPosition ifndef MPX
	adding DeviceIntPtr parameter to ScreenRec's cursor functions.
	cleanup of miPointer code to use same scheme in each function

dix:	MPHasCursor() function determines checking whether to invoke
	cursor rendering.

animcur: adding DeviceIntPtr parameter to cursor functions but animcur relies
	 on the core pointer right now.

xfixes: adding DeviceIntPtr parameter to cursor functions but xfixes relies on
	the core pointer right now.

rac:	adding DeviceIntPtr parameter to cursor functions but RAC relies on
	the core pointer right now.

ramdac:	adding DeviceIntPtr parameter to cursor functions but ramdac relies on
	the core pointer right now.
2006-11-23 17:15:14 +10:30
Daniel Stone aeba855b07 move keymap copy to event processing, from enqueuing
Move the keymap copying to event processing time (in
ProcessInputEvents), instead of being at event enqueuing time.
Break SetCore{Pointer,Keyboard} out into separate functions.
Change mieqEnqueue to take a device pointer, that asks for the
_original_ device associated with this event.
2006-10-20 00:43:11 +03:00
Daniel Stone 7465010d59 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug 2006-07-21 19:05:41 -04:00
Adam Jackson 0aaac95b0d Remove RCS tags. Fix Xprint makefile braindamage. 2006-07-21 17:56:00 -04:00
Daniel Stone 1987af8c49 add virtual core devices to DIX
Add virtual core devices, with proper keymaps etc, to the DIX.
2006-07-21 15:19:53 -04:00
Adam Jackson 291e89d4f2 Remove NEED_LINEHELPER BC cruft for pre-R6 DDXes. 2006-04-30 19:16:14 +00:00