Commit 51ae9262 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

hidclass.sys: Overwrite queued reports as FIFO instead of LIFO.

Based on a patch from Ivo Ivanov <logos128@gmail.com>. The issue causes severe skipping and non smooth movement tracking in apps/games, when the HidP/HidD APIs are used to control the device (joysticks, controllers, steering wheels, etc.). Usually such devices use constant stream of INPUT reports to report their coords, so any report skipping or change of the sequence, when the interested apps are reading, would lead to such issues. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51824Signed-off-by: 's avatarRémi Bernon <rbernon@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 9411ecf6
......@@ -190,10 +190,12 @@ static void hid_queue_push_report( struct hid_queue *queue, struct hid_report *r
KeAcquireSpinLock( &queue->lock, &irql );
prev = queue->reports[i];
queue->reports[i] = report;
if (next != queue->read_idx) queue->write_idx = next;
if (next == queue->read_idx) queue->read_idx = next + 1;
if (queue->read_idx >= queue->length) queue->read_idx = 0;
KeReleaseSpinLock( &queue->lock, irql );
hid_report_decref( prev );
queue->write_idx = next;
}
static struct hid_report *hid_queue_pop_report( struct hid_queue *queue )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment