On Sat, Oct 26, 2013 at 10:13:11PM +0600, Alexandr Shadchin wrote: > On Fri, Oct 25, 2013 at 11:41:25AM +0100, Edd Barrett wrote: > > On Thu, Oct 24, 2013 at 10:33:22PM +0300, Henri Kemppainen wrote: > > > What happens when priv->swap_axes is set, and the ax && ay branch is > > > taken along with the wsWheelEmuFilterMotion() branch. Following > > > continue another event is processed and now the axes are swapped again > > > (ax and ay were not reset after use) and then what? Not very likely > > > I know. > > > > Ah, yes, there is the possibility of posting an inconsistent pointer sample > > in this case. Perhaps we should only update the old_ax/old_ay if the > > wsWheelEmuFilterMotion branch is not taken? > > > > What do you think? And yes, this is a very very unlikely case. You could > > argue it wouldn't matter even if it did happen. > > > > -- > > Best Regards > > Edd Barrett > > > > http://www.theunixzoo.co.uk > > > > Alternative solution without extra magic (need rebuild kernel). > > Before (on example pms(4)): > * user move mouse > * pms(4) read state mouse and process it > * pms(4) send dx, dy and buttons in wscons > * wscons generate simple events > * ws(4) reads one event and process it immediately > > After applying diff: > * user move mouse > * pms(4) read state mouse and process it > * pms(4) send dx, dy and buttons in wscons > * wscons generate simple events and adds SYNC event > * ws(4) reads events until it receives SYNC, and only then begins processing > > Tested on mouse. > > Comments ? > > PS: > synaptics(4) is working on a similar basis > > -- > Alexandr Shadchin >
I've tested this diff with some hours of QuakeWorld, an old and very fast/demanding FPS game. Works well. This staircase fix + KMS have improved these types of games on OpenBSD a lot. However, mouse input still isn't there yet, it still feels slightly delayed and not precise enough compared to running the same game and game client on Linux. This is only subtle and will most likely not be noticed without playing quite a lot though. Modern Quake engines rely on high sleep granuality so I always have to rip out any usleep from the clients since in OpenBSD atm you can't sleep below tic rate (roughly 1/100 sec on my machine) AFAIK. This may add to the aforementioned felt latency on input. Alf OpenBSD 5.4-current (GENERIC.MP) #0: Tue Oct 29 14:32:26 CET 2013 r...@obsd.rechners.lemarit.com:/usr/src/sys/arch/amd64/compile/GENERIC.MP real mem = 8555986944 (8159MB) avail mem = 8320094208 (7934MB) mainbus0 at root bios0 at mainbus0: SMBIOS rev. 2.4 @ 0xf0100 (37 entries) bios0: vendor Award Software International, Inc. version "F9" date 03/21/2012 bios0: Gigabyte Technology Co., Ltd. PH67A-UD3-B3 acpi0 at bios0: rev 0 acpi0: sleep states S0 S3 S4 S5 acpi0: tables DSDT FACP MSDM HPET MCFG ASPT SSPT EUDS MATS TAMG APIC SSDT MATS acpi0: wakeup devices PEX0(S5) PEX1(S5) PEX2(S5) PEX3(S5) PEX4(S5) PEX5(S5) PEX6(S5) PEX7(S5) HUB0(S5) UAR1(S3) USBE(S3) USE2(S3) AZAL(S5) PCI0(S5) acpitimer0 at acpi0: 3579545 Hz, 24 bits acpihpet0 at acpi0: 14318179 Hz acpimcfg0 at acpi0 addr 0xf4000000, bus 0-63 acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat cpu0 at mainbus0: apid 0 (boot processor) cpu0: Intel(R) Core(TM) i5-2500 CPU @ 3.30GHz, 3396.09 MHz cpu0: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,DEADLINE,AES,XSAVE,AVX,NXE,LONG,LAHF,PERF,ITSC cpu0: 256KB 64b/line 8-way L2 cache cpu0: smt 0, core 0, package 0 cpu0: apic clock running at 99MHz cpu0: mwait min=64, max=64, C-substates=0.2.1.1.0, IBE cpu1 at mainbus0: apid 2 (application processor) cpu1: Intel(R) Core(TM) i5-2500 CPU @ 3.30GHz, 3395.56 MHz cpu1: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,DEADLINE,AES,XSAVE,AVX,NXE,LONG,LAHF,PERF,ITSC cpu1: 256KB 64b/line 8-way L2 cache cpu1: smt 0, core 1, package 0 cpu2 at mainbus0: apid 4 (application processor) cpu2: Intel(R) Core(TM) i5-2500 CPU @ 3.30GHz, 3395.56 MHz cpu2: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,DEADLINE,AES,XSAVE,AVX,NXE,LONG,LAHF,PERF,ITSC cpu2: 256KB 64b/line 8-way L2 cache cpu2: smt 0, core 2, package 0 cpu3 at mainbus0: apid 6 (application processor) cpu3: Intel(R) Core(TM) i5-2500 CPU @ 3.30GHz, 3395.56 MHz cpu3: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,DEADLINE,AES,XSAVE,AVX,NXE,LONG,LAHF,PERF,ITSC cpu3: 256KB 64b/line 8-way L2 cache cpu3: smt 0, core 3, package 0 ioapic0 at mainbus0: apid 2 pa 0xfec00000, version 20, 24 pins ioapic0: misconfigured as apic 0, remapped to apid 2 acpiprt0 at acpi0: bus 0 (PCI0) acpiprt1 at acpi0: bus 1 (PEG0) acpiprt2 at acpi0: bus -1 (PEG1) acpiprt3 at acpi0: bus 2 (PEX0) acpiprt4 at acpi0: bus 3 (PEX1) acpiprt5 at acpi0: bus 4 (PEX2) acpiprt6 at acpi0: bus 5 (PEX3) acpiprt7 at acpi0: bus -1 (PEX4) acpiprt8 at acpi0: bus -1 (PEX5) acpiprt9 at acpi0: bus -1 (PEX6) acpiprt10 at acpi0: bus -1 (PEX7) acpiprt11 at acpi0: bus -1 (HUB0) acpicpu0 at acpi0: C3, C2, C1, PSS acpicpu1 at acpi0: C3, C2, C1, PSS acpicpu2 at acpi0: C3, C2, C1, PSS acpicpu3 at acpi0: C3, C2, C1, PSS acpibtn0 at acpi0: PWRB cpu0: Enhanced SpeedStep 3396 MHz: speeds: 3601, 3600, 3500, 3400, 3300, 3200, 3100, 3000, 2900, 2800, 2700, 2600, 2500, 2400, 2300, 2200, 2100, 2000, 1600 MHz pci0 at mainbus0 bus 0 pchb0 at pci0 dev 0 function 0 "Intel Core 2G Host" rev 0x09 ppb0 at pci0 dev 1 function 0 "Intel Core 2G PCIE" rev 0x09: msi pci1 at ppb0 bus 1 radeondrm0 at pci1 dev 0 function 0 "ATI Radeon HD 6770" rev 0x00: apic 2 int 16 drm0 at radeondrm0 azalia0 at pci1 dev 0 function 1 "ATI Radeon HD 5700 Audio" rev 0x00: msi azalia0: no supported codecs "Intel 6 Series MEI" rev 0x04 at pci0 dev 22 function 0 not configured ehci0 at pci0 dev 26 function 0 "Intel 6 Series USB" rev 0x05: apic 2 int 18 usb0 at ehci0: USB revision 2.0 uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1 azalia1 at pci0 dev 27 function 0 "Intel 6 Series HD Audio" rev 0x05: msi azalia1: codecs: Realtek/0x0889 audio0 at azalia1 ppb1 at pci0 dev 28 function 0 "Intel 6 Series PCIE" rev 0xb5: msi pci2 at ppb1 bus 2 ppb2 at pci0 dev 28 function 1 "Intel 6 Series PCIE" rev 0xb5: msi pci3 at ppb2 bus 3 "NEC xHCI" rev 0x04 at pci3 dev 0 function 0 not configured ppb3 at pci0 dev 28 function 2 "Intel 6 Series PCIE" rev 0xb5: msi pci4 at ppb3 bus 4 re0 at pci4 dev 0 function 0 "Realtek 8168" rev 0x06: RTL8168E/8111E (0x2c00), apic 2 int 18, address 1c:6f:65:c9:e1:d6 rgephy0 at re0 phy 7: RTL8169S/8110S PHY, rev. 4 ppb4 at pci0 dev 28 function 3 "Intel 82801BA Hub-to-PCI" rev 0xb5: msi pci5 at ppb4 bus 5 ppb5 at pci5 dev 0 function 0 "ITExpress IT8892E PCIE-PCI" rev 0x10 pci6 at ppb5 bus 6 "Creative Labs SoundBlaster Audigy LS" rev 0x00 at pci6 dev 1 function 0 not configured ehci1 at pci0 dev 29 function 0 "Intel 6 Series USB" rev 0x05: apic 2 int 23 usb1 at ehci1: USB revision 2.0 uhub1 at usb1 "Intel EHCI root hub" rev 2.00/1.00 addr 1 pcib0 at pci0 dev 31 function 0 "Intel H67 LPC" rev 0x05 pciide0 at pci0 dev 31 function 2 "Intel 6 Series SATA" rev 0x05: DMA, channel 0 configured to native-PCI, channel 1 configured to native-PCI pciide0: using apic 2 int 19 for native-PCI interrupt wd0 at pciide0 channel 0 drive 0: <SAMSUNG SSD 830 Series> wd0: 16-sector PIO, LBA48, 122104MB, 250069680 sectors wd1 at pciide0 channel 0 drive 1: <Samsung SSD 840 Series> wd1: 16-sector PIO, LBA48, 114473MB, 234441648 sectors wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 6 wd1(pciide0:0:1): using PIO mode 4, Ultra-DMA mode 6 wd2 at pciide0 channel 1 drive 0: <Samsung SSD 840 Series> wd2: 16-sector PIO, LBA48, 114473MB, 234441648 sectors wd2(pciide0:1:0): using PIO mode 4, Ultra-DMA mode 6 ichiic0 at pci0 dev 31 function 3 "Intel 6 Series SMBus" rev 0x05: apic 2 int 18 iic0 at ichiic0 iic0: addr 0x4e 03=cc 04=cc 06=0d 07=01 08=0f 0a=40 0c=ae 0d=fa 0e=c6 0f=88 12=ff 13=ff 20=14 26=03 28=83 29=12 2a=23 2c=10 2f=e4 3c=28 3e=01 47=99 49=ff 4a=ff 4b=ff 4c=ff 4d=ff 4e=ff 4f=ff 71=ff 80=ff 82=ff 84=ff 86=ff 90=ff 91=ff 92=ff 93=ff 94=ff 95=ff 96=ff 98=ff 99=ff 9a=ff 9b=ff 9c=ff 9d=ff 9e=ff a0=ff a1=ff a2=ff a3=ff a4=ff a5=ff a6=ff a8=ff a9=ff aa=ff ab=ff ac=ff ad=ff ae=ff f0=ff f1=30 f2=2c f3=07 f4=e5 f5=3f f6=0c f7=fe f8=3c words 00=0000 01=0000 02=00cc 03=cccc 04=cc00 05=000d 06=0d01 07=010f spdmem0 at iic0 addr 0x50: 4GB DDR3 SDRAM PC3-10600 spdmem1 at iic0 addr 0x52: 4GB DDR3 SDRAM PC3-10600 pciide1 at pci0 dev 31 function 5 "Intel 6 Series SATA" rev 0x05: DMA, channel 0 wired to native-PCI, channel 1 wired to native-PCI pciide1: using apic 2 int 19 for native-PCI interrupt wd3 at pciide1 channel 0 drive 0: <Samsung SSD 840 Series> wd3: 16-sector PIO, LBA48, 238475MB, 488397168 sectors wd3(pciide1:0:0): using PIO mode 4, Ultra-DMA mode 6 isa0 at pcib0 isadma0 at isa0 com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo pckbc0 at isa0 port 0x60/5 pcppi0 at isa0 port 0x61 spkr0 at pcppi0 it0 at isa0 port 0x2e/2: IT8728F rev 0, EC port 0x290 mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges uhub2 at uhub0 port 1 "Intel Rate Matching Hub" rev 2.00/0.00 addr 2 uhidev0 at uhub2 port 1 configuration 1 interface 0 "Logitech USB-PS/2 Optical Mouse" rev 2.00/22.00 addr 3 uhidev0: iclass 3/1 ums0 at uhidev0: 8 buttons, Z dir wsmouse0 at ums0 mux 0 uhidev1 at uhub2 port 3 configuration 1 interface 0 "Metadot - Das Keyboard Das Keyboard Model S" rev 1.10/1.00 addr 4 uhidev1: iclass 3/1 ukbd0 at uhidev1: 8 variable keys, 6 key codes wskbd0 at ukbd0: console keyboard uhidev2 at uhub2 port 3 configuration 1 interface 1 "Metadot - Das Keyboard Das Keyboard Model S" rev 1.10/1.00 addr 4 uhidev2: iclass 3/0, 3 report ids uhid0 at uhidev2 reportid 2: input=1, output=0, feature=0 uhid1 at uhidev2 reportid 3: input=3, output=0, feature=0 uhub3 at uhub2 port 4 "NEC hub" rev 2.00/1.00 addr 5 uhub4 at uhub1 port 1 "Intel Rate Matching Hub" rev 2.00/0.00 addr 2 vscsi0 at root scsibus0 at vscsi0: 256 targets softraid0 at root scsibus1 at softraid0: 256 targets root on wd1a (d336e3eb55d9041d.a) swap on wd1b dump on wd1b drm: initializing kernel modesetting (JUNIPER 0x1002:0x68BA 0x1787:0x200A). radeondrm0: VRAM: 1024M 0x0000000000000000 - 0x000000003FFFFFFF (1024M used) radeondrm0: GTT: 512M 0x0000000040000000 - 0x000000005FFFFFFF ttm_pool_mm_shrink_init stub drm: probing gen 2 caps for device 0x8086:0x0101 = 2/0 drm: enabling PCIE gen 2 link speeds, disable with radeon.pcie_gen2=0 drm: PCIE GART of 512M enabled (table at 0x0000000000040000). drm: Internal thermal controller with fan control error: [drm:pid0:drm_edid_block_valid] *ERROR* EDID checksum is invalid, remainder is 254 Raw EDID: 00 01 04 00 fe 5b 80 a0 70 38 35 40 30 20 35 00 13 2a 21 00 00 1a 86 6f 80 a0 70 38 40 40 30 20 35 00 13 2a 21 00 00 1a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2c error: [drm:pid0:drm_edid_block_valid] *ERROR* EDID checksum is invalid, remainder is 254 Raw EDID: 00 01 04 00 fe 5b 80 a0 70 38 35 40 30 20 35 00 13 2a 21 00 00 1a 86 6f 80 a0 70 38 40 40 30 20 35 00 13 2a 21 00 00 1a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2c error: [drm:pid0:drm_edid_block_valid] *ERROR* EDID checksum is invalid, remainder is 254 Raw EDID: 00 01 04 00 fe 5b 80 a0 70 38 35 40 30 20 35 00 13 2a 21 00 00 1a 86 6f 80 a0 70 38 40 40 30 20 35 00 13 2a 21 00 00 1a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2c error: [drm:pid0:drm_edid_block_valid] *ERROR* EDID checksum is invalid, remainder is 254 Raw EDID: 00 01 04 00 fe 5b 80 a0 70 38 35 40 30 20 35 00 13 2a 21 00 00 1a 86 6f 80 a0 70 38 40 40 30 20 35 00 13 2a 21 00 00 1a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2c DVI-I-1: Ignoring invalid EDID block 1. radeondrm0: 1280x1024 wsdisplay0 at radeondrm0 mux 1: console (std, vt100 emulation), using wskbd0 wsdisplay0: screen 1-5 added (std, vt100 emulation)