Having trouble with two active wscons drivers, wskbd stops working on console

Alain Runa <[email protected]> Sun, 2 Apr 2023 20:32:15 +0200
Newsgroups gmane.os.netbsd.ports.amiga
Message-ID <[email protected]>
Hello all,

I=E2=80=99m currently revising my wscons based driver for the MNT Z9000 =
to make it compatible with the newest v1.13 firmware. The driver is =
almost finished, but I=E2=80=99m experiencing an issue with the wskbd. =
It stops working if two wscons display drivers are active in the kernel. =
For example, if I include amidisplaycc (Amiga native) and zz9k_fb =
(ZZ9000) in the kernel, the zz9k_fb gets the console at wsdisplay0 but =
the console does not respond to any key presses from the keyboard. On =
the other hand, if I only include amidisplaycc or zz9k_fb alone in the =
kernel, keyboard works fine on the console.

Here the kernel output extract in bad case (amidisplaycc + zz9k_fb):

kbd0 at mainbus0: CIA A type Amiga
wskbd0 at kbd0 mux 1
ms0 at mainbus0
wsmouse0 at ms0 mux 0
wsmouse1 at ms0 mux 0
amidisplaycc0 at mainbus0: Amiga custom chip graphics=20
wsdisplay1 at amidisplaycc0 kbdmux 1
wsmux1: connecting to wsdisplay1
wskbd0: connecting to wsdisplay1
=E2=80=A6
zz9k0 at zbus0 pa 0x48000000 man/pro 28014/4: MNT ZZ9000 Zorro III (HW: =
0.0, FW: 1.13)
zz9k0: Hardware status <Ccore: 52.6 C, Tcore: 0.99 V, Vaux: 1.77 V>
zzfb0 at zz9k0: Framebuffer resolution: 1280x1024p60, depth: 8 bpp =
(8-bit LUT)
wsdisplay0 at zzfb0 kbdmux 1: console (default, vt100 emulation)
wsmux1: connecting to wsdisplay0


And here the kernel output extract in good case (zz9k_fb only):

kbd0 at mainbus0: CIA A type Amiga
wskbd0 at kbd0 mux 1
ms0 at mainbus0
wsmouse0 at ms0 mux 0
wsmouse1 at ms0 mux 0
=E2=80=A6
zz9k0 at zbus0 pa 0x48000000 man/pro 28014/4: MNT ZZ9000 Zorro III (HW: =
0.0, FW: 1.13)
zz9k0: Hardware status <Ccore: 52.1 C, Tcore: 0.99 V, Vaux: 1.77 V>
zzfb0 at zz9k0: Framebuffer resolution: 1280x1024p60, depth: 8 bpp =
(8-bit LUT)
wsdisplay0 at zzfb0 kbdmux 1: console (default, vt100 emulation)
wsmux1: connecting to wsdisplay0
wskbd0: connecting to wsdisplay0


I=E2=80=99m not 100% sure what is going wrong here, but to me it looks =
like that in bad case, the wskbd0 is still connected to wsdisplay1 =
(Amiga native) and not to wsdisplay0 (zz9k_fb) which becomes the active =
console display. I see wsmux1 switching to wsdisplay0 but wskbd0 is not. =
I=E2=80=99m not sure if it is supposed to do so, but I assume it should.

Is my assumption correct? How do I instruct wskbd that it should switch =
to wsdisplay0, when zz9k_fb gets initialized?
Or is the problem somewhere else?

Any indication to the right direction would be appreciated.


Regards
Alain