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

Alain Runa <[email protected]> Wed, 5 Apr 2023 20:06:56 +0200
Newsgroups gmane.os.netbsd.ports.amiga
Message-ID <[email protected]>
--Apple-Mail=_899A52DD-C4E9-47D6-B0D9-19270EE49D86
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

Hi Frank,

Thank  you very much for your feedback, it was very helpful. I was =
missing the kbd_cnattach() call in my zzfb_cninit() function.
The zz9k driver was not published yet, as I want to sort out all known =
remaining issues of my list first. Actually, there is now only one left. =
More on that below.

The kernel boot message looks like this and is similar to yours now:

kbd0 at mainbus0: CIA A type Amiga
wskbd0 at kbd0: console keyboard
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
=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 <Tcore: 38.8 C, Vcore: 1.0 V, Vaux: 1.77 V>
zzfb0 at zz9k0: Framebuffer resolution: 1280x720p60, depth: 8 bpp (8-bit =
LUT)
wsdisplay0 at zzfb0 kbdmux 1: console (default, vt100 emulation), using =
wskbd0
wsmux1: connecting to wsdisplay0

So this issue is now solved. Let=E2=80=99s go to the next issue.

My goal is to have the zz9k driver active with CONSOLE as default in =
WSCONS, so that future NetBSD binary releases include it in the kernel =
and a potential user does not need to compile a kernel for himself to =
activate the zz9k driver.=20
However, during my extensive tests I noticed that the driver is working =
in various different setups and configurations, with the exception when =
there is no ZZ9000 card present in the Amiga, then the kernel will just =
lock up. I tracked down the issue to my zzfb_cnprobe() function:

void zzfb_cnprobe(struct consdev *cd) {
#ifdef ZZFB_CONSOLE
	cd->cn_pri =3D CN_INTERNAL;
	cd->cn_dev =3D NODEV;
#endif /* ZZFB_CONSOLE */
}

This function is called during kernel startup to prioritize the early =
console way before the Zorro bus and its cards get probed and =
initialized. zzfb_cnprobe() will be always called, independently if =
there is a ZZ9000 installed in the system or not and claim the early =
console for the zz9k_fb. But if the zzfb_match() fails to find the Zorro =
card later, there will be no zz9k_fb console available, and the kernel =
locks up.  =20
With "cd->cn_pri =3D CN_NORMAL;=E2=80=9D There is no lock-up as the =
amidisplaycc gets the early console instead. But this is not the =
behavior I want.
I need a way in zzfb_cnprobe() to determine if a ZZ9000 exists to set =
CN_INTERNAL or to set CN_NORMAL if not.
I don=E2=80=99t know how to solve this issue, as zzfb_cnprobe() is =
called long before Zorro bus is active.

I think this is the very same reason why the MNTVA (MNT VA2000) driver =
has not set the option MNTVA_CONSOLE as default in the WSCONS kernel =
config file.

Do you have an idea how to solve this issue?

Regards
Alain


> On 5. Apr 2023, at 11:48, Frank Wille <[email protected]> wrote:
>=20
> Alain Runa wrote:
>=20
>> [...] but I'm 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.
>=20
> The zz9k driver source is not yet available in the NetBSD source tree, =
or
> anywhere?
>=20
> I'm probably not much of a help, but just to be sure: did you enter =
the
> man/pro ids of your board into the preconftab[] of dev/zbus.c? And did =
you
> register a console-init function at constab[] in amiga/conf.c? And I =
guess
> you also attached wsemuldisplay correctly in your driver's attach =
function?
>=20
>=20
> Does the driver's console-init function call kbd_cnattach()?
>=20
>=20
>> Here the kernel output extract in bad case (amidisplaycc + zz9k_fb):
>>=20
>> 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
>> ...
>> 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
>=20
> Just for comparison, I booted my A3000 with Cybervision64 using the =
WSCONS
> kernel. There are some differences, indeed:
>=20
> kbd0 at mainbus0: CIA A type Amiga
> wskbd0 at kbd0: console keyboard
> 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
> ...
> grfcv0 at zbus0 pa 0x40000000 man/pro 8512/34
> grf5 at grfcv0: width 640 height 480 colors 16
> wsdisplay0 at grf5 kbdmux 1: console (default, vt100 emulation), using
> wskbd0
> wsmux1: connecting to wsdisplay0
> grfcv: CyberVision64 with 4MB being used
>=20
> 1. In my case wskbd0 is recognized as "console keyboard".
> 2. wskbd0 doesn't attach to amidisplaycc0's wsdisplay1.
> 3. I have "using wskbd0" for my wsdisplay0.
>=20
> Not sure if this is a problem in your config file or in the driver =
source.
> Maybe you want to show us both?
>=20
>=20
>> I see wsmux1 switching to wsdisplay0 but wskbd0 is
>> not. I'm not sure if it is supposed to do so, but I assume it should.
>=20
> wskbd0 shouldn't even attach to the non-console wsdisplay1.
>=20
> --=20
> Frank Wille
>=20


