1. 13 Sep, 2016 2 commits
  2. 12 Aug, 2016 1 commit
  3. 11 Aug, 2016 1 commit
    • Peter Hutterer's avatar
      os: append, rather than prepend, any new input thread fds · 2df2815d
      Peter Hutterer authored
      xf86AddEnabledDevice() prepends the new fd to the list,
      xf86RemoveEnabledDevice() then searches for a matching fd and removes that
      entry. If this is done for the same fd (and since we lose all information but
      the actual fd) we usually unregister virtual devices in reverse order, causing
      a dereference of already released memory.
      
      Case in point:
      - the wacom driver calls xf86AddEnabledDevice() once for the physical device,
        then multiple times for the virtual subdevices
      - when the physical device is unplugged, the driver calls
        xf86RemoveEnabledDevice() for the physical device
      - all we have is the fd, so we end up removing the last virtual device from
        the fd set
      - xf86DeleteInput() frees the physical device's pInfo
      - the fd goes crazy with ENODEV, but a read_input() now passes the already
        freed pInfo for the physical device
      - boom
      
      Fix this by appending to the fd list to provide bug-for-bug compatibility with
      the old SIGIO code. This needs to be fixed in the driver, but meanwhile not
      crashing the server provides for better user experience.
      Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
      Reviewed-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
      2df2815d
  4. 21 Jul, 2016 1 commit
  5. 18 Jul, 2016 1 commit
  6. 01 Jun, 2016 1 commit
  7. 30 May, 2016 1 commit
  8. 26 May, 2016 1 commit
    • Keith Packard's avatar
      Create a threaded mechanism for input [v7] · 30ac7567
      Keith Packard authored
      The current SIGIO signal handler method, used at generation of input events,
      has a bunch of oddities. This patch introduces an alternative way using a
      thread, which is used to select() all input device file descriptors.
      
      A mutex was used to control the access to input structures by the main and input
      threads. Two pipes to emit alert events (such hotplug ones) and guarantee the
      proper communication between them was also used.
      Co-authored-by: default avatarFernando Carrijo <fcarrijo@freedesktop.org>
      Signed-off-by: default avatarTiago Vignatti <tiago.vignatti@nokia.com>
      
      v2: Fix non-Xorg link. Enable where supported by default.
      
          This also splits out the actual enabling of input threads to
          DDX-specific patches which follow
      
      v3: Make the input lock recursive
      
      v4: Use regular RECURSIVE_MUTEXes instead of rolling our own
          Respect the --disable-input-thread configuration option by
          providing stubs that expose the same API/ABI.
      
          Respond to style comments from Peter Hutterer.
      
      v5: use __func__ in inputthread debug and error mesages.
      
          Respond to style comments from Peter Hutterer.
      
      v6: use AX_PTHREAD instead of inlining pthread tests.
      
          Suggested by Emil Velikov <emil.l.velikov@gmail.com>
      
      v7: Use pthread_sigmask instead of sigprocmask when using threads
      
          Suggested by Adam Jackson <ajax@redhat.com>
      Signed-off-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      Signed-off-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
      Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      30ac7567