Re: events in evdev.c

2008-09-21 Thread Sascha Hlusiak
  Your argument would make sense if X didn't go to painful lengths to
  maintain an abstract input driver API/ABI that allowed for arbitrary
  drivers.

 confused.  I was saying that the evdev wasn't as good an example of how to
 write a driver than the joystick was.  
The joystick driver itself maintains an abstract input layer which IMO belongs 
into the server, not the driver. What's left then is nothing more than the 
evdev driver. I really don't see where the joystick driver is superior in 
driver design other that it provides backends for 3 interfaces.

 I was, in my mind, really 
 concentrating on the keysym business, which is not compilable outside of
 Linux.  
keysyms are totally X11 and application side and very much cross-platform. 

 Where did you see the opposite?  Maybe, the fact that we're talking about
 Linux events versus Xorg events versus the non-existence of FreeBSD
 user-mode events is what confused things?
I think you confuse something here. We never talked about Xorg events here.

And something similar to the Linux events (as in evdev) do exist in FreeBSD, 
it's just no 1:1 mapping. And even if they didn't; what's your point? That 
the evdev driver should not exist then, just because other platforms don't 
provide such an interface?


- Sascha


signature.asc
Description: This is a digitally signed message part.
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Re: events in evdev.c

2008-09-20 Thread Matthieu Herrb
Chuck Robey wrote:

 I'm really rather curious where you got the idea that FreeBSD had something 
 that
 looked even vaguely like the Linux events.  I know that if you look at the
 FreeBSD man page EVENTHANDLER(9) you can see an event interface, but that one 
 is
 intra-kernel, not exported to applications like the Linux one is.  Using the
 event interface, like evdev does, takes away the portability.
 
 If I could find a FreeBSD applications-event interface ala Linux, I would be
 overjoyed, and immediately use it.
 

NetBSD and OpenBSD share (at least try to) the wscons console driver
which has a notion of event which is not too far away from evdev. It
should be possible to write a more OS neutral event based input driver
which could cover all of Solaris, Linux and wscons events.

I must admit that I don't know too much about the current state of the
FreeBSD console driver though.

-- 
Matthieu Herrb
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: events in evdev.c

2008-09-20 Thread Daniel Stone
On Sat, Sep 20, 2008 at 04:59:33PM +0200, Matthieu Herrb wrote:
 Chuck Robey wrote:
  I'm really rather curious where you got the idea that FreeBSD had something 
  that
  looked even vaguely like the Linux events.  I know that if you look at the
  FreeBSD man page EVENTHANDLER(9) you can see an event interface, but that 
  one is
  intra-kernel, not exported to applications like the Linux one is.  Using the
  event interface, like evdev does, takes away the portability.
  
  If I could find a FreeBSD applications-event interface ala Linux, I would be
  overjoyed, and immediately use it.
 
 NetBSD and OpenBSD share (at least try to) the wscons console driver
 which has a notion of event which is not too far away from evdev. It
 should be possible to write a more OS neutral event based input driver
 which could cover all of Solaris, Linux and wscons events.

Eh, might as well write xf86-input-wscons.  I don't see what benefit
you'd gain by sharing a codebase, aside from added complexity and #ifdef
hell, a la xf86-input-{keyboard,mouse}.

Cheers,
Daniel


signature.asc
Description: Digital signature
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Re: events in evdev.c

2008-09-20 Thread Chuck Robey
Daniel Stone wrote:
 On Sat, Sep 20, 2008 at 04:59:33PM +0200, Matthieu Herrb wrote:
 Chuck Robey wrote:
 I'm really rather curious where you got the idea that FreeBSD had something 
 that
 looked even vaguely like the Linux events.  I know that if you look at the
 FreeBSD man page EVENTHANDLER(9) you can see an event interface, but that 
 one is
 intra-kernel, not exported to applications like the Linux one is.  Using the
 event interface, like evdev does, takes away the portability.

 If I could find a FreeBSD applications-event interface ala Linux, I would be
 overjoyed, and immediately use it.
 NetBSD and OpenBSD share (at least try to) the wscons console driver
 which has a notion of event which is not too far away from evdev. It
 should be possible to write a more OS neutral event based input driver
 which could cover all of Solaris, Linux and wscons events.
 
 Eh, might as well write xf86-input-wscons.  I don't see what benefit
 you'd gain by sharing a codebase, aside from added complexity and #ifdef
 hell, a la xf86-input-{keyboard,mouse}.

I myself really like the approach that xf86-input-joystick takes, it allows the
approach that evdev takes for Linux, but it doesn't try to suppose that the
event interface that only works for Linux can work for other OSes.  You know how
evdev is usually put forward as the best example of driver writing?  I think
that the joystick is a way better (more portable) example.  Other OSes *do* have
events, but they're intra-kernel only, not exported to apps.  And, FreeBSD
doesn't have wscons (although I like that idea, myself).


 
 Cheers,
 Daniel

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: events in evdev.c

