Aaron Zang writes:
> Aaron Zang wrote:
> >>   - How do these ioctls solve the problem?  Who will issue the ioctls
> >>     and under what conditions?  What happens if they're not used (if,
> >>     for example, something kills the Xorg server)?
> >>
> >>   
> >
> > First, Xorg will open the hid devices upon startup. So the input goes 
> > to Xorg.
> > While switching back to console, Xorg is in charge of issuing the 
> > ioctls to switch input
> > to console since only Xorg has the context of which devices it keeps 
> > opening.
> >
> > If something kills the Xorg server, the opened files will be closed, 
> > so the input will
> > automatically directed to the internal stream again.

OK.  I assume that Xorg can't just close the open file when switching
to the console.

> > If we send the input to both the internal and external streams, when 
> > you are on console
> > again no matter by switching back or Xorg exits, all the input 
> > characters typed under
> > X will be shown on console, that would be messy.
> >
> Sorry, I was not 100% correct when trying to answer the latter question.
> If all the input were sent to both the internal and external streams. 
> The upper conskbd
>  (virtual keyboard "/dev/kbd") would also get the input. If Xorg opens 
> /dev/kbd which
> is the case for now, Xorg will get 2 copies of input.
> If Xorg does not open "/dev/kbd", console will get the input and echo 
> back, that
> would be the mess.

OK.  (I was just thinking about the mouse, but that makes sense for
the keyboard.)

> Actually we have already have a pair of similar ioctls (KIOC[GS]DIRECT]) 
> to direct
> the input in conskbd since conskbd also keeps 2 streams as you can see 
> from the
> diagram in the case material.

And those ioctls don't work because Xorg is now using /dev/usb/hid*,
right?  Even though it appears that the existing ioctls need to be
dealt with down at the HID level ...

What happens if both KIOCSDIRECT and HIDIOCKMSDIRECT are used?  Is it
just "last to set?"  What do you see if you do KIOCGDIRECT (get) after
doing HIDIOCKMSDIRECT (set), if you set via KIOC* and get via HIDIOC*?

(It's not clear to me who would ever need to 'get' this flag, but
perhaps that's just a nit.)

-- 
James Carlson, Solaris Networking              <james.d.carlson at sun.com>
Sun Microsystems / 35 Network Drive        71.232W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 1677

Reply via email to