I doubt anyone builds with this turned off or has done for a long
time.
It helps my eyes bleed slightly less when reading the code, I've left
the define in place as some drivers use it.
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
The mi filled arc code estimates that a filled arc will produce no
more spans than the arc is tall. This is true for most arcs except
for pie-slice arcs strictly between 180 and 360 degrees where the missing
portion of the arc faces up or down such that we get two spans on some
scanlines.
For those, we need to reserve room for another height/2 spans. This
patch just does it for all partial pie-sliced arcs to make the test
easier to understand; it's just over-allocating a bit of memory, so
that's safe.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Fix XQuartz build since commit e036cbfc "Make PseudoramiXExtensionInit()
prototype more generally available"
Add #include "nonsdk_extinit.h" to xprScreen.c
Add #include "nonsdk_extinit.h" to miinitext.c under INXQUARTZ to provide
declarations used under INXQUARTZ
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Reported-by: Adam Greenblatt <adam.greenblatt@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
xts' XDrawArcs/15 regressed (turning into a server-side infinite loop)
after:
commit 7679afd4da
Author: Adam Jackson <ajax@redhat.com>
Date: Fri Sep 26 12:01:37 2014 -0400
mi: Fold mifpolycon.c into miarc.c
The reason is miarc.c provided its own definitions (sigh) of min/max,
that both accept int arguments and return an int. Since miFillSppPoly
uses a double (sigh) and some min-involving math for its loop index
variable, things do not go well.
Since the integer versions of min/max are redundant, nuke 'em.
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Tested-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Changed when we added barriers, documentation didn't get updated.
Reported-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Again, this changes FixesCreateRegionFromGC to throw BadMatch when fed a
GC with no client clip.
v2: Fix Xnest and some variable names (Keith)
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Also put mifpoly.h on a diet, and stop including it from places that
don't need it.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
On gcc, __attribute__((cold)) means:
- consider calls to the function to be unlikely for branch prediction
- optimize the function for size
- emit the function in a dedicated cold text section
It's not worth deleting these routines even though there are no longer
in-tree consumers, but we can at least keep them out of i$ at runtime.
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
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>
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>
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>
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>
Nice, but not something our Windows servers build, and not something
that belongs in mi anyway.
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
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>
The majority of arches end up on the right-shift path here. I can't
think of any arch where that'd be slower than a divide, and semantically
it makes more sense to think of this as a shift operation anyway.
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
miSpriteBlockHandler was leaving the BlockHandler wrapped until just
before calling any nested block handler. If any code executed before
that added or removed block handlers, the wrapping chain would have
been broken.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
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>
miZeroLine allocates enough space to draw a line spanning the entire
width/height of the target drawable. When drawing multiple shorter
lines, this leaves most of the space in that buffer unfilled. Let
multiple lines be drawn into the buffer if there is plenty of space.
Speeds up glamor fallback zero-width lines:
Before
6000000 trep @ 0.0020 msec (508000.0/sec): 1-pixel line
6000000 trep @ 0.0020 msec (492000.0/sec): 10-pixel line
6000000 trep @ 0.0023 msec (427000.0/sec): 100-pixel line
4000000 trep @ 0.0035 msec (282000.0/sec): 500-pixel line
After:
600000000 trep @ 0.0000 msec (43400000.0/sec): 1-pixel line
140000000 trep @ 0.0001 msec (13000000.0/sec): 10-pixel line
16000000 trep @ 0.0008 msec (1300000.0/sec): 100-pixel line
4000000 trep @ 0.0038 msec (261000.0/sec): 500-pixel line
(500 pixel lines do not change in performance because the buffer can
only one one of them.)
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
This allocates span data for multiple arcs and draws the
whole set in one call, rather than doing them one at a time. For
modern hardware, this is a significant performance improvement.
v2: Limit the number of spans per buffer to 4M to avoid
integer overflow in computing the malloc size.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
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>
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>
mieq.c:520:9: error: void function 'mieqProcessDeviceEvent' should not return a value [-Wreturn-type,Semantic Issue]
return 0;
^ ~
1 error generated.
Regression-from: 9fb08310b5
Found-by: Tinderbox
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
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>
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>
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>
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>
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>
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>
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>
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>
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>