Home
last modified time | relevance | path

Searched hist:"33 b96d934902f96e901b72ac18bbc47afad1ac20" (Results 1 – 2 of 2) sorted by relevance

/linux/drivers/input/
H A Dff-core.cdiff 33b96d934902f96e901b72ac18bbc47afad1ac20 Thu Oct 15 02:29:37 CEST 2015 Elias Vanderstuyft <elias.vds@gmail.com> Input: document and check on implicitly defined FF_MAX_EFFECTS

There is an undocumented upper bound for the total number of ff effects:
FF_GAIN (= 96).
This can be found as follows:
- user: write(EV_FF, effect_id, iterations)
calls kernel: ff->playback(effect_id, ...): starts effect "effect_id"
- user: write(EV_FF, FF_GAIN, gain)
calls kernel: ff->set_gain(gain, ...): sets gain

A collision occurs when effect_id equals FF_GAIN.
According to input_ff_event(),
FF_GAIN is the smallest value where a collision occurs.
Therefore the greatest safe value for effect_id is FF_GAIN - 1,
and thus the total number of effects should never exceed FF_GAIN.

Define FF_MAX_EFFECTS as FF_GAIN and check on this limit in ff-core.

Signed-off-by: Elias Vanderstuyft <elias.vds@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
/linux/include/uapi/linux/
H A Dinput.hdiff 33b96d934902f96e901b72ac18bbc47afad1ac20 Thu Oct 15 02:29:37 CEST 2015 Elias Vanderstuyft <elias.vds@gmail.com> Input: document and check on implicitly defined FF_MAX_EFFECTS

There is an undocumented upper bound for the total number of ff effects:
FF_GAIN (= 96).
This can be found as follows:
- user: write(EV_FF, effect_id, iterations)
calls kernel: ff->playback(effect_id, ...): starts effect "effect_id"
- user: write(EV_FF, FF_GAIN, gain)
calls kernel: ff->set_gain(gain, ...): sets gain

A collision occurs when effect_id equals FF_GAIN.
According to input_ff_event(),
FF_GAIN is the smallest value where a collision occurs.
Therefore the greatest safe value for effect_id is FF_GAIN - 1,
and thus the total number of effects should never exceed FF_GAIN.

Define FF_MAX_EFFECTS as FF_GAIN and check on this limit in ff-core.

Signed-off-by: Elias Vanderstuyft <elias.vds@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>