#
0c6673e3 |
| 25-Feb-2025 |
Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> |
HID: pidff: Clamp effect playback LOOP_COUNT value
Ensures the loop count will never exceed the logical_maximum.
Fixes implementation errors happening when applications use the max value of int32/D
HID: pidff: Clamp effect playback LOOP_COUNT value
Ensures the loop count will never exceed the logical_maximum.
Fixes implementation errors happening when applications use the max value of int32/DWORD as the effect iterations. This could be observed when running software both native and in wine.
Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
show more ...
|
#
bbeface1 |
| 25-Feb-2025 |
Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> |
HID: pidff: Rename two functions to align them with naming convention
Driver uses "set" everywhere to indicate setting report values and requesting HID_REQ_SET_REPORT
Signed-off-by: Tomasz Pakuła <
HID: pidff: Rename two functions to align them with naming convention
Driver uses "set" everywhere to indicate setting report values and requesting HID_REQ_SET_REPORT
Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
show more ...
|
Revision tags: v6.14-rc4, v6.14-rc3 |
|
#
1bd55e79 |
| 11-Feb-2025 |
Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> |
HID: pidff: Remove redundant call to pidff_find_special_keys
Probably left out as a mistake after Anssi created the helper macro
Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> Sig
HID: pidff: Remove redundant call to pidff_find_special_keys
Probably left out as a mistake after Anssi created the helper macro
Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
show more ...
|
#
9d4174dc |
| 11-Feb-2025 |
Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> |
HID: pidff: Support device error response from PID_BLOCK_LOAD
If an error happens on the device, the driver will no longer fall into the trap of reading this status 60 times before it decides that t
HID: pidff: Support device error response from PID_BLOCK_LOAD
If an error happens on the device, the driver will no longer fall into the trap of reading this status 60 times before it decides that this reply won't change to success/memory full.
Greatly reduces communication overhead during device error situation.
Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
show more ...
|
#
e19675c2 |
| 11-Feb-2025 |
Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> |
HID: pidff: Comment and code style update
Update comments to fully conform to the Linux comment styling. Define Linux infinite effect duration (0) as FF_INFINITE
Chanage Oleg's name order
Signed-o
HID: pidff: Comment and code style update
Update comments to fully conform to the Linux comment styling. Define Linux infinite effect duration (0) as FF_INFINITE
Chanage Oleg's name order
Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
show more ...
|
#
1f650dce |
| 11-Feb-2025 |
Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> |
HID: pidff: Make sure to fetch pool before checking SIMULTANEOUS_MAX
As noted by Anssi some 20 years ago, pool report is sometimes messed up. This worked fine on many devices but casued oops on VRS
HID: pidff: Make sure to fetch pool before checking SIMULTANEOUS_MAX
As noted by Anssi some 20 years ago, pool report is sometimes messed up. This worked fine on many devices but casued oops on VRS DirectForce PRO.
Here, we're making sure pool report is refetched before trying to access any of it's fields. While loop was replaced with a for loop + exit conditions were moved aroud to decrease the possibility of creating an infinite loop scenario.
Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
show more ...
|
Revision tags: v6.14-rc2, v6.14-rc1 |
|
#
5d98079b |
| 01-Feb-2025 |
Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> |
HID: pidff: Factor out pool report fetch and remove excess declaration
We only want to refetch the pool report during device init. Reset function is now called when uploading effects to an empty dev
HID: pidff: Factor out pool report fetch and remove excess declaration
We only want to refetch the pool report during device init. Reset function is now called when uploading effects to an empty device so extract pool fetch to separate function and call it from init before autocenter check (autocenter check triggered reset during init).
Remove a superfluous pointer declaration and assigment as well.
Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> Reviewed-by: Michał Kopeć <michal@nozomi.space> Reviewed-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Cristóferson Bueno <cbueno81@gmail.com> Tested-by: Pablo Cisneros <patchkez@protonmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
show more ...
|
#
21755162 |
| 01-Feb-2025 |
Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> |
HID: pidff: Use macros instead of hardcoded min/max values for shorts
Makes it obvious these magic values ARE in fact derived from min and max values for s16 and u16
Signed-off-by: Tomasz Pakuła <t
HID: pidff: Use macros instead of hardcoded min/max values for shorts
Makes it obvious these magic values ARE in fact derived from min and max values for s16 and u16
Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> Reviewed-by: Michał Kopeć <michal@nozomi.space> Reviewed-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Cristóferson Bueno <cbueno81@gmail.com> Tested-by: Pablo Cisneros <patchkez@protonmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
show more ...
|
#
4eb9c2ee |
| 01-Feb-2025 |
Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> |
HID: pidff: Simplify pidff_rescale_signed
This function overrelies on ternary operators and makes it hard to parse it mentally. New version makes it very easy to understand.
Signed-off-by: Tomasz P
HID: pidff: Simplify pidff_rescale_signed
This function overrelies on ternary operators and makes it hard to parse it mentally. New version makes it very easy to understand.
Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> Reviewed-by: Michał Kopeć <michal@nozomi.space> Reviewed-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Cristóferson Bueno <cbueno81@gmail.com> Tested-by: Pablo Cisneros <patchkez@protonmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
show more ...
|
#
0d24d4b1 |
| 01-Feb-2025 |
Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> |
HID: pidff: Move all hid-pidff definitions to a dedicated header
Do not clutter hid includes with stuff not needed outside of the kernel.
Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail
HID: pidff: Move all hid-pidff definitions to a dedicated header
Do not clutter hid includes with stuff not needed outside of the kernel.
Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> Reviewed-by: Michał Kopeć <michal@nozomi.space> Reviewed-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Cristóferson Bueno <cbueno81@gmail.com> Tested-by: Pablo Cisneros <patchkez@protonmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
show more ...
|
#
22a05462 |
| 01-Feb-2025 |
Tomasz Pakuła <forest10pl@gmail.com> |
HID: pidff: Fix null pointer dereference in pidff_find_fields
This function triggered a null pointer dereference if used to search for a report that isn't implemented on the device. This happened bo
HID: pidff: Fix null pointer dereference in pidff_find_fields
This function triggered a null pointer dereference if used to search for a report that isn't implemented on the device. This happened both for optional and required reports alike.
The same logic was applied to pidff_find_special_field and although pidff_init_fields should return an error earlier if one of the required reports is missing, future modifications could change this logic and resurface this possible null pointer dereference again.
LKML bug report: https://lore.kernel.org/all/CAL-gK7f5=R0nrrQdPtaZZr1fd-cdAMbDMuZ_NLA8vM0SX+nGSw@mail.gmail.com
Reported-by: Nolan Nicholson <nolananicholson@gmail.com> Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> Reviewed-by: Michał Kopeć <michal@nozomi.space> Reviewed-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Cristóferson Bueno <cbueno81@gmail.com> Tested-by: Pablo Cisneros <patchkez@protonmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
show more ...
|
#
f7ebf0b1 |
| 01-Feb-2025 |
Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> |
HID: pidff: Factor out code for setting gain
Makes it possible to easily set gain from inside hid-pidff.c
Changes in v7: - Check if device gain field exists before setting device gain
Signed-off-b
HID: pidff: Factor out code for setting gain
Makes it possible to easily set gain from inside hid-pidff.c
Changes in v7: - Check if device gain field exists before setting device gain
Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> Reviewed-by: Michał Kopeć <michal@nozomi.space> Reviewed-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Cristóferson Bueno <cbueno81@gmail.com> Tested-by: Pablo Cisneros <patchkez@protonmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
show more ...
|
#
87131072 |
| 01-Feb-2025 |
Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> |
HID: pidff: Rescale time values to match field units
PID devices can use different exponents for time fields, while Linux Force Feedback API only supports miliseconds.
Read the exponent of a given
HID: pidff: Rescale time values to match field units
PID devices can use different exponents for time fields, while Linux Force Feedback API only supports miliseconds.
Read the exponent of a given time field and scale its value accordingly.
Changes in v7: - Rescale all time fields, not only period
changes in v9: - Properly assign fade_lenght, not attack_length to PID_FADE_TIME
Co-developed-by: Makarenko Oleg <oleg@makarenk.ooo> Signed-off-by: Makarenko Oleg <oleg@makarenk.ooo> Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> Reviewed-by: Michał Kopeć <michal@nozomi.space> Reviewed-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Cristóferson Bueno <cbueno81@gmail.com> Tested-by: Pablo Cisneros <patchkez@protonmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
show more ...
|
#
1c12f136 |
| 01-Feb-2025 |
Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> |
HID: pidff: Define values used in pidff_find_special_fields
Makes it clear where did these values came from
Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> Reviewed-by: Michał Kope
HID: pidff: Define values used in pidff_find_special_fields
Makes it clear where did these values came from
Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> Reviewed-by: Michał Kopeć <michal@nozomi.space> Reviewed-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Cristóferson Bueno <cbueno81@gmail.com> Tested-by: Pablo Cisneros <patchkez@protonmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
show more ...
|
#
e4bdc80e |
| 01-Feb-2025 |
Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> |
HID: pidff: Simplify pidff_upload_effect function
Merge a bit of code that reqeusts conditional effects upload. Makes it clear, that effect handling should be identical for SPRING, DAMPER, INERTIA a
HID: pidff: Simplify pidff_upload_effect function
Merge a bit of code that reqeusts conditional effects upload. Makes it clear, that effect handling should be identical for SPRING, DAMPER, INERTIA and FRICTION.
Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> Reviewed-by: Michał Kopeć <michal@nozomi.space> Reviewed-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Cristóferson Bueno <cbueno81@gmail.com> Tested-by: Pablo Cisneros <patchkez@protonmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
show more ...
|
#
cb3fd788 |
| 01-Feb-2025 |
Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> |
HID: pidff: Completely rework and fix pidff_reset function
Previously, it was assumed that DEVICE_CONTROL usage is always an array but a lot of devices implements it as a bitmask variable. This led
HID: pidff: Completely rework and fix pidff_reset function
Previously, it was assumed that DEVICE_CONTROL usage is always an array but a lot of devices implements it as a bitmask variable. This led to the pidff_reset function not working and causing errors in such cases.
Selectors can come in three types. One selection of a set, N selections and Any selection in form of bitmask as from USB Hid Usage Tables v1.5, subsection 3.4.2.1
Added pidff_send_device_control which handles usage flag check which decides whether DEVICE_CONTROL should be handled as "One selection of a set" or "Any selection of a set".
Reset was triggered once, on device initialization. Now, it's triggered every time when uploading an effect to an empty device (no currently stored effects), tracked by pidff->effect_count variable.
Co-developed-by: Makarenko Oleg <oleg@makarenk.ooo> Signed-off-by: Makarenko Oleg <oleg@makarenk.ooo> Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> Reviewed-by: Michał Kopeć <michal@nozomi.space> Reviewed-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Cristóferson Bueno <cbueno81@gmail.com> Tested-by: Pablo Cisneros <patchkez@protonmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
show more ...
|
#
abdbf876 |
| 01-Feb-2025 |
Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> |
HID: pidff: Add PERIODIC_SINE_ONLY quirk
Some devices only support SINE periodic effect although they advertise support for all PERIODIC effect in their HID descriptor. Some just do nothing when try
HID: pidff: Add PERIODIC_SINE_ONLY quirk
Some devices only support SINE periodic effect although they advertise support for all PERIODIC effect in their HID descriptor. Some just do nothing when trying to play such an effect (upload goes fine), some express undefined behavior like turning to one side.
This quirk forces all the periodic effects to be uploaded as SINE. This is acceptable as all these effects are similar in nature and are mostly used as rumble. SINE is the most popular with others seldom used (especially SAW_UP and SAW_DOWN).
Fixes periodic effects for PXN and LITE STAR wheels
Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> Reviewed-by: Michał Kopeć <michal@nozomi.space> Reviewed-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Cristóferson Bueno <cbueno81@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
show more ...
|
#
ce52c0c9 |
| 01-Feb-2025 |
Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> |
HID: pidff: Stop all effects before enabling actuators
Some PID compliant devices automatically play effects after boot (i.e. autocenter spring) that prevent the rendering of other effects since it
HID: pidff: Stop all effects before enabling actuators
Some PID compliant devices automatically play effects after boot (i.e. autocenter spring) that prevent the rendering of other effects since it is done outside the kernel driver.
This makes sure all the effects currently played are stopped after resetting the device. It brings compatibility to the Brunner CLS-P joystick and others
Reported-by: Jules Noirant <jules.noirant@orange.fr> Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> Reviewed-by: Michał Kopeć <michal@nozomi.space> Reviewed-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Cristóferson Bueno <cbueno81@gmail.com> Tested-by: Pablo Cisneros <patchkez@protonmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
show more ...
|
#
3051bf5e |
| 01-Feb-2025 |
Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> |
HID: pidff: Add FIX_WHEEL_DIRECTION quirk
Most steering wheels simply ignore DIRECTION field, but some try to be compliant with the PID standard and use it in force calculations. Games often ignore
HID: pidff: Add FIX_WHEEL_DIRECTION quirk
Most steering wheels simply ignore DIRECTION field, but some try to be compliant with the PID standard and use it in force calculations. Games often ignore setting this field properly and/or there can be issues with dinput8 -> wine -> SDL -> Linux API translation, and this value can be incorrect. This can lead to partial/complete loss of Force Feedback or even unexpected force reversal.
Sadly, this quirk can't be detected automatically without sending out effects that would move an axis.
This fixes FFB on Moza Racing devices and others where effect direction is not simply ignored.
Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> Reviewed-by: Michał Kopeć <michal@nozomi.space> Reviewed-by: Paul Dino Jones <paul@spacefreak18.xyz> Signed-off-by: Jiri Kosina <jkosina@suse.com>
show more ...
|
#
36de0164 |
| 01-Feb-2025 |
Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> |
HID: pidff: Add hid_pidff_init_with_quirks and export as GPL symbol
This lays out a way to provide an initial set of quirks to enable before device initialization takes place. GPL symbol export need
HID: pidff: Add hid_pidff_init_with_quirks and export as GPL symbol
This lays out a way to provide an initial set of quirks to enable before device initialization takes place. GPL symbol export needed for the possibility of building HID drivers which use this function as modules.
Adding a wrapper function to ensure compatibility with the old behavior of hid_pidff_init.
Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> Reviewed-by: Michał Kopeć <michal@nozomi.space> Reviewed-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Cristóferson Bueno <cbueno81@gmail.com> Tested-by: Pablo Cisneros <patchkez@protonmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
show more ...
|
#
a4119108 |
| 01-Feb-2025 |
Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> |
HID: pidff: Add PERMISSIVE_CONTROL quirk
With this quirk, a PID device isn't required to have a strict logical_minimum of 1 for the the PID_DEVICE_CONTROL usage page.
Some devices come with weird v
HID: pidff: Add PERMISSIVE_CONTROL quirk
With this quirk, a PID device isn't required to have a strict logical_minimum of 1 for the the PID_DEVICE_CONTROL usage page.
Some devices come with weird values in their device descriptors and this quirk enables their initialization even if the logical minimum of the DEVICE_CONTROL page is not 1.
Fixes initialization of VRS Direct Force Pro
Changes in v6: - Change quirk name to better reflect it's intention
Co-developed-by: Makarenko Oleg <oleg@makarenk.ooo> Signed-off-by: Makarenko Oleg <oleg@makarenk.ooo> Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> Reviewed-by: Michał Kopeć <michal@nozomi.space> Reviewed-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Cristóferson Bueno <cbueno81@gmail.com> Tested-by: Pablo Cisneros <patchkez@protonmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
show more ...
|
#
fc7c154e |
| 01-Feb-2025 |
Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> |
HID: pidff: Add MISSING_PBO quirk and its detection
Some devices with only one axis are missing PARAMETER_BLOCK_OFFSET field for conditional effects. They can only have one axis, so we're limiting t
HID: pidff: Add MISSING_PBO quirk and its detection
Some devices with only one axis are missing PARAMETER_BLOCK_OFFSET field for conditional effects. They can only have one axis, so we're limiting the max_axis when setting the report for those effects.
Automatic detection ensures compatibility even if such device won't be explicitly defined in the kernel.
Fixes initialization of VRS DirectForce PRO and possibly other devices.
Changes in v6: - Fixed NULL pointer dereference. When PBO is missing, make sure not to set it anyway
Co-developed-by: Makarenko Oleg <oleg@makarenk.ooo> Signed-off-by: Makarenko Oleg <oleg@makarenk.ooo> Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> Reviewed-by: Michał Kopeć <michal@nozomi.space> Reviewed-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Cristóferson Bueno <cbueno81@gmail.com> Tested-by: Pablo Cisneros <patchkez@protonmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
show more ...
|
#
2d5c7ce5 |
| 01-Feb-2025 |
Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> |
HID: pidff: Add MISSING_DELAY quirk and its detection
A lot of devices do not include this field, and it's seldom used in force feedback implementations. I tested about three dozen applications and
HID: pidff: Add MISSING_DELAY quirk and its detection
A lot of devices do not include this field, and it's seldom used in force feedback implementations. I tested about three dozen applications and none of them make use of the delay.
This fixes initialization of a lot of PID wheels like Cammus, VRS, FFBeast
This change has no effect on fully compliant devices
Co-developed-by: Makarenko Oleg <oleg@makarenk.ooo> Signed-off-by: Makarenko Oleg <oleg@makarenk.ooo> Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> Reviewed-by: Michał Kopeć <michal@nozomi.space> Reviewed-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Cristóferson Bueno <cbueno81@gmail.com> Tested-by: Pablo Cisneros <patchkez@protonmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
show more ...
|
#
f538183e |
| 01-Feb-2025 |
Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> |
HID: pidff: Clamp PERIODIC effect period to device's logical range
This ensures the effect can actually be played on the connected force feedback device. Adds clamping functions used instead of resc
HID: pidff: Clamp PERIODIC effect period to device's logical range
This ensures the effect can actually be played on the connected force feedback device. Adds clamping functions used instead of rescaling, as we don't want to change the characteristics of the periodic effects.
Fixes edge cases found on Moza Racing and some other hardware where the effects would not play if the period is outside the defined logical range.
Changes in v6: - Use in-kernel clamp macro instead of a custom solution
Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> Reviewed-by: Michał Kopeć <michal@nozomi.space> Reviewed-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Cristóferson Bueno <cbueno81@gmail.com> Tested-by: Pablo Cisneros <patchkez@protonmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
show more ...
|
#
8876fc18 |
| 01-Feb-2025 |
Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> |
HID: pidff: Do not send effect envelope if it's empty
Envelope struct is always initialized, but the envelope itself is optional as described in USB PID Device class definition 1.0.
5.1.1.1 Type Sp
HID: pidff: Do not send effect envelope if it's empty
Envelope struct is always initialized, but the envelope itself is optional as described in USB PID Device class definition 1.0.
5.1.1.1 Type Specific Block Offsets ... 4) Effects that do not use Condition Blocks use 1 Parameter Block and an *optional* Envelope Block.
Sending out "empty" envelope breaks force feedback on some devices with games that use SINE effect + offset to emulate constant force effect, as well as generally breaking Constant/Periodic effects. One of the affected brands is Moza Racing.
This change prevents the envelope from being sent if it contains all 0 values while keeping the old behavior of only sending it, if it differs from the old one.
Changes in v6: - Simplify the checks to make them clearer - Fix possible null pointer dereference while calling pidff_needs_set_envelope
Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> Reviewed-by: Michał Kopeć <michal@nozomi.space> Reviewed-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Paul Dino Jones <paul@spacefreak18.xyz> Tested-by: Cristóferson Bueno <cbueno81@gmail.com> Tested-by: Pablo Cisneros <patchkez@protonmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
show more ...
|