--Apple-Mail=_899A52DD-C4E9-47D6-B0D9-19270EE49D86
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"overflow-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;">Hi =
Frank,<div><br></div><div>Thank &nbsp;you very much for your feedback, =
it was very helpful. I was missing the kbd_cnattach() call in my =
zzfb_cninit() function.</div><div>The zz9k driver was not published yet, =
as I want to sort out all known remaining issues of my list first. =
Actually, there is now only one left. More on that =
below.</div><div><br></div><div>The kernel boot message looks like this =
and is similar to yours now:</div><div><br></div><div><div>kbd0 at =
mainbus0: CIA A type Amiga</div><div>wskbd0 at kbd0: console =
keyboard</div><div>ms0 at mainbus0</div><div>wsmouse0 at ms0 mux =
0</div><div>wsmouse1 at ms0 mux 0</div><div>amidisplaycc0 at mainbus0: =
Amiga custom chip graphics&nbsp;</div><div>wsdisplay1 at amidisplaycc0 =
kbdmux 1</div><div>wsmux1: connecting to =
wsdisplay1</div></div><div>=E2=80=A6</div><div><div>zz9k0 at zbus0 pa =
0x48000000 man/pro 28014/4: MNT ZZ9000 Zorro III (HW: 0.0, FW: =
1.13)</div><div>zz9k0: Hardware status &lt;Tcore: 38.8 C, Vcore: 1.0 V, =
Vaux: 1.77 V&gt;</div><div>zzfb0 at zz9k0: Framebuffer resolution: =
1280x720p60, depth: 8 bpp (8-bit LUT)</div><div>wsdisplay0 at zzfb0 =
kbdmux 1: console (default, vt100 emulation), using =
wskbd0</div><div>wsmux1: connecting to =
wsdisplay0</div></div><div><br></div><div>So this issue is now solved. =
Let=E2=80=99s go to the next issue.</div><div><br></div><div><font =
color=3D"#000000"><span style=3D"caret-color: rgb(0, 0, 0);">My goal is =
to have the zz9k driver active with CONSOLE as default in WSCONS, so =
that future NetBSD binary releases include it in the kernel and a =
potential user does not need to compile a kernel for himself to activate =
the zz9k driver.&nbsp;</span></font></div><div>However, during my =
extensive tests I noticed that the driver is working in various =
different setups and configurations, with the exception when there is no =
ZZ9000 card present in the Amiga, then the kernel will just lock up. I =
tracked down the issue to my zzfb_cnprobe() =
function:</div><div><br></div><div><div>void zzfb_cnprobe(struct consdev =
*cd) {</div><div>#ifdef ZZFB_CONSOLE</div><div><span =
class=3D"Apple-tab-span" style=3D"white-space:pre">	=
</span>cd-&gt;cn_pri =3D CN_INTERNAL;</div><div><span =
class=3D"Apple-tab-span" style=3D"white-space:pre">	=
</span>cd-&gt;cn_dev =3D NODEV;</div><div>#endif /* ZZFB_CONSOLE =
*/</div><div>}</div></div><div><br></div><div>This function is called =
during kernel startup to prioritize the early console way before the =
Zorro bus and its cards get probed and initialized. zzfb_cnprobe() will =
be always called, independently if there is a ZZ9000 installed in the =
system or not and claim the early console for the zz9k_fb. But if the =
zzfb_match() fails to find the Zorro card later, there will be no =
zz9k_fb console available, and the kernel locks up. =
&nbsp;&nbsp;</div><div>With "<font color=3D"#000000">cd-&gt;cn_pri =3D =
CN_NORMAL;=E2=80=9D There is no lock-up as the amidisplaycc gets the =
early console instead. But this is not the behavior I =
want.</font></div><div><font color=3D"#000000">I need a way =
in&nbsp;</font><span style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, =
0, 0);">zzfb_cnprobe()&nbsp;</span><font color=3D"#000000">to determine =
if a ZZ9000 exists to set&nbsp;</font><span style=3D"caret-color: rgb(0, =
0, 0); color: rgb(0, 0, 0);">CN_INTERNAL or to set </span><span =
style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, =
0);">CN_NORMAL&nbsp;</span><font color=3D"#000000"><span =
style=3D"caret-color: rgb(0, 0, 0);">if =
not.</span></font></div><div><font color=3D"#000000">I don=E2=80=99t =
know how to solve this issue, as&nbsp;<span style=3D"caret-color: rgb(0, =
0, 0);">zzfb_cnprobe() is called long before Zorro bus is =
active.</span></font></div><div><br></div><div><font color=3D"#000000">I =
think this is the very same reason why the MNTVA (MNT VA2000) driver has =
not set the option&nbsp;</font>MNTVA_CONSOLE as default in the WSCONS =
kernel config file.</div><div><br></div><div>Do you have an idea how to =
solve this =
issue?</div><div><br></div><div>Regards</div><div>Alain</div><div><br><div=
><div><br><blockquote type=3D"cite"><div>On 5. Apr 2023, at 11:48, Frank =
Wille &lt;[email protected]&gt; wrote:</div><br =
class=3D"Apple-interchange-newline"><div><div>Alain Runa =
wrote:<br><br><blockquote type=3D"cite">[...] but I'm experiencing an =
issue with the wskbd. It stops<br>working if two wscons display drivers =
are active in the kernel. For<br>example, if I include amidisplaycc =
(Amiga native) and zz9k_fb (ZZ9000)<br>in the kernel, the zz9k_fb gets =
the console at wsdisplay0 but the<br>console does not respond to any key =
presses from the keyboard.<br></blockquote><br>The zz9k driver source is =
not yet available in the NetBSD source tree, or<br>anywhere?<br><br>I'm =
probably not much of a help, but just to be sure: did you enter =
the<br>man/pro ids of your board into the preconftab[] of dev/zbus.c? =
And did you<br>register a console-init function at constab[] in =
amiga/conf.c? And I guess<br>you also attached wsemuldisplay correctly =
in your driver's attach function?<br><br><br>Does the driver's =
console-init function call kbd_cnattach()?<br><br><br><blockquote =
type=3D"cite">Here the kernel output extract in bad case (amidisplaycc + =
zz9k_fb):<br><br>kbd0 at mainbus0: CIA A type Amiga<br>wskbd0 at kbd0 =
mux 1<br>ms0 at mainbus0<br>wsmouse0 at ms0 mux 0<br>wsmouse1 at ms0 mux =
0<br>amidisplaycc0 at mainbus0: Amiga custom chip graphics =
<br>wsdisplay1 at amidisplaycc0 kbdmux 1<br>wsmux1: connecting to =
wsdisplay1<br>wskbd0: connecting to wsdisplay1<br>...<br>zz9k0 at zbus0 =
pa 0x48000000 man/pro 28014/4: MNT ZZ9000 Zorro III (HW:<br>0.0, FW: =
1.13)<br>zz9k0: Hardware status &lt;Ccore: 52.6 C, Tcore: 0.99 V, Vaux: =
1.77 V<br>zzfb0 at zz9k0: Framebuffer resolution: =
1280x1024p60,<br>depth: 8 bpp (8-bit LUT)<br>wsdisplay0 at zzfb0 kbdmux =
1: console (default, vt100 emulation)<br>wsmux1: connecting to =
wsdisplay0<br></blockquote><br>Just for comparison, I booted my A3000 =
with Cybervision64 using the WSCONS<br>kernel. There are some =
differences, indeed:<br><br>kbd0 at mainbus0: CIA A type Amiga<br>wskbd0 =
at kbd0: console keyboard<br>ms0 at mainbus0<br>wsmouse0 at ms0 mux =
0<br>wsmouse1 at ms0 mux 0<br>amidisplaycc0 at mainbus0: Amiga custom =
chip graphics <br>wsdisplay1 at amidisplaycc0 kbdmux 1<br>wsmux1: =
connecting to wsdisplay1<br>...<br>grfcv0 at zbus0 pa 0x40000000 man/pro =
8512/34<br>grf5 at grfcv0: width 640 height 480 colors 16<br>wsdisplay0 =
at grf5 kbdmux 1: console (default, vt100 emulation), =
using<br>wskbd0<br>wsmux1: connecting to wsdisplay0<br>grfcv: =
CyberVision64 with 4MB being used<br><br>1. In my case wskbd0 is =
recognized as "console keyboard".<br>2. wskbd0 doesn't attach to =
amidisplaycc0's wsdisplay1.<br>3. I have "using wskbd0" for my =
wsdisplay0.<br><br>Not sure if this is a problem in your config file or =
in the driver source.<br>Maybe you want to show us =
both?<br><br><br><blockquote type=3D"cite">I see wsmux1 switching to =
wsdisplay0 but wskbd0 is<br>not. I'm not sure if it is supposed to do =
so, but I assume it should.<br></blockquote><br>wskbd0 shouldn't even =
attach to the non-console wsdisplay1.<br><br>-- <br>Frank =
Wille<br><br></div></div></blockquote></div><br></div></div></body></html>=

--Apple-Mail=_899A52DD-C4E9-47D6-B0D9-19270EE49D86--