case FF_INERTIA:
case FF_SPRING:
return true;
- default:
- return false;
}
}
eff->start_at = now + msecs_to_jiffies(ueff->replay.delay);
eff->updated_at = eff->start_at;
+ eff->touch_at = eff->start_at;
if (ueff->replay.delay)
printk(KERN_NOTICE "KLGDFF: Delayed effect will be started at %lu, now: %lu\n", eff->start_at, now);
int ret;
struct ffpl_effect *eff = &priv->effects[idx];
+ if (time_before(now, eff->touch_at)) {
+ printk(KERN_NOTICE "KLGDFF: Combinable effect is to be processed at a later time, skipping\n");
+ continue;
+ }
+
if (eff->replace) {
/* Uncombinable effect is about to be replaced by a combinable one */
if (ffpl_process_memless(priv, &eff->latest)) {
struct ffpl_effect *eff = &priv->effects[idx];
printk(KERN_NOTICE "KLGDFF: Processing effect %lu\n", idx);
+
+ if (time_before(now, eff->touch_at)) {
+ printk(KERN_NOTICE "KLGDFF: Next change of the effect is schededuled for the future\n");
+ continue;
+ }
+
ret = ffpl_handle_state_change(priv, *s, eff, now);
/* TODO: Do something useful with the return code */
if (ret) {
eff->change = FFPL_TO_START;
break;
case FFPL_TRIG_STOP:
- /* Small processing delays might cause us to miss the precise stop point */
+ /* Small processing delays might make us to miss the precise stop point */
current_t = time_before(eff->stop_at, now) ? now : eff->stop_at;
eff->change = FFPL_TO_STOP;
eff->repeat--;
continue;
}
+ eff->touch_at = current_t;
+
if (!events++) {
printk(KERN_NOTICE "KLGDFF: First event\n");
*t = current_t;
unsigned long start_at; /* Time when to start the effect - in jiffies */
unsigned long stop_at; /* Time when to stop the effect - in jiffies */
unsigned long updated_at; /* Time when the effect was recalculated last time - in jiffies */
+ unsigned long touch_at; /* Time of the next modification of the effect - in jiffies */
u16 playback_time; /* Used internally by effect processor to calculate periods */
bool recalculate; /* Effect shall be recalculated in the respective processing loop */
};