platform/x86/tuxedo: Handle LampUpdateFlags in LampRangeUpdateReport
Subsystems (2)
PATCH v2 1/1 platform/x86/tuxedo: Handle LampUpdateFlags in LampRangeUpdateReport
According to HID Usage Tables v1.7 "Lighting And Illumination Page", the LampUpdateComplete flag marks an update report as the last of a batch. A device must apply all prior changes at once when it receives a report with this flag set.
The handler for LampMultiUpdateReport already honors LampUpdateFlags, but the handler for LampRangeUpdateReport did not. It always set LampUpdateComplete on the final chunk, so every range update flushed the internal color state regardless of what the host requested. This reduced efficiency and caused unwanted intermediate states for software that batches updates using the flag.
While splitting the update into several LampMultiUpdateReports, forward the flags from the range report on the final chunk. Intermediate chunks continue to carry no flags.
---
Changes in v2:
- Fix formatting
---
Tested userspace software:
- OpenRGB (aac7e55114)
- lampctl (https://github.com/tuxedo-aer/lampctl 5da2aff)
--- drivers/platform/x86/tuxedo/nb04/wmi_ab.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/platform/x86/tuxedo/nb04/wmi_ab.c +1 -2
@@ -723,8 +723,7 @@ static int handle_lamp_range_update_report(struct hid_device *hdev, LAMP_MULTI_UPDATE_REPORT_LAMP_COUNT_MAX); lamp_multi_update_report.lamp_update_flags = i +LAMP_MULTI_UPDATE_REPORT_LAMP_COUNT_MAX >= - rep->lamp_id_end +1 ? -LAMP_UPDATE_FLAGS_LAMP_UPDATE_COMPLETE :0 ; + rep->lamp_id_end +1 ? rep->lamp_update_flags :0 ;for (unsigned int j =0 ; j < lamp_multi_update_report.lamp_count; ++j) { lamp_multi_update_report.lamp_id[j] = i + j;
---
base-commit: c166bec9343c8b50e4c2acb78b1424c23d98841f
change-id: 20261028-nb04-fixes-6d5dab6989aa
Best regards,
Signature · 1 line
Aaron Erhardt <[email protected]>
Ilpo Järvinen
maintainerQuoted 5 lines · Aaron Erhardt
According to HID Usage Tables v1.7 "Lighting And Illumination Page", the LampUpdateComplete flag marks an update report as the last of a batch. A device must apply all prior changes at once when it receives a report with this flag set.
Quoted 8 lines
The handler for LampMultiUpdateReport already honors LampUpdateFlags, but the handler for LampRangeUpdateReport did not. It always set LampUpdateComplete on the final chunk, so every range update flushed the internal color state regardless of what the host requested. This reduced efficiency and caused unwanted intermediate states for software that batches updates using the flag.
[...]
Thank you for your contribution, it has been applied to my local review-ilpo-next branch. Note it will show up in the public platform-drivers-x86/review-ilpo-next branch only once I've pushed my local branch there, which might take a while.
FYI [if applicable to your patch], as per Linus' policy change, also fixes are mostly routed through for-next unless the fix is for a commit introduced in the most recent cycle or is clearly a regression fix.
The list of commits applied:
[1/1] platform/x86/tuxedo: Handle LampUpdateFlags in LampRangeUpdateReport
commit: 918846d92173e49fb4f1f75324b51927e7456c01
--
i.