Bug 206086

Summary: x11-drivers/xf86-input-wacom: Add new devices, fix hotplug and unplug dealock
Product: Ports & Packages Reporter: rozhuk.im
Component: Individual Port(s)Assignee: Jan Beich <jbeich>
Status: Closed FIXED    
Severity: Affects Many People CC: jbeich, rozhuk.im
Priority: --- Keywords: feature, needs-qa, patch
Version: LatestFlags: jbeich: maintainer-feedback+
jbeich: merge-quarterly-
Hardware: Any   
OS: Any   
Attachments:
Description Flags
add new devs
jbeich: maintainer-approval+
add new devs, devd fix, optimization
jbeich: maintainer-approval+
hotunlug fix
jbeich: maintainer-approval-
Example Xorg config jbeich: maintainer-approval-

Description rozhuk.im 2016-01-09 23:25:38 UTC
Created attachment 165334 [details]
add new devs

1. Add support:
 + 0x33B: Intuos Draw small;
 + 0x33C: Intuos Art/Photo/Comic small;
 + 0x33D: Intuos Draw medium;
 + 0x33E: Intuos Art medium

2. Fix/add devd hotplug support

3. Fix unplug deadlock: cuse (webcamd) cant remove opened device (and devd does not send remove event), xorg get infinite read error from unplugged device and write error to log.

4. Small code optimization.
Comment 1 rozhuk.im 2016-01-09 23:26:59 UTC
Created attachment 165335 [details]
add new devs, devd fix, optimization
Comment 2 rozhuk.im 2016-01-09 23:29:33 UTC
Created attachment 165337 [details]
hotunlug fix
Comment 3 rozhuk.im 2016-01-09 23:45:18 UTC
Created attachment 165339 [details]
Example Xorg config

Also require:

1. Add/Set:
Section "ServerFlags"
	Option		"AutoAddDevices" "true"
	Option		"AutoEnableDevices" "true"
EndSection


2. Xorg devd patch: will attach later in new PR.
Comment 4 commit-hook freebsd_committer 2016-02-07 16:26:52 UTC
A commit references this bug:

Author: jbeich
Date: Sun Feb  7 16:26:37 UTC 2016
New revision: 408423
URL: https://svnweb.freebsd.org/changeset/ports/408423

Log:
  x11-drivers/xf86-input-wacom: new device and hotplug support

  - Add device IDs for the following tablets:
      Intuos Draw small
      Intuos Art/Photo/Comic small
      Intuos Draw medium
      Intuos Art medium
  - Add and enable devd(8) hotplug support
  - Work around devd failing to remove stale device files opened by Xserver
  - Drop Xserver 1.7 tip from pkg-message after r374982

  PR:		206086
  Submitted by:	rozhuk.im@gmail.com

Changes:
  head/x11-drivers/xf86-input-wacom/Makefile
  head/x11-drivers/xf86-input-wacom/files/patch-src-wcmUSB.c
  head/x11-drivers/xf86-input-wacom/files/patch-src-wcmValidateDevice.c
  head/x11-drivers/xf86-input-wacom/files/patch-src-xf86Wacom.c
  head/x11-drivers/xf86-input-wacom/files/pkg-message.in
  head/x11-drivers/xf86-input-wacom/files/wacom.conf.sample
  head/x11-drivers/xf86-input-wacom/pkg-plist
Comment 5 Jan Beich freebsd_committer 2016-02-07 16:52:53 UTC
Thanks. Committed with minor changes:
- Silence spurious "Error reading wacom device"
- Close all device files with multi-tool tablets e.g.,

    // Bamboo Pen & Touch
    [   574.301] (II) input/event1 eraser: removing automatically added device.
    [   574.301] (II) UnloadModule: "wacom"
    [   574.301] (II) input/event1 stylus: removing automatically added device.
    [   574.301] (II) UnloadModule: "wacom"
    [   574.309] (II) input/event0 touch: removing automatically added device.
    [   574.310] (II) UnloadModule: "wacom"
    [   574.310] (II) input/event2 pad: removing automatically added device.
    [   574.310] (II) UnloadModule: "wacom"

I haven't tested HAL. As for xf86-input-evdev + bug 196678 it has lower priority than xf86-input-wacom.
Comment 6 Jan Beich freebsd_committer 2016-02-07 16:57:12 UTC
Comment on attachment 165337 [details]
hotunlug fix

This is where /dev/input/eventN were leaked.
Comment 7 Jan Beich freebsd_committer 2016-02-07 16:58:55 UTC
Comment on attachment 165339 [details]
Example Xorg config

It's already part of the distfile but the installation was previously commented out.
Comment 8 rozhuk.im 2016-02-08 00:05:22 UTC
Thanks!

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196678#c22
devd support for xorg

Please, also update wacom.conf.sample in port, using "InputClass" more easy and dont require user to edit.
May be we should install "Example Xorg config" from attach as working config?
Comment 9 Jan Beich freebsd_committer 2016-02-08 04:54:06 UTC
(In reply to rozhuk.im from comment #8)
> Please, also update wacom.conf.sample in port, using "InputClass" more easy and dont require user to edit.

wacom.conf.sample is for users with broken hotplugging for whatever reason. The file is intentionally *not* used by default i.e., xorg.conf.d/ support in Xserver only reads files ending in .conf.

> May be we should install "Example Xorg config" from attach as working config?

Do you mean /usr/local/share/X11/xorg.conf.d/50-wacom.conf ?
Comment 10 commit-hook freebsd_committer 2016-02-08 04:55:51 UTC
A commit references this bug:

Author: jbeich
Date: Mon Feb  8 04:54:51 UTC 2016
New revision: 408464
URL: https://svnweb.freebsd.org/changeset/ports/408464

Log:
  x11-drivers/xf86-input-wacom: missed pkg-plist comment in r408423

  PR:		206086

Changes:
  head/x11-drivers/xf86-input-wacom/pkg-plist
Comment 11 rozhuk.im 2016-02-08 09:26:30 UTC
(In reply to Jan Beich from comment #9)
Yes.
Does xorg handle config files in /usr/local/share/X11/xorg.conf.d/ ?
Comment 12 Jan Beich freebsd_committer 2016-02-08 09:40:57 UTC
According to xorg.conf(5) manpage:

       Finally, configuration files will also be searched for in a directory
       reserved for system use.  This is to separate configuration files from
       the vendor or 3rd party packages from those of local administration.
       These files are found in the following directory:

           /usr/local/share/X11/xorg.conf.d