[PATCH 09/15] Add four new motion filters
Daniel Stone
daniel at fooishbar.org
Tue Jun 14 09:00:05 PDT 2011
Hi,
On Tue, Jun 14, 2011 at 03:22:25PM +1000, Peter Hutterer wrote:
> On Thu, Jun 09, 2011 at 08:57:30PM +0100, Daniel Stone wrote:
> > Attempt to decrease the possibility of errant motion as much as possible
> > by adding three new configurable filters, disabled by default:
> > - Synaptics Max Jerk: maximum change in acceleration before the
> > packet is declared errant (xorg.conf MaxJerk)
> > - Synaptics Max Accel: maximum acceleration the pointer can have
> > before being declared errant (xorg.conf MaxAccel)
> > - Synaptics Max Error: maximum error from a best-fit prediction of
> > the next position before being declared errant (xorg.conf MaxError)
> > - Synaptics Max Distance: maximum distance a finger can move in a
> > single report before being declared errant (xorg.conf MaxDistance)
> >
>
> woo! more configuration options! :)
Yeah, I felt a bit bad about that.
> > +/* FLOAT */
> > +#define SYNAPTICS_PROP_MAX_DISTANCE "Synaptics Max Distance"
> > +
> > +/* FLOAT */
> > +#define SYNAPTICS_PROP_MAX_JERK "Synaptics Max Jerk"
> > +
> > +/* FLOAT */
> > +#define SYNAPTICS_PROP_MAX_ACCEL "Synaptics Max Accel"
> > +
> > +/* FLOAT */
> > +#define SYNAPTICS_PROP_MAX_ERROR "Synaptics Max Error"
>
> any reason these 4 couldn't be accumulated? they are related enough to
> justify it, imo.
>
> "Synaptics Acceleration Filters" or something more appropriate
What, have a single sledgehammer on/off switch? I can definitely see the
argument, but we're yet to find a useful algorithm that generates values
useful on all hardware, which is partly due to not having tested on a
massively broad range of devices.
> > @@ -1801,6 +1806,33 @@ static void regress(SynapticsPrivate *priv, const struct SynapticsHwState *hw,
> > double yb1n = 0, xb1n = 0, b1d = 0, xb1, yb1;
> > double dista, distb, distc, vela, velb, velc, acca, accb, jerk;
> >
> > + if (pars->max_distance &&
> for consistency with the checks a few lines below, this should state > 0 as well
Fixed, thanks.
> > + hypot(hw->x - HIST(0).x, hw->y - HIST(0).y) > pars->max_distance)
> > + goto filtered;
> > +
> > + if (pars->max_accel > 0 || pars->max_jerk > 0) {
> > + if (priv->count_packet_finger < 3) {
> > + *dx = 0;
> > + *dy = 0;
> > + return;
> > + }
> > +
>
> for the poor buggers that may have to debug this one day, a comment on
> what's actually done here would be awesome. I've spent too much time on
> wikipedia's math sites lately, trying to figure out what a piece of code was
> supposed to do.
Ha. I've added some more comments now.
Cheers,
Daniel
More information about the xorg-devel
mailing list