2008-09-20 Thread Daniel Stone
On Sat, Sep 20, 2008 at 11:48:08AM -0400, Chuck Robey wrote:
 Daniel Stone wrote:
  On Sat, Sep 20, 2008 at 04:59:33PM +0200, Matthieu Herrb wrote:
  Chuck Robey wrote:
  I'm really rather curious where you got the idea that FreeBSD had 
  something that
  looked even vaguely like the Linux events.  I know that if you look at the
  FreeBSD man page EVENTHANDLER(9) you can see an event interface, but that 
  one is
  intra-kernel, not exported to applications like the Linux one is.  Using 
  the
  event interface, like evdev does, takes away the portability.
 
  If I could find a FreeBSD applications-event interface ala Linux, I would 
  be
  overjoyed, and immediately use it.
  NetBSD and OpenBSD share (at least try to) the wscons console driver
  which has a notion of event which is not too far away from evdev. It
  should be possible to write a more OS neutral event based input driver
  which could cover all of Solaris, Linux and wscons events.
  
  Eh, might as well write xf86-input-wscons.  I don't see what benefit
  you'd gain by sharing a codebase, aside from added complexity and #ifdef
  hell, a la xf86-input-{keyboard,mouse}.
 
 I myself really like the approach that xf86-input-joystick takes, it allows 
 the
 approach that evdev takes for Linux, but it doesn't try to suppose that the
 event interface that only works for Linux can work for other OSes.  You know 
 how
 evdev is usually put forward as the best example of driver writing?  I think
 that the joystick is a way better (more portable) example.  Other OSes *do* 
 have
 events, but they're intra-kernel only, not exported to apps.  And, FreeBSD
 doesn't have wscons (although I like that idea, myself).

Your argument would make sense if X didn't go to painful lengths to
maintain an abstract input driver API/ABI that allowed for arbitrary
drivers.


signature.asc
Description: Digital signature
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Re: events in evdev.c

2008-09-20 Thread Chuck Robey
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Daniel Stone wrote:
 On Sat, Sep 20, 2008 at 11:48:08AM -0400, Chuck Robey wrote:
 Daniel Stone wrote:
 On Sat, Sep 20, 2008 at 04:59:33PM +0200, Matthieu Herrb wrote:
 Chuck Robey wrote:
 I'm really rather curious where you got the idea that FreeBSD had 
 something that
 looked even vaguely like the Linux events.  I know that if you look at the
 FreeBSD man page EVENTHANDLER(9) you can see an event interface, but that 
 one is
 intra-kernel, not exported to applications like the Linux one is.  Using 
 the
 event interface, like evdev does, takes away the portability.

 If I could find a FreeBSD applications-event interface ala Linux, I would 
 be
 overjoyed, and immediately use it.
 NetBSD and OpenBSD share (at least try to) the wscons console driver
 which has a notion of event which is not too far away from evdev. It
 should be possible to write a more OS neutral event based input driver
 which could cover all of Solaris, Linux and wscons events.
 Eh, might as well write xf86-input-wscons.  I don't see what benefit
 you'd gain by sharing a codebase, aside from added complexity and #ifdef
 hell, a la xf86-input-{keyboard,mouse}.
 I myself really like the approach that xf86-input-joystick takes, it allows 
 the
 approach that evdev takes for Linux, but it doesn't try to suppose that the
 event interface that only works for Linux can work for other OSes.  You know 
 how
 evdev is usually put forward as the best example of driver writing?  I think
 that the joystick is a way better (more portable) example.  Other OSes *do* 
 have
 events, but they're intra-kernel only, not exported to apps.  And, FreeBSD
 doesn't have wscons (although I like that idea, myself).
 
 Your argument would make sense if X didn't go to painful lengths to
 maintain an abstract input driver API/ABI that allowed for arbitrary
 drivers.

confused.  I was saying that the evdev wasn't as good an example of how to write
a driver than the joystick was.  I was, in my mind, really concentrating on the
keysym business, which is not compilable outside of Linux.  Yes, Xorg does go to
painful lengths to maintain compatibility, but where did I comment about Xorg in
general?  I didn't ever mean to say that, I meant to say (and I still believe)
that the joystick is more general in it's approach.

Where did you see the opposite?  Maybe, the fact that we're talking about Linux
events versus Xorg events versus the non-existence of FreeBSD user-mode events
is what confused things?
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.9 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkjVfmcACgkQz62J6PPcoOmJcgCgpWojFiVzhyx19QLVBVAHrmq6
jvcAn2eDoefVieVvHsyUBC0zxRoxDNzw
=ap3N
-END PGP SIGNATURE-
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: events in evdev.c

2008-09-20 Thread Peter Hutterer
On Sat, Sep 20, 2008 at 11:48:08AM -0400, Chuck Robey wrote:
 I myself really like the approach that xf86-input-joystick takes, it allows 
 the
 approach that evdev takes for Linux, but it doesn't try to suppose that the
 event interface that only works for Linux can work for other OSes.  You know 
 how
 evdev is usually put forward as the best example of driver writing?  I think
 that the joystick is a way better (more portable) example.  Other OSes *do* 
 have
 events, but they're intra-kernel only, not exported to apps.  And, FreeBSD
 doesn't have wscons (although I like that idea, myself).

