xserver: Branch 'master' - 7 commits
Peter Hutterer
whot at kemper.freedesktop.org
Thu Aug 7 23:55:42 PDT 2008
dix/devices.c | 3 +-
dix/getevents.c | 4 --
dix/ptrveloc.c | 58 ++++++++++++++++++-----------------------
hw/xfree86/common/xf86Xinput.c | 28 +++++++++++--------
xkb/xkb.c | 5 +++
5 files changed, 49 insertions(+), 49 deletions(-)
New commits:
commit d684f5760f40b682a8b879641300abe689a263c5
Author: Peter Hutterer <peter.hutterer at redhat.com>
Date: Fri Aug 8 14:18:01 2008 +0930
xkb: actually initialise sli before using it.
diff --git a/xkb/xkb.c b/xkb/xkb.c
index 56be6e2..754641b 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -3356,6 +3356,11 @@ _XkbSetNamedIndicator(ClientPtr client, DeviceIntPtr dev,
if (rc != Success || !map) /* oh-oh */
return rc;
+ sli = XkbFindSrvLedInfo(dev, stuff->ledClass, stuff->ledID,
+ XkbXI_IndicatorsMask);
+ if (!sli)
+ return BadAlloc;
+
namec = mapc = statec = 0;
extDevReason = 0;
commit e00cd54c1ac57ea6e7767e90592200f343d9d08a
Author: Simon Thum <simon.thum at gmx.de>
Date: Thu Aug 7 11:06:21 2008 +0200
dix: remove misleading comment in ptrvelo.c
Signed-off-by: Peter Hutterer <peter.hutterer at redhat.com>
diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c
index 330ab39..2406be8 100644
--- a/dix/ptrveloc.c
+++ b/dix/ptrveloc.c
@@ -152,9 +152,8 @@ Expected result is a series of filters, each progressively more integrating.
This allows for two strategies: Either you have one filter which is reasonable
and is being coupled to account for fast-changing input, or you have 'one for
-every situation'. You might want to have loose coupling then, i.e. > 1.
-E.g. you could start around 1/2 of your anticipated delta t and
-scale up until several motion deltas are 'averaged'.
+every situation'. You might want to have tighter coupling then, e.g. 0.1.
+In the filter stats, you can see if a reasonable filter useage emerges.
*/
void
InitFilterChain(DeviceVelocityPtr s, float rdecay, float progression, int stages, int lutsize)
commit 6ca34549b89e73e3e0ec3cb7585686b880534cef
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date: Thu Aug 7 16:27:57 2008 +0930
dix: remove obsolete FIXME comment.
Thanks to Simon Thum for pointing this out.
diff --git a/dix/getevents.c b/dix/getevents.c
index 5f9b8c1..61252c3 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -525,10 +525,6 @@ clipValuators(DeviceIntPtr pDev, int first_valuator, int num_valuators,
/**
* Fills events with valuator events for pDev, as given by the other
* parameters.
- *
- * FIXME: Need to fix ValuatorClassRec to store all the valuators as
- * last posted, not just x and y; otherwise relative non-x/y
- * valuators, though a very narrow use case, will be broken.
*/
static EventList *
getValuatorEvents(EventList *events, DeviceIntPtr pDev,
commit 2c3645581ee3f180d34e32c8016d5e4e1af4dca4
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date: Thu Aug 7 11:55:10 2008 +0930
dix: SetModifierMapping should only apply to the ClientPointer and it's SDs.
diff --git a/dix/devices.c b/dix/devices.c
index d8e37d7..7519e06 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -1651,10 +1651,11 @@ DoSetModifierMapping(ClientPtr client, KeyCode *inputMap,
int numKeyPerModifier, xSetModifierMappingReply *rep)
{
DeviceIntPtr pDev = NULL;
+ DeviceIntPtr cp = PickKeyboard(client); /* ClientPointer keyboard */
int rc, i = 0, inputMapLen = numKeyPerModifier * 8;
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
- if ((pDev->coreEvents || pDev == inputInfo.keyboard) && pDev->key) {
+ if (pDev == cp || (!pDev->isMaster && (pDev->u.master == cp) && pDev->key)) {
for (i = 0; i < inputMapLen; i++) {
/* Check that all the new modifiers fall within the advertised
* keycode range, and are okay with the DDX. */
commit e1b286d495b760cf67ddf936eca11da50fba847a
Author: Simon Thum <simon.thum at gmx.de>
Date: Wed Aug 6 09:42:32 2008 +0200
dix: simplified debugging helper for pointer acceleration
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c
index 56ce71b..330ab39 100644
--- a/dix/ptrveloc.c
+++ b/dix/ptrveloc.c
@@ -77,6 +77,15 @@ SimpleSmoothProfile(DeviceVelocityPtr pVel, float velocity,
float threshold, float acc);
+
+/*#define PTRACCEL_DEBUGGING*/
+
+#ifdef PTRACCEL_DEBUGGING
+#define DebugAccelF ErrorF
+#else
+#define DebugAccelF(...) /* */
+#endif
+
/********************************
* Init/Uninit etc
*******************************/
@@ -276,15 +285,13 @@ QueryFilterChain(
result = cur;
rfn = fn + 1; /*remember result determining filter */
} else if(cfn == -1){
- cfn = fn; /* rememeber first mismatching filter */
+ cfn = fn; /* remember first mismatching filter */
}
}
s->statistics.filter_usecount[rfn]++;
-#ifdef PTRACCEL_DEBUGGING
- ErrorF("(dix ptraccel) result from stage %i, input %.2f, output %.2f\n",
+ DebugAccelF("(dix ptracc) result from stage %i, input %.2f, output %.2f\n",
rfn, value, result);
-#endif
/* override first mismatching current (coupling) so the filter
* catches up quickly. */
@@ -347,9 +354,7 @@ ProcessVelocityData(
dy += s->last_dy;
diff += s->last_diff;
s->last_diff = time - s->lrm_time; /* prevent repeating add-up */
-#ifdef PTRACCEL_DEBUGGING
- ErrorF("(dix ptracc) axial correction\n");
-#endif
+ DebugAccelF("(dix ptracc) axial correction\n");
}else{
s->last_diff = diff;
}
@@ -387,9 +392,7 @@ ProcessVelocityData(
StuffFilterChain(s, cvelocity);
s->velocity = s->last_velocity = cvelocity;
s->last_reset = TRUE;
-#ifdef PTRACCEL_DEBUGGING
- ErrorF("(dix ptracc) non-visible state reset\n");
-#endif
+ DebugAccelF("(dix ptracc) non-visible state reset\n");
return TRUE;
}
@@ -401,9 +404,7 @@ ProcessVelocityData(
* stuff that into the filter chain.
*/
s->last_reset = FALSE;
-#ifdef PTRACCEL_DEBUGGING
- ErrorF("(dix ptracc) after-reset vel:%.3f\n", cvelocity);
-#endif
+ DebugAccelF("(dix ptracc) after-reset vel:%.3f\n", cvelocity);
StuffFilterChain(s, cvelocity);
s->velocity = cvelocity;
return FALSE;
@@ -415,12 +416,13 @@ ProcessVelocityData(
/* perform coupling and decide final value */
s->velocity = QueryFilterChain(s, cvelocity);
-#ifdef PTRACCEL_DEBUGGING
- ErrorF("(dix ptracc) guess: vel=%.3f diff=%d |%i|%i|%i|%i|\n",
+ DebugAccelF("(dix ptracc) guess: vel=%.3f diff=%d %i|%i|%i|%i|%i|%i|%i|%i|%i\n",
s->velocity, diff,
s->statistics.filter_usecount[0], s->statistics.filter_usecount[1],
- s->statistics.filter_usecount[2], s->statistics.filter_usecount[3]);
-#endif
+ s->statistics.filter_usecount[2], s->statistics.filter_usecount[3],
+ s->statistics.filter_usecount[4], s->statistics.filter_usecount[5],
+ s->statistics.filter_usecount[6], s->statistics.filter_usecount[7],
+ s->statistics.filter_usecount[8]);
return FALSE;
}
@@ -494,9 +496,7 @@ ComputeAcceleration(
float res;
if(vel->last_reset){
-#ifdef PTRACCEL_DEBUGGING
- ErrorF("(dix ptracc) profile skipped\n");
-#endif
+ DebugAccelF("(dix ptracc) profile skipped\n");
/*
* This is intended to override the first estimate of a stroke,
* which is too low (see ProcessVelocityData). 1 should make sure
@@ -516,17 +516,13 @@ ComputeAcceleration(
(vel->last_velocity + vel->velocity) / 2,
threshold, acc);
res /= 6.0f;
-#ifdef PTRACCEL_DEBUGGING
- ErrorF("(dix ptracc) profile average [%.2f ... %.2f] is %.3f\n",
- vel->velocity, vel->last_velocity, res);
-#endif
+ DebugAccelF("(dix ptracc) profile average [%.2f ... %.2f] is %.3f\n",
+ vel->velocity, vel->last_velocity, res);
return res;
}else{
res = BasicComputeAcceleration(vel, vel->velocity, threshold, acc);
-#ifdef PTRACCEL_DEBUGGING
- ErrorF("(dix ptracc) profile sample [%.2f] is %.3f\n",
+ DebugAccelF("(dix ptracc) profile sample [%.2f] is %.3f\n",
vel->velocity, res);
-#endif
return res;
}
}
commit d95136e1510a48cc3ad066d880d56061fc6a42ee
Author: Simon Thum <simon.thum at gmx.de>
Date: Thu Jul 31 00:39:03 2008 +0200
xf86: don't replicate dix defaults for pointer acceleration
the defaults from InitVelocityData() or hypothetic driver-side changes
are now respected, not overridden.
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 4ef7530..a8c9166 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -101,12 +101,9 @@ ProcessVelocityConfiguration(char* devname, pointer list, DeviceVelocityPtr s){
if(!s)
return;
- tempf = xf86SetRealOption(list, "FilterHalflife", 20);
- xf86Msg(X_CONFIG, "%s: (accel) filter halflife %.1f ms\n", devname, tempf);
+ tempf = xf86SetRealOption(list, "FilterHalflife", -1);
if(tempf > 0)
tempf = 1.0 / tempf; /* set reciprocal if possible */
- else
- tempf = 10000; /* else set fairly high */
tempf2 = xf86SetRealOption(list, "FilterChainProgression", 2.0);
xf86Msg(X_CONFIG, "%s: (accel) filter chain progression: %.2f\n",
@@ -118,7 +115,9 @@ ProcessVelocityConfiguration(char* devname, pointer list, DeviceVelocityPtr s){
if(tempi < 1 || tempi > MAX_VELOCITY_FILTERS)
tempi = 1;
- InitFilterChain(s, tempf, tempf2, tempi, 40);
+ if(tempf > 0.0f && tempi >= 1 && tempf2 >= 1.0f)
+ InitFilterChain(s, tempf, tempf2, tempi, 40);
+
for(i = 0; i < tempi; i++)
xf86Msg(X_CONFIG, "%s: (accel) filter stage %i: %.2f ms\n",
devname, i, 1.0f / (s->filters[i].rdecay));
@@ -138,10 +137,12 @@ ProcessVelocityConfiguration(char* devname, pointer list, DeviceVelocityPtr s){
s->min_acceleration = 1.0 / tempf; /* set minimum acceleration */
}
- tempf = xf86SetRealOption(list, "VelocityCoupling", 0.25);
- xf86Msg(X_CONFIG, "%s: (accel) velocity coupling is %.1f%%\n", devname,
+ tempf = xf86SetRealOption(list, "VelocityCoupling", -1);
+ if(tempf >= 0){
+ xf86Msg(X_CONFIG, "%s: (accel) velocity coupling is %.1f%%\n", devname,
tempf*100.0);
- s->coupling = tempf;
+ s->coupling = tempf;
+ }
/* Configure softening. If const deceleration is used, this is expected
* to provide better subpixel information so we enable
@@ -150,19 +151,22 @@ ProcessVelocityConfiguration(char* devname, pointer list, DeviceVelocityPtr s){
s->use_softening = xf86SetBoolOption(list, "Softening",
s->const_acceleration == 1.0);
- s->average_accel = xf86SetBoolOption(list, "AccelerationProfileAveraging", TRUE);
+ s->average_accel = xf86SetBoolOption(list, "AccelerationProfileAveraging",
+ s->average_accel);
- s->reset_time = xf86SetIntOption(list, "VelocityReset", 300);
+ s->reset_time = xf86SetIntOption(list, "VelocityReset", s->reset_time);
tempf = xf86SetRealOption(list, "ExpectedRate", 0);
if(tempf > 0){
s->corr_mul = 1000.0 / tempf;
}else{
- s->corr_mul = xf86SetRealOption(list, "VelocityScale", 10);
+ s->corr_mul = xf86SetRealOption(list, "VelocityScale", s->corr_mul);
}
/* select profile by number */
- tempi= xf86SetIntOption(list, "AccelerationProfile", 0);
+ tempi= xf86SetIntOption(list, "AccelerationProfile",
+ s->statistics.profile_number);
+
if(SetAccelerationProfile(s, tempi)){
xf86Msg(X_CONFIG, "%s: (accel) set acceleration profile %i\n", devname, tempi);
}else{
commit 4f333d53510b82db57cfac1bfea22422cbb7be79
Author: Simon Thum <simon.thum at gmx.de>
Date: Thu Jul 31 00:33:38 2008 +0200
dix: simplify velocity tracking filters
prefer fp-mul over fp-div and remove rather pointless check
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c
index 64b1c35..56ce71b 100644
--- a/dix/ptrveloc.c
+++ b/dix/ptrveloc.c
@@ -272,8 +272,7 @@ QueryFilterChain(
break;
cur = s->filters[fn].current;
- if (fabs(value - cur) <= 1.0f ||
- fabs(value - cur) / (value + cur) <= s->coupling){
+ if (fabs(value - cur) <= (s->coupling * (value + cur))){
result = cur;
rfn = fn + 1; /*remember result determining filter */
} else if(cfn == -1){
More information about the xorg-commit
mailing list