From: Jari Vanhala <ext-jari.vanhala@nokia.com>
To: Linux Input <linux-input@vger.kernel.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Anssi Hannula <anssi.hannula@iki.fi>
Subject: [RFC] ff-memless instant starting
Date: Wed, 23 Dec 2009 15:31:14 +0200 [thread overview]
Message-ID: <1261575074.24604.31.camel@tema> (raw)
[-- Attachment #1: Type: text/plain, Size: 723 bytes --]
Hi,
Looks like starting effect with low HZ machine takes considerably time
due need to wait for system timer. Simplest way to make things faster is
to do calculation for effect always instantly, like in stopping, but
this makes starting multiple effects more costly.
Other solution would be making it a module parameter, so behavior could
be controlled per machine. Optimize possible cost or speed. I attached
small patch which will do that.
If starting priority of individual effect is needed to controlled, you
probably need to add flag for that to effect itself... I don't know
which way FF-api is developing, so this could be either good or bad
thing.
Any opinions or suggestions? Other than rising HZ. =)
++Jam
[-- Attachment #2: 0001-Input-Add-instant-option-to-ff-memless.patch --]
[-- Type: text/x-patch, Size: 1345 bytes --]
>From d3b6fa1eaac42f878f7c9b89b22ddfa85d900f38 Mon Sep 17 00:00:00 2001
From: Jari Vanhala <ext-jari.vanhala@nokia.com>
Date: Tue, 22 Dec 2009 16:49:29 +0200
Subject: [PATCH] Input: Add instant option to ff-memless
Allows Force Feedback effect to be started immediately
and not to wait for timer. Useful in low HZ systems.
Signed-off-by: Jari Vanhala <ext-jari.vanhala@nokia.com>
---
drivers/input/ff-memless.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/drivers/input/ff-memless.c b/drivers/input/ff-memless.c
index b483b29..dfd5830 100644
--- a/drivers/input/ff-memless.c
+++ b/drivers/input/ff-memless.c
@@ -67,6 +67,10 @@ struct ml_device {
struct ff_effect *effect);
};
+static int instant;
+module_param(instant, int, 0);
+MODULE_PARM_DESC(instant, "Start new effect instantly");
+
static const struct ff_envelope *get_envelope(const struct ff_effect *effect)
{
static const struct ff_envelope empty_envelope;
@@ -411,7 +415,10 @@ static int ml_ff_playback(struct input_dev *dev, int effect_id, int value)
msecs_to_jiffies(state->effect->replay.length);
state->adj_at = state->play_at;
- ml_schedule_timer(ml);
+ if (instant && !state->effect->replay.delay)
+ ml_play_effects(ml);
+ else
+ ml_schedule_timer(ml);
} else {
debug("initiated stop");
--
1.6.3.3
next reply other threads:[~2009-12-23 13:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-23 13:31 Jari Vanhala [this message]
2009-12-23 19:38 ` [RFC] ff-memless instant starting Dmitry Torokhov
2009-12-24 23:52 ` Anssi Hannula
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1261575074.24604.31.camel@tema \
--to=ext-jari.vanhala@nokia.com \
--cc=anssi.hannula@iki.fi \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.