Summary: | CONFIG_HAL is enabled by default (if hal subsystem is available at build time) but is broken | ||||||
---|---|---|---|---|---|---|---|
Product: | xorg | Reporter: | Paulo César Pereira de Andrade <pcpa> | ||||
Component: | Input/other | Assignee: | Xorg Project Team <xorg-team> | ||||
Status: | RESOLVED WONTFIX | QA Contact: | Xorg Project Team <xorg-team> | ||||
Severity: | blocker | ||||||
Priority: | high | CC: | ademar | ||||
Version: | git | ||||||
Hardware: | Other | ||||||
OS: | Linux (All) | ||||||
Whiteboard: | |||||||
i915 platform: | i915 features: | ||||||
Attachments: |
|
Description
Paulo César Pereira de Andrade
2007-11-22 17:25:25 UTC
Created attachment 12895 [details] [review] This patch is broken, not finished, don't use it. Only attached for documentation and to use it for information on how to track other data structures from the "root ones". (In reply to comment #0) > First I will start with a clear bug in config/hal.c: > > In function get_prop_string_array() it is allocating the proper number of > bytes, or one less if adding an ending "," is considered correct, like it > is doing. Also, it appears to expect strcpy to return a pointer to the end > of the string, what is not true. I.e. if input.xkb.options = option1, option2 > it will generate the string ",," FWIW this part was fixed in a8e27a108abeba73b2888da4e0604008f4b02045 sorry Paulo, I'm losing track about the actual problem in this bug. (In reply to comment #0) > But the major problem is that the X Server uses whatever is specified in > xorg.conf, and config/hal.c will add again the input device specified in hal > (unless the function doesn't like the information it collects and doesn't call > NewInputDeviceRequest()), and it can end with two input modules (possibly > different drivers reading from different file descriptors) handling the same > device, and weird results will happen. the server can't know which device has been added already. reason being that if a section exists for /dev/input/mouse1, the server doesn't know this is also /dev/input/event3. > But the major problem I see is that, if there is an "InputDevice" in > xorg.conf, the X Server will use it, and, the hal code will also work, > and weird things will happen, like 2 instances of an input device. At > best one would have the problem I was having that is, pressing a mouse > button would always generate a double click :-) evdev does a EVIOCGRAB on the device, so this shouldn't actually happen. I tried it with a current git version, and it doesn't. Can you reproduce this problem? > One of the major problems to make a "temporary" patch, until xorg.conf > becomes obsolete would be merge xorg.conf options and hal properties, > giving preference to xorg.conf. But the major problem is that there isn't > a mapping from hal devices to xorg.conf devices. A simple guess of > keyboard/mouse can be done, but I am not sure about other devices, or > any "xorg.conf" device that uses a driver other than "kbd" or "mouse". I believe the correct solution is to make evdev aware of these devices. (In reply to comment #3) > sorry Paulo, I'm losing track about the actual problem in this bug. I did not look at this stuff since I wrote the bugreport, and currently Mandriva X Server is being compiled without dbus/hal support. But I should work/test it again soon, as I hope to be able to ship a newer X Server, possibly not even needing a configuration file anymore in next Mandriva release, but I think I will watch Fedora and *Debian go first, and if they don't sink I follow :-) > (In reply to comment #0) > > But the major problem is that the X Server uses whatever is specified in > > xorg.conf, and config/hal.c will add again the input device specified in hal > > (unless the function doesn't like the information it collects and doesn't call > > NewInputDeviceRequest()), and it can end with two input modules (possibly > > different drivers reading from different file descriptors) handling the same > > device, and weird results will happen. > > the server can't know which device has been added already. reason being that if > a section exists for /dev/input/mouse1, the server doesn't know this is also > /dev/input/event3. That is the main reason of the bug report :-), there must be only one "entity" managing the devices. In that case it should be hal, as X Server code (and code that handles xorg.conf) don't play well with hal because there is no mapping about who is managing what. > > But the major problem I see is that, if there is an "InputDevice" in > > xorg.conf, the X Server will use it, and, the hal code will also work, > > and weird things will happen, like 2 instances of an input device. At > > best one would have the problem I was having that is, pressing a mouse > > button would always generate a double click :-) > > evdev does a EVIOCGRAB on the device, so this shouldn't actually happen. I > tried it with a current git version, and it doesn't. Can you reproduce this > problem? The evdev driver seens a bit more stable now, but at the time of the bugreport, it just could not replace kdb and mouse, maybe kdb and mouse drivers could be changed to know about EVIOCGRAB also... > > One of the major problems to make a "temporary" patch, until xorg.conf > > becomes obsolete would be merge xorg.conf options and hal properties, > > giving preference to xorg.conf. But the major problem is that there isn't > > a mapping from hal devices to xorg.conf devices. A simple guess of > > keyboard/mouse can be done, but I am not sure about other devices, or > > any "xorg.conf" device that uses a driver other than "kbd" or "mouse". > > I believe the correct solution is to make evdev aware of these devices. Even tough I work for a Linux company, I am also a user of other OSS operating systems, and I don't feel confortable with evdev as it is Linux specific. But hopefuly, for my Mandriva packages at least, this should not be a problem anymore soon. (In reply to comment #4) > (In reply to comment #3) > > the server can't know which device has been added already. reason being that if > > a section exists for /dev/input/mouse1, the server doesn't know this is also > > /dev/input/event3. > > That is the main reason of the bug report :-), there must be only > one "entity" managing the devices. In that case it should be hal, as > X Server code (and code that handles xorg.conf) don't play well with > hal because there is no mapping about who is managing what. I'll take this as a reason to close this bug as WONTFIX. It isn't really a server problem, we just add what we get told. Anything more fancy needs to be in hal (or the other entity). > > > But the major problem I see is that, if there is an "InputDevice" in > > > xorg.conf, the X Server will use it, and, the hal code will also work, > > > and weird things will happen, like 2 instances of an input device. At > > > best one would have the problem I was having that is, pressing a mouse > > > button would always generate a double click :-) > > > > evdev does a EVIOCGRAB on the device, so this shouldn't actually happen. I > > tried it with a current git version, and it doesn't. Can you reproduce this > > problem? > > The evdev driver seens a bit more stable now, but at the time of > the bugreport, it just could not replace kdb and mouse, maybe kdb > and mouse drivers could be changed to know about EVIOCGRAB also... AFAIK EVIOCGRAB only works on evdev devices. mouse and kbd don't use evdev kernel devices, so that can't happen. > > > One of the major problems to make a "temporary" patch, until xorg.conf > > > becomes obsolete would be merge xorg.conf options and hal properties, > > > giving preference to xorg.conf. But the major problem is that there isn't > > > a mapping from hal devices to xorg.conf devices. A simple guess of > > > keyboard/mouse can be done, but I am not sure about other devices, or > > > any "xorg.conf" device that uses a driver other than "kbd" or "mouse". > > > > I believe the correct solution is to make evdev aware of these devices. > > Even tough I work for a Linux company, I am also a user of other > OSS operating systems, and I don't feel confortable with evdev as > it is Linux specific. But hopefuly, for my Mandriva packages at least, > this should not be a problem anymore soon. neither kbd nor mouse support hotplugging. until they are updated, evdev is the only way if you want input device hotplugging. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.