NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/53444: extended W mode enabling makes vt-switching very slow



>Number:         53444
>Category:       kern
>Synopsis:       extended W mode enabling makes vt-switching very slow
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jul 12 16:45:00 +0000 2018
>Originator:     coypu
>Release:        NetBSD 8.99.19
>Organization:
>Environment:
NetBSD localhost 8.99.19 NetBSD 8.99.19 (GENERIC2) #9: Thu Jul 12 19:28:39 IDT 2018  fly@:/home/fly/obj/sys/arch/amd64/compile/GENERIC2 amd64

>Description:
VT-switching used to be nearly instant.
Now it takes like 5-10 seconds.

My machine:
Full dmesg here: http://dmesgd.nycbug.org/index.cgi?do=view&id=3574

Excerpt:
pms0 at pckbc1 (aux slot)
pms0: Synaptics touchpad version 8.2
pms0: Extended W mode, Palm detect, One button click pad, Multi-finger Report, Multi-finger
pckbc1: using irq 12 for aux slot
wsmouse0 at pms0 mux 0

I found out that the following diff is sufficient to make vt-switching as fast as before:

--- a/sys/dev/pckbport/synaptics.c
+++ b/sys/dev/pckbport/synaptics.c 
 void
 pms_synaptics_enable(void *vsc)
 {
        struct pms_softc *psc = vsc;
        struct synaptics_softc *sc = &psc->u.synaptics;
        u_char enable_modes;
        int res;
-       u_char cmd[1], resp[3];
 
        if (sc->flags & SYN_FLAG_HAS_PASSTHROUGH) {
                /*
                 * Extended capability probes can confuse the passthrough
                 * device; reset the touchpad now to cure that.
                 */
                res = synaptics_poll_reset(psc);
        }
 
        /*
         * Enable Absolute mode with W (width) reporting, and set
         * the packet rate to maximum (80 packets per second). Enable
         * extended W mode if supported so we can report second finger
         * position.
         */
@@ -448,43 +447,44 @@ pms_synaptics_enable(void *vsc)
 
        synaptics_poll_cmd(psc, PMS_SET_SAMPLE, SYNAPTICS_CMD_SET_MODE2, 0);
 
        /* a couple of set scales to clear out pending commands */
        for (int i = 0; i < 2; i++)
                synaptics_poll_cmd(psc, PMS_SET_SCALE11, 0);
 
        /*
         * Enable multi-finger capability in cold boot case with
         * undocumented sequence.
         * Parameters from
         * https://github.com/RehabMan/OS-X-Voodoo-PS2-Controller/
         * VoodooPS2Trackpad/VoodooPS2SynapticsTouchPad.cpp
         * setTouchPadModeByte function.
         */
+#if 0
        if (sc->flags & SYN_FLAG_HAS_EXTENDED_WMODE) {
                static const uint8_t seq[] = {
                    0xe6, 0xe8, 0x00, 0xe8, 0x00,
                    0xe8, 0x00, 0xe8, 0x03, 0xf3,
                    0xc8,
                };
                for (size_t s = 0; s < __arraycount(seq); s++) {
                        cmd[0] = seq[s];
                        (void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot,
                                cmd, 1, 3, resp, 0);
                }
        }
-
+#endif

>How-To-Repeat:

>Fix:
No idea.



Home | Main Index | Thread Index | Old Index