Created attachment 212306 [details] Patch for wmt driver. Attached patch diff from r358834 CiVUE ACB-C27003 with controller EETI EXC80W32/P80H32 (newer eGalax multitouch). If usb frame length is set to 1024 bytes (WMT_BSIZE) the EETI controller will pack multiple touch events in the packet and the current code will only process the first touch event. (line 500: usbd_copy_out will only copy the first 64 bytes). As a result some important events are lost like releasing the finger from the touchscreen :) Just let the hardware report its maximum packet size.
A commit references this bug: Author: hselasky Date: Wed Mar 11 08:16:14 UTC 2020 New revision: 358872 URL: https://svnweb.freebsd.org/changeset/base/358872 Log: If the USB frame length is set to 1024 bytes, WMT_BSIZE, the EETI controller will pack multiple touch events in the packet and the current code will only process the first touch event. As a result some important events are lost like releasing the finger from the touchscreen. Use the maximum maximum packet size as buffer size instead. Submitted by: Oskar Holmlund <oskar.holmlund@ohdata.se> PR: 244718 MFC after: 3 days Sponsored by: Mellanox Technologies Changes: head/sys/dev/usb/input/wmt.c
Will be MFC'ed in a few days time. Thank you for the patch!
The patch breaks devices which have report size larger then packet size. I think we should start with reverting r337289 and r338458. I'll submit patch to test soon.
Wulf: Are you sure about this?
Feel free to fix this (I.E. revert patches) From my understand INTERRUPT endpoint data should fit within one wMaxPacketSize, but you know these devices better than I do. I think we have a HID function which computes the worst-case descriptor length, and maybe this can be used together with .proxy_buffer = 1, to ensure the RX buffer is a multiple of wMaxPacketSize. --HPS
Created attachment 212329 [details] dont_restrict_transfer_size_to_wMaxPacketSize.patch Try this patch. If it don't help then try reduce bufsize to sc->isize.
(In reply to Hans Petter Selasky from comment #5) > From my understand INTERRUPT endpoint data should fit within one wMaxPacketSize I have the device which reports data in 116 bytes transfers. Restricting bufsize to wMaxPacketSize (64) broke it.
Wulf: I see. Just make sure you check sc_isize <= WMT_BSIZE somewhere.
(In reply to Vladimir Kondratyev from comment #6) Your patch works with the EETI controller. Thank you.
Wulf: Do you want me to submit your second patch or will you handle it?
(In reply to Hans Petter Selasky from comment #10) I will handle it
A commit references this bug: Author: wulf Date: Wed Mar 11 20:05:50 UTC 2020 New revision: 358895 URL: https://svnweb.freebsd.org/changeset/base/358895 Log: wmt(4): Reapply r358872 (by hselasky) modified to use maximal input report size instead of wMaxPacketSize. If the USB frame length is set to 1024 bytes, WMT_BSIZE, the EETI controller will pack multiple touch events in the packet and the current code will only process the first touch event. As a result some important events are lost like releasing the finger from the touchscreen. Use the maximal input report size as buffer size instead. PR: 244718 Tested by: Oskar Holmlund <oskar.holmlund@ohdata.se>, wulf MFC after: 3 days Discussed with: hselasky Changes: head/sys/dev/usb/input/wmt.c
A commit references this bug: Author: wulf Date: Sat Mar 14 22:03:50 UTC 2020 New revision: 359003 URL: https://svnweb.freebsd.org/changeset/base/359003 Log: MFC r358895 wmt(4): Reapply r358872 (by hselasky) modified to use maximal input report size instead of wMaxPacketSize. If the USB frame length is set to 1024 bytes, WMT_BSIZE, the EETI controller will pack multiple touch events in the packet and the current code will only process the first touch event. As a result some important events are lost like releasing the finger from the touchscreen. Use the maximal input report size as buffer size instead. PR: 244718 Tested by: Oskar Holmlund <oskar.holmlund@ohdata.se>, wulf Discussed with: hselasky Changes: _U stable/12/ stable/12/sys/dev/usb/input/wmt.c
A commit references this bug: Author: wulf Date: Sat Mar 14 22:07:11 UTC 2020 New revision: 359004 URL: https://svnweb.freebsd.org/changeset/base/359004 Log: MFC r358895 wmt(4): Reapply r358872 (by hselasky) modified to use maximal input report size instead of wMaxPacketSize. If the USB frame length is set to 1024 bytes, WMT_BSIZE, the EETI controller will pack multiple touch events in the packet and the current code will only process the first touch event. As a result some important events are lost like releasing the finger from the touchscreen. Use the maximal input report size as buffer size instead. PR: 244718 Tested by: Oskar Holmlund <oskar.holmlund@ohdata.se>, wulf Discussed with: hselasky Changes: _U stable/11/ stable/11/sys/dev/usb/input/wmt.c