Subject: wsdisplay ioctls
To: None <tech-kern@NetBSD.org>
From: Garrett D'Amore <garrett@damore.org>
List: tech-kern
Date: 05/12/2006 14:23:07
After browsing, I notice that we are out of ioctl numbers for
wsdisplay.  Basically, wscons allocates ioctl codes 64-95 to wsdisplay. 
They are all used up.

I want to add more ioctls.  E.g. ioctls for changing screen resolution,
and some kind of ioctls for accleration.

I notice that ioctls are allocated in a fashion that I *think* is
wasteful.  As an example:

/* Cursor control: get and set position */
#define    WSDISPLAYIO_GCURPOS    _IOR('W', 70, struct wsdisplay_curpos)
#define    WSDISPLAYIO_SCURPOS    _IOW('W', 71, struct wsdisplay_curpos)


These use two different values (70 & 71).  It strikes me that the _IOR
and _IOW macros add other bits, and that maybe it could have been
possible to make them both use 70 (as an example).

Colormaps, video settings, and others have this property as well.

There are a couple of ioctls which are recently used for splash screen
support (SSPLASH and SPROGRESS).  Apart from these, I *think* all the
values have "escaped" into the field, and cannot easily be reclaimed
without breaking some applications.  (Though I think the number of
applications in the field which actually use wsdisplay ioctls is
probably quite small.)


The mouse range has not used most of their numbers; neither has the
keyboard. The range of numbers 128-255 also looks unused in wsconsio.

So where should I add new ioctl numbers?  In the upper empty range? 
Should I reclaim some old ioctl numbers, or reallocation them from empty
kbd and mouse space?  Should I move the splash stuff into its own
*small* range?

And can I use the alternate numbers for IOR/IOW to change the values? 
(E.g. if I want to add a WSDISPLAY_SINFO to set the resolution or color
depth, can I use the same numeric value as WSDISPLAY_GINFO, using IOW
instead of IOR?)

    -- Garrett