Subject: Re: CVS commit: src/sys
To: Garrett D'Amore <garrett_damore@tadpole.com>
From: Michael Lorenz <macallan@netbsd.org>
List: source-changes
Date: 04/12/2006 20:38:28
--Signature_Wed__12_Apr_2006_20_38_28_-0400_afIY=yJ8ZEENKWzW
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

Hello,

> Okay, I have a concern this.  As far as I can tell, the cookie is
> passed to the driver, but I cannot see how the driver can make sense
> of it.  The cookie that wsdisplay passes seems to be a struct
> wsscreen, which is a private structure to wsdisplay(4) -- it is not
> declared in any external headers.

struct wsscreen is not really defined anywhere I can see. What you get
in ioctl() and mmap() is supposedly the screen struct your
alloc_screen() method produced ( or vcons_alloc_screen(), in this case
it's a struct vcons_screen * ). Since its content is driver specific
it's handled as opaque cookie in wsdisplay.c

> So how is a display driver (e.g. machfb, or more to the point, my
> radeonfb driver) supposed to use this member argument?=20

Cast it to your driver-specific struct screen.

> Pass an opaque cookie is useless to the driver unless there is some
> way for the driver to do something meaningful with it.

The driver defines this cookie, it's opaque to anyone /but/ the driver.

have fun
Michael

--Signature_Wed__12_Apr_2006_20_38_28_-0400_afIY=yJ8ZEENKWzW
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (NetBSD)

iQEVAwUBRD2dhMpnzkX8Yg2nAQJGlQf7BBohyNB7wCdk8kB/wkv/D+lBEA3GmbtL
RxGmZdGyowo+hvklnp29jun4lHtEE5xk5LowbaKTsut0EUjBF/dpli/leqb8ELN1
ux0bx0fRz12FjDUDBgwC7ivmIDCkpuYE+TTSEjcA53xWBjlAq5jkEc6fwqnVNGYu
KxViNDPMAbSuz1yCYmthArVyxaIoTEdfRMzIAJG4zHP+QKUC0+1OnvZ8Ji4N/lMh
AiEAP3uxWJXs3cHg9MlZzKaY2Boh+tjSCeWxWwV/W4mRqRPPZq3UU471d99WHL7Y
vek4HzgNnyyc6ycEmEiRlHlqU+m53BOh5csTh+wf2kdJSu40RQhrXQ==
=SiEn
-----END PGP SIGNATURE-----

--Signature_Wed__12_Apr_2006_20_38_28_-0400_afIY=yJ8ZEENKWzW--