CV-Bowen opened a new pull request, #20865:
URL: https://github.com/apache/nuttx/pull/20865

   ## Summary
   
   QEMU's `virtio-tablet-device` reports absolute EV_ABS positions with
   BTN_LEFT/BTN_TOUCH as the contact and no ABS_PRESSURE. virtio-input
   treated it as a touchscreen and never produced usable samples.
   
   A device that advertises EV_KEY together with EV_ABS is now registered as
   a tablet and its events are translated into single-point touch samples
   (DOWN/MOVE/UP). The event ring is raised from 8 to 64 entries so a burst
   of ABS/KEY/SYN events is not dropped.
   
   The first commit only fixes existing nxstyle errors in virtio-input.c.
   
   ## Impact
   
   virtio-input only. Touchscreen devices with ABS_PRESSURE keep the old
   handler. No API or Kconfig change.
   
   ## Testing
   
   Host: Ubuntu 22.04.5 LTS x86_64, QEMU version 10.2.1, sim: cc (Ubuntu 
13.1.0-8ubuntu1~22.04) 13.1.0, qemu-armv8a: aarch64-none-elf-gcc (Arm GNU 
Toolchain 12.2.Rel1 (Build arm-12.24)) 12.2.1 20221205
   
   `qemu-armv8a:fb` with `DRIVERS_VIRTIO_INPUT`, `INPUT_TOUCHSCREEN` and
   `EXAMPLES_TOUCHSCREEN` enabled:
   
   ```
   qemu-system-aarch64 -cpu cortex-a53 -nographic \
     -machine virt,virtualization=on,gic-version=3 \
     -global virtio-mmio.force-legacy=false \
     -device virtio-gpu-device,xres=640,yres=480,bus=virtio-mmio-bus.0 \
     -device virtio-tablet-device,bus=virtio-mmio-bus.1 \
     -qmp unix:/tmp/qmp.sock,server,nowait -kernel ./nuttx
   ```
   
   Move, press, move and release injected through QMP `input-send-event`
   while `tc 4` runs:
   
   | event | before | after |
   |---|---|---|
   | move to (8000,4000) | flags 10, x 8000 | flags 0c (UP), x 8000 |
   | press | flags 00, x 0 y 0 | flags 19 (DOWN), x 8000 y 4000 |
   | move to (16000,12000) | flags 10 | flags 1a (MOVE), x 16000 y 12000 |
   | release | flags 00, x 0 y 0 | flags 0c (UP) |
   
   <details><summary>tc 4 (after)</summary>
   
   ```
   nsh> tc 4
   tc_main: nsamples: 4
   tc_main: Opening /dev/input0
   Sample     :
      npoints : 1
   Point 1    :
           id : 0
        flags : 0c
            x : 8000
            y : 4000
            h : 0
            w : 0
     pressure : 0
    timestamp : 3103408
   Sample     :
      npoints : 1
   Point 1    :
           id : 0
        flags : 19
            x : 8000
            y : 4000
            h : 0
            w : 0
     pressure : 0
    timestamp : 3704184
   Sample     :
      npoints : 1
   Point 1    :
           id : 0
        flags : 1a
            x : 16000
            y : 12000
            h : 0
            w : 0
     pressure : 0
    timestamp : 4305282
   Sample     :
      npoints : 1
   Point 1    :
           id : 0
        flags : 0c
            x : 16000
            y : 12000
            h : 0
            w : 0
     pressure : 0
    timestamp : 4906426
   Terminating!
   ```
   </details>
   
   <details><summary>tc 4 (before)</summary>
   
   ```
   nsh> tc 4
   tc_main: nsamples: 4
   tc_main: Opening /dev/input0
   Sample     :
      npoints : 1
   Point 1    :
           id : 0
        flags : 10
            x : 8000
            y : 4000
            h : 0
            w : 0
     pressure : 0
    timestamp : 3098290
   Sample     :
      npoints : 1
   Point 1    :
           id : 0
        flags : 00
            x : 0
            y : 0
            h : 0
            w : 0
     pressure : 0
    timestamp : 3701716
   Sample     :
      npoints : 1
   Point 1    :
           id : 0
        flags : 10
            x : 16000
            y : 12000
            h : 0
            w : 0
     pressure : 0
    timestamp : 4303014
   Sample     :
      npoints : 1
   Point 1    :
           id : 0
        flags : 00
            x : 0
            y : 0
            h : 0
            w : 0
     pressure : 0
    timestamp : 4904389
   Terminating!
   ```
   </details>
   
   No regression in rpmsg: sim:rpserver/rpproxy and 
qemu-armv8a:rpserver/rpproxy boot and pass the fixed rpmsg cases (dump, ping, 
rpmsgfs; 15/15). qemu-armv8a was built with LIBC_ENVPATH and BINFMT_CHECKEXEC 
disabled, which current master needs for nxinit to start nsh there; unrelated 
to this change.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to