When SourceValidate is performed on a window with IncludeInferiors
sub-window mode, force an immediate update of all the automatically
redirected windows, so that the current window contents will be up
to date.
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>
When GetImage is performed on a window, force an immediate update of
all the automatically redirected windows, so that the current window
contents will be up to date.
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>
TraverseTree visits the parent before the children. When performing
the automatic redirection updates, the children must be visited before
the parent.
If there are automatically redirected windows on multiple levels of the
tree, updating the parents before the children would cause the parent
updates to use stale data for areas covered by the children. Also
updating the damaged children would re-damage the parent, which would
cause additional walks over the tree.
In the worst case with an unbroken chain of automatically redirected
subwindows, all of which are damaged, only the leaf window would be
properly updated on the first round. Then it's parent would be properly
updated on the second round, and so on. And on every round all of the
ancestor windows would be updated as well, but with stale data.
So with N damaged windows you would end up with (N^2+N)/2 updates,
instead of the expected N.
This reverts commit 648c8871c9.
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>
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>
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>
Various cleanups identified during review of the
X Sync Fence Object patches.
-Correctly handle failure of AddResource()
-Don't assert when data structures are corrupt. Instead,
use a new helper function to check for counter sync
objects when they're expected, and warn if the type is
wrong.
-Use the default switch label rather than reimplementing
it.
-Re-introduce cast of result of dixAllocateObjectWithPrivate()
to kill an incompatible pointer type warning.
-Remove comments claiming protocol updates are needed. One
wasn't true and the other was addressed with a xextproto
change.
-Return BadFence, not BadCounter from XSyncAwaitFence()
Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
cc2c73ddcb4370a7c3ad439cda4da825156c26c9's three-cent titanium tax
doesn't go too far enough. Fix the rest of the call and jmp
instructions to handle the data prefix correctly.
Reference: Intel 64 and IA-32 Architectures Software Developer's Manual
Volume 2A: Instruction Set Reference, A-M
http://www.intel.com/Assets/PDF/manual/253666.pdf
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Cast it to a char *, mimicking the return immediately below it.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
LocalClient is used for all DRI2 requests that makes it frequently
called function. Querying if connection is local or not takes 10-15us
(on ARM) depending on malloc speed.
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
RemoveBlockAndWakeupHandlers requires caller to pass same block data
parameter as for RegisterBlockAndWakeupHandlers.
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>
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>
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>
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>
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>
We know that there is damage if the dynamic block handler is registered.
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Even calling block handler that doesn't do much is costly in arm. It
takes a few microseconds each time which adds up to relative high CPU
time because it is done 500+ times per second.
Simple optimization is to register the block handler only when it is
required.
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Calling BlockHandlers takes some time for each iteration in main loop
which adds up quickly over multiple request. To reduce the round-trip
costs to xserver BlockHandlers should be registered only when required.
AnimCurScreenBlockHandler is the first victim for this optimization.
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
In animate cursor block handler code assumes GetTimeInMillis returns
always nonzero value. This isn't true when time wraps around.
To prevent any problems in case GetTimeInMillis would return zero use
activeDevice variable to track if we have received time.
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
This enables us to reliably inspect properties when destroying windows.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org>
lnx_agp.c: In function ‘xf86DeallocateGARTMemory’:
lnx_agp.c:267: warning: cast to pointer from integer of different size
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
render2.c: In function ‘__glXDisp_Map2d’:
render2.c:127: warning: ‘u1’ may be used uninitialized in this function
render2.c: In function ‘__glXDisp_Map1d’:
render2.c:90: warning: ‘u1’ may be used uninitialized in this function
Remove unnecessary test, and change memcpy to memmove as all users were
doing overlapping copies.
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
xcmisc.c:202: warning: no previous prototype for ‘XCMiscExtensionInit’
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
dri.c: In function ‘DRIScreenInit’:
dri.c:434: warning: cast from pointer to integer of different size
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
loadmod.c: In function ‘FreeSubdirs’:
loadmod.c:377: warning: passing argument 1 of ‘free’ discards qualifiers
from pointer target type
/usr/include/stdlib.h:488: note: expected ‘void *’ but argument is of
type ‘const char *’
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
xf86AutoConfig.c: In function ‘FreeList’:
xf86AutoConfig.c:123: warning: passing argument 1 of ‘free’ discards
qualifiers from pointer target type
/usr/include/stdlib.h:488: note: expected ‘void *’ but argument is of
type ‘const char *’
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
All the DRI extension types have a base extension type as their first
member to avoid exactly these types of warning.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Cyril Brulebois <kibi@debian.org>
InputAttributes wants non-const members, and while it appears safe to
cast it, just leave it be for the moment.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
When we send BadValue back to the client for having invalid mask bits,
at least tell them what the (first) invalid bit was.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Will be used outside dix/events.c in proceeding XI 2.1 MT changes.
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The definition of rClient was duplicated across three source files, so
move it to resource.h.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Input drivers may use valuator masks for internal state. Having all the
valuator_mask_* functions available will help.
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Bump ABI_XINPUT_VERSION minor.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Assume that a mode can be used in either landscape or portrait
orientation. I suppose the correct thing to do would be to
collect all the supported rotations from the CRTCs that can be used
with a specific output, but that information doesn't seem to be
readily available when these checks are done. So just assume that
either orientation is fine.
Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
If the drawable size doesn't match the pixmap size page flipping should
not be allowed.
If the window is larger than the pixmap, page flipping might need to
reposition the CRTC somewhere in the middle of the pixmap. I didn't
spot any code that would handle that at least in the intel driver.
Also the root pixmap could then move to some negative screen
coordinates. Not sure if all bits of code could handle that. Perhaps
when composite is enabled screen_x/y would make it work, but without
composite there's no way that it would work AFAICS.
Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Add the appropriate casts so that gcc shuts up, even if it doesn't
matter.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
misync allocates space for its screen private with
dixRegisterPrivateKey, which means it doesn't have to free it at
CloseScreen time; doing so will, in fact, result in a crash.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: James Jones <jajones@nvidia.com>
Acked-by: Tiago Vignatti <tiago.vignatti@nokia.com>
On some systems, using CLOCK_MONOTONIC forces a readback of HPET or some
similarly expensive timer. CLOCK_MONOTONIC_COARSE can alleviate this,
at the cost of negligibly-reduced resolution, so prefer that where we
can.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
When we send BadValue back to the client for having invalid mask bits,
at least tell them what the (first) invalid bit was.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Will be used outside dix/events.c in proceeding XI 2.1 MT changes.
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The definition of rClient was duplicated across three source files, so
move it to resource.h.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Input drivers may use valuator masks for internal state. Having all the
valuator_mask_* functions available will help.
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Bump ABI_XINPUT_VERSION minor.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=24703 .
Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
The DDC1 and int10 code are blocking SIGIO to get some assurance that
their usleep() calls take as long as they expect. That's a good start
but you really want to be blocking more than just SIGIO, SIGALRM too at
minimum.
At this point, except for SIGIO handler setup itself, BlockSIGIO really
means "block input events".
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Back when we had RAC this was a vaguely meaningful thing. Since then
it's been a glorified (and confusing) wrapper around xf86BlockSIGIO.
Note that the APM and VT switch code are unusual relative to other code
that cares about SIGIO state. Most callers push a SIGIO disable to
create a critical section for the duration of the caller's stack frame,
but those two effectively disable SIGIO after their return and re-enable
on their next entry.
Reviewed-by: Tiago Vignatti <tigo.vignatti@nokia.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Enter was changing server operating state, Leave wasn't. Which was
wholly redundant, since all callers of Enter would immediately change
the operating state to exactly what Enter had just done.
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>