summaryrefslogtreecommitdiff
path: root/mi
AgeCommit message (Collapse)AuthorFilesLines
2015-01-05mi: fix accidental x/y coordinate swapPeter Hutterer1-2/+2
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>
2014-11-24mi: Fix regression in arc drawingAdam Jackson1-15/+0
xts' XDrawArcs/15 regressed (turning into a server-side infinite loop) after: commit 7679afd4da8b86aed27e5916ba723116a3c8bb4a 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>
2014-11-12mi: fix documentation for miPointerSetPositionPeter Hutterer1-0/+5
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>
2014-11-12Drop trailing whitespacesPeter Hutterer23-116/+116
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-10-27dix: Always store GC client clip as a region (v2)Adam Jackson4-40/+14
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>
2014-10-27mi: Fold micursor.c into mipointer.cAdam Jackson3-69/+14
Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27mi: Fold mipolyutil.c into mipoly.cAdam Jackson4-387/+285
Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27mi: Fold mipoly{con,gen}.c into mipoly.cAdam Jackson5-471/+329
Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27mi: Fold mifpolycon.c into miarc.cAdam Jackson6-293/+205
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>
2014-10-27mi: Fold mispans.c into miwideline.cAdam Jackson5-612/+518
Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27mi: Unexport arc fill implementation detailsAdam Jackson3-12/+3
Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27mi: Unexport subpixel polygon implementation detailsAdam Jackson2-10/+9
Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27mi: Unexport span group implementation detailsAdam Jackson2-13/+9
Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27mi: Unexport polygon edge table implementation detailsAdam Jackson1-13/+10
Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27mi: Unexport wide line detailsAdam Jackson3-30/+5
XAA wanted these, once upon a time, but that's gone now. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-23mi: Mark the span blit routines as _X_COLDAdam Jackson2-8/+7
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>
2014-10-09misc: Fold together some redundant conditionalsAdam Jackson2-21/+15
Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-09mi: miSlideAndSizeWindow -> miResizeWindowAdam Jackson3-10/+9
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-09dix: Lower backStorage to a bit instead of a pointerAdam Jackson1-1/+1
Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-09mi: Move pScreen->SendGraphicsExpose up to dixAdam Jackson3-55/+0
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-09mi: Drop plane argument from miHandleExposuresAdam Jackson4-14/+5
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-09mi: Simplify composite border clip redirection interfaceAdam Jackson2-44/+19
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-09mi: Deobfuscate miOverlayWindowExposuresAdam Jackson1-28/+12
Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-09mi: Deobfuscate miWindowExposuresAdam Jackson1-30/+11
Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-09dix: Drop the third argument from WindowExposuresProcPtrAdam Jackson4-39/+14
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-09-26mi: Remove Windows 8-bpp colormap compatibilityAdam Jackson1-44/+0
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>
2014-07-29mi: Remove apparently unused miSegregateChildrenAdam Jackson2-17/+0
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-28mi: Remove semi-arbitrary arch awareness in packed coordinate macrosAdam Jackson1-20/+0
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>
2014-07-21mieq: Fix a crash regression in mieqProcessDeviceEventJeremy Huddleston Sequoia1-1/+1
(lldb) bt * thread #6: tid = 0x92d4eb, 0x00000001001dee94 X11.bin`mieqProcessDeviceEvent(dev=0x0000000000000000, event=0x0000000100298bb0, screen=0x0000000000000000) + 36 at mieq.c:519, stop reason = EXC_BAD_ACCESS (code=1, address=0x44) * frame #0: 0x00000001001dee94 X11.bin`mieqProcessDeviceEvent(dev=0x0000000000000000, event=0x0000000100298bb0, screen=0x0000000000000000) + 36 at mieq.c:519 frame #1: 0x00000001001df3eb X11.bin`mieqProcessInputEvents + 555 at mieq.c:631 frame #2: 0x0000000100017674 X11.bin`ProcessInputEvents + 20 at darwinEvents.c:422 frame #3: 0x0000000100175eaa X11.bin`Dispatch + 154 at dispatch.c:357 frame #4: 0x0000000100181b4a X11.bin`dix_main(argc=4, argv=0x00007fff5fbff750, envp=0x00007fff5fbff650) + 1594 at main.c:296 frame #5: 0x000000010001ba80 X11.bin`server_thread(arg=0x0000000101208220) + 64 at quartzStartup.c:66 frame #6: 0x00007fff89bb9899 libsystem_pthread.dylib`_pthread_body + 138 frame #7: 0x00007fff89bb972a libsystem_pthread.dylib`_pthread_start + 137 frame #8: 0x00007fff89bbdfc9 libsystem_pthread.dylib`thread_start + 13 Regression from: 9fb08310b51b46736f3ca8dbc04efdf502420403 Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-07-17Merge remote-tracking branch 'origin/master' into glamor-nextEric Anholt2-41/+41
I've done this merge manually to resolve the minor conflict in glamor.c. Signed-off-by: Eric Anholt <eric@anholt.net>
2014-07-17mi: Fix block handler wrapping in miSpriteKeith Packard1-2/+2
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>
2014-07-17Avoid starting a comment with */*Peter Harris1-39/+39
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-06-15mi: Draw multiple lines in one FillSpans call in miZeroLineKeith Packard1-8/+8
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>
2014-06-12mi: Fill spans for multiple arcs in miPolyFillArcKeith Packard1-79/+67
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>
2014-06-12mi: Make miPolyArc draw fast zero-width when possibleKeith Packard3-2/+16
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-12mi: Create miPolylines as a general-purpose line drawing functionKeith Packard2-0/+26
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-06mi: Build fix: mieqProcessDeviceEvent returns voidJeremy Huddleston Sequoia1-1/+1
mieq.c:520:9: error: void function 'mieqProcessDeviceEvent' should not return a value [-Wreturn-type,Semantic Issue] return 0; ^ ~ 1 error generated. Regression-from: 9fb08310b51b46736f3ca8dbc04efdf502420403 Found-by: Tinderbox Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-06-04mi: don't process events from disabled devices (#77884)Peter Hutterer1-0/+4
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-05-08mi: start calculating the sprite trace from the first child of rootPeter Hutterer1-1/+1
Introduced in 73698d41e41ce76bef2d9a90b46ac0c24ae148dd "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-04-01Make XYToWindow a screen functionKeith Packard3-0/+71
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-03-29mi: Hush extension initialization (#75870)Adam Jackson1-8/+0
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-26mi: miPutImage with XYPixmap failed at depth 32 on 64-bit machinesKeith Packard1-1/+1
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 f39fd4242902eaa862321d39337f429dd14ebacf 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-25miinitext: introduce LoadExtensionList() to replace over LoadExtension()Emil Velikov1-14/+18
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-23miinitext: avoid allocating a sentinel ExtensionModuleEmil Velikov1-3/+2
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-23miinitext: constify staticExtensionsEmil Velikov1-1/+1
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-23miinitext: drop sentinel detection during LoadExtensionEmil Velikov1-3/+0
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-23miinitext: move AddStaticExtensions() to LoadExtension()Emil Velikov1-4/+4
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-02-10mi: fix printf warning about size_t format specifierPeter Hutterer1-1/+1
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 5ea21560dd071ea4ab87430000d087fd5fe1f092 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-01-12Clean up a few function prototypes to not place formals in /**/Keith Packard1-28/+21
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-12Replace 'pointer' type with 'void *'Keith Packard14-35/+35
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>