summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-04-22Fix trapezoid and triangle rendering to windowsSøren Sandmann Pedersen2-30/+28
For fbAdd{Traps,Triangles}() and fbRasterizeTrapezoid() this is just a matter of adding the image offsets to the trap offsets. For fbShapes, the story is more complicated: The recently added pixman API did not allow offsetting trapezoids. Instead, it would use x_dst and y_dst in such a way that the effect was to only offset the source image. In pixman 0.21.8, this API has changed such that all the traps are conceptually rendered to an infinitely big image, and the source and destination coordinates are then aligned with (0, 0) of that image. This means offsetting dst_x and dst_y will now offset the entire drawing, which is similar to how other composite functions work. This patch then changes fbComposite{Triangles,Traps} such that the source image is aligned with the shapes, and the destination coordinates offset according to drawable->{x, y}. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Soren Sandmann <ssp@redhat.com>
2011-04-22fb: Call miCompositeSourceValidate() on the source in fbShapes()Søren Sandmann Pedersen1-0/+2
Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Soren Sandmann <ssp@redhat.com>
2011-04-22render: Remove unused TriStrip and TriFan typedefsSøren Sandmann Pedersen1-18/+0
Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Soren Sandmann <ssp@redhat.com>
2011-04-22render: Remove unused fields in the source picture structsSøren Sandmann Pedersen2-38/+0
The fields class, stopRange, colorTable and colorTableSize are not used by any current code. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Soren Sandmann <ssp@redhat.com>
2011-04-22render: Delete PictureGradientColor()Søren Sandmann Pedersen2-50/+0
PictureGradientColor(), INTERPOLATE_PIXEL_256() and premultiply() are not used by anything. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Soren Sandmann <ssp@redhat.com>
2011-04-22Add RegionInitBoxes(), and fix some buggy callers of RegionInit().Søren Sandmann Pedersen3-8/+21
The interface to RegionInit(): RegionInit (RegionPtr pReg, BoxPtr rect, int size); is very confusing because it doesn't take a list of boxes, it takes *one* box, but if that box is NULL, it initializes an empty region with 'size' rectangles preallocated. Most callers of this function were correctly passing either NULL or just one box, but there were three confused cases, where the code seems to expect a region to be created from a list of boxes. This patch adds a new function RegionInitBoxes() and fixes those instances to call that instead. And yes, the pixman function to initialize a region from a list of boxes is called init_rects() because pixman is also awesome. V2: Make RegionInitBoxes() return a Bool indicating whether the call succeeded, and fix the callers to check this return value. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Søren Sandmann <ssp@redhat.com>
2011-04-22Track damage for fbTrapezoids() and fbTriangles().Søren Sandmann Pedersen1-0/+5
These calls no longer go through the CompositePicture() hook, so damage was no longer generated for them. This patch simply damages the entire destination clip region. It would be possible to generate tighter damage for certain operators such as Over and Add, where blank source pixels have no effect on the destination, but given that virtually all trapezoid rendering takes place on pixmaps, it's unlikely that anybody would actually benefit from this optimization, and the miTrapezoidBounds function did sometimes show up on profiles, probably because it does several divisions per trapezoid. V2: Call DamageRegionProcessPending() - pointed out by Michel Dänzer. V3: Call DamageRegionProcessPending() *after* rendering - pointed out by Maarten Maathuis Reviewed-by: Michel Dänzer <daenzer@vmware.com> Signed-off-by: Søren Sandmann <ssp@redhat.com>
2011-04-22Merge remote-tracking branch 'jeremyhu/master'Keith Packard8-58/+135
2011-04-22linux: Retry VT ioctls while errno == EINTRAaron Plattner1-34/+49
When the smart scheduler is enabled, the VT ioctls (particularly VT_WAITACTIVE) can be interrupted by the smart scheduler's SIGALRMs. Previously, this caused the server to immediately continue on to ScreenInit, almost certainly causing a crash or failure because the X server that owned the VT hadn't finished cleaning up. As of commit 7ee965a300c9eddcc1acacf9414cfe3e589222a8, it causes a FatalError instead. Retrying the ioctl as long as it fails with errno == EINTR fixes the problem and allows server regenerations to trigger VT switches that actually succeed. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Cyril Brulebois <kibi@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2011-04-22Merge remote-tracking branch 'whot/for-keith'Keith Packard39-820/+1078
2011-04-22XQuartz: Do translation and handoff of NSEvent to X11 in a separate serial queueJeremy Huddleston1-1/+20
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-04-22XQuartz: Send tablet proximity events with tilt and pressureJeremy Huddleston5-31/+51
<rdar://problem/6257569> Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-04-21XQuartz: Use dispatch_async to handoff the FDJeremy Huddleston1-2/+22
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-04-21configure.ac: Add check for libdispatch when building for darwinJeremy Huddleston2-3/+10
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-04-21XQuartz: Fix prototypes for thread functionsJeremy Huddleston3-5/+9
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-04-21XQuartz: Make the DarwinProcessFDAdditionQueue_thread wait 3 seconds to ↵Jeremy Huddleston2-16/+23
allow xinitrc to catch up Previously, we weren't always waiting the full three seconds. This should be better, but is still sub-optimal. We really want to start processing these once a WM has been started. http://xquartz.macosforge.org/trac/ticket/416 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-04-21dix: improve control flow in QueryTrackersPeter Hutterer1-8/+8
If the velocity is 0, skip the remainder. If we're not in range, skip the remainder. No functional change. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-04-21dix: rename a bunch of variables to be more self-explanatoryPeter Hutterer1-19/+20
i → used_offset iveloc → initial_velocity res → result vdiff → velocity_diff vfac → velocity_factor tmp → tracker_velocity Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21dix: reduce scope of tmp and mult.Peter Hutterer1-1/+4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21dix: reduce the work done by ApplySofteningPeter Hutterer1-15/+16
We can modify fdx/fdy in-place rather than requiring dx/dy as well. And the decision to soften can be made in the caller (unless decided by the velocity state). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21dix: split softening and constant deceleration into two functionsPeter Hutterer1-5/+10
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21dix: use single return statement in ApplySimpleSofteningPeter Hutterer1-6/+7
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21dix: rename od, d to prev_delta, deltaPeter Hutterer1-9/+9
And res to result. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21dix: Don't use short as boolPeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21dix: rename "res" to "result" for improved readabilityPeter Hutterer1-9/+9
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21dix: change ProcessVelocityData2D to BOOL.Peter Hutterer2-2/+2
Don't confuse users with a return type of short, that's even less indicative that it returns 0/non-0 than "int". Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-04-21dix: add some more documentation to ptraccel codePeter Hutterer1-4/+13
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21dix: don't pass the index for a tracker around, pass the trackerPeter Hutterer1-10/+11
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21dix: CalcTracker only uses the tracker, thus only pass the tracker.Peter Hutterer1-6/+4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-04-21dix: use single return statement in DoGetDirectionPeter Hutterer1-42/+49
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21dix: use single return value in GetDirectionPeter Hutterer1-9/+8
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21dix: document GetDirectionPeter Hutterer1-1/+7
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21dix: document DoGetDirection's mathsPeter Hutterer1-2/+10
This is the best explanation I can come up with, but it seems to hold true for my example values. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21dix: improve comment, directions flagged are 45° eachPeter Hutterer1-1/+1
The two directions returned by this calculation are always the two boundary conditions. Since we don't do quadrants but octants, the flagged ones are 45° each. e.g. an angle of 35° flags E and NE. 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-04-21dix: improve readbility of DoGetDirection.Peter Hutterer1-12/+25
Use enums for the direction bits, not hardcoded bitfield values that are added up. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21dix: only use a single return where only one is needed.Peter Hutterer1-2/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21dix: fix typo in direction calculationPeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21xfree86: removed unused "event" variable in xf86PostMotionEventMPeter Hutterer1-2/+0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-04-21dix: silence compiler warningPeter Hutterer1-1/+1
resource.c: In function 'AddResource': resource.c:493:3: warning: format '%lx' expects type 'long unsigned int', but argument 3 has type 'RESTYPE' RESTYPE is uint32_t, not long. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-04-21test: remove glib dependencyPeter Hutterer19-642/+580
The few features from the glib test suite we used can be replaced with assert and printf. This patch is a simple replacement for these two g_assert → assert g_test_message → printf g_test_init is removed and so is g_test_bug_base. g_test_run replaced with a simple return 0. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Tiago Vignatti <tiago.vignatti@nokia.com> Acked-by: Gaetan Nadon <memsize@videotron.ca>
2011-04-18input: remove GetKeyboardValuatorEvents, this is now unnecessary.Peter Hutterer11-44/+18
GetKeyboardValuatorEvents handles NULL valuator masks already, so the GetKeyboardEvents wrapper is not needed. Rename GKVE to GKE. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-04-18test: add some XIPassiveGrab protocol testing.Peter Hutterer2-0/+242
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Daniel Stone <daniel@fooishbar.org>
2011-04-18Xi: don't swap the status byte in the XIPassiveGrab repliesPeter Hutterer1-4/+7
Reported-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-04-18Xi: exit with error value if CheckGrabValues failed.Peter Hutterer1-0/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-04-18Xi: fix reply swapping function check for XIPassiveGrabDevicePeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-04-18Xi: return the bad device ID if a passive grab fails with BadDevice.Peter Hutterer1-0/+3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-04-18configure: actually require macros 1.13Peter Hutterer1-1/+1
Introduced in 6a5bf15fa99cf5b2358b3b3e2f29e5044aa8724a Reported-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-18Xi: silence valgrind warning. (#36120)Peter Hutterer1-0/+2
Conditional jump or move depends on uninitialised value(s) at 0x4357A1: GetEventMask (events.c:454) by 0x43B9E8: DeliverEventsToWindow (events.c:2029) by 0x4E0C59: SendEventToAllWindows (exevents.c:2125) by 0x4E8301: XISendDeviceHierarchyEvent (xichangehierarchy.c:118) by 0x426F99: DisableDevice (devices.c:507) by 0x46BF72: xf86Wakeup (xf86Events.c:457) by 0x432ABA: WakeupHandler (dixutils.c:419) by 0x45B708: WaitForSomething (WaitFor.c:235) by 0x42E8D9: Dispatch (dispatch.c:367) by 0x422DC9: main (main.c:287) Uninitialised value was created by a stack allocation at 0x4E8190: XISendDeviceHierarchyEvent (xichangehierarchy.c:61) Conditional jump or move depends on uninitialised value(s) at 0x43BB78: DeliverEventsToWindow (events.c:2010) by 0x4DDEEA: FindInterestedChildren (exevents.c:2103) by 0x4DDEFF: FindInterestedChildren (exevents.c:2104) by 0x4DDEFF: FindInterestedChildren (exevents.c:2104) by 0x4DDEFF: FindInterestedChildren (exevents.c:2104) by 0x4DDEFF: FindInterestedChildren (exevents.c:2104) by 0x4E0C6F: SendEventToAllWindows (exevents.c:2127) by 0x4E8301: XISendDeviceHierarchyEvent (xichangehierarchy.c:118) by 0x426F99: DisableDevice (devices.c:507) by 0x46BF72: xf86Wakeup (xf86Events.c:457) by 0x432ABA: WakeupHandler (dixutils.c:419) by 0x45B708: WaitForSomething (WaitFor.c:235) Uninitialised value was created by a stack allocation at 0x4E8190: XISendDeviceHierarchyEvent (xichangehierarchy.c:61) Set the type of dummyDev to SLAVE. The jump listed above comes from a check to IsMaster() in GetEventMask() that would then set the XIAllMasterDevices mask. Hierarchy events can only be set for XIAllDevices so the above IsMaster() check had no effect and the device type doesn't really matter anyway beyond shuting up valgrind. Also initialize dummyDev to 0 to ease future debugging. X.Org Bug 36120 <http://bugs.freedesktop.org/show_bug.cgi?id=36120> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-04-18Xi: fix valuator alignment in DeepCopyDeviceClasses (#36119)Peter Hutterer5-19/+70
commit 678f5396c91b3d0c7572ed579b0a4fb62b2b4655 only fixed the initialization, not the copy. After a slave device change, the valuator were out of alignment again. X.Org Bug 36119 <http://bugs.freedesktop.org/show_bug.cgi?id=36119> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-04-18Simplify auto-detect mouse for WSCONS_SUPPORTAlexandr Shadchin1-10/+3
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Reviewed-by: Matthieu Herrbb <matthieu.herrb@laas.fr> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>