aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/ptrveloc.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-02-11 08:02:10 +0100
committermarha <marha@users.sourceforge.net>2013-02-11 08:02:10 +0100
commit8753441b3ba4316448e1ae5f408e6a84b0116a3c (patch)
tree8defe6bffed265e0846489015877f2384f022e67 /xorg-server/dix/ptrveloc.c
parent212958ab41363d50d87470f6fb47bbcdc7a74c74 (diff)
downloadvcxsrv-8753441b3ba4316448e1ae5f408e6a84b0116a3c.tar.gz
vcxsrv-8753441b3ba4316448e1ae5f408e6a84b0116a3c.tar.bz2
vcxsrv-8753441b3ba4316448e1ae5f408e6a84b0116a3c.zip
xserver mesa git update 11 Feb 2013
xserver commit c1602d1c17967bdd4db9db19b3a9c0dfca6a58aa mesa commit 990bd49fba7d539e950bdda6eb9819a9abf14850
Diffstat (limited to 'xorg-server/dix/ptrveloc.c')
-rw-r--r--xorg-server/dix/ptrveloc.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/xorg-server/dix/ptrveloc.c b/xorg-server/dix/ptrveloc.c
index c7994b03d..d6fef9cf3 100644
--- a/xorg-server/dix/ptrveloc.c
+++ b/xorg-server/dix/ptrveloc.c
@@ -77,7 +77,7 @@ DeletePredictableAccelerationProperties(DeviceIntPtr,
/*#define PTRACCEL_DEBUGGING*/
#ifdef PTRACCEL_DEBUGGING
-#define DebugAccelF ErrorF
+#define DebugAccelF(...) ErrorFSigSafe("dix/ptraccel: " __VA_ARGS__)
#else
#define DebugAccelF(...) /* */
#endif
@@ -421,7 +421,7 @@ void
InitTrackers(DeviceVelocityPtr vel, int ntracker)
{
if (ntracker < 1) {
- ErrorF("(dix ptracc) invalid number of trackers\n");
+ ErrorF("invalid number of trackers\n");
return;
}
free(vel->tracker);
@@ -566,7 +566,7 @@ FeedTrackers(DeviceVelocityPtr vel, double dx, double dy, int cur_t)
vel->tracker[n].dy = 0.0;
vel->tracker[n].time = cur_t;
vel->tracker[n].dir = GetDirection(dx, dy);
- DebugAccelF("(dix prtacc) motion [dx: %i dy: %i dir:%i diff: %i]\n",
+ DebugAccelF("motion [dx: %f dy: %f dir:%d diff: %d]\n",
dx, dy, vel->tracker[n].dir,
cur_t - vel->tracker[vel->cur_tracker].time);
vel->cur_tracker = n;
@@ -614,7 +614,8 @@ QueryTrackers(DeviceVelocityPtr vel, int cur_t)
/* bail out if data is too old and protect from overrun */
if (age_ms >= vel->reset_time || age_ms < 0) {
- DebugAccelF("(dix prtacc) query: tracker too old\n");
+ DebugAccelF("query: tracker too old (reset after %d, age is %d)\n",
+ vel->reset_time, age_ms);
break;
}
@@ -626,7 +627,7 @@ QueryTrackers(DeviceVelocityPtr vel, int cur_t)
*/
dir &= tracker->dir;
if (dir == 0) { /* we've changed octant of movement (e.g. NE → NW) */
- DebugAccelF("(dix prtacc) query: no longer linear\n");
+ DebugAccelF("query: no longer linear\n");
/* instead of breaking it we might also inspect the partition after,
* but actual improvement with this is probably rare. */
break;
@@ -647,7 +648,7 @@ QueryTrackers(DeviceVelocityPtr vel, int cur_t)
velocity_diff / (initial_velocity + tracker_velocity) >=
vel->max_rel_diff) {
/* we're not in range, quit - it won't get better. */
- DebugAccelF("(dix prtacc) query: tracker too different:"
+ DebugAccelF("query: tracker too different:"
" old %2.2f initial %2.2f diff: %2.2f\n",
tracker_velocity, initial_velocity, velocity_diff);
break;
@@ -660,14 +661,14 @@ QueryTrackers(DeviceVelocityPtr vel, int cur_t)
}
}
if (offset == vel->num_tracker) {
- DebugAccelF("(dix prtacc) query: last tracker in effect\n");
+ DebugAccelF("query: last tracker in effect\n");
used_offset = vel->num_tracker - 1;
}
if (used_offset >= 0) {
#ifdef PTRACCEL_DEBUGGING
MotionTracker *tracker = TRACKER(vel, used_offset);
- DebugAccelF("(dix prtacc) result: offset %i [dx: %i dy: %i diff: %i]\n",
+ DebugAccelF("result: offset %i [dx: %f dy: %f diff: %i]\n",
used_offset, tracker->dx, tracker->dy,
cur_t - tracker->time);
#endif
@@ -693,6 +694,8 @@ ProcessVelocityData2D(DeviceVelocityPtr vel, double dx, double dy, int time)
velocity = QueryTrackers(vel, time);
+ DebugAccelF("velocity is %f\n", velocity);
+
vel->velocity = velocity;
return velocity == 0;
}
@@ -768,7 +771,7 @@ ComputeAcceleration(DeviceIntPtr dev,
double result;
if (vel->velocity <= 0) {
- DebugAccelF("(dix ptracc) profile skipped\n");
+ DebugAccelF("profile skipped\n");
/*
* If we have no idea about device velocity, don't pretend it.
*/
@@ -792,14 +795,14 @@ ComputeAcceleration(DeviceIntPtr dev,
threshold,
acc);
result /= 6.0f;
- DebugAccelF("(dix ptracc) profile average [%.2f ... %.2f] is %.3f\n",
+ DebugAccelF("profile average [%.2f ... %.2f] is %.3f\n",
vel->velocity, vel->last_velocity, result);
}
else {
result = BasicComputeAcceleration(dev, vel,
vel->velocity, threshold, acc);
- DebugAccelF("(dix ptracc) profile sample [%.2f] is %.3f\n",
- vel->velocity, res);
+ DebugAccelF("profile sample [%.2f] is %.3f\n",
+ vel->velocity, result);
}
return result;
@@ -1050,11 +1053,8 @@ SetDeviceSpecificAccelerationProfile(DeviceVelocityPtr vel,
DeviceVelocityPtr
GetDevicePredictableAccelData(DeviceIntPtr dev)
{
- /*sanity check */
- if (!dev) {
- ErrorF("[dix] accel: DeviceIntPtr was NULL");
- return NULL;
- }
+ BUG_RETURN_VAL(!dev, NULL);
+
if (dev->valuator &&
dev->valuator->accelScheme.AccelSchemeProc ==
acceleratePointerPredictable &&
@@ -1113,6 +1113,7 @@ acceleratePointerPredictable(DeviceIntPtr dev, ValuatorMask *val, CARD32 evtime)
(double) dev->ptrfeed->ctrl.num /
(double) dev->ptrfeed->ctrl.den);
+ DebugAccelF("mult is %f\n", mult);
if (mult != 1.0f || velocitydata->const_acceleration != 1.0f) {
if (mult > 1.0f && soften)
ApplySoftening(velocitydata, &dx, &dy);
@@ -1122,8 +1123,7 @@ acceleratePointerPredictable(DeviceIntPtr dev, ValuatorMask *val, CARD32 evtime)
valuator_mask_set_double(val, 0, mult * dx);
if (dy != 0.0)
valuator_mask_set_double(val, 1, mult * dy);
- DebugAccelF("pos (%i | %i) delta x:%.3f y:%.3f\n", mult * dx,
- mult * dy);
+ DebugAccelF("delta x:%.3f y:%.3f\n", mult * dx, mult * dy);
}
}
}