evdev is put forward as standard example because - unlike most other drivers -
most of its code deals with being an X driver, not a hardware driver.  There's
little protocol crazyness, only few ifdefs, and the code is relatively
straightforward.

I'm sorry if you don't see how that is a good way of _learning_ how to write
an input driver. 

Cheers,
  Peter
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: events in evdev.c

2008-09-19 Thread Chuck Robey
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Adam Jackson wrote:
 On Thu, 2008-09-18 at 09:24 -0700, Alan Coopersmith wrote:
 Chuck Robey wrote:
 Sorry, I can't parse what you wrote.  You don't know where I heard that 
 Xorg is
 Linux-only?  Is that what you said?  My understanding *had been* that Xorg 
 was
 trying to be compatible with as many Unixes as possible, and specifically 
 avoid
 being Linux only, which is why seeing the depth of Linuxcode that is in your
 flagship input driver, evdev, surprised me so.  I uderstood, from Peter's 
 mail,
 that I'm wrong there, and the use of Linux-only ocde in that flagship 
 driver was
 deliberate.  Simply really surprised me, that's all.
 Xorg is not Linux-only, but evdev is.   On Solaris  BSD, Xorg uses the
 xf86-input-keyboard  xf86-input-mouse drivers instead.
 
 Both Solaris and BSD have very similar event APIs, afaik, and could
 easily have drivers for same.  But they don't.  Patches gratefully etc.
 
 - ajax

I'm really rather curious where you got the idea that FreeBSD had something that
looked even vaguely like the Linux events.  I know that if you look at the
FreeBSD man page EVENTHANDLER(9) you can see an event interface, but that one is
intra-kernel, not exported to applications like the Linux one is.  Using the
event interface, like evdev does, takes away the portability.

If I could find a FreeBSD applications-event interface ala Linux, I would be
overjoyed, and immediately use it.

The xf86_input_joystick interface is a way better example for how to write a
driver than the evdev is (unless you're using Linux), because it compatibly
brings in 3 different interfaces types, /including/ evdev.  If it were me,
that's the one I'd give newbies, not evdev.
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.9 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkjUBKgACgkQz62J6PPcoOkIzQCglxtdK6clIGMc8Ui1hXwhm1IR
NocAn01KFXPda+CN23fx6DZXDf3YfbHX
=jfyu
-END PGP SIGNATURE-
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: events in evdev.c

2008-09-19 Thread Sascha Hlusiak
  Both Solaris and BSD have very similar event APIs, afaik, and could
  easily have drivers for same.  But they don't.  Patches gratefully etc.
 
  - ajax

 I'm really rather curious where you got the idea that FreeBSD had something
 that looked even vaguely like the Linux events.  I know that if you look at
 the FreeBSD man page EVENTHANDLER(9) you can see an event interface, but
 that one is intra-kernel, not exported to applications like the Linux one
 is.  Using the event interface, like evdev does, takes away the
 portability.

 The xf86_input_joystick interface is a way better example for how to write
 a driver than the evdev is (unless you're using Linux), because it
 compatibly brings in 3 different interfaces types, /including/ evdev.  If
 it were me, that's the one I'd give newbies, not evdev.
BSD has the usbhid interface, which uses events as well. It's implemented in 
xf86-input-joystick's backend_bsd.c file and it's pretty generic (here of 
course trimmed for joystick use).
Of course the interface is BSD-only (don't know about Solaris) but if the 
interfaces are somewhat compatible one could of course thing about wrapping 
it in the server, like the joystick driver does for itself.

- Sascha


signature.asc
Description: This is a digitally signed message part.
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Re: events in evdev.c

2008-09-18 Thread Daniel Stone
On Wed, Sep 17, 2008 at 08:38:09PM -0400, Chuck Robey wrote:
 I don't know if this is important or not, and I won't harp on this, but I've
 heard before that an attempt is made both to keep evdev.c very current, AND to
 have it not have anything in it that is Linux-only.

I don't know where you heard the Linux-only bit, but it's completely
wrong.  evdev is a Linux-only API.

Cheers,
Daniel


signature.asc
Description: Digital signature
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Re: events in evdev.c

2008-09-18 Thread Julien Cristau
On Thu, Sep 18, 2008 at 12:10:13 -0400, Chuck Robey wrote:

 Sorry, I can't parse what you wrote.

EVDEV IS LINUX ONLY.

Is that clearer now?

Cheers,
Julien
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: events in evdev.c

2008-09-17 Thread Peter Hutterer
On Wed, Sep 17, 2008 at 08:38:09PM -0400, Chuck Robey wrote:
 I don't know if this is important or not, and I won't harp on this, but I've
 heard before that an attempt is made both to keep evdev.c very current, AND to
 have it not have anything in it that is Linux-only.  

AFAIK, only the linux kernel has the evdev interface that the X.org evdev
driver uses, so the linux-depency is not accidental.

Cheers,
  Peter
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg