Re: [PATCH libinput] filter: add Simon's copyright

2015-05-15 Thread Hans de Goede

Hi,

On 06-05-15 05:20, Peter Hutterer wrote:

This code was largely lifted from the X server in
bb25b2ad297891430606c367bfabc but didn't take the copyright messages that
applied to that code.

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net


LGTM: Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

Hans


---
Simon: I think that should cover it. Sorry about that, it was certainly not
intentional. Let me know if that covers it or if you think there's something
else missing.

  COPYING  | 1 +
  src/filter.c | 1 +
  2 files changed, 2 insertions(+)

diff --git a/COPYING b/COPYING
index 8bbb3c3..efc1a94 100644
--- a/COPYING
+++ b/COPYING
@@ -1,3 +1,4 @@
+Copyright © 2006-2009 Simon Thum
  Copyright © 2008-2012 Kristian Høgsberg
  Copyright © 2010-2012 Intel Corporation
  Copyright © 2010-2011 Benjamin Franzke
diff --git a/src/filter.c b/src/filter.c
index b953bee..626cb0a 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -1,4 +1,5 @@
  /*
+ * Copyright © 2006-2009 Simon Thum
   * Copyright © 2012 Jonas Ådahl
   *
   * Permission to use, copy, modify, distribute, and sell this software and


___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xauth] usage(): Print summary for the -n option

2015-05-13 Thread Hans de Goede
From: Søren Sandmann Pedersen s...@redhat.com

This option is mentioned in the man page, but not in the help text

Signed-off-by: Hans de Goede hdego...@redhat.com
---
 xauth.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xauth.c b/xauth.c
index 85fcaf4..d9efda0 100644
--- a/xauth.c
+++ b/xauth.c
@@ -68,6 +68,7 @@ usage(void)
 -q turn off extra messages,
 -i ignore locks on authority file,
 -b break locks on authority file,
+-n do not resolve host names in authority 
file,
 -V show version number of xauth,
 ,
 and commands have the following syntax:,
-- 
2.4.0

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH 1/2] dix: Add unaccelerated valuators to the ValuatorMask

2015-05-05 Thread Hans de Goede

Hi Peter,

On 05-05-15 07:22, Peter Hutterer wrote:

Allows a mask to carry both accelerated and unaccelerated motion at the same
time.

This is required for xf86-input-libinput where the pointer acceleration
happens in libinput already, but parts of the server, specifically raw events
and DGA rely on device-specific unaccelerated data.

To ease integration add this as a second set to the ValuatorMask rather than
extending all APIs to carry a second, possibly NULL set of valuators.

Note that a valuator mask should only be used in either accel/unaccel or
standard mode at any time. Switching requires either a valuator_mask_zero()
call or unsetting all valuators one-by-one.
Trying to mix the two will produce a warning.

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net


The entire set looks good to me, and seems to be a clean solution to the
problem:

Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

Hans



---
  dix/inpututils.c   | 75 +++---
  hw/xfree86/common/xf86Module.h |  2 +-
  include/input.h| 14 
  include/inpututils.h   |  2 ++
  4 files changed, 87 insertions(+), 6 deletions(-)

diff --git a/dix/inpututils.c b/dix/inpututils.c
index 5c2a32d..c5869ab 100644
--- a/dix/inpututils.c
+++ b/dix/inpututils.c
@@ -505,11 +505,8 @@ valuator_mask_isset(const ValuatorMask *mask, int valuator)
  return mask-last_bit = valuator  BitIsOn(mask-mask, valuator);
  }

-/**
- * Set the valuator to the given floating-point data.
- */
-void
-valuator_mask_set_double(ValuatorMask *mask, int valuator, double data)
+static inline void
+_valuator_mask_set_double(ValuatorMask *mask, int valuator, double data)
  {
  mask-last_bit = max(valuator, mask-last_bit);
  SetBit(mask-mask, valuator);
@@ -517,6 +514,17 @@ valuator_mask_set_double(ValuatorMask *mask, int valuator, 
double data)
  }

  /**
+ * Set the valuator to the given floating-point data.
+ */
+void
+valuator_mask_set_double(ValuatorMask *mask, int valuator, double data)
+{
+BUG_WARN_MSG(mask-has_unacel,
+ Do not mix valuator types, zero mask first\n);
+_valuator_mask_set_double(mask, valuator, data);
+}
+
+/**
   * Set the valuator to the given integer data.
   */
  void
@@ -594,11 +602,15 @@ valuator_mask_unset(ValuatorMask *mask, int valuator)

  ClearBit(mask-mask, valuator);
  mask-valuators[valuator] = 0.0;
+mask-unaccelerated[valuator] = 0.0;

  for (i = 0; i = mask-last_bit; i++)
  if (valuator_mask_isset(mask, i))
  lastbit = max(lastbit, i);
  mask-last_bit = lastbit;
+
+if (mask-last_bit == -1)
+mask-has_unacel = FALSE;
  }
  }

@@ -611,6 +623,59 @@ valuator_mask_copy(ValuatorMask *dest, const ValuatorMask 
*src)
  valuator_mask_zero(dest);
  }

+Bool
+valuator_mask_has_accelerated(const ValuatorMask *mask)
+{
+return mask-has_unacel;
+}
+
+/**
+ * Set both accelerated and unaccelerated value for this mask.
+ */
+void
+valuator_mask_set_accelerated(ValuatorMask *mask,
+  int valuator,
+  double accel,
+  double unaccel)
+{
+BUG_WARN_MSG(mask-last_bit != -1  !mask-has_unacel,
+ Do not mix valuator types, zero mask first\n);
+_valuator_mask_set_double(mask, valuator, accel);
+mask-has_unacel = TRUE;
+mask-unaccelerated[valuator] = unaccel;
+}
+
+double
+valuator_mask_get_accelerated(const ValuatorMask *mask,
+  int valuator)
+{
+return valuator_mask_get_double(mask, valuator);
+}
+
+double
+valuator_mask_get_unaccelerated(const ValuatorMask *mask,
+int valuator)
+{
+return mask-unaccelerated[valuator];
+}
+
+Bool
+valuator_mask_fetch_accelerated(const ValuatorMask *mask,
+int valuator,
+double *accel,
+double *unaccel)
+{
+if (valuator_mask_isset(mask, valuator)) {
+if (accel)
+*accel = valuator_mask_get_accelerated(mask, valuator);
+if (unaccel)
+*unaccel = valuator_mask_get_unaccelerated(mask, valuator);
+return TRUE;
+}
+else
+return FALSE;
+}
+
  int
  CountBits(const uint8_t * mask, int len)
  {
diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h
index 25a8869..66c2bb5 100644
--- a/hw/xfree86/common/xf86Module.h
+++ b/hw/xfree86/common/xf86Module.h
@@ -81,7 +81,7 @@ typedef enum {
   */
  #define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4)
  #define ABI_VIDEODRV_VERSION  SET_ABI_VERSION(19, 0)
-#define ABI_XINPUT_VERSION SET_ABI_VERSION(22, 0)
+#define ABI_XINPUT_VERSION SET_ABI_VERSION(22, 1)
  #define ABI_EXTENSION_VERSION SET_ABI_VERSION(9, 0)
  #define ABI_FONT_VERSION  SET_ABI_VERSION(0, 6)

diff --git a/include/input.h b/include

Re: [PATCH evdev] Add the default evdev config

2015-05-05 Thread Hans de Goede

Hi,

On 05-05-15 07:54, Peter Hutterer wrote:

This used to be part of the server but now that we have two drivers doing the
same thing (libinput, evdev) shift the configuration defaults to the driver.
This way you get what you install.

https://bugs.freedesktop.org/show_bug.cgi?id=89023

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net


The set LGTM:

Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

Hans



---
  10-evdev.conf | 40 
  Makefile.am   |  1 +
  configure.ac  |  7 +++
  3 files changed, 48 insertions(+)
  create mode 100644 10-evdev.conf

diff --git a/10-evdev.conf b/10-evdev.conf
new file mode 100644
index 000..cc83ab2
--- /dev/null
+++ b/10-evdev.conf
@@ -0,0 +1,40 @@
+#
+# Catch-all evdev loader for udev-based systems
+# We don't simply match on any device since that also adds accelerometers
+# and other devices that we don't really want to use. The list below
+# matches everything but joysticks.
+
+Section InputClass
+Identifier evdev pointer catchall
+MatchIsPointer on
+MatchDevicePath /dev/input/event*
+Driver evdev
+EndSection
+
+Section InputClass
+Identifier evdev keyboard catchall
+MatchIsKeyboard on
+MatchDevicePath /dev/input/event*
+Driver evdev
+EndSection
+
+Section InputClass
+Identifier evdev touchpad catchall
+MatchIsTouchpad on
+MatchDevicePath /dev/input/event*
+Driver evdev
+EndSection
+
+Section InputClass
+Identifier evdev tablet catchall
+MatchIsTablet on
+MatchDevicePath /dev/input/event*
+Driver evdev
+EndSection
+
+Section InputClass
+Identifier evdev touchscreen catchall
+MatchIsTouchscreen on
+MatchDevicePath /dev/input/event*
+Driver evdev
+EndSection
diff --git a/Makefile.am b/Makefile.am
index 00c7940..1cc3ea6 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -28,6 +28,7 @@ MAINTAINERCLEANFILES = ChangeLog INSTALL
  pkgconfigdir = $(libdir)/pkgconfig
  pkgconfig_DATA = xorg-evdev.pc

+dist_xorgconf_DATA = 10-evdev.conf

  .PHONY: ChangeLog INSTALL

diff --git a/configure.ac b/configure.ac
index e0d480a..f6fd2e4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,6 +59,13 @@ AC_ARG_WITH(xorg-module-dir,
  inputdir=${moduledir}/input
  AC_SUBST(inputdir)

+AC_ARG_WITH(xorg-conf-dir,
+AC_HELP_STRING([--with-xorg-conf-dir=DIR],
+   [Default xorg.conf.d directory 
[[default=$prefix/share/X11/xorg.conf.d/]]]),
+[xorgconfdir=$withval],
+[xorgconfdir=$prefix/share/X11/xorg.conf.d])
+AC_SUBST(xorgconfdir)
+
  # X Server SDK location is required to install evdev header files
  # This location is also relayed in the xorg-evdev.pc file
  sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server`


___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH 2/2] systemd-logind: Only use systemd-logind integration together with keeptty

2015-04-30 Thread Hans de Goede

Hi,

On 23-01-15 05:20, Peter Hutterer wrote:

On Wed, Jan 21, 2015 at 10:36:16AM +0100, Hans de Goede wrote:

systemd-logind integration does not work when starting X on a new tty, as
that detaches X from the current session and after hat systemd-logind revokes
all rights any already open fds and refuses to open new fds for X.

This means that currently e.g. startx -- vt7 breaks, and breaks badly,
requiring ssh access to the system to kill X.

The fix for this is easy, we must not use systemd-logind integration when
not using KeepTty, or iow we may only use systemd-logind integration together
with KeepTty.

Signed-off-by: Hans de Goede hdego...@redhat.com
---
  hw/xfree86/os-support/linux/systemd-logind.c | 7 +++
  1 file changed, 7 insertions(+)

diff --git a/hw/xfree86/os-support/linux/systemd-logind.c 
b/hw/xfree86/os-support/linux/systemd-logind.c
index 49758f4..b061877 100644
--- a/hw/xfree86/os-support/linux/systemd-logind.c
+++ b/hw/xfree86/os-support/linux/systemd-logind.c
@@ -34,6 +34,7 @@

  #include os.h
  #include dbus-core.h
+#include linux.h
  #include xf86.h
  #include xf86platformBus.h
  #include xf86Xinput.h
@@ -595,6 +596,12 @@ static struct dbus_core_hook core_hook = {
  int
  systemd_logind_init(void)
  {
+/* get vtno now as it may change keeptty */
+linux_get_vtno();
+/* systemd_logind integration requires keeptty */
+if (!linux_get_keeptty())
+return 1;
+


I think this behaviour should be documented in the man page. And maybe even
printf here that -keeptty provided, disabling systemd-logind as an Info.
Otherwise there's too much quietly happening that's not obvious.

with that, Reviewed-by: Peter Hutterer peter.hutte...@who-t.net
for both


Will fix both for v2.

Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH 1/2] linux: Add linux_get_vtno and linux_get_keeptty helpers

2015-04-30 Thread Hans de Goede

Hi,

So after letting these sit it is time to dust them of, fix the review
comments and get them upstream.

On 23-01-15 05:20, Peter Hutterer wrote:

On Wed, Jan 21, 2015 at 10:36:15AM +0100, Hans de Goede wrote:

systemd-logind integration does not work when starting X on a new tty, as
that detaches X from the current session and after hat systemd-logind revokes
all rights any already open fds and refuses to open new fds for X.


typo all rights _on_ any ...


Will fix.


This means that currently e.g. startx -- vt7 breaks, and breaks badly,
requiring ssh access to the system to kill X.

The fix for this is easy, we must not use systemd-logind integration when
not using KeepTty, or iow we may only use systemd-logind integration together
with KeepTty.

But the final KeepTty value is not known until the code to chose which vtno to
run on has been called, which currently happens after intializing
systemd-logind.

This commit is step 1 in fixing the startx -- vt7 breakage, it factors out
the linux xf86OpenConsole bits which set xf86Info.vtno and keepTty so that
these can be called earlier. Calling this earlier is safe as this code has
no side effects other then setting xf86Info.vtno and keepTty.


typo: then - than


Will fix.


Note this basically only moves a large chunk of xf86OpenConsole() into
linux_get_vtno() without changing a single line of it, this is hard to see
in the diff because the identation level has changed.

Signed-off-by: Hans de Goede hdego...@redhat.com
---
  hw/xfree86/os-support/linux/linux.h|  32 +
  hw/xfree86/os-support/linux/lnx_init.c | 117 +++--
  2 files changed, 99 insertions(+), 50 deletions(-)
  create mode 100644 hw/xfree86/os-support/linux/linux.h

diff --git a/hw/xfree86/os-support/linux/linux.h 
b/hw/xfree86/os-support/linux/linux.h
new file mode 100644
index 000..9613148
--- /dev/null
+++ b/hw/xfree86/os-support/linux/linux.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright © 2015 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the Software),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Author: Hans de Goede hdego...@redhat.com
+ */
+
+#ifndef XF86_LINUX_H
+#define XF86_LINUX_H
+
+void linux_get_vtno(void);
+int linux_get_keeptty(void);
+
+#endif
diff --git a/hw/xfree86/os-support/linux/lnx_init.c 
b/hw/xfree86/os-support/linux/lnx_init.c
index 9485307..a6e9ac1 100644
--- a/hw/xfree86/os-support/linux/lnx_init.c
+++ b/hw/xfree86/os-support/linux/lnx_init.c
@@ -31,6 +31,7 @@
  #include X11/Xmd.h

  #include compiler.h
+#include linux.h

  #include xf86.h
  #include xf86Priv.h
@@ -80,71 +81,87 @@ switch_to(int vt, const char *from)
  #pragma GCC diagnostic ignored -Wformat-nonliteral

  void
-xf86OpenConsole(void)
+linux_get_vtno(void)


nitpick: I'd expect this to return the vtno, not set vtno and KeepTTTY.
Maybe use linux_open_vt()?


Well it does not actually open the vt, it temporarily opens /dev/tty0 to find
a free vt, but that is all. As you said it sets vtno and KeepTTTY,
linux_open_vt() is too much like xf86OpenConsole() which does actually
open things.

Thinking more about this linux_parse_vt_settings() is the best name
I can come up with, so I'm going to go with that.

Regards,

Hans




Cheers,
Peter


  {
  int i, fd = -1, ret, current_vt = -1;
-struct vt_mode VT;
  struct vt_stat vts;
  struct stat st;
  MessageType from = X_PROBED;
  const char *tty0[] = { /dev/tty0, /dev/vc/0, NULL };
-const char *vcs[] = { /dev/vc/%d, /dev/tty%d, NULL };

-if (serverGeneration == 1) {
-/*
- * setup the virtual terminal manager
- */
-if (xf86Info.vtno != -1) {
-from = X_CMDLINE;
-}
-else {
+/*
+ * setup the virtual terminal manager
+ */
+if (xf86Info.vtno != -1) {
+from = X_CMDLINE;
+}
+else {

-i = 0;
-while (tty0[i] != NULL) {
-if ((fd = open(tty0[i

[PATCH v2 2/2] systemd-logind: Only use systemd-logind integration together with keeptty

2015-04-30 Thread Hans de Goede
systemd-logind integration does not work when starting X on a new tty, as
that detaches X from the current session and after hat systemd-logind revokes
all rights any already open fds and refuses to open new fds for X.

This means that currently e.g. startx -- vt7 breaks, and breaks badly,
requiring ssh access to the system to kill X.

The fix for this is easy, we must not use systemd-logind integration when
not using KeepTty, or iow we may only use systemd-logind integration together
with KeepTty.

Signed-off-by: Hans de Goede hdego...@redhat.com
---
Changes in v2:
-Document that -keeptty must be passed for logind integration in man page
-Print an INFO message when disabling logind integration due to -keeptty
 not being set
---
 hw/xfree86/man/Xorg.man  | 6 +++---
 hw/xfree86/os-support/linux/systemd-logind.c | 9 +
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/hw/xfree86/man/Xorg.man b/hw/xfree86/man/Xorg.man
index 3ff6aef..0864a58 100644
--- a/hw/xfree86/man/Xorg.man
+++ b/hw/xfree86/man/Xorg.man
@@ -271,9 +271,9 @@ is ignored if
 is anything other than \(oqPCI\(cq.
 .TP 8
 .B \-keeptty
-Prevent the server from detaching its initial controlling terminal.
-This option is only useful when debugging the server.  Not all platforms
-support (or can use) this option.
+Prevent the server from detaching its initial controlling terminal. If you
+want to use systemd-logind integration you must specify this option.
+Not all platorms support (or can use) this option.
 .TP 8
 .BI \-keyboard  keyboard-name
 Use the xorg.conf(__filemansuffix__) file
diff --git a/hw/xfree86/os-support/linux/systemd-logind.c 
b/hw/xfree86/os-support/linux/systemd-logind.c
index 4ad41a3..72f1ae3 100644
--- a/hw/xfree86/os-support/linux/systemd-logind.c
+++ b/hw/xfree86/os-support/linux/systemd-logind.c
@@ -34,6 +34,7 @@
 
 #include os.h
 #include dbus-core.h
+#include linux.h
 #include xf86.h
 #include xf86platformBus.h
 #include xf86Xinput.h
@@ -596,6 +597,14 @@ static struct dbus_core_hook core_hook = {
 int
 systemd_logind_init(void)
 {
+linux_parse_vt_settings();
+if (!linux_get_keeptty()) {
+LogMessage(X_INFO,
+systemd-logind: logind integration requires -keeptty and 
+-keeptty was not provided, disabling logind integration\n);
+return 1;
+}
+
 return dbus_core_add_hook(core_hook);
 }
 
-- 
2.3.6

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[PATCH v2 1/2] linux: Add linux_get_vtno and linux_get_keeptty helpers

2015-04-30 Thread Hans de Goede
systemd-logind integration does not work when starting X on a new tty, as
that detaches X from the current session and after hat systemd-logind revokes
all rights on any already open fds and refuses to open new fds for X.

This means that currently e.g. startx -- vt7 breaks, and breaks badly,
requiring ssh access to the system to kill X.

The fix for this is easy, we must not use systemd-logind integration when
not using KeepTty, or iow we may only use systemd-logind integration together
with KeepTty.

But the final KeepTty value is not known until the code to chose which vtno to
run on has been called, which currently happens after intializing
systemd-logind.

This commit is step 1 in fixing the startx -- vt7 breakage, it factors out
the linux xf86OpenConsole bits which set xf86Info.vtno and keepTty so that
these can be called earlier. Calling this earlier is safe as this code has
no side effects other than setting xf86Info.vtno and keepTty.

Note this basically only moves a large chunk of xf86OpenConsole() into
linux_get_vtno() without changing a single line of it, this is hard to see
in the diff because the identation level has changed.

Signed-off-by: Hans de Goede hdego...@redhat.com
---
Changes in v2:
-Rename linux_get_vtno to linux_parse_vt_settings
---
 hw/xfree86/os-support/linux/linux.h|  32 +
 hw/xfree86/os-support/linux/lnx_init.c | 122 -
 2 files changed, 105 insertions(+), 49 deletions(-)
 create mode 100644 hw/xfree86/os-support/linux/linux.h

diff --git a/hw/xfree86/os-support/linux/linux.h 
b/hw/xfree86/os-support/linux/linux.h
new file mode 100644
index 000..8cb8e3d
--- /dev/null
+++ b/hw/xfree86/os-support/linux/linux.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright © 2015 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the Software),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Author: Hans de Goede hdego...@redhat.com
+ */
+
+#ifndef XF86_LINUX_H
+#define XF86_LINUX_H
+
+void linux_parse_vt_settings(void);
+int linux_get_keeptty(void);
+
+#endif
diff --git a/hw/xfree86/os-support/linux/lnx_init.c 
b/hw/xfree86/os-support/linux/lnx_init.c
index 9485307..22c61bf 100644
--- a/hw/xfree86/os-support/linux/lnx_init.c
+++ b/hw/xfree86/os-support/linux/lnx_init.c
@@ -31,6 +31,7 @@
 #include X11/Xmd.h
 
 #include compiler.h
+#include linux.h
 
 #include xf86.h
 #include xf86Priv.h
@@ -80,71 +81,94 @@ switch_to(int vt, const char *from)
 #pragma GCC diagnostic ignored -Wformat-nonliteral
 
 void
-xf86OpenConsole(void)
+linux_parse_vt_settings(void)
 {
 int i, fd = -1, ret, current_vt = -1;
-struct vt_mode VT;
 struct vt_stat vts;
 struct stat st;
 MessageType from = X_PROBED;
 const char *tty0[] = { /dev/tty0, /dev/vc/0, NULL };
-const char *vcs[] = { /dev/vc/%d, /dev/tty%d, NULL };
 
-if (serverGeneration == 1) {
-/*
- * setup the virtual terminal manager
- */
-if (xf86Info.vtno != -1) {
-from = X_CMDLINE;
-}
-else {
+/* Only do this once */
+static int vt_settings_parsed = 0;
 
-i = 0;
-while (tty0[i] != NULL) {
-if ((fd = open(tty0[i], O_WRONLY, 0)) = 0)
-break;
-i++;
-}
+if (vt_settings_parsed)
+return;
 
-if (fd  0)
-FatalError(xf86OpenConsole: Cannot open /dev/tty0 (%s)\n,
-   strerror(errno));
+/*
+ * setup the virtual terminal manager
+ */
+if (xf86Info.vtno != -1) {
+from = X_CMDLINE;
+}
+else {
 
-if (xf86Info.ShareVTs) {
-SYSCALL(ret = ioctl(fd, VT_GETSTATE, vts));
-if (ret  0)
-FatalError(xf86OpenConsole: Cannot find the current
-VT (%s)\n, strerror(errno));
-xf86Info.vtno = vts.v_active;
-}
-else

Re: [PATCH xf86-input-libinput 1/4] Add a property for middle button emulation

2015-04-29 Thread Hans de Goede

Hi,

On 29-04-15 01:51, Peter Hutterer wrote:

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net


Other then the bugzilla link in 4/4 not making any sense (as already pointed 
out)
this patch set looks good and is:

Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

Hans



---
  configure.ac  |  2 +-
  include/libinput-properties.h |  7 
  man/libinput.man  |  9 +
  src/libinput.c| 87 ++-
  4 files changed, 103 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 0ba780c..aab6356 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,7 +45,7 @@ XORG_DEFAULT_OPTIONS

  # Obtain compiler/linker options from server and required extensions
  PKG_CHECK_MODULES(XORG, [xorg-server = 1.10] xproto [inputproto = 2.2])
-PKG_CHECK_MODULES(LIBINPUT, [libinput = 0.11.0])
+PKG_CHECK_MODULES(LIBINPUT, [libinput = 0.14.0])

  # Define a configure option for an alternate input module directory
  AC_ARG_WITH(xorg-module-dir,
diff --git a/include/libinput-properties.h b/include/libinput-properties.h
index 8947126..6760b50 100644
--- a/include/libinput-properties.h
+++ b/include/libinput-properties.h
@@ -95,4 +95,11 @@
  /* Click method: BOOL, 2 values in order buttonareas, clickfinger
 only one enabled at a time at max, read-only */
  #define LIBINPUT_PROP_CLICK_METHOD_ENABLED_DEFAULT libinput Click Method Enabled 
Default
+
+/* Middle button emulation: BOOL, 1 value */
+#define LIBINPUT_PROP_MIDDLE_EMULATION_ENABLED libinput Middle Emulation 
Enabled
+
+/* Middle button emulation: BOOL, 1 value, read-only */
+#define LIBINPUT_PROP_MIDDLE_EMULATION_ENABLED_DEFAULT libinput Middle Emulation 
Enabled Default
+
  #endif /* _LIBINPUT_PROPERTIES_H_ */
diff --git a/man/libinput.man b/man/libinput.man
index e807578..4d44c18 100644
--- a/man/libinput.man
+++ b/man/libinput.man
@@ -64,6 +64,10 @@ default click method for this device is used.
  .BI Option \*qLeftHanded\*q \*q bool \*q
  Enables left-handed button orientation, i.e. swapping left and right buttons.
  .TP 7
+.BI Option \*qMiddleEmulation\*q \*q bool \*q
+Enables middle button emulation. When enabled, pressing the left and right
+buttons simultaneously produces a middle mouse button click.
+.TP 7
  .BI Option \*qNaturalScrolling\*q \*q bool \*q
  Enables or disables natural scrolling behavior.
  .TP 7
@@ -151,6 +155,11 @@ Indicates which click methods are available on this device.
  .BI libinput Click Methods Enabled
  2 boolean values (8 bit, 0 or 1), in order buttonareas, clickfinger.
  Indicates which click methods are enabled on this device.
+.TP 7
+.BI libinput Middle Emulation Enabled
+1 boolean value (8 bit, 0 or 1). Indicates if middle emulation is enabled or
+disabled.
+.TP7
  .PP
  The above properties have a
  .BI libinput property name Default
diff --git a/src/libinput.c b/src/libinput.c
index 15a9c1f..ae905df 100644
--- a/src/libinput.c
+++ b/src/libinput.c
@@ -89,6 +89,7 @@ struct xf86libinput {
BOOL tapping;
BOOL natural_scrolling;
BOOL left_handed;
+   BOOL middle_emulation;
CARD32 sendevents;
CARD32 scroll_button; /* xorg button number */
float speed;
@@ -309,6 +310,13 @@ LibinputApplyConfig(DeviceIntPtr dev)
Failed to set click method to %s\n,
method);
}
+
+   if (libinput_device_config_middle_emulation_is_available(device) 
+   libinput_device_config_middle_emulation_set_enabled(device,
+   
driver_data-options.middle_emulation) != LIBINPUT_CONFIG_STATUS_SUCCESS)
+   xf86IDrvMsg(pInfo, X_ERROR,
+   Failed to set MiddleEmulation to %d\n,
+   driver_data-options.middle_emulation);
  }

  static int
@@ -1167,6 +1175,20 @@ xf86libinput_parse_options(InputInfoPtr pInfo,
driver_data-options.click_method = m;
free(method);
}
+
+   if (libinput_device_config_middle_emulation_is_available(device)) {
+   BOOL enabled = xf86SetBoolOption(pInfo-options,
+MiddleEmulation,
+
libinput_device_config_middle_emulation_get_default_enabled(device));
+   if (libinput_device_config_middle_emulation_set_enabled(device, 
enabled) !=
+   LIBINPUT_CONFIG_STATUS_SUCCESS) {
+   xf86IDrvMsg(pInfo, X_ERROR,
+   Failed to set MiddleEmulation to %d\n,
+   enabled);
+   enabled = 
libinput_device_config_middle_emulation_get_enabled(device);
+   }
+   driver_data-options.middle_emulation = enabled;
+   }
  }

  static int
@@ -1347,6 +1369,8 @@ static

Re: [PATCH 1/2] systemd-logind: filter out non-signal messages from message filter

2015-04-17 Thread Hans de Goede

Hi,

On 16-04-15 17:28, Ray Strode wrote:

It's possible to receive a message reply in the message filter if a
previous message call timed out locally before the reply arrived.

The message_filter function only handles signals, at the moment, and
does not properly handle message replies.

This commit changes the message_filter function to filter out all
non-signal messages, including spurious message replies.

Downstream-bug: https://bugzilla.redhat.com/show_bug.cgi?id=1209347
Signed-off-by: Ray Strode rstr...@redhat.com


Thanks both patches look good and are:

Reviewed-by: Hans de Goede hdego...@redhat.com

Keith, can you pick these 2 up directly please?

Regards,

Hans

p.s.

Ray, you may want to reduce the number of context lines a bit next time
you post patches.



---
  hw/xfree86/os-support/linux/systemd-logind.c | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/hw/xfree86/os-support/linux/systemd-logind.c 
b/hw/xfree86/os-support/linux/systemd-logind.c
index 49758f4..57c87c0 100644
--- a/hw/xfree86/os-support/linux/systemd-logind.c
+++ b/hw/xfree86/os-support/linux/systemd-logind.c
@@ -286,60 +286,63 @@ systemd_logind_ack_pause(struct systemd_logind_info *info,
 DBUS_TYPE_INVALID)) {
  LogMessage(X_ERROR, systemd-logind: out of memory\n);
  goto cleanup;
  }

  reply = dbus_connection_send_with_reply_and_block(info-conn, msg,
DBUS_TIMEOUT, error);
  if (!reply)
  LogMessage(X_ERROR, systemd-logind: failed to ack pause: %s\n,
 error.message);

  cleanup:
  if (msg)
  dbus_message_unref(msg);
  if (reply)
  dbus_message_unref(reply);
  dbus_error_free(error);
  }

  static DBusHandlerResult
  message_filter(DBusConnection * connection, DBusMessage * message, void *data)
  {
  struct systemd_logind_info *info = data;
  struct xf86_platform_device *pdev = NULL;
  InputInfoPtr pInfo = NULL;
  int ack = 0, pause = 0, fd = -1;
  DBusError error;
  dbus_int32_t major, minor;
  char *pause_str;

+if (dbus_message_get_type (message) != DBUS_MESSAGE_TYPE_SIGNAL)
+return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+
  dbus_error_init(error);

  if (dbus_message_is_signal(message,
 org.freedesktop.DBus, NameOwnerChanged)) {
  char *name, *old_owner, *new_owner;

  dbus_message_get_args(message, error,
DBUS_TYPE_STRING, name,
DBUS_TYPE_STRING, old_owner,
DBUS_TYPE_STRING, new_owner, 
DBUS_TYPE_INVALID);
  if (dbus_error_is_set(error)) {
  LogMessage(X_ERROR, systemd-logind: NameOwnerChanged: %s\n,
 error.message);
  dbus_error_free(error);
  return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
  }

  if (name  strcmp(name, org.freedesktop.login1) == 0)
  FatalError(systemd-logind disappeared (stopped/restarted?)\n);

  return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
  }

  if (strcmp(dbus_message_get_path(message), info-session) != 0)
  return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;

  if (dbus_message_is_signal(message, org.freedesktop.login1.Session,
 PauseDevice)) {
  if (!dbus_message_get_args(message, error,
 DBUS_TYPE_UINT32, major,


___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH 1/2] systemd-logind: filter out non-signal messages from message filter

2015-04-17 Thread Hans de Goede

Hi,

On 17-04-15 15:07, Ray Strode wrote:

Hi,


Ray, you may want to reduce the number of context lines a bit next time
you post patches.


Nope, definitely don't. my default config produces patches with a lot
of context intentionally. I want driveby readers who aren't motivated
enough to go to the source tree to still be able to do a cursory
review from just the patches themselves.

Clearly it doesn't help with full reviews, but by making life easier
for someone casually trawling email or bugzilla, I get more eyes for
free.


You may be making life easier for casual reviewers, but you are making life
harder for the people actually merging your patches as the chances of a conflict
increase enormously with such a large context.

Anyways, this is just my 2 usd cents.

Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[PATCH] Re-enable non serverfd input devices immediately on vtenter

2015-04-08 Thread Hans de Goede
Non serverfd input devices will never get a systemd-logind dbus resume signal,
causing them to never get re-enabled.

This commit changes xf86VTEnter() to enable them immediately, fixing this.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=89756
Signed-off-by: Hans de Goede hdego...@redhat.com
---
 hw/xfree86/common/xf86Events.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index c06aaae..97a1f97 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -583,10 +583,11 @@ xf86VTEnter(void)
 /* Turn screen saver off when switching back */
 dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset);
 
-/* If we use systemd-logind it will enable input devices for us */
-if (!systemd_logind_controls_session())
-for (pInfo = xf86InputDevs; pInfo; pInfo = pInfo-next)
+for (pInfo = xf86InputDevs; pInfo; pInfo = pInfo-next) {
+/* Devices with server managed fds get enabled on logind resume */
+if (!(pInfo-flags  XI86_SERVER_FD))
 xf86EnableInputDeviceForVTSwitch(pInfo);
+}
 
 for (ih = InputHandlers; ih; ih = ih-next) {
 if (ih-is_input)
-- 
2.3.4

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Current master still does not build properly with gcc5

2015-04-08 Thread Hans de Goede

Hi,

When building current master on Fedora 22 I end up with the following in
sdksyms.c:

/*
 * These symbols are referenced to ensure they
 * will be available in the X Server binary.
 */
/* topdir=../.. */
_X_HIDDEN void *xorg_symbols[] = {
(void *) ,  /* ../../inclu
(void *) ,  /* ../../inclu
(void *) ,  /* ../../inclu

Resulting in build errors, since sdksyms.sh is using a bunch of
awk which I do not speak, I'm just reporting this here and not
providing a patch.

Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: Current master still does not build properly with gcc5

2015-04-08 Thread Hans de Goede

Hi,

On 08-04-15 13:54, Hans de Goede wrote:

Hi,

When building current master on Fedora 22 I end up with the following in
sdksyms.c:

/*
  * These symbols are referenced to ensure they
  * will be available in the X Server binary.
  */
/* topdir=../.. */
_X_HIDDEN void *xorg_symbols[] = {
 (void *) ,  /* ../../inclu
 (void *) ,  /* ../../inclu
 (void *) ,  /* ../../inclu

Resulting in build errors, since sdksyms.sh is using a bunch of
awk which I do not speak, I'm just reporting this here and not
providing a patch.


Oops, I was on the server-1.17 branch, the fix in master does actually
work if you're on the master branch :)

Sorry for the false alarm.

Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xinit 2/2] startx: Make startx auto display select work with per user /tmp dirs

2015-03-26 Thread Hans de Goede

Hi,

On 25-03-15 22:45, Julien Cristau wrote:

On Wed, Mar 25, 2015 at 09:15:12 -0400, Ray Strode wrote:


Hi,


Now, I've tried to avoid anything xauth-related, but from the little I know:
to support displayfd in startx you'd have to communicate back to startx
about the $DISPLAY and do the xauth dance before continuing with the xinit
initial client connection. AFAICT, that's the tricky bit about -displayfd
support in startx. Does that make sense or am I way off here?

Sending $DISPLAY back to startx isn't actually an option since, $DISPLAY comes
from the X server, and the auth file has to be prepared before
starting the X server.
If you start the X server without the auth file then the X server will
get started wide
open to anyone on the host. Sure you could lock it down at that point,
but then there's
a race where anyone could open the display and snoop from then on.


I ran into this when trying to make our xvfb-run wrapper use
-displayfd, would be nice if we can fix this.  Maybe by making the
server consider empty -auth file as nobody allowed instead of
everybody allowed?


As discussed already the proper fix here is to teach xinit to write
out the xauth file, and then have xinit pass both
-displayfd and -xauth xinit-generated-file to the server.

See example the gdm code for launching the server for how to do this.

Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xinit] startx: don't init defaultdisplay to :0

2015-03-25 Thread Hans de Goede

Hi,

On 25-03-15 02:50, Peter Hutterer wrote:

This is misleading - it is always overwritten after looping through the lock
files.

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net


Looks good to me:

Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

Hans


---
  startx.cpp | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/startx.cpp b/startx.cpp
index cc8be90..636d55e 100644
--- a/startx.cpp
+++ b/startx.cpp
@@ -56,7 +56,7 @@ defaultclient=XTERM
  defaultserver=XSERVER
  defaultclientargs=
  defaultserverargs=
-defaultdisplay=:0
+defaultdisplay=
  clientargs=
  serverargs=
  vtarg=


___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xinit 2/2] startx: Make startx auto display select work with per user /tmp dirs

2015-03-25 Thread Hans de Goede

Hi,

On 25-03-15 02:53, Peter Hutterer wrote:

On Mon, Mar 23, 2015 at 02:16:13PM +, Jon TURNEY wrote:



On 20/03/2015 17:16, Ray Strode wrote:

On Fri, Mar 20, 2015 at 10:02 AM, Hans de Goede hdego...@redhat.com wrote:

If a separate /tmp per user is used the existing auto display select code
does not work, add an extra check for the unix socket for the display number
existing in /proc/net/unix (linux only).


This patch and the previous patch make sense to me near term.  It
fixes some corner
cases without regressing any others.  I do think a better medium-term
solution would
be for xinit to start using -displayfd and startx to drop its try to
figure out a display
number heuristics.  There's just no reason programs that start an X
server should be
trawling around in /tmp and/or binding to sockets up front (except for
hysterical raisins)


I wrote a patch [1] a while ago to teach xinit to handle the -displayfd
option.

If I understand you correctly, you are suggesting something slightly
different, that -displayfd should be used by default if a display number
isn't explicitly specified, but this might serve as a starting point...

[1] 
http://cgit.freedesktop.org/~jturney/xinit/commit/?id=c6dc4db8fdcbe115867f6f4a1ab9138536f99fec


The patch itself looks fine, minus a couple of coding style differences with
the rest of the file. they should be fixed. Plus, you're leaving the pipe
open from what I can tell.

What gets interesting is using that from startx. The order of startx is
pretty much:
1) dig around in the system to find a suitable $DISPLAY
2) add xauth entries for $DISPLAY
3) xinit

Now, I've tried to avoid anything xauth-related, but from the little I know:
to support displayfd in startx you'd have to communicate back to startx
about the $DISPLAY and do the xauth dance before continuing with the xinit
initial client connection. AFAICT, that's the tricky bit about -displayfd
support in startx. Does that make sense or am I way off here?


You're right I had forgotten that the xauth file needs to contain the
displaynr, so there is no easy fix here I'm afraid.

I think that if we want to fix this we should add a -autodisplayconfig
config to xinit which takes care of handling both -displayfd and of
generating and passing in an xauth file. Once we've a such a
-autodisplayconfig option to xinit fixing startx becomes trivial.

Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH keyboard] linux: bring our process group to the foreground (#89653)

2015-03-25 Thread Hans de Goede

Hi,

On 25-03-15 05:21, Peter Hutterer wrote:

Required to make the driver receive keyboard events from the console.

X.Org Bug  http://bugs.freedesktop.org/show_bug.cgi?id=89653

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net


Looks good:

Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

Hans


---
Mark was right, this seems to do the trick. I don't know why this is needed
now though when it wasn't in the past. When I tried bisecting this
yesterday I started before all the systemd-logind patches and it still had
the same behaviour. A 3.18rc4 kernel that I still had around
also required the patch. So something somewhere has broken this, I just
don't know what.

Either way, this fixes it, with no side-effects that I found so far.
I was contemplating of putting this in the server but it's really only the
keyboard driver that needs this.

  src/lnx_kbd.c | 9 +
  1 file changed, 9 insertions(+)

diff --git a/src/lnx_kbd.c b/src/lnx_kbd.c
index 811a7d7..c221194 100644
--- a/src/lnx_kbd.c
+++ b/src/lnx_kbd.c
@@ -187,8 +187,17 @@ OpenKeyboard(InputInfoPtr pInfo)

  s = xf86SetStrOption(pInfo-options, Device, NULL);
  if (s == NULL) {
+   int rc;
 pInfo-fd = xf86Info.consoleFd;
 pKbd-isConsole = TRUE;
+
+   rc = tcsetpgrp(pInfo-fd, getpgid(0));
+   if (rc  0) {
+   xf86IDrvMsg(pInfo, X_ERROR,
+   failed to set us as foreground pgrp (%s)\n,
+   strerror(errno));
+   }
+
  } else {
 pInfo-fd = open(s, O_RDONLY | O_NONBLOCK | O_EXCL);
 if (pInfo-fd == -1) {


___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xinit 1/2] startx: Fix startx picking an already used display number when -nolock is used

2015-03-25 Thread Hans de Goede

Hi,

On 25-03-15 01:54, Peter Hutterer wrote:

On Fri, Mar 20, 2015 at 03:02:35PM +0100, Hans de Goede wrote:

Currently startx relies on /tmp/.X?-lock being present for automatically
picking a free display number. This does not work if -nolock is used when
starting the server, or if the server is started with -displayfd as -displayfd
implies -nolock.

This is becoming a problem now that -displayfd is getting used by
display-managers (e.g. gdm), this fixes this by also checking for
/tmp/.X11-unix/X?

Signed-off-by: Hans de Goede hdego...@redhat.com


Reviewed-by: Peter Hutterer peter.hutte...@who-t.net


Thanks, pushed.

Regards,

Hans



Cheers,
Peter


---
  startx.cpp | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/startx.cpp b/startx.cpp
index 8520399..fe49996 100644
--- a/startx.cpp
+++ b/startx.cpp
@@ -120,7 +120,7 @@ enable_xauth=1
  XCOMM Automatically determine an unused $DISPLAY
  d=0
  while true ; do
-[ -e /tmp/.X$d-lock ] || break
+[ -e /tmp/.X$d-lock -o -S /tmp/.X11-unix/X$d ] || break
  d=$(($d + 1))
  done
  defaultdisplay=:$d
--
2.3.3

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xinit 2/2] startx: Make startx auto display select work with per user /tmp dirs

2015-03-25 Thread Hans de Goede

Hi,

On 25-03-15 14:20, Ray Strode wrote:

Hi,


You're right I had forgotten that the xauth file needs to contain the
displaynr, so there is no easy fix here I'm afraid.

That's not true actually. The xauth file can have a display wildcard, but
the xauth command doesn't support generating xauth files with display
wildcards.


I think that if we want to fix this we should add a -autodisplayconfig
config to xinit which takes care of handling both -displayfd and of
generating and passing in an xauth file.

Yea, exactly!  I would go a step further and just always do what the
-autodisplayconfig line does, implicitly. Of course, if the caller passes
in a -auth line and $DISPLAY, use the ones passed in, but always do
-displayfd no matter what, since -displayfd works fine with a passed
in $DISPLAY and is still useful for getting ready notification without
having to use unix signal handlers.


Ok, either way (explicit cmdline option or implied by lack of something
specified on the cmdline) sounds good to me. Now all we need is for someone
to code this :)

Note that I've no intent to work at this myself since the startx fixes to
select a really free displaynr work well enough for now, and I've my plate
full with other stuff.

Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH synaptics] eventcomm: ignore fake and broken MT devices

2015-03-24 Thread Hans de Goede

Hi,

On 24-03-15 06:45, Peter Hutterer wrote:

An MT device without X/Y is not a touchpad. And neither are fake MT devices.

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net


Looks good:

Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

Hans


---
  src/eventcomm.c | 9 +
  1 file changed, 9 insertions(+)

diff --git a/src/eventcomm.c b/src/eventcomm.c
index cddf7fc..3a9d45d 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -325,6 +325,15 @@ event_query_is_touchpad(struct libevdev *evdev)
  libevdev_has_event_code(evdev, EV_ABS, BTN_TOOL_PEN)) /* Don't match 
wacom tablets */
  return FALSE;

+if (libevdev_has_event_code(evdev, EV_ABS, ABS_MT_SLOT)) {
+if (libevdev_get_num_slots(evdev) == -1)
+return FALSE; /* Ignore fake MT devices */
+
+if (!libevdev_has_event_code(evdev, EV_ABS, ABS_MT_POSITION_X) ||
+!libevdev_has_event_code(evdev, EV_ABS, ABS_MT_POSITION_Y))
+return FALSE;
+}
+
  return TRUE;
  }



___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH synaptics] eventcomm: prevent possibly division by zero

2015-03-23 Thread Hans de Goede

Hi,

On 23-03-15 02:51, Peter Hutterer wrote:

This came up as a kernel bug, but it's valid to create uinput devices with a
min == max range for x/y. Technically valid, but effectively useless, so catch
it, complain and hobble on along.

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net


Looks good:

Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

Hans


---
  src/eventcomm.c | 10 ++
  1 file changed, 10 insertions(+)

diff --git a/src/eventcomm.c b/src/eventcomm.c
index 53a0ca4..cddf7fc 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -436,6 +436,11 @@ event_query_axis_ranges(InputInfoPtr pInfo)
  event_get_abs(proto_data-evdev, ABS_Y, priv-miny, priv-maxy,
priv-synpara.hyst_y, priv-resy);

+if (priv-minx == priv-maxx || priv-miny == priv-maxy) {
+xf86IDrvMsg(pInfo, X_ERROR, Kernel bug: min == max on ABS_X/Y\n);
+return;
+}
+
  priv-has_pressure = libevdev_has_event_code(proto_data-evdev, EV_ABS, 
ABS_PRESSURE);
  priv-has_width = libevdev_has_event_code(proto_data-evdev, EV_ABS, 
ABS_TOOL_WIDTH);

@@ -458,6 +463,11 @@ event_query_axis_ranges(InputInfoPtr pInfo)
  event_get_abs(proto_data-evdev, ABS_MT_POSITION_Y, priv-miny,
priv-maxy, priv-synpara.hyst_y, priv-resy);

+if (priv-minx == priv-maxx || priv-miny == priv-maxy) {
+xf86IDrvMsg(pInfo, X_ERROR, Kernel bug: min == max on 
ABS_MT_POSITION_X/Y\n);
+return;
+}
+
  proto_data-st_to_mt_offset[0] = priv-minx - st_minx;
  proto_data-st_to_mt_scale[0] =
  (priv-maxx - priv-minx) / (st_maxx - st_minx);


___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xinit 2/2] startx: Make startx auto display select work with per user /tmp dirs

2015-03-20 Thread Hans de Goede
If a separate /tmp per user is used the existing auto display select code
does not work, add an extra check for the unix socket for the display number
existing in /proc/net/unix (linux only).

Signed-off-by: Hans de Goede hdego...@redhat.com
---
 startx.cpp | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/startx.cpp b/startx.cpp
index fe49996..3b0dd86 100644
--- a/startx.cpp
+++ b/startx.cpp
@@ -120,7 +120,11 @@ enable_xauth=1
 XCOMM Automatically determine an unused $DISPLAY
 d=0
 while true ; do
-[ -e /tmp/.X$d-lock -o -S /tmp/.X11-unix/X$d ] || break
+[ -e /tmp/.X$d-lock -o -S /tmp/.X11-unix/X$d ] ||
+#ifdef __linux__
+grep -q /tmp/.X11-unix/X$d /proc/net/unix ||
+#endif
+break
 d=$(($d + 1))
 done
 defaultdisplay=:$d
-- 
2.3.3

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xinit 1/2] startx: Fix startx picking an already used display number when -nolock is used

2015-03-20 Thread Hans de Goede
Currently startx relies on /tmp/.X?-lock being present for automatically
picking a free display number. This does not work if -nolock is used when
starting the server, or if the server is started with -displayfd as -displayfd
implies -nolock.

This is becoming a problem now that -displayfd is getting used by
display-managers (e.g. gdm), this fixes this by also checking for
/tmp/.X11-unix/X?

Signed-off-by: Hans de Goede hdego...@redhat.com
---
 startx.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/startx.cpp b/startx.cpp
index 8520399..fe49996 100644
--- a/startx.cpp
+++ b/startx.cpp
@@ -120,7 +120,7 @@ enable_xauth=1
 XCOMM Automatically determine an unused $DISPLAY
 d=0
 while true ; do
-[ -e /tmp/.X$d-lock ] || break
+[ -e /tmp/.X$d-lock -o -S /tmp/.X11-unix/X$d ] || break
 d=$(($d + 1))
 done
 defaultdisplay=:$d
-- 
2.3.3

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH v2 synaptics] Revert Support the new Lenovo X1 Carbon 3rd trackpoint buttons

2015-03-18 Thread Hans de Goede

Hi,

On 18-03-15 03:58, Peter Hutterer wrote:


This reverts commit 064445364b4775b25ba49c2250b22b169f291147.

The Lenovo *50 series, including the X1 Carbon 3rd always require multiple
kernel patches to enable the touchpad buttons. This patch in synaptics only
addresses the re-routing of the top buttons.

The final iteration of the kernel patches also route the trackpoint buttons
through the trackpoint device, rendering this patch unnecessary. These patches
are queued for 4.0.

See kernel patch series up to commit cdd9dc195916ef5644cfac079094c3c1d1616e4c
Author: Benjamin Tissoires benjamin.tissoi...@redhat.com
Date:   Sun Mar 8 22:35:41 2015 -0700

 Input: synaptics - re-route tracksticks buttons on the Lenovo 2015 series

Currently in Dmitry's for-linus branch.

Distributions running older kernels or the kernel stable series which has
partial backports of the above patch series are encouraged to leave the
0644453 commit in and undo this revert.

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
Reviewed-by: Hans de Goede hdego...@redhat.com
---
Just sending this out for the changed commit message. Some of the patches
are en-route to the stable kernel, the full patcheset is scheduled for 4.0.

Depending on distros' backports and the stable kernel there are some kernels
out there that would need this patch in userspace. We've decided to not
worry about that upstream though, distros will have to carry this patch
until they update to 4.0.

Hans - your chance to remove your rev-by if you disagree :)


Nope, my rev-by still stands.

Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: xf86-input-keyboard not working

2015-03-18 Thread Hans de Goede

Hi,

On 18-03-15 03:43, Ingo Brückl wrote:

I've got it!

It has nothing to do with xf86-input-keyboard or xorg-server, but with
startx. It nowadays starts X on the current tty due to an issue in
systemd-logind (according to bugzilla.redhat.com/show_bug.cgi?id=806491).
This causes xorg-server to enable keeptty and thus the trouble.

 From my point of view the corresponding patch
(cgit.freedesktop.org/xorg/app/xinit/commit/startx.cpp?id=44915d6953076849b69
a017f6fc8234b0f254362) should be considered a bug. To fix it properly, the
xinit configure ought to have a enable-systemd-logind option with auto
detection - just like xorg-server.

Please fix it.


I do not believe that adding auto-detection to the xinit configure script is
going to help much here, people may be running a Xorg build with systemd-logind
capabilities without actually using it, so I believe that if there is something
to fix we need a runtime check, not a buildtime one.

Other then that I've not been following this thread. Is there a bug report
somewhere were the problem is spelled out step by step, including a detailed
analysis of why you believe the startx behavior is the cause ?

If not please file such a bug report here:
https://bugs.freedesktop.org/enter_bug.cgi?product=xorgcomponent=App/xinit

And then mail me back with the bug number and I will take a look.

Regards,

Hans
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: %(user_address)s

Re: [PATCH xf86-input-libinput 1/2] Add a helper function for making properties

2015-03-17 Thread Hans de Goede

Hi,

On 16-03-15 23:22, Peter Hutterer wrote:

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net


Both patches look good to me and are:

Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

Hans


---
  src/libinput.c | 212 ++---
  1 file changed, 80 insertions(+), 132 deletions(-)

diff --git a/src/libinput.c b/src/libinput.c
index 5f2bd34..1eadbc7 100644
--- a/src/libinput.c
+++ b/src/libinput.c
@@ -1727,23 +1727,44 @@ LibinputSetProperty(DeviceIntPtr dev, Atom atom, 
XIPropertyValuePtr val,
return rc;
  }

+static Atom
+LibinputMakeProperty(DeviceIntPtr dev,
+const char *prop_name,
+Atom type,
+int format,
+int len,
+void *data)
+{
+   int rc;
+   Atom prop = MakeAtom(prop_name, strlen(prop_name), TRUE);
+
+   rc = XIChangeDeviceProperty(dev, prop, type, format,
+   PropModeReplace,
+   len, data, FALSE);
+   if (rc != Success)
+   return None;
+
+   XISetDevicePropertyDeletable(dev, prop, FALSE);
+
+   return prop;
+}
+
  static void
  LibinputInitTapProperty(DeviceIntPtr dev,
struct xf86libinput *driver_data,
struct libinput_device *device)
  {
BOOL tap = driver_data-options.tapping;
-   int rc;

if (libinput_device_config_tap_get_finger_count(device) == 0)
return;

-   prop_tap = MakeAtom(LIBINPUT_PROP_TAP, strlen(LIBINPUT_PROP_TAP), TRUE);
-   rc = XIChangeDeviceProperty(dev, prop_tap, XA_INTEGER, 8,
-   PropModeReplace, 1, tap, FALSE);
-   if (rc != Success)
-   return;
-   XISetDevicePropertyDeletable(dev, prop_tap, FALSE);
+   prop_tap = LibinputMakeProperty(dev,
+   LIBINPUT_PROP_TAP,
+   XA_INTEGER,
+   8,
+   1,
+   tap);
  }

  static void
@@ -1752,7 +1773,6 @@ LibinputInitCalibrationProperty(DeviceIntPtr dev,
struct libinput_device *device)
  {
float calibration[9];
-   int rc;

if (!libinput_device_config_calibration_has_matrix(device))
return;
@@ -1765,15 +1785,10 @@ LibinputInitCalibrationProperty(DeviceIntPtr dev,
calibration[7] = 0;
calibration[8] = 1;

-   prop_calibration = MakeAtom(LIBINPUT_PROP_CALIBRATION,
-   strlen(LIBINPUT_PROP_CALIBRATION),
-   TRUE);
-
-   rc = XIChangeDeviceProperty(dev, prop_calibration, prop_float, 32,
-   PropModeReplace, 9, calibration, FALSE);
-   if (rc != Success)
-   return;
-   XISetDevicePropertyDeletable(dev, prop_calibration, FALSE);
+   prop_calibration = LibinputMakeProperty(dev,
+   LIBINPUT_PROP_CALIBRATION,
+   prop_float, 32,
+   9, calibration);
  }

  static void
@@ -1782,17 +1797,14 @@ LibinputInitAccelProperty(DeviceIntPtr dev,
  struct libinput_device *device)
  {
float speed = driver_data-options.speed;
-   int rc;

if (!libinput_device_config_accel_is_available(device))
return;

-   prop_accel = MakeAtom(LIBINPUT_PROP_ACCEL, strlen(LIBINPUT_PROP_ACCEL), 
TRUE);
-   rc = XIChangeDeviceProperty(dev, prop_accel, prop_float, 32,
-   PropModeReplace, 1, speed, FALSE);
-   if (rc != Success)
-   return;
-   XISetDevicePropertyDeletable(dev, prop_accel, FALSE);
+   prop_accel = LibinputMakeProperty(dev,
+ LIBINPUT_PROP_ACCEL,
+ prop_float, 32,
+ 1, speed);
  }

  static void
@@ -1801,19 +1813,14 @@ LibinputInitNaturalScrollProperty(DeviceIntPtr dev,
  struct libinput_device *device)
  {
BOOL natural_scroll = driver_data-options.natural_scrolling;
-   int rc;

if (!libinput_device_config_scroll_has_natural_scroll(device))
return;

-   prop_natural_scroll = MakeAtom(LIBINPUT_PROP_NATURAL_SCROLL,
-  strlen(LIBINPUT_PROP_NATURAL_SCROLL),
-  TRUE);
-   rc = XIChangeDeviceProperty(dev, prop_natural_scroll, XA_INTEGER, 8,
-   PropModeReplace, 1, natural_scroll, FALSE);
-   if (rc != Success)
-   return;
-   XISetDevicePropertyDeletable(dev, prop_natural_scroll, FALSE

Re: [PATCH synaptics] Revert Support the new Lenovo X1 Carbon 3rd trackpoint buttons

2015-03-17 Thread Hans de Goede

Hi,

On 17-03-15 07:14, Peter Hutterer wrote:

This reverts commit 064445364b4775b25ba49c2250b22b169f291147.

The Lenovo *50 series, including the X1 Carbon 3rd always require multiple
kernel patches to enable the touchpad buttons. This patch in synaptics only
addresses the re-routing of the top buttons.

The final iteration of the kernel patches also route the trackpoint buttons
through the trackpoint device, rendering this patch unnecessary.
Since there are no released kernels that support all touchpad buttons
correctly but still have the routing through the touchpad, we can revert this
change in synaptics and instead rely on the kernel.

See kernel commit cdd9dc195916ef5644cfac079094c3c1d1616e4c
Author: Benjamin Tissoires benjamin.tissoi...@redhat.com
Date:   Sun Mar 8 22:35:41 2015 -0700

 Input: synaptics - re-route tracksticks buttons on the Lenovo 2015 series

Currently in Dmitry's for-linus branch.

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net


Looks good to me:

Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

Hans

---
  conf/50-synaptics.conf  |  7 ---
  conf/71-synaptics.rules | 20 
  conf/Makefile.am|  7 ---
  configure.ac| 10 --
  man/synaptics.man   | 14 --
  src/synaptics.c | 42 --
  src/synapticsstr.h  |  2 --
  7 files changed, 102 deletions(-)
  delete mode 100644 conf/71-synaptics.rules

diff --git a/conf/50-synaptics.conf b/conf/50-synaptics.conf
index 5fb131e..aa50456 100644
--- a/conf/50-synaptics.conf
+++ b/conf/50-synaptics.conf
@@ -44,10 +44,3 @@ Section InputClass
  MatchDriver synaptics
  Option SoftButtonAreas 0 0 0 0 0 0 0 0
  EndSection
-
-Section InputClass
-Identifier Lenovo *50 and Carbon 3rd trackpoint buttons
-MatchDriver synaptics
-MatchTag has_trackpoint_buttons
-Option HasTrackpointButtons on
-EndSection
diff --git a/conf/71-synaptics.rules b/conf/71-synaptics.rules
deleted file mode 100644
index 7a89e14..000
--- a/conf/71-synaptics.rules
+++ /dev/null
@@ -1,20 +0,0 @@
-ACTION==remove, GOTO=touchpad_end
-KERNEL!=event*, GOTO=touchpad_end
-ENV{ID_INPUT_TOUCHPAD}==, GOTO=touchpad_end
-
-# Lenovo X1 Carbon 3rd
-KERNELS==serio1, \
-ATTRS{firmware_id}==*LEN0048*, \
-ENV{ID_INPUT.tags}=has_trackpoint_buttons
-
-# Lenovo W451
-KERNELS==serio1, \
-ATTRS{firmware_id}==*LEN004a*, \
-ENV{ID_INPUT.tags}=has_trackpoint_buttons
-
-# Lenovo T450s
-KERNELS==serio1, \
-ATTRS{firmware_id}==*LEN200f*, \
-ENV{ID_INPUT.tags}=has_trackpoint_buttons
-
-LABEL=touchpad_end
diff --git a/conf/Makefile.am b/conf/Makefile.am
index 4dde902..38d2a01 100644
--- a/conf/Makefile.am
+++ b/conf/Makefile.am
@@ -25,10 +25,3 @@ else
  fdidir = $(datadir)/hal/fdi/policy/20thirdparty
  dist_fdi_DATA = 11-x11-synaptics.fdi
  endif
-
-if HAVE_UDEV_RULES_DIR
-udevdir=$(UDEV_RULES_DIR)
-udev_DATA = 71-synaptics.rules
-endif
-
-EXTRA_DIST = 71-synaptics.rules
diff --git a/configure.ac b/configure.ac
index 2844da2..0a2bfb6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -135,16 +135,6 @@ AM_CONDITIONAL([BUILD_EVENTCOMM], [test x${BUILD_EVENTCOMM} = 
xyes])
  AM_CONDITIONAL([BUILD_PSMCOMM], [test x${BUILD_PSMCOMM} = xyes])
  AM_CONDITIONAL([BUILD_PS2COMM], [test x${BUILD_PS2COMM} = xyes])

-AC_ARG_WITH(udev-rules-dir,
-AS_HELP_STRING([--with-udev-rules-dir=DIR],
-   [Directory where udev expects its rules files
-   [[default=$libdir/udev/rules.d]]]),
-[udevdir=$withval],
-[udevdir=$libdir/udev/rules.d])
-UDEV_RULES_DIR=${udevdir}
-AC_SUBST(UDEV_RULES_DIR)
-AM_CONDITIONAL(HAVE_UDEV_RULES_DIR, [test x$UDEV_RULES_DIR != xno])
-
  # 
-
  # Dependencies for synclient and syndaemon
  # 
-
diff --git a/man/synaptics.man b/man/synaptics.man
index 65fb337..7083b3a 100644
--- a/man/synaptics.man
+++ b/man/synaptics.man
@@ -518,20 +518,6 @@ initialized if
  .B Option \*qHasSecondarySoftButtons\*q
  is enabled and this option is set in the __xconfigfile__(__filemansuffix__).
  .
-.TP
-.BI Option \*qHasTrackpointButtons\*q \*q boolean \*q
-This option is only available on selected devices. You should never need to
-set this option manually, your distribution should ship
-__xconfigfile__(__filemansuffix__) snippets to enable this option where
-required. Devices that require this option include the Lenovo X1 Carbon 3rd
-and the Lenovo *50 series (T450, T550, etc.).
-If enabled, the device is considered to have the trackpoint left, middle,
-right buttons wired to the touchpad. If set, this option disables scroll
-buttons, i.e.
-.B Option \*qUpDownScrolling\*q, \*qLeftRightScrolling\*q
-and the respective repeat options for scroll buttons.
-This options

Re: [PATCH util-modular 1/3] xorg.modules: Add libevdev requirement to synaptics

2015-03-16 Thread Hans de Goede

Hi Peter,

On 15-03-15 23:47, Peter Hutterer wrote:

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net


All 3 patches look good to me and are:

Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

Hans


---
  xorg.modules | 1 +
  1 file changed, 1 insertion(+)

diff --git a/xorg.modules b/xorg.modules
index 7216192..6d80c6b 100644
--- a/xorg.modules
+++ b/xorg.modules
@@ -1974,6 +1974,7 @@
dep package=libX11/
dep package=libXi/
dep package=xserver/
+  dep package=libevdev/
  /dependencies
/autotools



___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH evdev 1/5] Require multitouch/smooth scrolling dependencies

2015-03-11 Thread Hans de Goede

Hi,

All patches in this series look good and are:

Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

Hans


On 11-03-15 06:53, Peter Hutterer wrote:

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
---
  configure.ac | 12 ++--
  src/evdev.c  | 93 
  src/evdev.h  | 16 ---
  3 files changed, 2 insertions(+), 119 deletions(-)

diff --git a/configure.ac b/configure.ac
index 46f3dc7..e53177e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -44,19 +44,11 @@ XORG_MACROS_VERSION(1.8)
  XORG_DEFAULT_OPTIONS

  # Obtain compiler/linker options from server and required extensions
-PKG_CHECK_MODULES(XORG, [xorg-server = 1.10] xproto inputproto)
+PKG_CHECK_MODULES(XORG, [xorg-server = 1.12] xproto [inputproto = 2.1.99.3])
  PKG_CHECK_MODULES(UDEV, libudev)

-PKG_CHECK_MODULES(XI22, [inputproto = 2.1.99.3] [xorg-server = 1.11.99.901], 
HAVE_XI22=yes, HAVE_XI22=no)
  PKG_CHECK_MODULES(LIBEVDEV, [libevdev = 0.4])
-
-if test x$HAVE_XI22 = xyes; then
-# Obtain compiler/linker options for mtdev
-PKG_CHECK_MODULES(MTDEV, mtdev, HAVE_MTDEV=yes, HAVE_MTDEV=no)
-fi
-if test x$HAVE_XI22 = xyes  test x$HAVE_MTDEV = xyes; then
-AC_DEFINE(MULTITOUCH, 1, [XI2.2 available])
-fi
+PKG_CHECK_MODULES(MTDEV, mtdev, HAVE_MTDEV=yes, HAVE_MTDEV=no)

  # Define a configure option for an alternate input module directory
  AC_ARG_WITH(xorg-module-dir,
diff --git a/src/evdev.c b/src/evdev.c
index 9c1a4d3..af691f5 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -53,9 +53,7 @@
  #include X11/Xatom.h
  #include evdev-properties.h
  #include xserver-properties.h
-#ifdef MULTITOUCH
  #include mtdev-plumbing.h
-#endif

  #ifndef XI_PROP_PRODUCT_ID
  #define XI_PROP_PRODUCT_ID Device Product ID
@@ -259,12 +257,6 @@ out:
  return rc;
  }

-#ifndef HAVE_SMOOTH_SCROLLING
-static int wheel_up_button = 4;
-static int wheel_down_button = 5;
-static int wheel_left_button = 6;
-static int wheel_right_button = 7;
-#endif

  static EventQueuePtr
  EvdevNextInQueue(InputInfoPtr pInfo)
@@ -325,7 +317,6 @@ EvdevQueueProximityEvent(InputInfoPtr pInfo, int value)
  }
  }

-#ifdef MULTITOUCH
  void
  EvdevQueueTouchEvent(InputInfoPtr pInfo, unsigned int touch, ValuatorMask 
*mask,
   uint16_t evtype)
@@ -339,7 +330,6 @@ EvdevQueueTouchEvent(InputInfoPtr pInfo, unsigned int 
touch, ValuatorMask *mask,
  pQueue-val = evtype;
  }
  }
-#endif

  /**
   * Post button event right here, right now.
@@ -611,23 +601,6 @@ EvdevProcessRelativeMotionEvent(InputInfoPtr pInfo, struct 
input_event *ev)
  value = ev-value;

  switch (ev-code) {
-#ifndef HAVE_SMOOTH_SCROLLING
-case REL_WHEEL:
-if (value  0)
-EvdevQueueButtonClicks(pInfo, wheel_up_button, value);
-else if (value  0)
-EvdevQueueButtonClicks(pInfo, wheel_down_button, -value);
-break;
-
-case REL_DIAL:
-case REL_HWHEEL:
-if (value  0)
-EvdevQueueButtonClicks(pInfo, wheel_right_button, value);
-else if (value  0)
-EvdevQueueButtonClicks(pInfo, wheel_left_button, -value);
-break;
-/* We don't post wheel events as axis motion. */
-#endif
  default:
  /* Ignore EV_REL events if we never set up for them. */
  if (!(pEvdev-flags  EVDEV_RELATIVE_EVENTS) 
@@ -650,7 +623,6 @@ EvdevProcessRelativeMotionEvent(InputInfoPtr pInfo, struct 
input_event *ev)
  }
  }

-#ifdef MULTITOUCH
  static void
  EvdevProcessTouch(InputInfoPtr pInfo)
  {
@@ -763,10 +735,6 @@ EvdevProcessTouchEvent(InputInfoPtr pInfo, struct 
input_event *ev)
  }
  }
  }
-#else
-#define EvdevProcessTouch(pInfo)
-#define EvdevProcessTouchEvent(pInfo, ev)
-#endif /* MULTITOUCH */

  /**
   * Take the absolute motion input event and process it accordingly.
@@ -913,9 +881,7 @@ EvdevPostProximityEvents(InputInfoPtr pInfo, int which)
  switch (pEvdev-queue[i].type) {
  case EV_QUEUE_KEY:
  case EV_QUEUE_BTN:
-#ifdef MULTITOUCH
  case EV_QUEUE_TOUCH:
-#endif
  break;
  case EV_QUEUE_PROXIMITY:
  if (pEvdev-queue[i].val == which)
@@ -955,13 +921,11 @@ static void EvdevPostQueuedEvents(InputInfoPtr pInfo)
  break;
  case EV_QUEUE_PROXIMITY:
  break;
-#ifdef MULTITOUCH
  case EV_QUEUE_TOUCH:
  xf86PostTouchEvent(pInfo-dev, pEvdev-queue[i].detail.touch,
 pEvdev-queue[i].val, 0,
 pEvdev-queue[i].touchMask);
  break;
-#endif
  }
  }
  }
@@ -1033,9 +997,7 @@ EvdevProcessEvent(InputInfoPtr pInfo, struct input_event 
*ev)
  static void
  EvdevFreeMasks(EvdevPtr pEvdev)
  {
-#ifdef MULTITOUCH
  int i;
-#endif

  free(pEvdev-slots);
  pEvdev-slots = NULL;
@@ -1043,7 +1005,6

Re: [PATCH xf86-input-libinput] Up the scroll dist value for touchpads

2015-03-05 Thread Hans de Goede

Hi,

On 04-03-15 22:46, Peter Hutterer wrote:

On Wed, Mar 04, 2015 at 01:15:31PM +0100, Hans de Goede wrote:

Hi,

On 04-03-15 06:00, Peter Hutterer wrote:

For source FINGER and CONTINUOUS, the axis value is the same as relative
motion - but scrolling in X usually doesn't have the same speed as finger
movement, it's a lot coarser.

We don't know ahead of time where we'll get the scroll events from. Set a
default scroll distance of 15 and multiply any wheel clicks we get by this
value.

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
---
15 is more-or-less a magic value, it feels just right on my box here


Hmm, this is somewhat different from what we discussed in our mail conversation.


indeed, I had that first, then compared it to the evdev driver and decided
that this one is the better approach after all, explanation below.


First of all the problem most users are reporting and I'm seeing myself is not
that mouse wheel scrolling is too slow (which this patch seems to imply), but
rather that finger scrolling is much too fast, see e.g.:

https://bugzilla.redhat.com/show_bug.cgi?id=1198467

What I understood from our discussion on this is that the idea for
mouse wheel scrolling was to emulate discrete-value number of button
4 / 5 clicks and let X do the translation into scrolling axis, giving
us the exact same scroll wheel speed as the evdev driver.

That and for finger scroll events actually make things slower by applying
a multiplication factor  1.0 .


X has two ways for a driver to submit scroll events: buttons 4-7 or data in
a scroll valuator. Because clients may rely on either of those methods
exclusively, the server emulates the other method.

If set up, a driver defines a scroll distance. A valuator movement of that
scroll distance is equivalent to one mouse wheel click, and vice versa.
So if the driver sends a button 5 click, the server emulates a
distance motion event. If the driver sends a distance motion event, the
server emulates a button 4 click. The distance accumulates in the server, so
if you send distance/2 twice, the server will only emulate the click event
on the second event.

This is what the scroll distance does here - a movement of 15 on the
touchpad is now equivalent to a mouse wheel click. So this patch does slow
down the touchpad scrolling while leaving the mouse wheel as-is.

This is a better approach (and a smaller diff) than the button click
approach I suggested initially because it gives us some smooth scrolling on
the wheel as well. A REL_WHEEL value of 2 will now result in a single smooth
scroll event that can be used for speed calculation. Posting the button
events directly would prevent that.

Ideally we could just leave the scroll distance at 1 for devices that only
have mouse wheels but we don't know this at device init time. Hence the
default distance optimized for touchpads, then we multiply by that distance
for wheel clicks. The actual value of the scroll distance is meaningless,
it's just a reference to know how many scroll units a motion event
represents. IIRC synaptics currently uses a default of 100 and that's in
device coordinates.

So in short, this patch does what we want, it slows down touchpad scrolling
while leaving wheel scrolling as-is.


Ah thanks for the explanation. Xorg sometimes has too many levels of
indirection making things confusing...

Given the above this patch is:

Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

Hans

p.s.

We should probably create an updated Fedora package for this, and push it as
an F-22 update, making it close:
https://bugzilla.redhat.com/show_bug.cgi?id=1198467

I can take care of that if you want me to. Please let me know either way.







Cheers,
Peter




  src/libinput.c | 16 ++--
  1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/libinput.c b/src/libinput.c
index 049c15b..5e616c8 100644
--- a/src/libinput.c
+++ b/src/libinput.c
@@ -756,18 +756,22 @@ xf86libinput_handle_axis(InputInfoPtr pInfo, struct 
libinput_event_pointer *even

axis = LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL;
if (libinput_event_pointer_has_axis(event, axis)) {
-   if (source == LIBINPUT_POINTER_AXIS_SOURCE_WHEEL)
+   if (source == LIBINPUT_POINTER_AXIS_SOURCE_WHEEL) {
value = 
libinput_event_pointer_get_axis_value_discrete(event, axis);
-   else
+   value *=  driver_data-scroll_vdist;
+   } else {
value = libinput_event_pointer_get_axis_value(event, 
axis);
+   }
valuator_mask_set_double(mask, 3, value);
}
axis = LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL;
if (libinput_event_pointer_has_axis(event, axis)) {
-   if (source == LIBINPUT_POINTER_AXIS_SOURCE_WHEEL)
+   if (source == LIBINPUT_POINTER_AXIS_SOURCE_WHEEL) {
value = 
libinput_event_pointer_get_axis_value_discrete

Re: [PATCH xf86-input-libinput] Up the scroll dist value for touchpads

2015-03-04 Thread Hans de Goede

Hi,

On 04-03-15 06:00, Peter Hutterer wrote:

For source FINGER and CONTINUOUS, the axis value is the same as relative
motion - but scrolling in X usually doesn't have the same speed as finger
movement, it's a lot coarser.

We don't know ahead of time where we'll get the scroll events from. Set a
default scroll distance of 15 and multiply any wheel clicks we get by this
value.

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
---
15 is more-or-less a magic value, it feels just right on my box here


Hmm, this is somewhat different from what we discussed in our mail conversation.

First of all the problem most users are reporting and I'm seeing myself is not
that mouse wheel scrolling is too slow (which this patch seems to imply), but
rather that finger scrolling is much too fast, see e.g.:

https://bugzilla.redhat.com/show_bug.cgi?id=1198467

What I understood from our discussion on this is that the idea for
mouse wheel scrolling was to emulate discrete-value number of button
4 / 5 clicks and let X do the translation into scrolling axis, giving
us the exact same scroll wheel speed as the evdev driver.

That and for finger scroll events actually make things slower by applying
a multiplication factor  1.0 .

Regards,

Hans




  src/libinput.c | 16 ++--
  1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/libinput.c b/src/libinput.c
index 049c15b..5e616c8 100644
--- a/src/libinput.c
+++ b/src/libinput.c
@@ -756,18 +756,22 @@ xf86libinput_handle_axis(InputInfoPtr pInfo, struct 
libinput_event_pointer *even

axis = LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL;
if (libinput_event_pointer_has_axis(event, axis)) {
-   if (source == LIBINPUT_POINTER_AXIS_SOURCE_WHEEL)
+   if (source == LIBINPUT_POINTER_AXIS_SOURCE_WHEEL) {
value = 
libinput_event_pointer_get_axis_value_discrete(event, axis);
-   else
+   value *=  driver_data-scroll_vdist;
+   } else {
value = libinput_event_pointer_get_axis_value(event, 
axis);
+   }
valuator_mask_set_double(mask, 3, value);
}
axis = LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL;
if (libinput_event_pointer_has_axis(event, axis)) {
-   if (source == LIBINPUT_POINTER_AXIS_SOURCE_WHEEL)
+   if (source == LIBINPUT_POINTER_AXIS_SOURCE_WHEEL) {
value = 
libinput_event_pointer_get_axis_value_discrete(event, axis);
-   else
+   value *=  driver_data-scroll_hdist;
+   } else {
value = libinput_event_pointer_get_axis_value(event, 
axis);
+   }
valuator_mask_set_double(mask, 2, value);
}

@@ -1189,8 +1193,8 @@ xf86libinput_pre_init(InputDriverPtr drv,
if (!driver_data-valuators)
goto fail;

-   driver_data-scroll_vdist = 1;
-   driver_data-scroll_hdist = 1;
+   driver_data-scroll_vdist = 15;
+   driver_data-scroll_hdist = 15;

path = xf86SetStrOption(pInfo-options, Device, NULL);
if (!path)


___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xf86-input-libinput 1/2] Split out property init into helper functions

2015-02-26 Thread Hans de Goede

Hi,

On 26-02-15 08:07, Peter Hutterer wrote:

Makes the code less messy. Only functional change is that if one property
fails to initialize we'll now continue with the others. Previously the first
failed property would prevent any other property init.

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net


Both patches look good and are:

Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

Hans


---
  src/libinput.c | 403 +
  1 file changed, 234 insertions(+), 169 deletions(-)

diff --git a/src/libinput.c b/src/libinput.c
index be0b24d..9be17b4 100644
--- a/src/libinput.c
+++ b/src/libinput.c
@@ -1632,196 +1632,240 @@ LibinputSetProperty(DeviceIntPtr dev, Atom atom, 
XIPropertyValuePtr val,
  }

  static void
-LibinputInitProperty(DeviceIntPtr dev)
+LibinputInitTapProperty(DeviceIntPtr dev,
+   struct xf86libinput *driver_data,
+   struct libinput_device *device)
  {
-   InputInfoPtr pInfo  = dev-public.devicePrivate;
-   struct xf86libinput *driver_data = pInfo-private;
-   struct libinput_device *device = driver_data-device;
-   const char *device_node;
-   CARD32 product[2];
-   uint32_t scroll_methods;
-   uint32_t sendevent_modes;
+   BOOL tap = driver_data-options.tapping;
int rc;

-   prop_float = XIGetKnownProperty(FLOAT);
+   if (libinput_device_config_tap_get_finger_count(device) == 0)
+   return;

-   if (libinput_device_config_tap_get_finger_count(device)  0) {
-   BOOL tap = driver_data-options.tapping;
+   prop_tap = MakeAtom(LIBINPUT_PROP_TAP, strlen(LIBINPUT_PROP_TAP), TRUE);
+   rc = XIChangeDeviceProperty(dev, prop_tap, XA_INTEGER, 8,
+   PropModeReplace, 1, tap, FALSE);
+   if (rc != Success)
+   return;
+   XISetDevicePropertyDeletable(dev, prop_tap, FALSE);
+}

-   prop_tap = MakeAtom(LIBINPUT_PROP_TAP, 
strlen(LIBINPUT_PROP_TAP), TRUE);
-   rc = XIChangeDeviceProperty(dev, prop_tap, XA_INTEGER, 8,
-   PropModeReplace, 1, tap, FALSE);
-   if (rc != Success)
-   return;
-   XISetDevicePropertyDeletable(dev, prop_tap, FALSE);
-   }
+static void
+LibinputInitCalibrationProperty(DeviceIntPtr dev,
+   struct xf86libinput *driver_data,
+   struct libinput_device *device)
+{
+   float calibration[9];
+   int rc;
+
+   if (!libinput_device_config_calibration_has_matrix(device))
+   return;

/* We use a 9-element matrix just to be closer to the X server's
   transformation matrix which also has the full matrix */
-   if (libinput_device_config_calibration_has_matrix(device)) {
-   float calibration[9];
-
-   libinput_device_config_calibration_get_matrix(device, 
calibration);
-   calibration[6] = 0;
-   calibration[7] = 0;
-   calibration[8] = 1;
-
-   prop_calibration = MakeAtom(LIBINPUT_PROP_CALIBRATION,
-   strlen(LIBINPUT_PROP_CALIBRATION),
-   TRUE);
-
-   rc = XIChangeDeviceProperty(dev, prop_calibration, prop_float, 
32,
-   PropModeReplace, 9, calibration, 
FALSE);
-   if (rc != Success)
-   return;
-   XISetDevicePropertyDeletable(dev, prop_calibration, FALSE);
-   }
-
-   if (libinput_device_config_accel_is_available(device)) {
-   float speed = driver_data-options.speed;
-
-   prop_accel = MakeAtom(LIBINPUT_PROP_ACCEL, 
strlen(LIBINPUT_PROP_ACCEL), TRUE);
-   rc = XIChangeDeviceProperty(dev, prop_accel, prop_float, 32,
-   PropModeReplace, 1, speed, FALSE);
-   if (rc != Success)
-   return;
-   XISetDevicePropertyDeletable(dev, prop_accel, FALSE);
-   }
-
-   if (libinput_device_config_scroll_has_natural_scroll(device)) {
-   BOOL natural_scroll = driver_data-options.natural_scrolling;
-
-   prop_natural_scroll = MakeAtom(LIBINPUT_PROP_NATURAL_SCROLL,
-  
strlen(LIBINPUT_PROP_NATURAL_SCROLL),
-  TRUE);
-   rc = XIChangeDeviceProperty(dev, prop_natural_scroll, 
XA_INTEGER, 8,
-   PropModeReplace, 1, 
natural_scroll, FALSE);
-   if (rc != Success)
-   return;
-   XISetDevicePropertyDeletable(dev, prop_natural_scroll, FALSE);
-   }
+
+   libinput_device_config_calibration_get_matrix(device, calibration);
+   calibration[6] = 0

Re: [PATCH] Massage cpp output before passing to awk for generating sdksyms.c

2015-02-13 Thread Hans de Goede

Hi,

On 11-02-15 17:04, Alan Coopersmith wrote:

Fixes build errors when using Solaris Studio 12.4 from getting the wrong
strings (such as __attribute__) put into the sdksyms function list.

Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com


Hmm, have you seen my patch to sdksyms.sh to fix buildign with gcc5's
cpp ? It is not a very good patch, but at least it sticks to awk only,
I do not think adding sed to the mix makes things better.

What we really need is someone who knows awk to step in and help us
with both our problems and fix things properly.

So does anyone know anyone who may be able to help out with fixing
the awk stuff ?

Regards,

Hans



---
  hw/xfree86/Makefile.am |3 ++-
  hw/xfree86/sdksyms.sh  |7 ++-
  2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
index 27f2cc6..a600a75 100644
--- a/hw/xfree86/Makefile.am
+++ b/hw/xfree86/Makefile.am
@@ -135,7 +135,8 @@ CLEANFILES = sdksyms.c sdksyms.dep Xorg.sh
  EXTRA_DIST += sdksyms.sh

  sdksyms.dep sdksyms.c: sdksyms.sh
-   $(AM_V_GEN)CPP='$(CPP)' AWK='$(AWK)' $(SHELL) $(srcdir)/sdksyms.sh 
$(top_srcdir) $(CFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS)
+   $(AM_V_GEN)CPP='$(CPP)' AWK='$(AWK)' SED='$(SED)' $(SHELL) \
+$(srcdir)/sdksyms.sh $(top_srcdir) $(CFLAGS) $(AM_CFLAGS) 
$(AM_CPPFLAGS)

  SDKSYMS_DEP = sdksyms.dep
  -include $(SDKSYMS_DEP)
diff --git a/hw/xfree86/sdksyms.sh b/hw/xfree86/sdksyms.sh
index 2305073..3b9363a 100755
--- a/hw/xfree86/sdksyms.sh
+++ b/hw/xfree86/sdksyms.sh
@@ -314,7 +314,12 @@ shift
  LC_ALL=C
  export LC_ALL
  ${CPP:-cpp} $@ sdksyms.c  /dev/null || exit $?
-${CPP:-cpp} $@ sdksyms.c | ${AWK:-awk} -v topdir=$topdir '
+# Some cpps add spaces in the middle of __attribute__((visibility(...)))
+# so we need to remove them for the following awk script to work.
+${CPP:-cpp} $@ sdksyms.c | \
+${SED:-sed} -e 's/( /(/g' -e 's/_ (/_(/g' -e 's/ )/)/g' \
+-e 's/visibility (/visibility(/' | \
+${AWK:-awk} -v topdir=$topdir '
  BEGIN {
  sdk = 0;
  print(/*);


___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[PATCH] sdksyms.sh: Make sdksyms.sh work with gcc5.

2015-02-11 Thread Hans de Goede
gcc5's cpp inserts patterns like this:

extern
  __attribute__((visibility(default)))
int WaitForSomething(int *
);

This patch make sdksyms.sh work with this. Note my awk skills are weak, so
there likely is a better way to deal with this.

Signed-off-by: Hans de Goede hdego...@redhat.com
---
 hw/xfree86/sdksyms.sh | 17 +
 1 file changed, 17 insertions(+)

diff --git a/hw/xfree86/sdksyms.sh b/hw/xfree86/sdksyms.sh
index 2305073..99b0cae 100755
--- a/hw/xfree86/sdksyms.sh
+++ b/hw/xfree86/sdksyms.sh
@@ -350,6 +350,23 @@ BEGIN {
 if (sdk) {
n = 3;
 
+   # detect the following gcc5 cpp pattern and skip it:
+   # extern
+   # # 320 ../../include/os.h 3 4
+   # __attribute__((visibility(default)))
+   # # 320 ../../include/os.h
+   # Note in this case the extern  or extern void  always has
+   # a trailing space
+   if ($0 ~ ^extern.* $) {
+   getline;
+   getline;
+   getline;
+   getline;
+   n = 1;
+   while ($n ==  )
+   n++;
+   }
+
# skip attribute, if any
while ($n ~ /^(__attribute__|__global)/ ||
# skip modifiers, if any
-- 
2.1.0

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH] sdksyms.sh: Make sdksyms.sh work with gcc5.

2015-02-11 Thread Hans de Goede

Hi,

In case someone wants to do a better fix, I've put a
file already mangled by gcc5 cpp here:

https://fedorapeople.org/~jwrdegoede/sdksyms.pre

Regards,

Hans


On 11-02-15 16:39, Hans de Goede wrote:

gcc5's cpp inserts patterns like this:

extern
   __attribute__((visibility(default)))
 int WaitForSomething(int *
 );

This patch make sdksyms.sh work with this. Note my awk skills are weak, so
there likely is a better way to deal with this.

Signed-off-by: Hans de Goede hdego...@redhat.com
---
  hw/xfree86/sdksyms.sh | 17 +
  1 file changed, 17 insertions(+)

diff --git a/hw/xfree86/sdksyms.sh b/hw/xfree86/sdksyms.sh
index 2305073..99b0cae 100755
--- a/hw/xfree86/sdksyms.sh
+++ b/hw/xfree86/sdksyms.sh
@@ -350,6 +350,23 @@ BEGIN {
  if (sdk) {
n = 3;

+   # detect the following gcc5 cpp pattern and skip it:
+   # extern
+   # # 320 ../../include/os.h 3 4
+   # __attribute__((visibility(default)))
+   # # 320 ../../include/os.h
+   # Note in this case the extern  or extern void  always has
+   # a trailing space
+   if ($0 ~ ^extern.* $) {
+   getline;
+   getline;
+   getline;
+   getline;
+   n = 1;
+   while ($n ==  )
+   n++;
+   }
+
# skip attribute, if any
while ($n ~ /^(__attribute__|__global)/ ||
# skip modifiers, if any


___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: Migrating away from using cpp for startx and xinitrc in xinit

2015-02-10 Thread Hans de Goede

Hi,

On 10-02-15 08:39, Jeremy Huddleston Sequoia wrote:

It seems that using cpp for startx and xinitrc in the xinit port is coming back 
to bite us now as different C preprocessors don't exactly process non-C files 
in ways that we might want.

https://trac.macports.org/ticket/46811#comment:4

Does anyone have any strong opinions about this state of affairs and how we 
should address it?  If not, I'll mull it over for a while and try to figure 
something out.


startx is quite fragile, I think it may be best to just fix things
so that they do work with the cpp from llvm, e.g. replace the #
comments with /* ... */ comments might be all that is necessary.

Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xf86-input-libinput] Handle capability events after adding a device

2015-02-03 Thread Hans de Goede

Hi,

On 30-01-15 06:31, Peter Hutterer wrote:

Needs a temporary libinput context to get all capability events without
events from other devices interfering.

This doesn't yet handle true capability changes, only the initial burst of
events after the DEVICE_ADDED event.

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net


Hmm, this one does not give me a warm/fuzzy feeling. Are we sure that having
the capabilities of libinput events on the fly is the best way to go ?

It is the logical thing to do from a libinput pov, but it seems to put an
unnecessary burden on libinput users, we're likely going to see similar
problems in compositors. I would prefer to just solve this in libinput,
e.g. :

1) Add a heuristic to see if a device may have multiple evdev nodes representing
a single device.
2) If 1) is true, then wait for evdev nodes to show up for 0.5 seconds (or maybe
we can even know which evdev nodes to wait for) and do not give the device to
the libinput user until it is complete.

This is more work in libinput, but it seems much easier on libinput users, and
thus the right thing to do.

Regards,

Hans



---
That's based on a patchset scheduled for libinput 0.10

  src/libinput.c | 68 --
  1 file changed, 61 insertions(+), 7 deletions(-)

diff --git a/src/libinput.c b/src/libinput.c
index a24cbff..29a624c 100644
--- a/src/libinput.c
+++ b/src/libinput.c
@@ -51,6 +51,8 @@
  #define TOUCH_MAX_SLOTS 15
  #define XORG_KEYCODE_OFFSET 8

+#define AS_MASK(v) (1  v)
+
  /*
 libinput does not provide axis information for absolute devices, instead
 it scales into the screen dimensions provided. So we set up the axes with
@@ -70,6 +72,7 @@ static struct xf86libinput_driver driver_context;
  struct xf86libinput {
char *path;
struct libinput_device *device;
+   unsigned int capabilities;

int scroll_vdist;
int scroll_hdist;
@@ -600,15 +603,15 @@ xf86libinput_init(DeviceIntPtr dev)

dev-public.on = FALSE;

-   if (libinput_device_has_capability(device, 
LIBINPUT_DEVICE_CAP_KEYBOARD))
+   if (driver_data-capabilities  AS_MASK(LIBINPUT_DEVICE_CAP_KEYBOARD))
xf86libinput_init_keyboard(pInfo);
-   if (libinput_device_has_capability(device, 
LIBINPUT_DEVICE_CAP_POINTER)) {
+   if (driver_data-capabilities  AS_MASK(LIBINPUT_DEVICE_CAP_POINTER)) {
if (libinput_device_config_calibration_has_matrix(device))
xf86libinput_init_pointer_absolute(pInfo);
else
xf86libinput_init_pointer(pInfo);
}
-   if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_TOUCH))
+   if (driver_data-capabilities  AS_MASK(LIBINPUT_DEVICE_CAP_TOUCH))
xf86libinput_init_touch(pInfo);

/* unref the device now, because we'll get a new ref during
@@ -815,6 +818,8 @@ xf86libinput_handle_event(struct libinput_event *event)
case LIBINPUT_EVENT_NONE:
case LIBINPUT_EVENT_DEVICE_ADDED:
case LIBINPUT_EVENT_DEVICE_REMOVED:
+   case LIBINPUT_EVENT_DEVICE_CAPABILITY_ADDED:
+   case LIBINPUT_EVENT_DEVICE_CAPABILITY_REMOVED:
break;
case LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE:
xf86libinput_handle_absmotion(pInfo,
@@ -1117,6 +1122,49 @@ xf86libinput_parse_options(InputInfoPtr pInfo,

  }

+/* libinput sends capabilities as events after opening the device. In X we
+   need the capabilities to be done when we get to DEVICE_INIT.
+   The capability events may be intermixed with real events from other
+   devices, making handling device init a lot more complicated than it needs
+   to be. To avoid this, we create a temporary libinput context, pull the
+   capability events off the context, then ignore them in the main context.
+ */
+static int
+get_capabilities(const char *path)
+{
+   int rc = -1;
+   struct libinput *libinput = NULL;
+   struct libinput_device *device;
+   struct libinput_event *event;
+   struct libinput_event_device_capability *cap;
+
+   libinput = libinput_path_create_context(interface,
+   driver_context);
+   if (!libinput)
+   goto out;
+
+
+   device = libinput_path_add_device(libinput, path);
+   if (!device)
+   goto out;
+
+   libinput_dispatch(libinput);
+
+   rc = 0;
+   while ((event = libinput_get_event(libinput))) {
+   if (libinput_event_get_type(event) == 
LIBINPUT_EVENT_DEVICE_CAPABILITY_ADDED) {
+   cap = libinput_event_get_device_capability_event(event);
+   rc |= 
AS_MASK(libinput_event_device_capability_get_capability(cap));
+   }
+   libinput_event_destroy(event);
+   }
+
+out:
+   libinput_unref(libinput);
+
+   return rc;
+}
+
  

Re: [PATCH xf86-input-libinput] Handle capability events after adding a device

2015-02-03 Thread Hans de Goede

Hi,

On 02/03/2015 12:13 PM, Peter Hutterer wrote:

On 3/02/2015 18:29 , Hans de Goede wrote:

Hi,

On 30-01-15 06:31, Peter Hutterer wrote:

Needs a temporary libinput context to get all capability events without
events from other devices interfering.

This doesn't yet handle true capability changes, only the initial
burst of
events after the DEVICE_ADDED event.

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net


Hmm, this one does not give me a warm/fuzzy feeling. Are we sure that
having
the capabilities of libinput events on the fly is the best way to go ?

It is the logical thing to do from a libinput pov, but it seems to put an
unnecessary burden on libinput users, we're likely going to see similar
problems in compositors. I would prefer to just solve this in libinput,
e.g. :

1) Add a heuristic to see if a device may have multiple evdev nodes
representing
a single device.
2) If 1) is true, then wait for evdev nodes to show up for 0.5 seconds
(or maybe
we can even know which evdev nodes to wait for) and do not give the
device to
the libinput user until it is complete.

This is more work in libinput, but it seems much easier on libinput
users, and
thus the right thing to do.


we (Benjamin and I) did consider this at first but the big drawback is
that we then have to keep a model database of devices in libinput.
Heuristics are hard and even harder when you have to guess whether a
tablet is a Intuos 5 or an Intuos 5 Touch - without a model DB you don't
know. And the database is a big drawback: yet another layer in the stack
that needs updating for new devices.

The timeout approach could work, but was pretty much dismissed
immediately, mainly for the usual reasons: not sure how long to wait,
you can't know if/when the second device will show up, etc.

Pushing this to the caller where the device is handled semantically
seemed like the most reliable solution, even if it is more complex to
deal with.


Hmm, I'm still not 100% convinced but if you and Benjamin believe that
this is best, then this patch is:

Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Qt/KDE problems with MIT-SHM when Xorg is not running as root

2015-01-29 Thread Hans de Goede

Hi All,

A Fedora user has reported problems with MIT-SHM when the xserver
is not running as root. Normal use works fine, but when doing a
su - and then starting X apps as root MIT-SHM fails, see this
screenshot:

https://bugzilla.redhat.com/attachment.cgi?id=977933

The culprit is this error:
Xerror: BadAccess (Attempt to access private resources denied)

Which makes sense, the shm segment is created by the app running
as root, and the Xserver which is running as a normal user thus
cannot access it, so far this has never been a problem because
X was always running as root :)

I'm tempted to call this a feature rather then a bug, and declaring
this a Qt/KDE bug. I've written MIT SHM using X11 code in the past,
and always installed an error handler, and did an XSync after the
attach to check if the xshm-attach succeed, as it will also fail
when running over the network. I guess qt/kde is using some other
heuristic to determine if it is not running over a network, and
assumes that things will just work when not running over the
network, rather then doing proper error checking here.

So to me it seems that Qt/KDE should do proper error checking
here and simply fallback to a non shm path in this special case.

Still I thought I would send a mail to the xorg-devel list before
reporting this to the Qt guys, in case anyone has some clever
ideas how to make this work with the xserver running as a regular
user.

Regards,

Hans


p.s.

This is being tracked here for now:
https://bugzilla.redhat.com/show_bug.cgi?id=1185893
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: Qt/KDE problems with MIT-SHM when Xorg is not running as root

2015-01-29 Thread Hans de Goede

Hi,

On 29-01-15 10:33, Martin Gräßlin wrote:

On Thursday 29 January 2015 10:20:41 Hans de Goede wrote:

Hi All,

A Fedora user has reported problems with MIT-SHM when the xserver
is not running as root. Normal use works fine, but when doing a
su - and then starting X apps as root MIT-SHM fails, see this
screenshot:

https://bugzilla.redhat.com/attachment.cgi?id=977933

The culprit is this error:
Xerror: BadAccess (Attempt to access private resources denied)

Which makes sense, the shm segment is created by the app running
as root, and the Xserver which is running as a normal user thus
cannot access it, so far this has never been a problem because
X was always running as root :)

I'm tempted to call this a feature rather then a bug, and declaring
this a Qt/KDE bug. I've written MIT SHM using X11 code in the past,
and always installed an error handler, and did an XSync after the
attach to check if the xshm-attach succeed, as it will also fail
when running over the network. I guess qt/kde is using some other
heuristic to determine if it is not running over a network, and
assumes that things will just work when not running over the
network, rather then doing proper error checking here.

So to me it seems that Qt/KDE should do proper error checking
here and simply fallback to a non shm path in this special case.


thanks for letting me know. Sharing my personal opinion on it:
first of all I consider it an out-of-scope if one runs kcalc as root ;-) That
basically applies to all KDE applications - I do not think we support running
them on root. So breakage here is for me a feature and not a bug.


While I agree that running apps as root in general is a bad idea, I would
not go as far as saying that this breakage is desirable :)


Otherwise it's important to know which application version that is. Whether
it's Qt 4 or Qt 5. The complete interaction with X11 got rewritten for Qt 5
from scratch using XCB. From studying the code in the past I know the xshm
related code supports fallback to non-shm paths. I assume that kcalc is still
a Qt 4 based application in Fedora. If this problem is solved in Qt 5 I guess
nobody would care any more about it.


This is on Fedora 21, so KDE4 (4.14), which AFAIK means qt4.

Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH synaptics] Support the new Lenovo X1 Carbon 3rd trackpoint buttons

2015-01-29 Thread Hans de Goede

Hi,

On 29-01-15 03:00, Peter Hutterer wrote:

This device has the trackpoint buttons wired up to the touchpad to send BTN_0,
BTN_1 and BTN_2 for left, right, middle. This conflicts with previous
touchpads that used those event codes for dedicated scroll buttons.

Add an option HasTrackpointButtons that can be set via a xorg.conf.d
snippets. This option is not intended as a user-set option, rather
we expect distributions to ship some conglomerate of udev/hal rules with
xorg.conf snippets that take effect.

If the option is set, we look at the three affected buttons at the beginning
of HandleState and send button events immediately for them. The HW state is
reset to neutral and other processing continues. This saves us from having to
synchronize these buttons with software buttons (also present on this device),
tapping, etc.

Since the buttons are physically different and (mentally) associated with the
trackpoint device we also don't need to worry about having finger motion event
correctly synced up with the button presses - it's acceptable to send the
presses before the motion events.

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net


Looks good.

Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

Hans


---
  conf/50-synaptics.conf  |  7 +++
  conf/71-synaptics.rules |  9 +
  man/synaptics.man   | 14 ++
  src/synaptics.c | 42 ++
  src/synapticsstr.h  |  2 ++
  5 files changed, 74 insertions(+)
  create mode 100644 conf/71-synaptics.rules

diff --git a/conf/50-synaptics.conf b/conf/50-synaptics.conf
index aa50456..5fb131e 100644
--- a/conf/50-synaptics.conf
+++ b/conf/50-synaptics.conf
@@ -44,3 +44,10 @@ Section InputClass
  MatchDriver synaptics
  Option SoftButtonAreas 0 0 0 0 0 0 0 0
  EndSection
+
+Section InputClass
+Identifier Lenovo *50 and Carbon 3rd trackpoint buttons
+MatchDriver synaptics
+MatchTag has_trackpoint_buttons
+Option HasTrackpointButtons on
+EndSection
diff --git a/conf/71-synaptics.rules b/conf/71-synaptics.rules
new file mode 100644
index 000..b1cec40
--- /dev/null
+++ b/conf/71-synaptics.rules
@@ -0,0 +1,9 @@
+ACTION==remove, GOTO=touchpad_end
+KERNEL!=event*, GOTO=touchpad_end
+ENV{ID_INPUT_TOUCHPAD}==, GOTO=touchpad_end
+
+KERNELS==serio1, \
+ATTRS{firmware_id}==*LEN0048*, \
+ENV{ID_INPUT.tags}=has_trackpoint_buttons
+
+LABEL=touchpad_end
diff --git a/man/synaptics.man b/man/synaptics.man
index 7083b3a..65fb337 100644
--- a/man/synaptics.man
+++ b/man/synaptics.man
@@ -518,6 +518,20 @@ initialized if
  .B Option \*qHasSecondarySoftButtons\*q
  is enabled and this option is set in the __xconfigfile__(__filemansuffix__).
  .
+.TP
+.BI Option \*qHasTrackpointButtons\*q \*q boolean \*q
+This option is only available on selected devices. You should never need to
+set this option manually, your distribution should ship
+__xconfigfile__(__filemansuffix__) snippets to enable this option where
+required. Devices that require this option include the Lenovo X1 Carbon 3rd
+and the Lenovo *50 series (T450, T550, etc.).
+If enabled, the device is considered to have the trackpoint left, middle,
+right buttons wired to the touchpad. If set, this option disables scroll
+buttons, i.e.
+.B Option \*qUpDownScrolling\*q, \*qLeftRightScrolling\*q
+and the respective repeat options for scroll buttons.
+This options is considered a hardware property and is not exposed as
+configurable X Input device property.

  .SH CONFIGURATION DETAILS
  .SS Area handling
diff --git a/src/synaptics.c b/src/synaptics.c
index 955b042..07b012f 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -703,6 +703,12 @@ set_default_parameters(InputInfoPtr pInfo)
  pars-touchpad_off = xf86SetIntOption(opts, TouchpadOff, TOUCHPAD_ON);

  if (priv-has_scrollbuttons) {
+priv-has_trackpoint_buttons = xf86SetBoolOption(opts, 
HasTrackpointButtons, FALSE);
+if (priv-has_trackpoint_buttons)
+priv-has_scrollbuttons = FALSE;
+}
+
+if (priv-has_scrollbuttons) {
  pars-updown_button_scrolling =
  xf86SetBoolOption(opts, UpDownScrolling, TRUE);
  pars-leftright_button_scrolling =
@@ -1081,6 +1087,7 @@ SynapticsReset(SynapticsPrivate * priv)
  priv-mid_emu_state = MBE_OFF;
  priv-nextRepeat = 0;
  priv-lastButtons = 0;
+priv-lastTrackpointButtons = 0;
  priv-prev_z = 0;
  priv-prevFingers = 0;
  priv-num_active_touches = 0;
@@ -2779,6 +2786,34 @@ handle_clickfinger(SynapticsPrivate * priv, struct 
SynapticsHwState *hw)
  }
  }

+static void
+handle_trackpoint_buttons(const InputInfoPtr pInfo,
+  struct SynapticsHwState *hw)
+{
+SynapticsPrivate *priv = (SynapticsPrivate *) (pInfo-private);
+unsigned int buttons, change;
+int id;
+
+   buttons = (hw-multi[0] ? 0x1 : 0) |
+ (hw-multi[1] ? 0x4 : 0) |
+ (hw-multi[2] ? 0x2 : 0

Re: [PATCH xinit] startx: Don't use GNU expr extensions

2015-01-29 Thread Hans de Goede

Hi,

On 29-01-15 11:36, Mark Kettenis wrote:

Use the ':' operator instead of match and avoid the use of \+.  Both
constructions aren't specified by POSIX and not supported in BSD expr.
Also drop the '^' from the regular expressions as it is implicit and
POSIX leaves its behaviour undefined.

Signed-off-by: Mark Kettenis kette...@openbsd.org


Looks good, and I've checked that this still does what we want it to do under
Linux / bash:

Acked-by: Hans de Goede hdego...@redhat.com


---
  startx.cpp | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/startx.cpp b/startx.cpp
index 45d7bd9..ce4713f 100644
--- a/startx.cpp
+++ b/startx.cpp
@@ -193,7 +193,7 @@ if [ x$server = x ]; then
  XCOMM the startx session being seen as inactive:
  XCOMM https://bugzilla.redhat.com/show_bug.cgi?id=806491;
  tty=$(tty)
-if expr match $tty '^/dev/tty[0-9]\+$'  /dev/null; then
+if expr $tty : '/dev/tty[0-9][0-9]*$'  /dev/null; then
  tty_num=$(echo $tty | grep -oE '[0-9]+$')
  vtarg=vt$tty_num -keeptty
  fi
@@ -217,7 +217,7 @@ fi
  XCOMM if no vt is specified add vtarg (which may be empty)
  have_vtarg=no
  for i in $serverargs; do
-if expr match $i '^vt[0-9]\+$'  /dev/null; then
+if expr $i : 'vt[0-9][0-9]*$'  /dev/null; then
  have_vtarg=yes
  fi
  done



Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH] config/udev: Respect seat assignments when assigned devices

2015-01-29 Thread Hans de Goede

Hi,

On 01/29/2015 01:23 AM, Dave Airlie wrote:

From: Dave Airlie airl...@redhat.com

Jonathan Dieter posted a few patches to do this inside the Xorg
server but it makes no sense to do it there, just have the code
we use to probe the device list at startup check seat assignments
using the same code we check at hotplug time.


This patch indeed looks nicer then Jonathan's original patch:

Acked-by: Hans de Goede hdego...@redhat.com

Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH v3] Respect seat assignments when assigning drm devices to seats

2015-01-28 Thread Hans de Goede

Hi,

On 28-01-15 10:07, Jonathan Dieter wrote:

On 01/23/2015 09:50 AM, Jonathan Dieter wrote:

Dave, is this what you're looking for in moving it to config/udev.c?
I've also fixed the indentation on the #ifdefs.


Sorry if I'm being a pain, but is there anything else that I need to do with 
this patch?


I was waiting for Dave to chime in, but I guess he is busy,
v3 looks good to me and is:

Reviewed-by: Hans de Goede hdego...@redhat.com

Keith, this seems to count as a bugfix to me, can you pick this
up and add it to master ?

Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH 2/2] systemd-logind: Only use systemd-logind integration together with keeptty

2015-01-24 Thread Hans de Goede

Hi,

On 23-01-15 17:05, Ray Strode wrote:

Hi,


The fix for this is easy, we must not use systemd-logind integration when
not using KeepTty, or iow we may only use systemd-logind integration together
with KeepTty.

I think this behaviour should be documented in the man page. And maybe even
printf here that -keeptty provided, disabling systemd-logind as an Info.

Should say '-keeptty not provided, disabling systemd-logind' right?
i.e. you need both?
But I wonder if a better tact would be to just implicitly assume
-keeptty if systemd-logind
is being used?


That is not going to fly, some people don't care about X running as
root, start in runlevel 3 and want to do stuff like:

startx -- vt7

Which means X must open a new tty and take control of that tty.

I know this is not a very compelling use case, but at least from an
upstream pov we do not want to break any existing use-cases.

Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH] Respect seat assignments when assigning drm devices to server. Currently, drm devices go to whichever server can get them first.

2015-01-22 Thread Hans de Goede

Hi,

On 21-01-15 18:21, Jonathan Dieter wrote:

See https://bugzilla.redhat.com/show_bug.cgi?id=1183654

Signed-off-by: Jonathan Dieter jdie...@lesbg.com


Thanks looks good now:

Reviewed-by: Hans de Goede hdego...@redhat.com

Keith can you pick this up, or do you want me to prepare a tree and send
a pull-req for this ?

Regards,

Hans


---
  hw/xfree86/os-support/linux/lnx_platform.c | 39 ++
  1 file changed, 39 insertions(+)

diff --git a/hw/xfree86/os-support/linux/lnx_platform.c 
b/hw/xfree86/os-support/linux/lnx_platform.c
index 1d145b3..59f1083 100644
--- a/hw/xfree86/os-support/linux/lnx_platform.c
+++ b/hw/xfree86/os-support/linux/lnx_platform.c
@@ -20,6 +20,10 @@
  #include hotplug.h
  #include systemd-logind.h

+#ifdef CONFIG_UDEV_KMS
+#include libudev.h
+#endif
+
  static Bool
  get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index)
  {
@@ -161,6 +165,41 @@ xf86PlatformDeviceProbe(struct OdevAttributes *attribs)
  if (i != xf86_num_platform_devices)
  goto out_free;

+#ifdef CONFIG_UDEV_KMS
+{
+struct udev_device *udev_device;
+const char *dev_seat;
+char *syspath = NULL;
+struct udev *udev;
+
+udev = udev_new();
+if (!udev)
+goto out_free;
+
+syspath = config_odev_get_attribute(attribs, ODEV_ATTRIB_SYSPATH);
+
+udev_device = udev_device_new_from_syspath(udev, syspath);
+if (!udev_device) {
+udev_unref(udev);
+goto out_free;
+}
+
+dev_seat = udev_device_get_property_value(udev_device, ID_SEAT);
+if (!dev_seat)
+dev_seat = seat0;
+
+if ((SeatId  strcmp(dev_seat, SeatId)) ||
+(!SeatId  strcmp(dev_seat, seat0))) {
+LogMessage(X_INFO, xfree86: Not adding drm device (%s) as it's 
assigned to seat: %s\n, path, dev_seat);
+udev_unref(udev);
+udev_device_unref(udev_device);
+goto out_free;
+}
+
+udev_unref(udev);
+udev_device_unref(udev_device);
+}
+#endif
  LogMessage(X_INFO, xfree86: Adding drm device (%s)\n, path);

  if (!xf86VTOwner()) {


___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH] Respect seat assignments when assigning drm devices to server

2015-01-21 Thread Hans de Goede

Hi,

On 19-01-15 16:02, Jonathan Dieter wrote:

Currently xorg ignores the seat assignments for drm devices because the devices 
are initialized earlier in the code.  Depending on race conditions, the first X 
server will get more than one of the drm devices, which breaks multiseat 
systems.

This patch fixes that by rejecting drm devices that haven't been assigned to 
our seat.  The code has been mostly taken from config/udev.c and modified.

This patch is against HEAD, but also applies cleanly and has been tested 
against 1.16.2.901.


Thanks for the patch, I've one minor comment:

Can you please rewrite this bit:

+if (SeatId  strcmp(dev_seat, SeatId)) {
+LogMessage(X_INFO, xfree86: Not adding drm device (%s): Wrong seat: 
%s\n, path, dev_seat);
+udev_unref(udev);
+udev_device_unref(udev_device);
+goto out_free;
+}
+
+if (!SeatId  strcmp(dev_seat, seat0)) {
+LogMessage(X_INFO, xfree86: Not adding drm device (%s): Wrong seat: 
%s\n, path, dev_seat);
+udev_unref(udev);
+udev_device_unref(udev_device);
+goto out_free;
+}

as:

+if ((SeatId  strcmp(dev_seat, SeatId)) ||
+(!SeatId  strcmp(dev_seat, seat0))) {
+LogMessage(X_INFO, xfree86: Not adding drm device (%s): Wrong seat: 
%s\n, path, dev_seat);
+udev_unref(udev);
+udev_device_unref(udev_device);
+goto out_free;
+}

And then post a v2.

Regards,

Hans

p.s.

It is easier for reviewers if you send patches inline, git send-email does this 
properly for you.
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH:libXt 1/5] If CFLAGS_FOR_BUILD is not set, include CWARNFLAGS in default value

2015-01-21 Thread Hans de Goede

Hi,

The entire set looks good to me and is:

Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

Hans


On 19-01-15 19:41, Alan Coopersmith wrote:

Help catch errors like missing prototypes in makestrs sooner.

Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com
---
  configure.ac |3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 1f95a5c..34e6aab 100644
--- a/configure.ac
+++ b/configure.ac
@@ -66,7 +66,8 @@ fi
  AC_SUBST([CC_FOR_BUILD])
  CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD-${CPPFLAGS}}
  AC_SUBST(CPPFLAGS_FOR_BUILD)
-CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}}
+DEFAULT_CFLAGS_FOR_BUILD=${CFLAGS} ${CWARNFLAGS}
+CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${DEFAULT_CFLAGS_FOR_BUILD}}
  AC_SUBST(CFLAGS_FOR_BUILD)
  LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-${LDFLAGS}}
  AC_SUBST(LDFLAGS_FOR_BUILD)


___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[PATCH 1/2] linux: Add linux_get_vtno and linux_get_keeptty helpers

2015-01-21 Thread Hans de Goede
systemd-logind integration does not work when starting X on a new tty, as
that detaches X from the current session and after hat systemd-logind revokes
all rights any already open fds and refuses to open new fds for X.

This means that currently e.g. startx -- vt7 breaks, and breaks badly,
requiring ssh access to the system to kill X.

The fix for this is easy, we must not use systemd-logind integration when
not using KeepTty, or iow we may only use systemd-logind integration together
with KeepTty.

But the final KeepTty value is not known until the code to chose which vtno to
run on has been called, which currently happens after intializing
systemd-logind.

This commit is step 1 in fixing the startx -- vt7 breakage, it factors out
the linux xf86OpenConsole bits which set xf86Info.vtno and keepTty so that
these can be called earlier. Calling this earlier is safe as this code has
no side effects other then setting xf86Info.vtno and keepTty.

Note this basically only moves a large chunk of xf86OpenConsole() into
linux_get_vtno() without changing a single line of it, this is hard to see
in the diff because the identation level has changed.

Signed-off-by: Hans de Goede hdego...@redhat.com
---
 hw/xfree86/os-support/linux/linux.h|  32 +
 hw/xfree86/os-support/linux/lnx_init.c | 117 +++--
 2 files changed, 99 insertions(+), 50 deletions(-)
 create mode 100644 hw/xfree86/os-support/linux/linux.h

diff --git a/hw/xfree86/os-support/linux/linux.h 
b/hw/xfree86/os-support/linux/linux.h
new file mode 100644
index 000..9613148
--- /dev/null
+++ b/hw/xfree86/os-support/linux/linux.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright © 2015 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the Software),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Author: Hans de Goede hdego...@redhat.com
+ */
+
+#ifndef XF86_LINUX_H
+#define XF86_LINUX_H
+
+void linux_get_vtno(void);
+int linux_get_keeptty(void);
+
+#endif
diff --git a/hw/xfree86/os-support/linux/lnx_init.c 
b/hw/xfree86/os-support/linux/lnx_init.c
index 9485307..a6e9ac1 100644
--- a/hw/xfree86/os-support/linux/lnx_init.c
+++ b/hw/xfree86/os-support/linux/lnx_init.c
@@ -31,6 +31,7 @@
 #include X11/Xmd.h
 
 #include compiler.h
+#include linux.h
 
 #include xf86.h
 #include xf86Priv.h
@@ -80,71 +81,87 @@ switch_to(int vt, const char *from)
 #pragma GCC diagnostic ignored -Wformat-nonliteral
 
 void
-xf86OpenConsole(void)
+linux_get_vtno(void)
 {
 int i, fd = -1, ret, current_vt = -1;
-struct vt_mode VT;
 struct vt_stat vts;
 struct stat st;
 MessageType from = X_PROBED;
 const char *tty0[] = { /dev/tty0, /dev/vc/0, NULL };
-const char *vcs[] = { /dev/vc/%d, /dev/tty%d, NULL };
 
-if (serverGeneration == 1) {
-/*
- * setup the virtual terminal manager
- */
-if (xf86Info.vtno != -1) {
-from = X_CMDLINE;
-}
-else {
+/*
+ * setup the virtual terminal manager
+ */
+if (xf86Info.vtno != -1) {
+from = X_CMDLINE;
+}
+else {
 
-i = 0;
-while (tty0[i] != NULL) {
-if ((fd = open(tty0[i], O_WRONLY, 0)) = 0)
-break;
-i++;
-}
+i = 0;
+while (tty0[i] != NULL) {
+if ((fd = open(tty0[i], O_WRONLY, 0)) = 0)
+break;
+i++;
+}
 
-if (fd  0)
-FatalError(xf86OpenConsole: Cannot open /dev/tty0 (%s)\n,
-   strerror(errno));
+if (fd  0)
+FatalError(xf86OpenConsole: Cannot open /dev/tty0 (%s)\n,
+   strerror(errno));
 
-if (xf86Info.ShareVTs) {
-SYSCALL(ret = ioctl(fd, VT_GETSTATE, vts));
-if (ret  0)
-FatalError(xf86OpenConsole: Cannot find the current
-VT (%s)\n, strerror(errno

[PATCH 2/2] systemd-logind: Only use systemd-logind integration together with keeptty

2015-01-21 Thread Hans de Goede
systemd-logind integration does not work when starting X on a new tty, as
that detaches X from the current session and after hat systemd-logind revokes
all rights any already open fds and refuses to open new fds for X.

This means that currently e.g. startx -- vt7 breaks, and breaks badly,
requiring ssh access to the system to kill X.

The fix for this is easy, we must not use systemd-logind integration when
not using KeepTty, or iow we may only use systemd-logind integration together
with KeepTty.

Signed-off-by: Hans de Goede hdego...@redhat.com
---
 hw/xfree86/os-support/linux/systemd-logind.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/hw/xfree86/os-support/linux/systemd-logind.c 
b/hw/xfree86/os-support/linux/systemd-logind.c
index 49758f4..b061877 100644
--- a/hw/xfree86/os-support/linux/systemd-logind.c
+++ b/hw/xfree86/os-support/linux/systemd-logind.c
@@ -34,6 +34,7 @@
 
 #include os.h
 #include dbus-core.h
+#include linux.h
 #include xf86.h
 #include xf86platformBus.h
 #include xf86Xinput.h
@@ -595,6 +596,12 @@ static struct dbus_core_hook core_hook = {
 int
 systemd_logind_init(void)
 {
+/* get vtno now as it may change keeptty */
+linux_get_vtno();
+/* systemd_logind integration requires keeptty */
+if (!linux_get_keeptty())
+return 1;
+
 return dbus_core_add_hook(core_hook);
 }
 
-- 
2.1.0

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xinit] startx: Pass -keeptty when telling the server to start on the current tty

2015-01-20 Thread Hans de Goede
Detaching from the tty causes systemd-logind to refuse service to the xserver,
the xserver already tries to detect that it is being asked to run on the
current tty and then automatically enables -keeptty, but this code fails if
all of stdin, stdout and stderr are redirected to a file. So explicitly tell
the xserver to not detach when we're telling it to run on the current tty.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1177513
Signed-off-by: Hans de Goede hdego...@redhat.com
---
 startx.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/startx.cpp b/startx.cpp
index 1c6fce0..45d7bd9 100644
--- a/startx.cpp
+++ b/startx.cpp
@@ -195,7 +195,7 @@ if [ x$server = x ]; then
 tty=$(tty)
 if expr match $tty '^/dev/tty[0-9]\+$'  /dev/null; then
 tty_num=$(echo $tty | grep -oE '[0-9]+$')
-vtarg=vt$tty_num
+vtarg=vt$tty_num -keeptty
 fi
 #endif
 
-- 
2.1.0

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH:transset] Only use property pointer if XGetWindowProperty returns success

2015-01-05 Thread Hans de Goede

Hi,

On 03-01-15 23:29, Alan Coopersmith wrote:

In Xlib versions prior to 1.6, if XGetWindowProperty returns a failure,
it didn't always set the property pointer to NULL, and could leave it
uninitialized.

Reported by Oracle Parfait 1.5.1:
Error: Uninitialised memory (CWE 456)
Possible access to uninitialised memory 'data'
 at line 298 of transSet.c in function 'main'.
   data allocated at line 154.
 at line 299 of transSet.c in function 'main'.
   data allocated at line 154.
 at line 300 of transSet.c in function 'main'.
   data allocated at line 154.

Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com


Looks good:

Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

Hans


---
  transSet.c |9 -
  1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/transSet.c b/transSet.c
index 9938e79..04c40e4 100644
--- a/transSet.c
+++ b/transSet.c
@@ -291,11 +291,10 @@ main (int argc, char **argv)
  }

  /* get property */
-XGetWindowProperty (dpy, target_win, XInternAtom (dpy, OPACITY, False),
-0L, 1L, False, XA_CARDINAL, actual, format, n, 
left,
-(unsigned char **) data);
-
-if (data != None) {
+if ((XGetWindowProperty (dpy, target_win, XInternAtom (dpy, OPACITY, 
False),
+ 0L, 1L, False, XA_CARDINAL, actual, format, n,
+ left, data) == Success)
+ (data != None)) {
  memcpy (current_opacity, data, sizeof (unsigned int));
  XFree ((void *) data);
  if (flag_verbose)


___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH:xcmsdb] Only use results from GetWindowProperty if it returned Success

2015-01-05 Thread Hans de Goede

Hi,

On 04-01-15 00:00, Alan Coopersmith wrote:

Since Xlib prior to 1.6 didn't always clear values on failure, don't
assume they're safe to use unless we succeeded.

Reported by Oracle Parfait 1.5.1:
Error: Uninitialised memory
Uninitialised memory variable (CWE 457): Possible access to uninitialised 
memory variable 'ret_format'
 at line 743 of app/xcmsdb/xcmsdb.c in function 'RemoveSCCData'.
   ret_format allocated at line 733.
 at line 757 of app/xcmsdb/xcmsdb.c in function 'RemoveSCCData'.
   ret_format allocated at line 733.
Uninitialised memory variable (CWE 457): Possible access to uninitialised 
memory variable 'ret_prop'
 at line 748 of app/xcmsdb/xcmsdb.c in function 'RemoveSCCData'.
   ret_prop allocated at line 731.
 at line 762 of app/xcmsdb/xcmsdb.c in function 'RemoveSCCData'.
   ret_prop allocated at line 731.

Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com


Looks good:

Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

Hans


---
  xcmsdb.c |   26 +-
  1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/xcmsdb.c b/xcmsdb.c
index ab5cb66..68b083b 100644
--- a/xcmsdb.c
+++ b/xcmsdb.c
@@ -730,17 +730,17 @@ RemoveSCCData(Display *dpy, Window root, int colorFlag)
  {
  unsigned char *ret_prop;
  unsigned long ret_len, ret_after;
-int  ret_format;
+int  ret_format, status = -1;
  Atom MatricesAtom, CorrectAtom, ret_atom;

  if (colorFlag != 0) {
MatricesAtom = ParseAtom (dpy, XDCCC_MATRIX_ATOM_NAME, True);
if (MatricesAtom != None) {
-   XGetWindowProperty (dpy, root, MatricesAtom, 0, 8192, False,
-   XA_INTEGER, ret_atom, ret_format, ret_len,
+   status = XGetWindowProperty (dpy, root, MatricesAtom, 0, 8192,
+   False, XA_INTEGER, ret_atom, ret_format, ret_len,
ret_after, ret_prop);
}
-   if (MatricesAtom == None || !ret_format) {
+   if (MatricesAtom == None || status != Success || !ret_format) {
printf (Could not find property %s\n, XDCCC_MATRIX_ATOM_NAME);
} else {
printf (Deleting property %s\n, XDCCC_MATRIX_ATOM_NAME);
@@ -750,11 +750,11 @@ RemoveSCCData(Display *dpy, Window root, int colorFlag)

CorrectAtom = XInternAtom (dpy, XDCCC_CORRECT_ATOM_NAME, True);
if (CorrectAtom != None) {
-   XGetWindowProperty (dpy, root, CorrectAtom, 0, 8192, False,
-   XA_INTEGER, ret_atom, ret_format, ret_len,
+   status = XGetWindowProperty (dpy, root, CorrectAtom, 0, 8192,
+   False, XA_INTEGER, ret_atom, ret_format, ret_len,
ret_after, ret_prop);
}
-   if (CorrectAtom == None || !ret_format) {
+   if (CorrectAtom == None || status != Success || !ret_format) {
printf (Could not find property %s\n, XDCCC_CORRECT_ATOM_NAME);
} else {
printf (Deleting property %s\n, XDCCC_CORRECT_ATOM_NAME);
@@ -766,11 +766,11 @@ RemoveSCCData(Display *dpy, Window root, int colorFlag)
  if (colorFlag != 1) {
MatricesAtom = ParseAtom (dpy, XDCCC_SCREENWHITEPT_ATOM_NAME, True);
if (MatricesAtom != None) {
-   XGetWindowProperty (dpy, root, MatricesAtom, 0, 8192, False,
-   XA_INTEGER, ret_atom, ret_format, ret_len,
+   status = XGetWindowProperty (dpy, root, MatricesAtom, 0, 8192,
+   False, XA_INTEGER, ret_atom, ret_format, ret_len,
ret_after, ret_prop);
}
-   if (MatricesAtom == None || !ret_format) {
+   if (MatricesAtom == None || status != Success || !ret_format) {
printf (Could not find property %s\n, 
XDCCC_SCREENWHITEPT_ATOM_NAME);
} else {
printf (Deleting property %s\n, XDCCC_SCREENWHITEPT_ATOM_NAME);
@@ -780,11 +780,11 @@ RemoveSCCData(Display *dpy, Window root, int colorFlag)

CorrectAtom = XInternAtom (dpy, XDCCC_GRAY_CORRECT_ATOM_NAME, True);
if (CorrectAtom != None) {
-   XGetWindowProperty (dpy, root, CorrectAtom, 0, 8192, False,
-   XA_INTEGER, ret_atom, ret_format, ret_len,
+   status = XGetWindowProperty (dpy, root, CorrectAtom, 0, 8192,
+   False, XA_INTEGER, ret_atom, ret_format, ret_len,
ret_after, ret_prop);
}
-   if (CorrectAtom == None || !ret_format) {
+   if (CorrectAtom == None || status != Success || !ret_format) {
printf (Could not find property %s\n, 
XDCCC_GRAY_CORRECT_ATOM_NAME);
} else {
printf (Deleting property %s\n, XDCCC_GRAY_CORRECT_ATOM_NAME);


___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH:xsetroot] Only use results from GetWindowProperty if it returned success

2015-01-05 Thread Hans de Goede

Hi,

On 03-01-15 23:30, Alan Coopersmith wrote:

Since Xlib prior to 1.6 didn't always clear values on failure, don't
assume they're safe to use unless we succeeded.

Reported by Oracle Parfait 1.5.1:
Error: Uninitialised memory (CWE 456)
Possible access to uninitialised memory 'after'
 at line 328 of xsetroot.c in function 'FixupState'.
   after allocated at line 317.
Possible access to uninitialised memory 'data'
 at line 330 of xsetroot.c in function 'FixupState'.
   data allocated at line 318.
Possible access to uninitialised memory 'format'
 at line 328 of xsetroot.c in function 'FixupState'.
   format allocated at line 316.
Possible access to uninitialised memory 'length'
 at line 328 of xsetroot.c in function 'FixupState'.
   length allocated at line 317.
Possible access to uninitialised memory 'type'
 at line 328 of xsetroot.c in function 'FixupState'.
   type allocated at line 315.
 at line 331 of xsetroot.c in function 'FixupState'.
   type allocated at line 315.

Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com


Looks good:

Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

Hans


---
  xsetroot.c |   11 +++
  1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/xsetroot.c b/xsetroot.c
index 56ce741..5f142e1 100644
--- a/xsetroot.c
+++ b/xsetroot.c
@@ -331,10 +331,13 @@ FixupState(void)
return;
  prop = XInternAtom(dpy, _XSETROOT_ID, False);
  if (unsave_past) {
-   (void)XGetWindowProperty(dpy, root, prop, 0L, 1L, True, AnyPropertyType,
-type, format, length, after, data);
-   if ((type == XA_PIXMAP)  (format == 32) 
-   (length == 1)  (after == 0))
+   if (XGetWindowProperty(dpy, root, prop, 0L, 1L, True, AnyPropertyType,
+  type, format, length, after, data) != Success)
+   fprintf(stderr,
+   %s: warning: cannot get _XSETROOT_ID property from root 
window\n,
+   program_name);
+   else if ((type == XA_PIXMAP)  (format == 32) 
+(length == 1)  (after == 0))
XKillClient(dpy, *((Pixmap *)data));
else if (type != None)
fprintf(stderr, %s: warning: _XSETROOT_ID property is garbage\n,


___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: xfree86: rename Xorg.bin to Xorg

2014-12-29 Thread Hans de Goede

Hi,

On 16-12-14 05:19, Peter Hutterer wrote:

If the suid wrapper is enabled, /usr/bin/Xorg is just a shell script that
execs either /usr/libexec/Xorg.bin directly or the Xorg.wrap binary which then
execve's /usr/libexec/Xorg.bin.

Either way, we end up with Xorg.bin, which is problematic for two reasons:
* ps shows the command as Xorg.bin
* _COMM and _EXE in systemd's journal will both show Xorg.bin as well

There's not much we can do about the path, but having the actual command stay
as Xorg means better compatibility to existing scripts. And, the reason for
this patch: the command
journalctl _COMM=Xorg
works universally, regardless of whether the wrapper is used or not.

CC: Hans de Goede hdego...@redhat.com
Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
Reviewed-by: Keith Packard kei...@keithp.com


Looks good:

Acked-by: Hans de Goede hdego...@redhat.com

Regards,

Hans




---
configure.ac | 2 +-
  hw/xfree86/Makefile.am   | 2 +-
  hw/xfree86/Xorg.sh.in| 4 ++--
  hw/xfree86/man/Xorg.wrap.man | 2 +-
  hw/xfree86/xorg-wrapper.c| 6 +++---
  5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/configure.ac b/configure.ac
index 96524c5..b593fc7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -923,7 +923,7 @@ if test x$SUID_WRAPPER = xyes; then
  PKG_CHECK_MODULES([LIBDRM], $LIBDRM)
  dnl This is a define so that if some platforms want to put the wrapper
  dnl somewhere else this can be easily changed
-AC_DEFINE_DIR(SUID_WRAPPER_DIR, libexecdir, [Where to install Xorg.bin 
and Xorg.wrap])
+AC_DEFINE_DIR(SUID_WRAPPER_DIR, libexecdir, [Where to install the Xorg 
binary and Xorg.wrap])
  SETUID=no
  fi
  AM_CONDITIONAL(SUID_WRAPPER, [test x$SUID_WRAPPER = xyes])
diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
index d46bf0a..27f2cc6 100644
--- a/hw/xfree86/Makefile.am
+++ b/hw/xfree86/Makefile.am
@@ -106,7 +106,7 @@ if INSTALL_SETUID
  endif
  if SUID_WRAPPER
$(MKDIR_P) $(DESTDIR)$(SUID_WRAPPER_DIR)
-   mv $(DESTDIR)$(bindir)/Xorg $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.bin
+   mv $(DESTDIR)$(bindir)/Xorg $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg
${INSTALL} -m 755 Xorg.sh $(DESTDIR)$(bindir)/Xorg
-chown root $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap  chmod u+s 
$(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap
  endif
diff --git a/hw/xfree86/Xorg.sh.in b/hw/xfree86/Xorg.sh.in
index cef4859..4814135 100644
--- a/hw/xfree86/Xorg.sh.in
+++ b/hw/xfree86/Xorg.sh.in
@@ -1,11 +1,11 @@
  #!/bin/sh
  #
-# Execute Xorg.wrap if it exists otherwise execute Xorg.bin directly.
+# Execute Xorg.wrap if it exists otherwise execute Xorg directly.
  # This allows distros to put the suid wrapper in a separate package.

  basedir=@SUID_WRAPPER_DIR@
  if [ -x $basedir/Xorg.wrap ]; then
exec $basedir/Xorg.wrap $@
  else
-   exec $basedir/Xorg.bin $@
+   exec $basedir/Xorg $@
  fi
diff --git a/hw/xfree86/man/Xorg.wrap.man b/hw/xfree86/man/Xorg.wrap.man
index 58937c7..11090f1 100644
--- a/hw/xfree86/man/Xorg.wrap.man
+++ b/hw/xfree86/man/Xorg.wrap.man
@@ -33,7 +33,7 @@ Xorg.wrap \- Xorg X server binary wrapper
  The Xorg X server may need root rights to function properly. To start the
  Xorg X server with these rights your system is using a suid root wrapper
  installed as __suid_wrapper_dir__/Xorg.wrap which will execute the real
-X server which is installed as __suid_wrapper_dir__/Xorg.bin .
+X server which is installed as __suid_wrapper_dir__/Xorg.
  .PP
  By default Xorg.wrap will autodetect if root rights are necessary, and
  if not it will drop its elevated rights before starting the real X server.
diff --git a/hw/xfree86/xorg-wrapper.c b/hw/xfree86/xorg-wrapper.c
index 4ea4733..9ae8dec 100644
--- a/hw/xfree86/xorg-wrapper.c
+++ b/hw/xfree86/xorg-wrapper.c
@@ -255,18 +255,18 @@ int main(int argc, char *argv[])
  }
  }

-snprintf(buf, sizeof(buf), %s/Xorg.bin, SUID_WRAPPER_DIR);
+snprintf(buf, sizeof(buf), %s/Xorg, SUID_WRAPPER_DIR);

  /* Check if the server is executable by our real uid */
  if (access(buf, X_OK) != 0) {
-fprintf(stderr, %s: Missing execute permissions for %s/Xorg.bin: 
%s\n,
+fprintf(stderr, %s: Missing execute permissions for %s/Xorg: %s\n,
  progname, SUID_WRAPPER_DIR, strerror(errno));
  exit(1);
  }

  argv[0] = buf;
  (void) execv(argv[0], argv);
-fprintf(stderr, %s: Failed to execute %s/Xorg.bin: %s\n,
+fprintf(stderr, %s: Failed to execute %s/Xorg: %s\n,
  progname, SUID_WRAPPER_DIR, strerror(errno));
  exit(1);
  }


___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH] xfree86: rename Xorg.bin to Xorg

2014-12-29 Thread Hans de Goede

Hi,

On 29-12-14 00:57, Peter Hutterer wrote:

On Thu, Dec 25, 2014 at 02:21:04PM -0800, Keith Packard wrote:

Peter Hutterer peter.hutte...@who-t.net writes:


true, both changed locally


Did I miss a patch/pull request with this change included?


Haven't sent one yet, I wanted to wait for Hans' ack/nak on this,


Ah, I did not know that, I thought that Keith's review would be
enough. You've my ack (I've also replied to the original posting
of the patch).

Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xf86-input-libinput] Support server-side fds

2014-12-08 Thread Hans de Goede

Hi,

On 07-12-14 23:42, Peter Hutterer wrote:

On Fri, Dec 05, 2014 at 02:21:15PM +0100, Hans de Goede wrote:

Hi Peter,

Thanks for working on this!

On 12/02/2014 06:01 AM, Peter Hutterer wrote:

libinput's device handling and server-side fd handling are a bit of a
mismatch, so this is hackier than one would hope for.

The server sets pInfo-fd and the options fd and device.
The server requires pInfo-fd to be the one triggering select(2) to call the
correct pInfo-read_input. We can't pass an fd to use into libinput, all we
have is the open_restricted callback. That callback gives us the context, but
not the pInfo with the fd we want.

The solution:
1) In PreInit, store the patch + fd combination in a driver-wide list. Search
that list for an fd in open_restricted, return the pre-openend fd.

2) Overwrite all devices' pInfo-fd with the libinput epollfd. In this driver
we don't care about which device read_input is called on, we get the correct
pInfo to post events from through the struct libinput_device of the libinput
events.

3) When a device is closed, swap the real fd back in so systemd-logind closes 
the
right fd.

This saves us worrying about keeping the right refcount on who currently has
the fd set to the libinput fd. We just set it for all devices, let the server
figure out which device to call (the first in inputInfo.devices) and we only
need to remember to swap it back during DEVICE_OFF.

If the server calls close on a pInfo-fd without telling the driver, that's a
bug anyway.


I've gone over this all twice, and I cannot find a fault in it, nor think of
a better way. I do have one small nitpick, as it currently stands this patch
adds an unchecked calloc as well as an unchecked strdup (both in fd_push), 
please
fix that. I'm fine with just using the xnf variants (assuming those are exported
to drivers). With that fixed this is:

Reviewed-by: Hans de Goede hdego...@redhat.com


amended, thanks.

AFAICT the only way to fix this fd mess is by having a libinput API that
takes an fd in the path backend.


Yes, I was thinking the same thing, but even then we would still need to swap
the server provided fd in pInfo with the epoll fd, which actually is the 
ugliest /
hairiest bit. So I agree this is not worth the trouble.

Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xf86-input-libinput] Support server-side fds

2014-12-05 Thread Hans de Goede

Hi Peter,

Thanks for working on this!

On 12/02/2014 06:01 AM, Peter Hutterer wrote:

libinput's device handling and server-side fd handling are a bit of a
mismatch, so this is hackier than one would hope for.

The server sets pInfo-fd and the options fd and device.
The server requires pInfo-fd to be the one triggering select(2) to call the
correct pInfo-read_input. We can't pass an fd to use into libinput, all we
have is the open_restricted callback. That callback gives us the context, but
not the pInfo with the fd we want.

The solution:
1) In PreInit, store the patch + fd combination in a driver-wide list. Search
that list for an fd in open_restricted, return the pre-openend fd.

2) Overwrite all devices' pInfo-fd with the libinput epollfd. In this driver
we don't care about which device read_input is called on, we get the correct
pInfo to post events from through the struct libinput_device of the libinput
events.

3) When a device is closed, swap the real fd back in so systemd-logind closes 
the
right fd.

This saves us worrying about keeping the right refcount on who currently has
the fd set to the libinput fd. We just set it for all devices, let the server
figure out which device to call (the first in inputInfo.devices) and we only
need to remember to swap it back during DEVICE_OFF.

If the server calls close on a pInfo-fd without telling the driver, that's a
bug anyway.


I've gone over this all twice, and I cannot find a fault in it, nor think of
a better way. I do have one small nitpick, as it currently stands this patch
adds an unchecked calloc as well as an unchecked strdup (both in fd_push), 
please
fix that. I'm fine with just using the xnf variants (assuming those are exported
to drivers). With that fixed this is:

Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

Hans



This patch also drops the pInfo-fd = -1 calls, they've been unnecessary since
at least 1.11, possibly earlier.

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
---
  src/libinput.c | 126 ++---
  1 file changed, 121 insertions(+), 5 deletions(-)

diff --git a/src/libinput.c b/src/libinput.c
index 04681e9..e00a428 100644
--- a/src/libinput.c
+++ b/src/libinput.c
@@ -31,6 +31,7 @@
  #include time.h
  #include unistd.h
  #include xorg-server.h
+#include list.h
  #include exevents.h
  #include xkbsrv.h
  #include xf86Xinput.h
@@ -40,6 +41,10 @@

  #include X11/Xatom.h

+#ifndef XI86_SERVER_FD
+#define XI86_SERVER_FD 0x20
+#endif
+
  #define TOUCHPAD_NUM_AXES 4 /* x, y, hscroll, vscroll */
  #define TOUCH_MAX_SLOTS 15
  #define XORG_KEYCODE_OFFSET 8
@@ -61,6 +66,7 @@
  struct xf86libinput_driver {
struct libinput *libinput;
int device_enabled_count;
+   struct xorg_list server_fds;
  };

  static struct xf86libinput_driver driver_context;
@@ -95,6 +101,80 @@ struct xf86libinput {
} options;
  };

+/*
+   libinput provides a userdata for the context, but not per path device. so
+   the open_restricted call has the libinput context, but no reference to
+   the pInfo-fd that we actually need to return.
+   To avoid this, we store each path/fd combination during pre_init in the
+   context, then return that during open_restricted. If a device is added
+   twice with two different fds this may give us the wrong fd but why are
+   you doing that anyway.
+ */
+struct serverfd {
+   struct xorg_list node;
+   int fd;
+   char *path;
+};
+
+static inline int
+use_server_fd(const InputInfoPtr pInfo) {
+   return pInfo-fd  -1  (pInfo-flags  XI86_SERVER_FD);
+}
+
+static inline void
+fd_push(struct xf86libinput_driver *context,
+   int fd,
+   const char *path)
+{
+   struct serverfd *sfd = calloc(1, sizeof(*sfd));
+
+   sfd-fd = fd;
+   sfd-path = strdup(path);
+   xorg_list_add(sfd-node, context-server_fds);
+}
+
+static inline int
+fd_get(struct xf86libinput_driver *context,
+   const char *path)
+{
+   struct serverfd *sfd;
+
+   xorg_list_for_each_entry(sfd, context-server_fds, node) {
+   if (strcmp(path, sfd-path) == 0)
+   return sfd-fd;
+   }
+
+   return -1;
+}
+
+static inline void
+fd_pop(struct xf86libinput_driver *context, int fd)
+{
+   struct serverfd *sfd;
+
+   xorg_list_for_each_entry(sfd, context-server_fds, node) {
+   if (fd != sfd-fd)
+   continue;
+
+   xorg_list_del(sfd-node);
+   free(sfd-path);
+   free(sfd);
+   break;
+   }
+}
+
+static inline int
+fd_find(struct xf86libinput_driver *context, int fd)
+{
+   struct serverfd *sfd;
+
+   xorg_list_for_each_entry(sfd, context-server_fds, node) {
+   if (fd == sfd-fd)
+   return fd;
+   }
+   return -1;
+}
+
  static inline unsigned int
  btn_linux2xorg(unsigned int b)
  {
@@ -222,13 +302,24 @@ xf86libinput_on(DeviceIntPtr dev)
struct

Re: [PATCH:libXaw 1/2] Use autoconf HAVE_UNISTD_H instead of imake X_NOT_POSIX to find unistd.h

2014-11-06 Thread Hans de Goede
Hi,

Series looks good and is:

Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

Hans


On 11/06/2014 03:05 AM, Alan Coopersmith wrote:
 Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com
 ---
  src/OS.c |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/src/OS.c b/src/OS.c
 index 8bc23dd..4c69005 100644
 --- a/src/OS.c
 +++ b/src/OS.c
 @@ -7,7 +7,7 @@
  #include X11/IntrinsicP.h
  #include Private.h
  
 -#ifndef X_NOT_POSIX
 +#ifdef HAVE_UNISTD_H
  #include unistd.h  /* for sysconf(), and getpagesize() */
  #endif
  
 
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH:libXaw3d] Just use C89 size_t instead of rolling our own Size_t Off_t

2014-11-06 Thread Hans de Goede
Hi,

On 11/06/2014 03:26 AM, Alan Coopersmith wrote:
 Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com

Looks good:

Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

Hans



 ---
  src/AsciiSrc.c |   15 ---
  src/MultiSrc.c |   16 
  2 files changed, 8 insertions(+), 23 deletions(-)
 
 diff --git a/src/AsciiSrc.c b/src/AsciiSrc.c
 index 2f59441..ff7b9df 100644
 --- a/src/AsciiSrc.c
 +++ b/src/AsciiSrc.c
 @@ -115,13 +115,6 @@ static String StorePiecesInString(AsciiSrcObject);
  static Boolean SetValues(Widget, Widget, Widget, ArgList, Cardinal *);
  static Boolean WriteToFile(_Xconst _XtString, _Xconst _XtString);
  
 -#ifdef X_NOT_POSIX
 -#define Off_t long
 -#define Size_t unsigned int
 -#else
 -#define Off_t off_t
 -#define Size_t size_t
 -#endif
  
  #define superclass   (textSrcClassRec)
  AsciiSrcClassRec asciiSrcClassRec = {
 @@ -1039,7 +1032,7 @@ InitStringOrFile(AsciiSrcObject src, Boolean newString)
  
  if (!src-ascii_src.is_tempfile) {
   if ((file = fopen(src-ascii_src.string, open_mode)) != 0) {
 - (void) fseek(file, (Off_t)0, 2);
 + (void) fseek(file, 0, 2);
   src-ascii_src.length = (XawTextPosition) ftell(file);
   return file;
   } else {
 @@ -1069,9 +1062,9 @@ LoadPieces(AsciiSrcObject src, FILE * file, char * 
 string)
local_str = XtMalloc((unsigned) (src-ascii_src.length + 1)
  * sizeof(unsigned char));
if (src-ascii_src.length != 0) {
 - fseek(file, (Off_t)0, 0);
 - src-ascii_src.length = fread(local_str, (Size_t)sizeof(unsigned char),
 -   (Size_t)src-ascii_src.length, file);
 + fseek(file, 0, 0);
 + src-ascii_src.length = fread(local_str, sizeof(unsigned char),
 +   (size_t)src-ascii_src.length, file);
   if (src-ascii_src.length = 0)
 XtErrorMsg(readError, asciiSourceCreate, XawError,
fread returned error., NULL, NULL);
 diff --git a/src/MultiSrc.c b/src/MultiSrc.c
 index c7cc2ac..3ea875b 100644
 --- a/src/MultiSrc.c
 +++ b/src/MultiSrc.c
 @@ -139,14 +139,6 @@ static void (MyWStrncpy)();
  
  extern char *tmpnam(String);
  
 -#ifdef X_NOT_POSIX
 -#define Off_t long
 -#define Size_t unsigned int
 -#else
 -#define Off_t off_t
 -#define Size_t size_t
 -#endif
 -
  extern wchar_t* _XawTextMBToWC(Display *, char *, int *);
  extern char *_XawTextWCToMB(Display *, wchar_t *, int *);
  
 @@ -1126,7 +1118,7 @@ InitStringOrFile(MultiSrcObject src, Boolean newString)
  
  if (!src-multi_src.is_tempfile) {
   if ((file = fopen(src-multi_src.string, open_mode)) != 0) {
 - (void) fseek(file, (Off_t)0, 2);
 + (void) fseek(file, 0, 2);
  src-multi_src.length = ftell (file);
   return file;
   } else {
 @@ -1190,10 +1182,10 @@ LoadPieces(MultiSrcObject src, FILE *file, char 
 *string)
  if (src-multi_src.length != 0) {
temp_mb_holder =
   XtMalloc((unsigned)(src-multi_src.length + 1) * sizeof(unsigned char));
 -  fseek(file, (Off_t)0, 0);
 +  fseek(file, 0, 0);
src-multi_src.length = fread (temp_mb_holder,
 -  (Size_t)sizeof(unsigned char),
 -  (Size_t)src-multi_src.length, file);
 +  sizeof(unsigned char),
 +  (size_t)src-multi_src.length, file);
if (src-multi_src.length = 0)
   XtAppErrorMsg( XtWidgetToApplicationContext ((Widget) src),
  readError, multiSource, XawError,
 
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH inputproto] specs: rename EVENTMASK to EVTYPEMASK

2014-10-27 Thread Hans de Goede
Hi,

On 10/27/2014 05:37 AM, Peter Hutterer wrote:
 EVENTMASK was used twice in the spec, once as the actual bitmask for events,
 once as the set of deviceid, mask length and mask.
 
 The libXi public API uses XIEventMask for the latter data triplet, so leave
 EVENTMASK, and rename the pure bitmask to EVTYPEMASK.
 
 Reported-by: Gabriel Laskar gabr...@lse.epita.fr
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Looks good:

Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

Hans

 ---
  specs/XI2proto.txt | 12 ++--
  1 file changed, 6 insertions(+), 6 deletions(-)
 
 diff --git a/specs/XI2proto.txt b/specs/XI2proto.txt
 index e3636ac..697dd89 100644
 --- a/specs/XI2proto.txt
 +++ b/specs/XI2proto.txt
 @@ -672,9 +672,9 @@ Data types
  device hierarchy. See Section The Master/Slave device hierarchy
  for more information.
  
 -EVENTMASK
 -An EVENTMASK is a binary mask defined as (1  event type).
 -A SETofEVENTMASK is a binary OR of zero or more EVENTMASK.
 +EVTYPEMASK
 +An EVTYPEMASK is a binary mask defined as (1  event type).
 +A SETofEVTYPEMASK is a binary OR of zero or more EVTYPEMASK.
  
  FP1616
  Fixed point decimal in 16.16 format as one INT16 and one CARD16.
 @@ -971,7 +971,7 @@ XISelectEvents
  
  EVENTMASK { deviceid:  DEVICE,
  mask_len:  CARD16,
 -mask:  SETofEVENTMASK
 +mask:  SETofEVTYPEMASK }
  
  window
  The window to select the events on.
 @@ -1392,7 +1392,7 @@ XIGrabDevice
  time:TIMESTAMP or CurrentTime
  cursor:  Cursor
  mask_len:CARD16
 -masks:   SETofEVENTMASK
 +masks:   SETofEVTYPEMASK
  ▶
  status:  Success, AlreadyGrabbed, Frozen, InvalidTime, 
 NotViewable
  └───
 @@ -1638,7 +1638,7 @@ XIPassiveGrabDevice
  paired_device_mode: { Synchronous, Asynchronous }
  num_modifiers:   INT16
  mask_len:CARD16
 -masks:   SETofEVENTMASK
 +masks:   SETofEVTYPEMASK
  modifiers:   LISTofSETofMODIFIERMASK
  ▶
  num_modifiers_return:INT16
 
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH:libxtrans 1/7] Update docs to note that TransName is now const char *

2014-10-24 Thread Hans de Goede
Hi,

On 08/26/2014 03:21 AM, Alan Coopersmith wrote:
 Missed when the code was updated in commit eb9a8904fbef61a57ff0.
 
 Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com

Looks good, series is:

Acked-by: Hans de Goede hdego...@redhat.com

Regards,

Hans

 ---
  doc/xtrans.xml |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/doc/xtrans.xml b/doc/xtrans.xml
 index 59daa3f..d89c247 100644
 --- a/doc/xtrans.xml
 +++ b/doc/xtrans.xml
 @@ -187,7 +187,7 @@ points for a single transport. This record is defined as:
  synopsis
  typedef struct _Xtransport {
  
 -char *TransName;
 +const char *TransName;
  int  flags;
  
  XtransConnInfo (*OpenCOTSClient)(
 
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH:font/util] Update map-JISX0201.1976-0 to current version from Unicode Consortium

2014-10-23 Thread Hans de Goede
Hi,

On 08/26/2014 04:06 AM, Alan Coopersmith wrote:
 New version is exactly as downloaded on August 25, 2014 from
 ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/JIS0201.TXT
 
 Does not change mappings, only changes comments (including license notice).
 
 Reported-by: AGinsberg on #xorg-devel irc
 Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com

Looks good:

Acked-by: Hans de Goede hdego...@redhat.com

Regards,

Hans

 ---
  COPYING |2 +-
  map-JISX0201.1976-0 |   42 ++
  2 files changed, 27 insertions(+), 17 deletions(-)
 
 diff --git a/COPYING b/COPYING
 index 0ff9042..8febe74 100644
 --- a/COPYING
 +++ b/COPYING
 @@ -103,7 +103,7 @@ from the copyright holders.
  

  
 -Copyright (c) 1991-2003 Unicode, Inc.  All Rights reserved.
 +Copyright (c) 1991-2011 Unicode, Inc.  All Rights reserved.
  
  This file is provided as-is by Unicode, Inc. (The Unicode Consortium).
  No claims are made as to fitness for any particular purpose.  No
 diff --git a/map-JISX0201.1976-0 b/map-JISX0201.1976-0
 index 87e9e94..ca18c42 100644
 --- a/map-JISX0201.1976-0
 +++ b/map-JISX0201.1976-0
 @@ -1,13 +1,11 @@
  #
  #Name: JIS X 0201 (1976) to Unicode 1.1 Table
  #Unicode version:  1.1
 -#Table version:0.9
 +#Table version:1.0
  #Table format: Format A
 -#Date: 8 March 1994
 -#Authors:  Glenn Adams gl...@metis.com
 -# John H. Jenkins john_jenk...@taligent.com
 +#Date: 2011 October 14
  #
 -#Copyright (c) 1991-1994 Unicode, Inc.  All Rights reserved.
 +#Copyright (c) 1994-2011 Unicode, Inc.  All Rights reserved.
  #
  #This file is provided as-is by Unicode, Inc. (The Unicode Consortium).
  #No claims are made as to fitness for any particular purpose.  No
 @@ -17,17 +15,22 @@
  #remedy for any claim will be exchange of defective media within 90
  #days of receipt.
  #
 -#Recipient is granted the right to make copies in any form for
 -#internal distribution and to freely use the information supplied
 -#in the creation of products supporting Unicode.  Unicode, Inc.
 -#specifically excludes the right to re-distribute this file directly
 -#to third parties or other organizations whether for profit or not.
 +#  Unicode, Inc. hereby grants the right to freely use the information
 +#  supplied in this file in the creation of products supporting the
 +#  Unicode Standard, and to make copies of this file in any form for
 +#  internal or external distribution as long as this notice remains
 +#  attached.
  #
  #General notes:
  #
 -#This table contains the data the Unicode Consortium has on how
 -#single-byte JIS X 0201 characters map into Unicode 1.1
 -#(ISO/IEC 10646:1-1993 UCS-2).
 +#
 +# This table contains one set of mappings from JIS X 0201 into Unicode.
 +# Note that these data are *possible* mappings only and may not be the
 +# same as those used by actual products, nor may they be the best suited
 +# for all uses.  For more information on the mappings between various code
 +# pages incorporating the repertoire of JIS X 0201 and Unicode, consult the
 +# VENDORS mapping data.
 +#
  #
  #Format:  Three tab-separated columns
  #Column #1 is the shift JIS code (in hex as 0xXX)
 @@ -36,11 +39,18 @@
  #
  #The entries are in JIS order
  #
 -#   These mappings are provisional, pending definition of
 -#   official mappings by Japanese standards bodies.
 +#  Revision History:
 +#
 +#[v1.0, 2011 October 14]
 +#Updated terms of use to current wording.
 +#Updated contact information.
 +#No changes to the mapping data.
  #
 -#Any comments or problems, contact john_jenk...@taligent.com
 +#[v0.9, 8 March 1994]
 +#First release.
  #
 +#  Use the Unicode reporting form http://www.unicode.org/reporting.html
 +#for any questions or comments or to report errors in the data.
  #
  0x20 0x0020  # SPACE
  0x21 0x0021  # EXCLAMATION MARK
 
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH libXau] XauGet*AuthByAddr: add new variants which allow passing an explicit authorization file path.

2014-10-23 Thread Hans de Goede
Hi,

On 10/20/2014 02:19 PM, Laércio de Sousa wrote:
 It will allow extending functions like Xlib's XOpenDislay() or XCB's 
 xcb_connect()
 to allow passing an explicit authorization file path (they already allow 
 passing
 an explicit display number). This can be useful in exceptional cases where
 XAUTHORITY environment variable is not set at the time a X11 client is 
 launched.
 Currently, a X11 client that needs to connect to a display with a given
 authorization file needs to set XAUTHORITY itself (if not yet set) before 
 connecting.
 
 Signed-off-by: Laércio de Sousa laercioso...@sme-mogidascruzes.sp.gov.br

Code looks good to me and is:

Acked-by: Hans de Goede hdego...@redhat.com

I think this should get a second look by someone more familiar with the Xau code
though, so I'll leave merging this up to someone else.

Regards,

Hans

 ---
  AuGetAddr.c  | 38 --
  AuGetBest.c  | 36 +++--
  include/X11/Xauth.h  | 45 
 
  man/Xau.man  | 20 ++--
  man/XauGetAuthByAddrWithFile.man |  1 +
  man/XauGetBestAuthByAddrWithFile.man |  1 +
  6 files changed, 135 insertions(+), 6 deletions(-)
  create mode 100644 man/XauGetAuthByAddrWithFile.man
  create mode 100644 man/XauGetBestAuthByAddrWithFile.man
 
 diff --git a/AuGetAddr.c b/AuGetAddr.c
 index 6f5fe16..3aeffa4 100644
 --- a/AuGetAddr.c
 +++ b/AuGetAddr.c
 @@ -33,7 +33,8 @@ in this Software without prior written authorization from 
 The Open Group.
  #define binaryEqual(a, b, len) (memcmp(a, b, len) == 0)
  
  Xauth *
 -XauGetAuthByAddr (
 +XauGetAuthByAddrWithFile (
 +_Xconst char*auth_file,
  #if NeedWidePrototypes
  unsigned int family,
  unsigned int address_length,
 @@ -59,7 +60,7 @@ _Xconst char*   name)
  char*auth_name;
  Xauth   *entry;
  
 -auth_name = XauFileName ();
 +auth_name = auth_file ? auth_file : XauFileName ();
  if (!auth_name)
   return NULL;
  if (access (auth_name, R_OK) != 0)   /* checks REAL id */
 @@ -100,3 +101,36 @@ _Xconst char*name)
  (void) fclose (auth_file);
  return entry;
  }
 +
 +Xauth *
 +XauGetAuthByAddr (
 +#if NeedWidePrototypes
 +unsigned int family,
 +unsigned int address_length,
 +#else
 +unsigned short   family,
 +unsigned short   address_length,
 +#endif
 +_Xconst char*address,
 +#if NeedWidePrototypes
 +unsigned int number_length,
 +#else
 +unsigned short   number_length,
 +#endif
 +_Xconst char*number,
 +#if NeedWidePrototypes
 +unsigned int name_length,
 +#else
 +unsigned short   name_length,
 +#endif
 +_Xconst char*name)
 +{
 +XauGetAuthByAddrWithFile (NULL,
 +  family,
 +  address_length,
 +  address,
 +  number_length,
 +  number,
 +  name_length,
 +  name);
 +}
 diff --git a/AuGetBest.c b/AuGetBest.c
 index 5556559..73ee907 100644
 --- a/AuGetBest.c
 +++ b/AuGetBest.c
 @@ -41,7 +41,8 @@ in this Software without prior written authorization from 
 The Open Group.
  #define binaryEqual(a, b, len) (memcmp(a, b, len) == 0)
  
  Xauth *
 -XauGetBestAuthByAddr (
 +XauGetBestAuthByAddrWithFile (
 +_Xconst char*auth_file,
  #if NeedWidePrototypes
  unsigned int family,
  unsigned int address_length,
 @@ -71,7 +72,7 @@ XauGetBestAuthByAddr (
  unsigned short   fully_qual_address_length;
  #endif
  
 -auth_name = XauFileName ();
 +auth_name = auth_file ? auth_file : XauFileName ();
  if (!auth_name)
   return NULL;
  if (access (auth_name, R_OK) != 0)   /* checks REAL id */
 @@ -161,3 +162,34 @@ XauGetBestAuthByAddr (
  (void) fclose (auth_file);
  return best;
  }
 +
 +Xauth *
 +XauGetBestAuthByAddr (
 +#if NeedWidePrototypes
 +unsigned int family,
 +unsigned int address_length,
 +#else
 +unsigned short   family,
 +unsigned short   address_length,
 +#endif
 +_Xconst char*address,
 +#if NeedWidePrototypes
 +unsigned int number_length,
 +#else
 +unsigned short   number_length,
 +#endif
 +_Xconst char*number,
 +int  types_length,
 +char**   types,
 +_Xconst int* type_lengths)
 +{
 +XauGetBestAuthByAddrWithFile (NULL,
 +  family,
 +  address_length,
 +  address,
 +  number_length,
 +  number,
 +  types_length,
 +  types,
 +  type_lengths);
 +}
 diff --git a/include/X11/Xauth.h b/include/X11/Xauth.h
 index a707bed

[PATCH font/encodings] jisx0201.1976-0.enc: Add undefined mapping for 0x7f - 0xa0 range

2014-10-23 Thread Hans de Goede
From: Akira TAGOH ta...@redhat.com

The jisx0201 encoding has a hole in it in the 0x7f - 0xa0 range, see:
http://en.wikipedia.org/wiki/JIS_X_0201

The document for the format of the encoding files says:
Codes not listed are assumed to map through the identity (i.e. to the same
 numerical value). In order to override this default mapping, you may specify
 a range of codes to be undefined by using an `UNDEFINE' line

jisx0201.1976-0.enc was not doing this, causing all the codes on the range
to be mapped 1:1. This specifically is causing problems for ttmkfdir, which
checks that a font covers (most of) an encoding before adding a line for that
encoding to fonts.scale, and the hole not properly being undefined causes
this check to fail for atleast the Sazanami fonts.

Cc: Akira TAGOH ta...@redhat.com
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1009350
Signed-off-by: Hans de Goede hdego...@redhat.com
---
 large/jisx0201.1976-0.enc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/large/jisx0201.1976-0.enc b/large/jisx0201.1976-0.enc
index 915d50c..328bc7a 100644
--- a/large/jisx0201.1976-0.enc
+++ b/large/jisx0201.1976-0.enc
@@ -68,6 +68,7 @@ ENDMAPPING
 STARTMAPPING unicode
 0x5C   0x00A5  # YEN SIGN
 0x7E   0x203E  # OVERLINE
+UNDEFINE   0x7F0xA0
 0x00A1 0x00DF 0xFF61
 ENDMAPPING
 STARTMAPPING cmap 1 1
-- 
2.1.0

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH vmmouse] Back off if we detect a vmmouse kernel driver v2

2014-10-02 Thread Hans de Goede
Hi,

On 10/02/2014 02:39 PM, Thomas Hellstrom wrote:
 If a vmmouse kernel driver is active, vmmouse input is handled by the Xorg
 evdev driver and not by the vmmouse driver, so make sure the vmmouse_detect
 utility doesn't detect a vmmouse if a kernel driver is active.
 
 v2: Change the vmmouse kernel device name, fix comment.
 
 Signed-off-by: Thomas Hellstrom thellst...@vmware.com
 Reviewed-by: Brian Paul bri...@vmware.com

Looks good:

Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

Hans

 ---
  configure.ac   |  14 +++
  tools/Makefile.am  |   7 +++-
  tools/vmmouse_detect.c |   5 +++
  tools/vmmouse_udev.c   | 100 
 +
  4 files changed, 124 insertions(+), 2 deletions(-)
  create mode 100644 tools/vmmouse_udev.c
 
 diff --git a/configure.ac b/configure.ac
 index ad05504..1197555 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -105,6 +105,20 @@ XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
  XORG_DRIVER_CHECK_EXT(XINPUT, inputproto)
  
  # Checks for pkg-config packages
 +libudev_check=yes
 +AC_ARG_WITH([libudev],
 + [AS_HELP_STRING([--without-libudev],
 + [Use to build without libudev on linux])],
 + [if test x$withval = xno; then libudev_check=no; fi]
 + [])
 +
 +if test x`uname` = xLinux -a $libudev_check = yes; then
 +   PKG_CHECK_MODULES(LIBUDEV, [libudev],
 +[AC_DEFINE([HAVE_LIBUDEV], 1,
 +[Has libudev installed])],
 +[]);
 +fi
 +
  PKG_CHECK_MODULES(XORG, [xorg-server = 1.0.1] xproto $REQUIRED_MODULES)
  
  PKG_CHECK_EXISTS([xorg-server = 1.1.0],
 diff --git a/tools/Makefile.am b/tools/Makefile.am
 index 8ae5516..a1396ba 100644
 --- a/tools/Makefile.am
 +++ b/tools/Makefile.am
 @@ -22,8 +22,11 @@ bin_PROGRAMS = @DRIVER_NAME@_detect
  
  AM_CPPFLAGS = -I$(top_srcdir)/shared $(XORG_CFLAGS)
  
 -@DRIVER_NAME@_detect_SOURCES = vmmouse_detect.c
 -@DRIVER_NAME@_detect_LDADD = $(top_builddir)/shared/lib@DRIVER_NAME@.la
 +@DRIVER_NAME@_detect_SOURCES = vmmouse_detect.c vmmouse_udev.c
 +@DRIVER_NAME@_detect_LDADD = $(top_builddir)/shared/lib@DRIVER_NAME@.la \
 + @LIBUDEV_LIBS@
 +@DRIVER_NAME@_detect_CFLAGS = @LIBUDEV_CFLAGS@
 +
  
  calloutsdir=$(HAL_CALLOUTS_DIR)
  callouts_SCRIPTS = hal-probe-vmmouse
 diff --git a/tools/vmmouse_detect.c b/tools/vmmouse_detect.c
 index 7939ff8..b743b2d 100644
 --- a/tools/vmmouse_detect.c
 +++ b/tools/vmmouse_detect.c
 @@ -34,6 +34,8 @@
  #include signal.h
  #include vmmouse_client.h
  
 +extern int vmmouse_uses_kernel_driver(void);
 +
  void
  segvCB(int sig)
  {
 @@ -46,6 +48,9 @@ segvCB(int sig)
  int
  main(void)
  {
 +   if (vmmouse_uses_kernel_driver())
 +  return 1;
 +
 /*
  * If the vmmouse test is not run in a VMware virtual machine, it
  * will segfault instead of successfully accessing the port.
 diff --git a/tools/vmmouse_udev.c b/tools/vmmouse_udev.c
 new file mode 100644
 index 000..a79c37a
 --- /dev/null
 +++ b/tools/vmmouse_udev.c
 @@ -0,0 +1,100 @@
 +/*
 + * Copyright 2014 by VMware, Inc.
 + *
 + * Permission is hereby granted, free of charge, to any person obtaining a
 + * copy of this software and associated documentation files (the Software),
 + * to deal in the Software without restriction, including without limitation
 + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 + * and/or sell copies of the Software, and to permit persons to whom the
 + * Software is furnished to do so, subject to the following conditions:
 + *
 + * The above copyright notice and this permission notice shall be included in
 + * all copies or substantial portions of the Software.
 + *
 + * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
 + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 + * OTHER DEALINGS IN THE SOFTWARE.
 + *
 + * Except as contained in this notice, the name of the copyright holder(s)
 + * and author(s) shall not be used in advertising or otherwise to promote
 + * the sale, use or other dealings in this Software without prior written
 + * authorization from the copyright holder(s) and author(s).
 + */
 +
 +#ifdef HAVE_CONFIG_H
 +#include config.h
 +#endif
 +
 +#ifdef HAVE_LIBUDEV
 +#include libudev.h
 +#include stdlib.h
 +#include string.h
 +
 +#define KERNEL_DEVNAME VirtualPS/2 VMware VMMouse
 +
 +/**
 + * vmmouse_uses_kernel_driver - Check whether there's an active
 + *vmmouse driver in the kernel.
 + *
 + * Returns 0 if there was no kernel driver found.
 + * Returns non-zero on error or if there was an active driver found.
 + *
 + * Scans the input subsystem

Re: [PATCH evdev 2/2] Always report all valuators on absolute devices

2014-09-30 Thread Hans de Goede
Hi Éric

On 09/29/2014 10:57 PM, Éric Brunet wrote:
 Hi!
 
 ok, this patch looked good at first, so I applied it locally.
 Unfortunately, it breaks a couple of tests in XIT, specifically
 EvdevMixedDeviceTest.AbsXYAndRelScroll/*.

 [...]
 
 Ouch... I am summarizing, to be sure I understood:

snip

Note not sure if Peter mentioned this in his last email, but Peter
is currently traveling with limited internet-access, so it may be
a while before he responds to this.

As for comments on your detailed analysis, I'll leave that to Peter.

Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: vmmouse kernel driver

2014-09-26 Thread Hans de Goede
Hi,

On 09/26/2014 09:06 AM, Thomas Hellstrom wrote:
 Hi!
 
 On 09/26/2014 03:36 AM, Peter Hutterer wrote:
 On Wed, Sep 24, 2014 at 11:12:50AM +0200, Thomas Hellstrom wrote:
 While looking at a vmmouse kernel driver, I wonder how the Xorg evdev
 driver can be configured to receive both absolute and relative events
 from the same device as the vmmouse sometimes sends absolute events and
 sometimes relative. Is the IgnoreAbsoluteAxes False option sufficient?
 at the same time, or depending on the configuration? The
 IgnoreAbsoluteAxes/IgnoreRelativeAxes options simply disable one of the two
 on startup, allowing the other one to be initialized. that's for virtual
 devices mostly used in VMs because our device autodetection fails there.

 So short answer: yes, should be sufficient provided you stay in that mode
 for the lifetime of the device.
 
 Thanks for the answer. The problem is we don't. We could suddenly decide
 that apparently somebody applied a screen tranformation or is running a
 game and revert back to relative events.
 Otherwise the preferred choice is absolute events for minimal cursor
 latency.
 
 I know that for this reason the virtual USB mice are duplicated: one for
 absolute events and one for relative events but I haven't looked to
 closely at what level this actually happens.
 
 But whatever solution that emerges needs to work also with the new
 compositors. I guess I have to look at somehow make the mouse appear as
 two different ps2 mice from within the kernel driver...

Actually one ps/2 device(mouse) which registers 2 input devices, that is
more or less quite normal for trackpoint / touchpad combo's which are
interfaced over a single ps/2 connection (some use ps/2 multiplexing, but
others both touchpad and trackpoint ps/2 packets are send over the same
ps/2 device).

See drivers/input/mouse/alps.c for an example of this, search for dev2
to all the code dealing with the second device. This way you can simply
register both an absolute and a relative device, and send events out of
the right one depending on the mode. That is probably the best way to deal
with this.

Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: F21/F22: xorg-x11-drv: which for SiS?

2014-09-25 Thread Hans de Goede
Hi,

On 09/24/2014 09:23 PM, Felix Miata wrote:
 Laércio de Sousa wrote on 2014-09-23 08:05 (GMT-0300):
 
 2014-09-23 3:37 GMT-03:00 Jasper St. Pierre composed:
 
 Felix Miata wrote:
 
 xorg-x11-drv-sis seems to have disappeared. Did that happen on purpose? It
 still exists as a selelection in Bugzilla. Xorg is looking for sis module 
 but
 cannot find it. Gfxchip here is Z7/Z9 (XG20 core). Is it now supposed to be
 using some other (not installed) driver? Before today's upgrade, X still
 worked.
 
 Seems to exist to me:
 
 http://cgit.freedesktop.org/xorg/driver/xf86-video-sis/
 
 According to
 http://pkgs.fedoraproject.org/cgit/xorg-x11-drv-sis.git/commit/?id=95dc18d4c803988702974635badb391cc50b6a63
 
 this package is dead for Fedora 21 and later due to lack of KMS support.
 
 Not exactly. My OP here was intended to goto the
 de...@lists.fedoraproject.org list, but I copied and pasted the wrong address
 from an email that had been sent both places. I later sent it there, and
 ultimately was told (by ajax) that lack of maintainer was the reason for its
 elimination[1], and not just from Rawhide, but the package is gone from
 Fedora 19, 20  21 repos as well.

No it is not, it has been retired for F-21 and later. And as I've already told
you in a reply to de...@lists.fedoraproject.org, you are free to step up to
maintain it in Fedora and unretire it. I've even offered my help in doing so,
and that offer still stands.

Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH synaptics] Limit the movement to 20 mm per event

2014-09-16 Thread Hans de Goede
Hi,

On 09/16/2014 03:08 AM, Peter Hutterer wrote:
 Touchpads are limited by a fixed sampling rate (usually 80Hz). Some finger
 changes may happen too fast for this sampling rate, resulting in two distinct
 event sequences:
 * finger 1 up and finger 2 down in the same EV_SYN frame. Synaptics sees one
   finger down before and after and the changed coordinates
 * finger 1 up and finger 2 down _between_ two EV_SYN frames. Synaptics sees 
 one
   touchpoint move from f1 position to f2 position.
 
 That move causes a large cursor jump. The former could be solved (with
 difficulty) by adding fake EV_SYN handling after releasing touchpoints but
 that won't fix the latter case.
 
 So as a solution for now limit the finger movement to 20mm per event.
 Tests on a T440 and an x220 showed that this is just above what a reasonable
 finger movement would trigger. If a movement is greater than that limit, reset
 it to 0/0.
 
 On devices without resolution, use 0.25 the touchpad's diagonal instead.
 
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Looks good to me:

Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

Hans


 ---
 See the git repo below for a simple script to verify valid movement deltas
 on your device if you feel like it:
 https://github.com/whot/input-data-analysis/tree/master/touchpad-max-delta
 Max I got was 9mm on the x220 and 17mm on the T440s but the latter was
 really ripping the cursor around the screen beyond what I'd deem useful.
 
  src/synaptics.c| 33 +
  src/synapticsstr.h |  2 ++
  2 files changed, 35 insertions(+)
 
 diff --git a/src/synaptics.c b/src/synaptics.c
 index 2e3ad0c..756751d 100644
 --- a/src/synaptics.c
 +++ b/src/synaptics.c
 @@ -780,6 +780,23 @@ set_default_parameters(InputInfoPtr pInfo)
  pars-resolution_vert = 1;
  }
  
 +/* Touchpad sampling rate is too low to detect all movements.
 +   A user may lift one finger and put another one down within the same
 +   EV_SYN or even between samplings so the driver doesn't notice at all.
 +
 +   We limit the movement to 20 mm within one event, that is more than
 +   recordings showed is needed (17mm on a T440).
 +  */
 +if (pars-resolution_horiz  1 
 +pars-resolution_vert  1)
 +pars-maxDeltaMM = 20;
 +else {
 +/* on devices without resolution set the vector length to 0.25 of
 +   the touchpad diagonal */
 +pars-maxDeltaMM = diag * 0.25;
 +}
 +
 +
  /* Warn about (and fix) incorrectly configured TopEdge/BottomEdge 
 parameters */
  if (pars-top_edge  pars-bottom_edge) {
  int tmp = pars-top_edge;
 @@ -2229,6 +2246,13 @@ get_delta(SynapticsPrivate *priv, const struct 
 SynapticsHwState *hw,
  *dy = integral;
  }
  
 +/* Vector length, but not sqrt'ed, we only need it for comparison */
 +static inline double
 +vlenpow2(double x, double y)
 +{
 +return x * x + y * y;
 +}
 +
  /**
   * Compute relative motion ('deltas') including edge motion.
   */
 @@ -2238,6 +2262,7 @@ ComputeDeltas(SynapticsPrivate * priv, const struct 
 SynapticsHwState *hw,
  {
  enum MovingState moving_state;
  double dx, dy;
 +double vlen;
  int delay = 10;
  
  dx = dy = 0;
 @@ -2283,6 +2308,14 @@ ComputeDeltas(SynapticsPrivate * priv, const struct 
 SynapticsHwState *hw,
   out:
  priv-prevFingers = hw-numFingers;
  
 +vlen = vlenpow2(dx/priv-synpara.resolution_horiz,
 +dy/priv-synpara.resolution_vert);
 +
 +if (vlen  priv-synpara.maxDeltaMM * priv-synpara.maxDeltaMM) {
 +dx = 0;
 +dy = 0;
 +}
 +
  *dxP = dx;
  *dyP = dy;
  
 diff --git a/src/synapticsstr.h b/src/synapticsstr.h
 index 4bd32ac..75f52d5 100644
 --- a/src/synapticsstr.h
 +++ b/src/synapticsstr.h
 @@ -226,6 +226,8 @@ typedef struct _SynapticsParameters {
  int area_left_edge, area_right_edge, area_top_edge, area_bottom_edge;
/* area coordinates absolute */
  int softbutton_areas[4][4]; /* soft button area coordinates, 0 = right, 
 1 = middle , 2 = secondary right, 3 = secondary middle button */
  int hyst_x, hyst_y; /* x and y width of hysteresis box */
 +
 +int maxDeltaMM;   /* maximum delta movement (vector length) 
 in mm */
  } SynapticsParameters;
  
  struct _SynapticsPrivateRec {
 
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH] os: Don't listen to 'tcp' by default. Add '-listen' option. [v2]

2014-09-15 Thread Hans de Goede
Hi,

On 09/15/2014 05:42 PM, Keith Packard wrote:
 This disables the tcp listen socket by default. Then, it
 uses a new xtrans interface, TRANS(Listen), to provide a command line
 option to re-enable those if desired.
 
 v2: Leave unix socket enabled by default. Add configure options.
 
 Signed-off-by: Keith Packard kei...@keithp.com

Looks good:

Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

Hans


 ---
  configure.ac| 20 
  include/dix-config.h.in |  9 +
  man/Xserver.man |  7 +++
  os/utils.c  | 29 +
  4 files changed, 65 insertions(+)
 
 diff --git a/configure.ac b/configure.ac
 index cba7d24..a7bd8bd 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -484,6 +484,16 @@ AC_ARG_WITH(os-vendor,   
 AS_HELP_STRING([--with-os-vendor=OSVENDOR], [Name o
  AC_ARG_WITH(builderstring,   
 AS_HELP_STRING([--with-builderstring=BUILDERSTRING], [Additional builder 
 string]),
   [ BUILDERSTRING=$withval ]
   [ ])
 +AC_ARG_ENABLE(listen-tcp,AS_HELP_STRING([--enable-listen-tcp],
 +[Listen on TCP by default 
 (default:disabled)]),
 +[LISTEN_TCP=$enableval], [LISTEN_TCP=no])
 +AC_ARG_ENABLE(listen-unix,   AS_HELP_STRING([--disable-listen-unix],
 +[Listen on Unix by default 
 (default:enabled)]),
 +[LISTEN_UNIX=$enableval], [LISTEN_UNIX=yes])
 +
 +AC_ARG_ENABLE(listen-local,  AS_HELP_STRING([--disable-listen-local],
 +[Listen on local by default 
 (default:enabled)]),
 +[LISTEN_LOCAL=$enableval], 
 [LISTEN_LOCAL=yes])
  
  dnl Determine font path
  XORG_FONTROOTDIR
 @@ -1081,6 +1091,16 @@ if test x$RES = xyes; then
   SDK_REQUIRED_MODULES=$SDK_REQUIRED_MODULES $RESOURCEPROTO
  fi
  
 +if test x$LISTEN_TCP = xyes; then
 + AC_DEFINE(LISTEN_TCP, 1, [Listen on TCP socket])
 +fi
 +if test x$LISTEN_UNIX = xyes; then
 + AC_DEFINE(LISTEN_UNIX, 1, [Listen on Unix socket])
 +fi
 +if test x$LISTEN_LOCAL = xyes; then
 + AC_DEFINE(LISTEN_LOCAL, 1, [Listen on local socket])
 +fi
 +
  # The XRes extension may support client ID tracking only if it has
  # been specifically enabled. Client ID tracking is implicitly not
  # supported if XRes extension is disabled.
 diff --git a/include/dix-config.h.in b/include/dix-config.h.in
 index 2203f82..41b6a22 100644
 --- a/include/dix-config.h.in
 +++ b/include/dix-config.h.in
 @@ -496,4 +496,13 @@
  /* byte order */
  #undef X_BYTE_ORDER
  
 +/* Listen on TCP socket */
 +#undef LISTEN_TCP
 +
 +/* Listen on Unix socket */
 +#undef LISTEN_UNIX
 +
 +/* Listen on local socket */
 +#undef LISTEN_LOCAL
 +
  #endif /* _DIX_CONFIG_H_ */
 diff --git a/man/Xserver.man b/man/Xserver.man
 index 7a74e85..c03830c 100644
 --- a/man/Xserver.man
 +++ b/man/Xserver.man
 @@ -196,6 +196,13 @@ with
  This option may be issued multiple times to disable listening to different
  transport types.
  .TP 8
 +.B \-listen \fItrans-type\fP
 +enables a transport type.  For example, TCP/IP connections can be enabled
 +with
 +.BR \-listen tcp .
 +This option may be issued multiple times to enable listening to different
 +transport types.
 +.TP 8
  .B \-noreset
  prevents a server reset when the last client connection is closed.  This
  overrides a previous
 diff --git a/os/utils.c b/os/utils.c
 index c83f77d..82fc621 100644
 --- a/os/utils.c
 +++ b/os/utils.c
 @@ -557,6 +557,7 @@ UseMsg(void)
  ErrorF(-nolockdisable the locking mechanism\n);
  #endif
  ErrorF(-nolisten string   don't listen on protocol\n);
 +ErrorF(-listen string listen on protocol\n);
  ErrorF(-noreset   don't reset after last client exists\n);
  ErrorF(-background [none] create root window with no background\n);
  ErrorF(-reset reset after last client exists\n);
 @@ -646,6 +647,19 @@ VerifyDisplayName(const char *d)
  return 1;
  }
  
 +static const char *defaultNoListenList[] = {
 +#ifndef LISTEN_TCP
 +tcp,
 +#endif
 +#ifndef LISTEN_UNIX
 +unix,
 +#endif
 +#ifndef LISTEN_LOCAL
 +local,
 +#endif
 +NULL
 +};
 +
  /*
   * This function parses the command line. Handles device-independent fields
   * and allows ddx to handle additional fields.  It is not allowed to modify
 @@ -664,6 +678,12 @@ ProcessCommandLine(int argc, char *argv[])
  PartialNetwork = TRUE;
  #endif
  
 +for (i = 0; defaultNoListenList[i] != NULL; i++) {
 +if (_XSERVTransNoListen(defaultNoListenList[i]))
 +ErrorF(Failed to disable listen for %s transport,
 +   defaultNoListenList[i]);
 +}
 +
  for (i = 1; i  argc; i++) {
  /* call ddx first, so it can peek/override if it wants */
  if ((skip

[ANNOUNCE] xinit 1.3.4

2014-09-13 Thread Hans de Goede
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi All,

I'm happy to announce the new xinit 1.3.4 release.

This release features various portability fixes, and
some startx clean-ups and improvements.

Alan Coopersmith (4):
  Fix warnings about parameters to startServer  startClient shadowing 
globals
  Pass files to cpp via CLI arg instead of stdin to workaround gcc 4.8 
change
  configure: Drop AM_MAINTAINER_MODE
  autogen.sh: Honor NOCONFIGURE=1

Brad Smith (1):
  Remove hardcoded path to OpenSSL for OpenBSD

Hans de Goede (7):
  Remove unixware / sco support
  Bump required util-macros version to 1.19
  Replace $RAWCPPFLAGS with $TRADITIONALCPPFLAGS when processing cpp files
  startx: Under Linux start X on the current VT
  startx: Pass vtX as long as the user did not specify one
  startx: Make the bugzilla reference in a comment survive cpp processing
  xinit 1.3.4

git tag: xinit-1.3.4

http://xorg.freedesktop.org/archive/individual/app/xinit-1.3.4.tar.bz2
MD5:  4e928452dfaf73851413a2d8b8c76388  xinit-1.3.4.tar.bz2
SHA1: de3469080d73ced1f7d7a1803e813bc6ea352072  xinit-1.3.4.tar.bz2
SHA256: 75d88d7397a07e01db253163b7c7a00b249b3d30e99489f2734cac9a0c7902b3  
xinit-1.3.4.tar.bz2
PGP:  http://xorg.freedesktop.org/archive/individual/app/xinit-1.3.4.tar.bz2.sig

http://xorg.freedesktop.org/archive/individual/app/xinit-1.3.4.tar.gz
MD5:  91c5697345016ec7841f5e5fccbe7a4c  xinit-1.3.4.tar.gz
SHA1: 78d6457ba69f07ae1a727a88ae12fb3897874f72  xinit-1.3.4.tar.gz
SHA256: 754c284875defa588951c1d3d2b20897d3b84918d0a97cb5a4724b00c0da0746  
xinit-1.3.4.tar.gz
PGP:  http://xorg.freedesktop.org/archive/individual/app/xinit-1.3.4.tar.gz.sig

Regards,

Hans
-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iEYEARECAAYFAlQR3eAACgkQF3VEtJrzE/tYkQCfaqR29DcD2PSDpJDxF0lZFLQC
gAYAn1k4PchtZIXtt6b05uIDF5vcqqJ2
=PiVL
-END PGP SIGNATURE-
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: %(user_address)s


Re: [PATCH xinit 0/1] startx: Pass -nolisten tcp by default

2014-09-13 Thread Hans de Goede
Hi,

On 09/12/2014 08:40 PM, Keith Packard wrote:
 Hans de Goede hdego...@redhat.com writes:
 
 This patch fixes this, I realize that this is a behavior change, and as such
 may be a bit controversial, but I really believe that in this day and age
 -nolisten tcp by default is the right thing to do.
 
 I've posted patches to Xtrans and the X server that disable tcp and unix
 listener ports by default while providing a '-listen' command line
 option to re-enable them. Missing from these patches are a version bump
 to Xtrans and the associated version check in the X server. If the
 general form of these patches is acceptable, I'd bump the Xtrans
 version, do a release, and then make the X server depend on that.
 
 The 'unix' listener port uses a non-abstract socket, /tmp/.X11-unix/X0,
 which is subject to various security threats, and which xcb and Xlib
 don't use anymore.

I was afraid that people would consider your solution a too big hammer,
but since it seems that that is not the case I'm all in favor of this change.

Also +1 for dropping /tmp/.X11-unix/X* on Linux.

Question, could we somehow also get rid of /tmp/.X*-lock ? If we drop
/tmp/.X11-unix/X* that would be another step to getting rid of things
expected to be in a global /tmp namespace, which breaks having a private
per user /tmp dir.

Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH libxtrans] Add TRANS(Listen) function to re-enable specific listen sockets

2014-09-13 Thread Hans de Goede
Hi,

On 09/12/2014 08:33 PM, Keith Packard wrote:
 This will allow a server to disable listeners by default and then
 let later configuration re-enable them. In particular, this lets the X
 server disable inet and unix listen sockets by default while still
 providing a '-listen' command line option to re-enable them later on.
 
 Signed-off-by: Keith Packard kei...@keithp.com

Looks good:

Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

Hans


 ---
  Xtrans.c | 25 +
  Xtrans.h |  4 
  2 files changed, 29 insertions(+)
 
 diff --git a/Xtrans.c b/Xtrans.c
 index 2880803..bfba1ad 100644
 --- a/Xtrans.c
 +++ b/Xtrans.c
 @@ -804,6 +804,31 @@ TRANS(NoListen) (const char * protocol)
  }
  
  int
 +TRANS(Listen) (const char * protocol)
 +{
 +   Xtransport *trans;
 +   int i = 0, ret = 0;
 +
 +   if ((trans = TRANS(SelectTransport)(protocol)) == NULL)
 +   {
 + prmsg (1,TransListen: unable to find transport: %s\n,
 +protocol);
 +
 + return -1;
 +   }
 +   if (trans-flags  TRANS_ALIAS) {
 +   if (trans-nolisten)
 +while (trans-nolisten[i]) {
 +ret |= TRANS(Listen)(trans-nolisten[i]);
 +i++;
 +   }
 +   }
 +
 +   trans-flags = ~TRANS_NOLISTEN;
 +   return ret;
 +}
 +
 +int
  TRANS(IsListening) (const char * protocol)
  {
 Xtransport *trans;
 diff --git a/Xtrans.h b/Xtrans.h
 index 6decc6b..026fbd7 100644
 --- a/Xtrans.h
 +++ b/Xtrans.h
 @@ -311,6 +311,10 @@ int TRANS(NoListen) (
  const char* /* protocol*/
  );
  
 +int TRANS(Listen) (
 +const char* /* protocol*/
 +);
 +
  int TRANS(IsListening) (
  const char* /* protocol*/
  );
 
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH] os: Don't listen to 'tcp' or 'unix' by default. Add '-listen' option.

2014-09-13 Thread Hans de Goede
Hi,

On 09/12/2014 08:35 PM, Keith Packard wrote:
 This disables tcp and unix listen ports by default (the unix port is
 the non-abstract /tmp/.X11-unix port that xcb doesn't use). Then, it
 uses a new xtrans interface, TRANS(Listen), to provide a command line
 option to re-enable those if desired.
 
 Signed-off-by: Keith Packard kei...@keithp.com

We should probably put a #ifdef __linux__ around the
unix in the defaultNoListenList, other then that this
looks good:

Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

Hans

 ---
  os/utils.c | 21 +
  1 file changed, 21 insertions(+)
 
 diff --git a/os/utils.c b/os/utils.c
 index c83f77d..ff1806b 100644
 --- a/os/utils.c
 +++ b/os/utils.c
 @@ -646,6 +646,12 @@ VerifyDisplayName(const char *d)
  return 1;
  }
  
 +static const char *defaultNoListenList[] = {
 +tcp,
 +unix,
 +NULL
 +};
 +
  /*
   * This function parses the command line. Handles device-independent fields
   * and allows ddx to handle additional fields.  It is not allowed to modify
 @@ -664,6 +670,12 @@ ProcessCommandLine(int argc, char *argv[])
  PartialNetwork = TRUE;
  #endif
  
 +for (i = 0; defaultNoListenList[i] != NULL; i++) {
 +if (_XSERVTransNoListen(defaultNoListenList[i]))
 +ErrorF(Failed to disable listen for %s transport,
 +   defaultNoListenList[i]);
 +}
 +
  for (i = 1; i  argc; i++) {
  /* call ddx first, so it can peek/override if it wants */
  if ((skip = ddxProcessArgument(argc, argv, i))) {
 @@ -849,6 +861,15 @@ ProcessCommandLine(int argc, char *argv[])
  else
  UseMsg();
  }
 +else if (strcmp(argv[i], -listen) == 0) {
 +if (++i  argc) {
 +if (_XSERVTransListen(argv[i]))
 +ErrorF(Failed to enable listen for %s transport,
 +   argv[i]);
 +}
 +else
 +UseMsg();
 +}
  else if (strcmp(argv[i], -noreset) == 0) {
  dispatchExceptionAtReset = 0;
  }
 
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH libxtrans] Add TRANS(Listen) function to re-enable specific listen sockets

2014-09-13 Thread Hans de Goede
Hi,

On 09/13/2014 08:00 PM, Keith Packard wrote:
 Hans de Goede hdego...@redhat.com writes:
 
 Signed-off-by: Keith Packard kei...@keithp.com

 Looks good:

 Reviewed-by: Hans de Goede hdego...@redhat.com
 
 I've pushed this to master. We'll need a release before we can use it in
 the X server. You did the last release of that library; feel free to do
 another if you please :-)

I've been rather swamped with work, and I'm finally slowly climbing
out of the hole I was drowning in. So if possible I would prefer for
someone else to pick this up.

Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH xinit 0/1] startx: Pass -nolisten tcp by default

2014-09-12 Thread Hans de Goede
Hi All,

After doing the 1.3.4 release yesterday, I've started working on updating the
Fedora packages to 1.3.4. While looking at our open bug list against xinit,
I found one bug which is not yet resolved in 1.3.4 .

This patch fixes this, I realize that this is a behavior change, and as such
may be a bit controversial, but I really believe that in this day and age
-nolisten tcp by default is the right thing to do.

Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH xinit] startx: Pass -nolisten tcp by default

2014-09-12 Thread Hans de Goede
Having servers started by startx listen on tcp by default is not a good idea
in this time and age. Pass -nolisten tcp by default, and add a special
-listen server option which can be used to disable this new default behavior.

Signed-off-by: Hans de Goede hdego...@redhat.com
---
 man/startx.man | 7 +++
 startx.cpp | 5 +
 2 files changed, 12 insertions(+)

diff --git a/man/startx.man b/man/startx.man
index 0405be0..fc2cbc3 100644
--- a/man/startx.man
+++ b/man/startx.man
@@ -39,6 +39,8 @@ startx \- initialize an X session
 .I server
 ] [
 .I display
+] [
+.I -listen
 ]
 .I options
 \.\|.\|. ]
@@ -56,6 +58,11 @@ command are used to start a client in the same manner as
 The special argument
 .RB '--'
 marks the end of client arguments and the beginning of server options.
+By default startx passes
+.RB '-nolisten\ tcp'
+to the server, the special server option
+.RB '-listen'
+can be used to stop startx from doing this.
 It may be convenient to specify server options with startx to change on a
 per-session basis the
 default color depth, the server's notion of the number of dots-per-inch the
diff --git a/startx.cpp b/startx.cpp
index 1c6fce0..8612fa6 100644
--- a/startx.cpp
+++ b/startx.cpp
@@ -60,6 +60,7 @@ defaultdisplay=:0
 clientargs=
 serverargs=
 vtarg=
+listenarg=-nolisten tcp
 
 #ifdef __APPLE__
 
@@ -156,6 +157,8 @@ while [ x$1 != x ]; do
if [ x$serverargs = x ]  @@
 expr $1 : ':[0-9][0-9]*$'  /dev/null 21; then
display=$1
+   elif [ $1 = -listen ]; then
+   listenarg=
else
serverargs=$serverargs $1
fi
@@ -225,6 +228,8 @@ if [ $have_vtarg = no ]; then
 serverargs=$serverargs $vtarg
 fi
 
+serverargs=$serverargs $listenarg
+
 XCOMM if no display, use default
 if [ x$display = x ]; then
 display=$defaultdisplay
-- 
2.1.0

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH xinit 0/1] startx: Pass -nolisten tcp by default

2014-09-12 Thread Hans de Goede
Hi,

On 09/12/2014 11:12 AM, Mark Kettenis wrote:
 From: Hans de Goede hdego...@redhat.com
 Date: Fri, 12 Sep 2014 09:25:17 +0200

 Hi All,

 After doing the 1.3.4 release yesterday, I've started working on updating the
 Fedora packages to 1.3.4. While looking at our open bug list against xinit,
 I found one bug which is not yet resolved in 1.3.4 .

 This patch fixes this, I realize that this is a behavior change, and as such
 may be a bit controversial, but I really believe that in this day and age
 -nolisten tcp by default is the right thing to do.
 
 You're probably right.  However instead of fixing this in each and
 every bit of code that starts and X server, wouldn't it make more
 sense to simply change the default in the X server itself and add the
 -listen option there to override things?

I was thinking the same thing while working on this patch, the problem
is that most bits of code starting the xserver have already been patched
to start it with -nolisten tcp, and have their own config file options /
cmdline options to override this.

Changing the server would break all this, where as just changing startx
keeps all of the existing other xserver starters working.

Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH xinit 0/1] startx: Pass -nolisten tcp by default

2014-09-12 Thread Hans de Goede
Hi,

On 09/12/2014 02:11 PM, Laurent Bigonville wrote:
 Le Fri, 12 Sep 2014 09:25:17 +0200,
 Hans de Goede hdego...@redhat.com a écrit :
 
 Hi All,
 
 Hello,
 
 After doing the 1.3.4 release yesterday, I've started working on
 updating the Fedora packages to 1.3.4. While looking at our open bug
 list against xinit, I found one bug which is not yet resolved in
 1.3.4 .

 This patch fixes this, I realize that this is a behavior change, and
 as such may be a bit controversial, but I really believe that in this
 day and age -nolisten tcp by default is the right thing to do.
 
 On Debian we have the -nolisten tcp option set in the system-wide
 xserverrc file since 2006 at least.

Interesting, note though that startx will ignore xserverrc as soon as
any server options, including a display, are passed, so a not untypical
usage of:

startx -- :1

Will circumvent this.

 But isn't your patch preventing the user or local admin to explicitly
 ask to listen on tcp in xserverrc or .xserverrc ?

Which is why the actual commit message of the patch contains:

Pass -nolisten tcp by default, and add a special -listen server option
 which can be used to disable this new default behavior.

As well as actually doing so, and documenting this in the man page :)

Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xinit 0/1] startx: Pass -nolisten tcp by default

2014-09-12 Thread Hans de Goede
Hi,

On 09/12/2014 03:46 PM, Mark Kettenis wrote:
 Date: Fri, 12 Sep 2014 12:17:24 +0200
 From: Hans de Goede hdego...@redhat.com

 Hi,

 On 09/12/2014 11:12 AM, Mark Kettenis wrote:
 From: Hans de Goede hdego...@redhat.com
 Date: Fri, 12 Sep 2014 09:25:17 +0200

 Hi All,

 After doing the 1.3.4 release yesterday, I've started working on updating 
 the
 Fedora packages to 1.3.4. While looking at our open bug list against xinit,
 I found one bug which is not yet resolved in 1.3.4 .

 This patch fixes this, I realize that this is a behavior change, and as 
 such
 may be a bit controversial, but I really believe that in this day and age
 -nolisten tcp by default is the right thing to do.

 You're probably right.  However instead of fixing this in each and
 every bit of code that starts and X server, wouldn't it make more
 sense to simply change the default in the X server itself and add the
 -listen option there to override things?

 I was thinking the same thing while working on this patch, the problem
 is that most bits of code starting the xserver have already been patched
 to start it with -nolisten tcp, and have their own config file options /
 cmdline options to override this.

 Changing the server would break all this, where as just changing startx
 keeps all of the existing other xserver starters working.
 
 I don't see how this would break things.

User is using e.g. gdm to start the xserver, user wants the server to
listen on tcp, has added necessary gdm magic to not make gdm pass -nolisten 
tcp,
user all of a sudden gets -nolisten tcp regardless because that is now the
default.

Fixing this would require patching gdm, to pass the new -listen option to the
server when the user has requested to not pass -nolisten in gdm.conf.

And then the same for any other app starting the xserver which already passes
-nolisten tcp by default + and has an app specific way to tell the app to not
do that.

 Just make sure that
 -nolisten tcp continues to be accepted by the xserver.  It will
 become a no-op of course.  Unless perhaps you do something silly as
 starting the xserver with -listen tcp -nolisten tcp.

There is no such option as -listen (at least not according to man Xserver),
I've added one to startx, which negates startx's adding of -nolisten tcp

Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH xinit] startx: Pass -nolisten tcp by default

2014-09-12 Thread Hans de Goede
Hi,

On 09/12/2014 04:40 PM, Mateusz Jończyk wrote:
 W dniu 12.09.2014 o 09:25, Hans de Goede pisze:
 Having servers started by startx listen on tcp by default is not a good idea
 in this time and age. Pass -nolisten tcp by default, and add a special
 -listen server option which can be used to disable this new default behavior.

 Signed-off-by: Hans de Goede hdego...@redhat.com
 ---
  man/startx.man | 7 +++
  startx.cpp | 5 +
  2 files changed, 12 insertions(+)
 
 Hello,
 This may generate a security threat in case some people will assume that xinit
 uses -nolisten tcp by default and then do not pass this parameter on the
 command line.
 When that code will run will an older XServer version, it will expose the X
 Server on a network.

I don't think that adding warnings for security issues in older versions
to man-pages is a good idea. If we do that each time we tweak a security related
setting for better security by default man pages will become unreadable over 
time.

Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[ANNOUNCE] xinit 1.3.4

2014-09-11 Thread Hans de Goede
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi All,

I'm happy to announce the new xinit 1.3.4 release.

This release features various portability fixes, and
some startx clean-ups and improvements.

Alan Coopersmith (4):
  Fix warnings about parameters to startServer  startClient shadowing 
globals
  Pass files to cpp via CLI arg instead of stdin to workaround gcc 4.8 
change
  configure: Drop AM_MAINTAINER_MODE
  autogen.sh: Honor NOCONFIGURE=1

Brad Smith (1):
  Remove hardcoded path to OpenSSL for OpenBSD

Hans de Goede (7):
  Remove unixware / sco support
  Bump required util-macros version to 1.19
  Replace $RAWCPPFLAGS with $TRADITIONALCPPFLAGS when processing cpp files
  startx: Under Linux start X on the current VT
  startx: Pass vtX as long as the user did not specify one
  startx: Make the bugzilla reference in a comment survive cpp processing
  xinit 1.3.4

git tag: xinit-1.3.4

http://xorg.freedesktop.org/archive/individual/app/xinit-1.3.4.tar.bz2
MD5:  4e928452dfaf73851413a2d8b8c76388  xinit-1.3.4.tar.bz2
SHA1: de3469080d73ced1f7d7a1803e813bc6ea352072  xinit-1.3.4.tar.bz2
SHA256: 75d88d7397a07e01db253163b7c7a00b249b3d30e99489f2734cac9a0c7902b3  
xinit-1.3.4.tar.bz2
PGP:  http://xorg.freedesktop.org/archive/individual/app/xinit-1.3.4.tar.bz2.sig

http://xorg.freedesktop.org/archive/individual/app/xinit-1.3.4.tar.gz
MD5:  91c5697345016ec7841f5e5fccbe7a4c  xinit-1.3.4.tar.gz
SHA1: 78d6457ba69f07ae1a727a88ae12fb3897874f72  xinit-1.3.4.tar.gz
SHA256: 754c284875defa588951c1d3d2b20897d3b84918d0a97cb5a4724b00c0da0746  
xinit-1.3.4.tar.gz
PGP:  http://xorg.freedesktop.org/archive/individual/app/xinit-1.3.4.tar.gz.sig

Regards,

Hans
-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iEYEARECAAYFAlQR3eAACgkQF3VEtJrzE/tYkQCfaqR29DcD2PSDpJDxF0lZFLQC
gAYAn1k4PchtZIXtt6b05uIDF5vcqqJ2
=PiVL
-END PGP SIGNATURE-
___
xorg-announce mailing list
xorg-announce@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-announce


Re: [PATCH for 1.16 0/2] xfree86: Allow non-PCI devices as primary

2014-09-09 Thread Hans de Goede

Hi,

On 09/09/2014 12:12 AM, Julien Cristau wrote:

On Sat, Sep  6, 2014 at 10:14:29 +0200, Hans de Goede wrote:


Hi All,

When the support for automatically loading drivers for non-PCI devices
landed in 1.16, these 2 patches were missed, and without these 2 patches
the non-PCI device support does not work.

This is a straight cherry pick from master, with one compile error due to
1.16 not having syspath directly in OdevAttributes fixed.


Care to give me the commit ids from master?


Certainly:

http://cgit.freedesktop.org/xorg/xserver/commit/?id=2f0183222b4279266e6ef60b923738ff55f0afba
http://cgit.freedesktop.org/xorg/xserver/commit/?id=5d133276de9c50146e80ffc69edd429c2afe98e6

Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: EE Xorg.bin xf86PlatformMatchDriver - Segmentation fault - Server aborting

2014-09-07 Thread Hans de Goede
Hi poma,

On 09/05/2014 11:19 PM, poma wrote:
 ...
 
 - xorg-x11-server-Xorg-1.16.99.1-1.fc21.x86_64
   commit 3a51418
   *auto-detection* PASSED
 
 - xorg-x11-server-Xorg-1.16.99.1-2.fc21.x86_64
   commit 3a51418 + xorg-non-pci-v2.patch[1] (rebased xorg-non-pci.patch)
   *auto-detection* BROKEN

As discussed in another email discussion, we're dropping xorg-non-pci.patch,
as upstream has a different solution. I've just kicked of builds for F-21+
with this patch dropped, which should resolve your issue.

Regards,

Hans



 
 /var/log/Xorg.0.log
 [29.408] 
 This is a pre-release version of the X server from Fedora Project.
 It is not supported in any way.
 Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/.
 Select the xorg product for bugs you find in this release.
 Before reporting bugs in pre-release versions please check the
 latest version in the X.Org Foundation git repository.
 See http://wiki.x.org/wiki/GitPage for git access instructions.
 [29.409] 
 X.Org X Server 1.16.99.1
 Release Date: 2014-07-17
 [29.409] X Protocol Version 11, Revision 0
 [29.409] Build Operating System: lnx 3.17.0-0.rc3.git0.1.fc22.x86_64 
 [29.409] Current Operating System: Linux rawhide642 
 3.17.0-0.rc3.git0.1.fc22.x86_64 #1 SMP Mon Sep 1 14:47:34 UTC 2014 x86_64
 [29.409] Kernel command line: 
 BOOT_IMAGE=/vmlinuz-3.17.0-0.rc3.git0.1.fc22.x86_64 
 root=UUID=a07556d2-6fe2-417f-8202-c54c07fd9386 
 drm_kms_helper.edid_firmware=DVI-I-1:edid/848x480.bin  
 initrd=/initramfs-3.17.0-0.rc3.git0.1.fc22.x86_64.img
 [29.409] Build Date: 05 September 2014  09:11:28PM
 [29.410] Build ID: xorg-x11-server 1.16.99.1-2.fc21 
 [29.410] Current version of pixman: 0.32.6
 [29.410]  Before reporting problems, check http://wiki.x.org
   to make sure that you have the latest version.
 [29.410] Markers: (--) probed, (**) from config file, (==) default 
 setting,
   (++) from command line, (!!) notice, (II) informational,
   (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
 [29.411] (==) Log file: /var/log/Xorg.0.log, Time: Fri Sep  5 22:40:21 
 2014
 [29.411] (==) Using system config directory /usr/share/X11/xorg.conf.d
 [29.426] (==) No Layout section.  Using the first Screen section.
 [29.426] (==) No screen section available. Using defaults.
 [29.426] (**) |--Screen Default Screen Section (0)
 [29.427] (**) |   |--Monitor default monitor
 [29.427] (==) No monitor specified for screen Default Screen Section.
   Using a default monitor configuration.
 [29.427] (==) Automatically adding devices
 [29.427] (==) Automatically enabling devices
 [29.427] (==) Automatically adding GPU devices
 [29.428] (==) FontPath set to:
   catalogue:/etc/X11/fontpath.d,
   built-ins
 [29.428] (==) ModulePath set to /usr/lib64/xorg/modules
 [29.428] (II) The server relies on udev to provide the list of input 
 devices.
   If no devices become available, reconfigure udev or disable 
 AutoAddDevices.
 [29.428] (II) Loader magic: 0x81be40
 [29.428] (II) Module ABI versions:
 [29.428]  X.Org ANSI C Emulation: 0.4
 [29.428]  X.Org Video Driver: 18.0
 [29.428]  X.Org XInput driver : 21.0
 [29.428]  X.Org Server Extension : 8.0
 [29.434] (EE) systemd-logind: failed to get session: PID 655 does not 
 belong to any known session
 [29.435] (II) xfree86: Adding drm device (/dev/dri/card1)
 [29.436] (II) xfree86: Adding drm device (/dev/dri/card0)
 [29.460] (--) PCI:*(0:1:0:0) 10de:087d:1849:087d rev 177, Mem @ 
 0xfb00/16777216, 0xe000/268435456, 0xf600/33554432, I/O @ 
 0xec00/128, BIOS @ 0x/131072
 [29.461] (II) LoadModule: glx
 [29.462] (II) Loading /usr/lib64/xorg/modules/extensions/libglx.so
 [29.487] (II) Module glx: vendor=X.Org Foundation
 [29.487]  compiled for 1.16.99.1, module version = 1.0.0
 [29.488]  ABI class: X.Org Server Extension, version 8.0
 [29.488] (==) AIGLX enabled
 [29.488] (EE) 
 [29.488] (EE) Backtrace:
 [29.490] (EE) 0: /usr/libexec/Xorg.bin (OsSigHandler+0x29) [0x59ab89]
 [29.491] (EE) 1: /lib64/libpthread.so.0 (__restore_rt+0x0) 
 [0x7f0d482947cf]
 [29.492] (EE) 2: /usr/libexec/Xorg.bin (xf86PlatformMatchDriver+0x31d) 
 [0x49a3fd]
 [29.494] (EE) 3: /usr/libexec/Xorg.bin 
 (listPossibleVideoDrivers.constprop.0+0x3d) [0x49d54d]
 [29.508] (EE) 4: /usr/libexec/Xorg.bin (autoConfigDevice+0xfe) [0x49da3e]
 [29.509] (EE) 5: /usr/libexec/Xorg.bin (InitOutput+0xb56) [0x47b9e6]
 [29.510] (EE) 6: /usr/libexec/Xorg.bin (dix_main+0x1ea) [0x43cd5a]
 [29.512] (EE) 7: /lib64/libc.so.6 (__libc_start_main+0xf0) 
 [0x7f0d47edd0e0]
 [29.514] (EE) 8: /usr/libexec/Xorg.bin (_start+0x29) [0x4273ae]
 [29.516] (EE) 9: ? (?+0x29) [0x29]
 [29.516] (EE) 
 [29.516] (EE) Segmentation fault at address 0x0
 [29.517] (EE) 
 Fatal server error:
 [29.517] (EE) Caught signal 11 

[PATCH for 1.16 1/2] xfree86: Fallback to first platform device as primary

2014-09-06 Thread Hans de Goede
From: Thierry Reding tred...@nvidia.com

When neither of the various bus implementations was able to find a
primary bus and device, fallback to using the platform bus as primary
bus and the first platform device as primary device.

Signed-off-by: Thierry Reding tred...@nvidia.com
Reviewed-by: Rob Clark robdcl...@gmail.com
Tested-by: Rob Clark robdcl...@gmail.com
Signed-off-by: Keith Packard kei...@keithp.com
Signed-off-by: Hans de Goede hdego...@redhat.com
---
 hw/xfree86/common/xf86Bus.c |  3 +++
 hw/xfree86/common/xf86platformBus.c | 17 +
 hw/xfree86/common/xf86platformBus.h |  1 +
 3 files changed, 21 insertions(+)

diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index b3b3f8c..bd3e4e3 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -210,6 +210,9 @@ xf86BusProbe(void)
 #if (defined(__sparc__) || defined(__sparc))  !defined(__OpenBSD__)
 xf86SbusProbe();
 #endif
+#ifdef XSERVER_PLATFORM_BUS
+xf86platformPrimary();
+#endif
 }
 
 /*
diff --git a/hw/xfree86/common/xf86platformBus.c 
b/hw/xfree86/common/xf86platformBus.c
index eb1a3fb..1890494 100644
--- a/hw/xfree86/common/xf86platformBus.c
+++ b/hw/xfree86/common/xf86platformBus.c
@@ -635,4 +635,21 @@ void xf86platformVTProbe(void)
 xf86PlatformReprobeDevice(i, xf86_platform_devices[i].attribs);
 }
 }
+
+void xf86platformPrimary(void)
+{
+/* use the first platform device as a fallback */
+if (primaryBus.type == BUS_NONE) {
+xf86Msg(X_INFO, no primary bus or device found\n);
+
+if (xf86_num_platform_devices  0) {
+char *syspath = xf86_get_platform_attrib(0, ODEV_ATTRIB_SYSPATH);
+
+primaryBus.id.plat = xf86_platform_devices[0];
+primaryBus.type = BUS_PLATFORM;
+
+xf86Msg(X_NONE, \tfalling back to %s\n, syspath);
+}
+}
+}
 #endif
diff --git a/hw/xfree86/common/xf86platformBus.h 
b/hw/xfree86/common/xf86platformBus.h
index 5dee4e0..dec1956 100644
--- a/hw/xfree86/common/xf86platformBus.h
+++ b/hw/xfree86/common/xf86platformBus.h
@@ -77,6 +77,7 @@ extern _X_EXPORT int
 xf86PlatformMatchDriver(char *matches[], int nmatches);
 
 extern void xf86platformVTProbe(void);
+extern void xf86platformPrimary(void);
 #endif
 
 #endif
-- 
2.1.0

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH for 1.16 2/2] xfree86: Allow non-PCI devices as primary

2014-09-06 Thread Hans de Goede
From: Thierry Reding tred...@nvidia.com

On platforms that don't support PCI or have no GPU attached to the PCI
bus, there can still be a primary device on a non-PCI bus.

Signed-off-by: Thierry Reding tred...@nvidia.com
Reviewed-by: Rob Clark robdcl...@gmail.com
Tested-by: Rob Clark robdcl...@gmail.com
Signed-off-by: Keith Packard kei...@keithp.com
Signed-off-by: Hans de Goede hdego...@redhat.com
---
 hw/xfree86/common/xf86platformBus.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/hw/xfree86/common/xf86platformBus.c 
b/hw/xfree86/common/xf86platformBus.c
index 1890494..c541788 100644
--- a/hw/xfree86/common/xf86platformBus.c
+++ b/hw/xfree86/common/xf86platformBus.c
@@ -476,10 +476,9 @@ xf86platformProbeDev(DriverPtr drvp)
 /* for non-seat0 servers assume first device is the master */
 if (ServerIsNotSeat0())
 break;
-if (xf86_platform_devices[j].pdev) {
-if (xf86IsPrimaryPlatform(xf86_platform_devices[j]))
-break;
-}
+
+if (xf86IsPrimaryPlatform(xf86_platform_devices[j]))
+break;
 }
 }
 
-- 
2.1.0

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH for 1.16 0/2] xfree86: Allow non-PCI devices as primary

2014-09-06 Thread Hans de Goede
Hi All,

When the support for automatically loading drivers for non-PCI devices
landed in 1.16, these 2 patches were missed, and without these 2 patches
the non-PCI device support does not work.

This is a straight cherry pick from master, with one compile error due to
1.16 not having syspath directly in OdevAttributes fixed.

Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH synaptics] eventcomm: ensure we're on the same clock as the server

2014-09-03 Thread Hans de Goede
Hi,

On 09/03/2014 04:20 AM, Peter Hutterer wrote:
 Default on evdev devices is CLOCK_REALTIME. If that clock falls behind the
 server's CLOCK_MONOTONIC, motion after a clickpad click may be delayed by the
 difference in the clocks.
 
 In detail:
 When the timer func is triggered, GetTimeInMillis() which is CLOCK_MONOTONIC,
 is stored as hwState-millis. The eventcomm backend uses struct
 input_event time (CLOCK_REALTIME).
 
 When we read events from the device, if the evdev time is less than the server
 time, the fix for (#48777) sets the current event time to hwState-millis.
 Until the evdev time overtakes that stored time, all events have the
 hwState-millis time.
 
 If during that time a clickpad triggers a physical click,
 clickpad_click_millis is set to hwState-millis + the ignore-motion timeout.
 Thus, all motion is ignored until the event time overtakes that stored
 time.
 
 The whole issue is further enhanced by us unconditionally setting the timer
 func if we get any events, which is a separate issue anyway.
 
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Looks good:

Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

Hans


 ---
  src/eventcomm.c | 13 +++--
  1 file changed, 11 insertions(+), 2 deletions(-)
 
 diff --git a/src/eventcomm.c b/src/eventcomm.c
 index 845f547..4a646af 100644
 --- a/src/eventcomm.c
 +++ b/src/eventcomm.c
 @@ -39,6 +39,7 @@
  #include dirent.h
  #include string.h
  #include stdio.h
 +#include time.h
  #include synproto.h
  #include synapticsstr.h
  #include xf86.h
 @@ -88,6 +89,8 @@ struct eventcomm_proto_data {
  
  struct libevdev *evdev;
  enum libevdev_read_flag read_flag;
 +
 +int have_monotonic_clock;
  };
  
  #ifdef HAVE_LIBEVDEV_DEVICE_LOG_FUNCS
 @@ -234,6 +237,7 @@ EventDeviceOnHook(InputInfoPtr pInfo, SynapticsParameters 
 * para)
  SynapticsPrivate *priv = (SynapticsPrivate *) pInfo-private;
  struct eventcomm_proto_data *proto_data =
  (struct eventcomm_proto_data *) priv-proto_data;
 +int ret;
  
  if (libevdev_get_fd(proto_data-evdev) != -1) {
  struct input_event ev;
 @@ -253,7 +257,6 @@ EventDeviceOnHook(InputInfoPtr pInfo, SynapticsParameters 
 * para)
  
  if (para-grab_event_device) {
  /* Try to grab the event device so that data don't leak to 
 /dev/input/mice */
 -int ret;
  
  ret = libevdev_grab(proto_data-evdev, LIBEVDEV_GRAB);
  if (ret  0) {
 @@ -265,6 +268,9 @@ EventDeviceOnHook(InputInfoPtr pInfo, SynapticsParameters 
 * para)
  
  proto_data-need_grab = FALSE;
  
 +ret = libevdev_set_clock_id(proto_data-evdev, CLOCK_MONOTONIC);
 +proto_data-have_monotonic_clock = (ret == 0);
 +
  InitializeTouch(pInfo);
  
  return TRUE;
 @@ -682,7 +688,10 @@ EventReadHwState(InputInfoPtr pInfo,
  switch (ev.code) {
  case SYN_REPORT:
  hw-numFingers = count_fingers(pInfo, comm);
 -hw-millis = 1000 * ev.time.tv_sec + ev.time.tv_usec / 1000;
 +if (proto_data-have_monotonic_clock)
 +hw-millis = 1000 * ev.time.tv_sec + ev.time.tv_usec / 
 1000;
 +else
 +hw-millis = GetTimeInMillis();
  SynapticsCopyHwState(hwRet, hw);
  return TRUE;
  }
 
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Doing a new xinit release ?

2014-08-28 Thread Hans de Goede
Hi All,

I know I send this same a couple of months ago as well, and then did
nothing (as I got burried on other work), but this time I really do
plan to do a new release soon :)

Starting the X-server as non root through startx on Linux requires some
startx changes, which are now all in place. As such I would like to do
a new xinit release, any objections ?

Also if anyone still has any pending xinit patches please send them to
the list ASAP so that we can include them in the upcoming release.

Thanks  Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH xinit] startx: Make the bugzilla reference in a comment survive cpp processing

2014-08-26 Thread Hans de Goede
https://bugs.freedesktop.org/show_bug.cgi?id=83019

Signed-off-by: Hans de Goede hdego...@redhat.com
---
 startx.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/startx.cpp b/startx.cpp
index 5dafce7..1c6fce0 100644
--- a/startx.cpp
+++ b/startx.cpp
@@ -191,7 +191,7 @@ if [ x$server = x ]; then
 #ifdef __linux__
 XCOMM When starting the defaultserver start X on the current tty to avoid
 XCOMM the startx session being seen as inactive:
-XCOMM https://bugzilla.redhat.com/show_bug.cgi?id=806491
+XCOMM https://bugzilla.redhat.com/show_bug.cgi?id=806491;
 tty=$(tty)
 if expr match $tty '^/dev/tty[0-9]\+$'  /dev/null; then
 tty_num=$(echo $tty | grep -oE '[0-9]+$')
-- 
2.1.0

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH synaptics] conf: increase top software button area to 15%

2014-08-06 Thread Hans de Goede
Hi,

On 08/06/2014 04:13 AM, Peter Hutterer wrote:
 We had reports that the top software button area is hard to hit for those
 using the trackpoint and clicking the buttons with their thumb.
 
 Analysis of event recordings (3 different people) for left, right and middle
 clicks shows that there is a significant amount of events up to about 10mm
 (with outliers up to 12mm) from the top of the touchpad. That maps to 15%.
 
 Interestingly, the middle button is not affected by this, presumably the
 haptic feedback of the little dots sticking out from the surface make hitting
 the button easier.
 
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Looks good, thanks.

Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

Hans

 ---
  conf/50-synaptics.conf | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/conf/50-synaptics.conf b/conf/50-synaptics.conf
 index a3145b8..aa50456 100644
 --- a/conf/50-synaptics.conf
 +++ b/conf/50-synaptics.conf
 @@ -33,7 +33,7 @@ Section InputClass
  Identifier Default clickpad buttons
  MatchDriver synaptics
  Option SoftButtonAreas 50% 0 82% 0 0 0 0 0
 -Option SecondarySoftButtonAreas 58% 0 0 8% 42% 58% 0 8%
 +Option SecondarySoftButtonAreas 58% 0 0 15% 42% 58% 0 15%
  EndSection
  
  # This option disables software buttons on Apple touchpads.
 
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH xf86-video-ati] configure: Include xorg-server.h before glamor.h

2014-07-28 Thread Hans de Goede
glamor.h cannot be included without first including xorg-server.h, this also
applies to including it from configure snippets.

Without this the configure glamor checks fail on systems with the latest
glibc, throwing this error:

In file included from /usr/include/xorg/misc.h:115:0,
 from /usr/include/xorg/screenint.h:50,
 from /usr/include/xorg/scrnintstr.h:50,
 from /usr/include/xorg/glamor.h:32,
 from conftest.c:61:
/usr/include/xorg/os.h:579:2: error: expected identifier or '(' before
'__exten
 strndup(const char *str, size_t n);
  ^

This is caused by HAVE_STRNDUP not being set (it is set from xorg-server.h),
causing os.h to redefine it.

Signed-off-by: Hans de Goede hdego...@redhat.com
---
 configure.ac | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 101ca17..e74a0a2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -106,12 +106,13 @@ AC_ARG_ENABLE(glamor,
  [GLAMOR=yes])
 
 if test x$GLAMOR != xno; then
-   AC_CHECK_HEADERS([glamor.h], [GLAMOR_H=yes], [GLAMOR_H=no], [])
+   AC_CHECK_HEADERS([glamor.h], [GLAMOR_H=yes], [GLAMOR_H=no], 
[#include xorg-server.h])
 
if test x$GLAMOR_H = xyes; then
AC_CHECK_DECL(GLAMOR_NO_DRI3,
  [GLAMOR_XSERVER=yes], [GLAMOR_XSERVER=no],
- [#include glamor.h])
+ [#include xorg-server.h
+  #include glamor.h])
fi
 
if test x$GLAMOR_XSERVER != xyes; then
-- 
2.0.1

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH 0/2] Replace OdevAttributes API

2014-07-16 Thread Hans de Goede
Hi,

On 07/16/2014 02:31 AM, Keith Packard wrote:
 Here's a 'real' version of the proposed OdevAttributes API
 change. This one provides a patch which adds a backward compatible API
 for drivers. I made that API perform compile-time checks on the
 attribute and default values provided to make sure drivers won't get
 surprised by the semantic differences between the APIs.

Both patches look good to me and are:

Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH v2 0/2] Fix ODEV_ATTRIB_DRIVER overlapping with ODEV_ATTRIB_FD

2014-07-15 Thread Hans de Goede
Hi,

On 07/15/2014 01:19 AM, Keith Packard wrote:
 Hans de Goede hdego...@redhat.com writes:
 
 Note the robustness patch needs to be applied after the fix, otherwise
 the switch-case in the fix will fail to compile due to a duplicate
 label.
 
 This is better than my version as it effectively types the values
 explicitly. Thanks!

You're welcome.

 
 Reviewed-by: Keith Packard kei...@keithp.com
 
 Merged.
9a19bf0..4dbb641  master - master

Thanks.

 I've spent a few minutes this morning reworking the OdevAttributes stuff
 to just store the values in a struct; this results in compile-time
 typechecking of values and about 200 lines less code. This isn't going
 into 1.16, but can land immediately afterwards, once reviewed.

Hmm, I'm not sure I like this change. I can see it is a nice cleanup,
but there are 2 things about it I don't like:

1) I was not around when the OdevAttributes stuff got added, but I
think the idea behind it was to be able to add new atrributes without
breaking ABI (as was done this cycle when adding the driver string,
although that needed a bit of a fixup).

2) It will require some ugly #ifdef-ery in almost all the drivers to work
with both the old and the new way.

Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH] headers: Fix build errors with latest glibc

2014-07-15 Thread Hans de Goede
Hi,

On 07/14/2014 03:41 PM, Daniel Stone wrote:
 Hi,
 
 On 14 July 2014 13:51, Hans de Goede hdego...@redhat.com wrote:
 
 On 07/14/2014 02:43 PM, Julien Cristau wrote:
 On Mon, Jul 14, 2014 at 14:33:00 +0200, Hans de Goede wrote:
 Can I / we please get a reply from you on this ?
 As explained below this is not about glamor.h, but about
 making os.h safe to include which really is an
 orthogonal problem, The glamor.h usage of os.h was
 just a (bad) example.

 The drivers need to include xorg-server.h before any other server
 header.  AFAICT that's true both before and after your patch.

 
 Yes, this is basically my position. Including anything from xorg/*.h
 without having either xorg-server.h (for drivers) or xorg-config.h
 (internal) included first results in undefined behaviour. Specifically on
 64-bit systems, you lose out horrendously because CARD32 secretly gets
 promoted via unsigned long to CARD64, as _XSERVER64 is not defined. The
 lack of all the functional definitions in xorg-server.h also means that
 your ABI's probably different even without the type differences.
 
 It's a terrible, terrible, idea that results in really hard-to-track-down
 bug reports. To be fair, I'm not on the end of these bug reports anymore,
 but it's not fun. Anything we can do to discourage this would be better.
 
 
 Well in practice they are not doing that, and they are getting
 away with it (iow everything works just fine), except that
 os.h starts re-defining system libc functions.

 
 
 
 I really don't want to go and fix every single driver out there.

 
 To be honest, I really don't think it would be every single driver.
 
 
 There may be some headers where drivers really *must* include
 xorg-server.h first, but os.h is not one of them. So far we've
 been getting away with os.h redefining e.g. strndup, but with
 the latest glibc things have started to conflict.

 I know X is really really old, so we have a bunch of legacy,
 like headers which do not work stand-alone (which is considered
 a big no no in modern C development practices). But just because
 we have this legacy we should no strive to do better.

 So there are 2 reasons to make these changes to os.h:

 1) It avoids the need to fix every single driver out there
 2) It is simply the right thing to do

 
 os.h isn't safe to necessarily safe to include without xorg-server.h, as it
 drags in misc.h, which has: extern _X_EXPORT void SwapLongs(CARD32 *list,
 unsigned long count);
 
 Again, CARD32 is unsigned long without xorg-server.h, which makes it 64-bit
 on those systems; including xorg-server.h defines _XSERVER64, which makes
 CARD32 actually be uint32_t. Not massively harmful, but still not really
 great. A lot of the authorization functions also use XID types, which have
 the same variance on 64-bit systems without xorg-server.h.
 
 It might not be strictly harmful in some cases, but it's not the sort of
 thing I want to encourage. 'Always include xorg-server.h before any X
 header ever' is a really simple rule to remember for driver developers;
 muddying the water, particularly when not documented, isn't amazingly
 helpful IMHO.

Ok, fair enough. I hope someone will get around to fixup drivers where
necessary before the next Fedora mass-rebuild though. If not I guess I
will get to see how bad the driver situation wrt this really is.

Regards,

Hans


___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH] headers: Fix build errors with latest glibc

2014-07-15 Thread Hans de Goede
Hi,

On 07/15/2014 10:42 AM, Hans de Goede wrote:

snip

 It might not be strictly harmful in some cases, but it's not the sort of
 thing I want to encourage. 'Always include xorg-server.h before any X
 header ever' is a really simple rule to remember for driver developers;
 muddying the water, particularly when not documented, isn't amazingly
 helpful IMHO.
 
 Ok, fair enough. I hope someone will get around to fixup drivers where
 necessary before the next Fedora mass-rebuild though. If not I guess I
 will get to see how bad the driver situation wrt this really is.

For starters someone needs to fixup glamor.h, who should I poke for that?

Or should xf86-video-ati be fixed to include xorg-server.h before glamor.h ?

Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH v2 0/2] Fix ODEV_ATTRIB_DRIVER overlapping with ODEV_ATTRIB_FD

2014-07-15 Thread Hans de Goede

Hi,

On 07/15/2014 11:33 AM, Keith Packard wrote:

Hans de Goede hdego...@redhat.com writes:


1) I was not around when the OdevAttributes stuff got added, but I
think the idea behind it was to be able to add new atrributes without
breaking ABI (as was done this cycle when adding the driver string,
although that needed a bit of a fixup).


The server ABI changes at every single X server release, so ABI
compatibility of this interface isn't going to help driver authors at
all.


True.


2) It will require some ugly #ifdef-ery in almost all the drivers to work
with both the old and the new way.


There are 18 references to ODEV_ in all of the open source drivers
(master as of this morning):

./xf86-video-freedreno/src/msm-driver.c:fd = 
xf86_get_platform_device_int_attrib(dev, ODEV_ATTRIB_FD, -1);
./xf86-video-opentegra/src/driver.c:
   ODEV_ATTRIB_PATH);
./xf86-video-opentegra/src/driver.c:char *path = 
xf86_get_platform_device_attrib(dev, ODEV_ATTRIB_PATH);
./xf86-video-modesetting/src/driver.c:fd = 
xf86_get_platform_device_int_attrib(platform_dev, ODEV_ATTRIB_FD, -1);
./xf86-video-modesetting/src/driver.c:const char *path = 
xf86_get_platform_device_attrib(dev, ODEV_ATTRIB_PATH);
./xf86-video-modesetting/src/driver.c:ms-fd = 
xf86_get_platform_device_int_attrib(pEnt-location.id.plat, ODEV_ATTRIB_FD, -1);
./xf86-video-modesetting/src/driver.c:char *path = 
xf86_get_platform_device_attrib(pEnt-location.id.plat, ODEV_ATTRIB_PATH);
./xf86-video-intel/src/intel_device.c:#if defined(ODEV_ATTRIB_PATH)
./xf86-video-intel/src/intel_device.c:  path = 
xf86_get_platform_device_attrib(dev, ODEV_ATTRIB_PATH);
./xf86-video-intel/src/intel_device.c:#if defined(ODEV_ATTRIB_FD)
./xf86-video-intel/src/intel_device.c:  return 
xf86_get_platform_device_int_attrib(dev, ODEV_ATTRIB_FD, -1);
./xf86-video-omap/src/omap_driver.c:
ODEV_ATTRIB_BUSID);
./xf86-video-omap/src/omap_driver.c:char *busid = 
xf86_get_platform_device_attrib(dev, ODEV_ATTRIB_BUSID);
./xf86-video-ati/src/radeon_kms.c:  
   ODEV_ATTRIB_FD, -1);
./xf86-video-vmware/vmwgfx/vmwgfx_driver.c:#ifdef ODEV_ATTRIB_FD
./xf86-video-vmware/vmwgfx/vmwgfx_driver.c: 
 ODEV_ATTRIB_FD, -1);
./xf86-video-qxl/src/qxl_kms.c:#if defined(ODEV_ATTRIB_FD)
./xf86-video-qxl/src/qxl_kms.c: 
 ODEV_ATTRIB_FD, -1);

We could either just have #ifdefs in these few places, or if we were
really lazy, we could provide inline functions for the two getter
functions used here and still net an overall savings in code.


I think defining 2 inlines for the 2 getter functions is a good idea.

Can you resend the patch as a proper top-level mail with the inlines
added? Then I'll review it.

I guess we should probably wait a bit with applying this to give others a
chance to respond.

Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH v2 0/2] Fix ODEV_ATTRIB_DRIVER overlapping with ODEV_ATTRIB_FD

2014-07-14 Thread Hans de Goede
Hi Keith,

Here is a v2 of my odev-attrribute fix patch. The actual patch itself is
unchanged. New is the second patch which makes the api robust against storing
an int in a string attribute or vice versa.

Note the robustness patch needs to be applied after the fix, otherwise
the switch-case in the fix will fail to compile due to a duplicate label.

Regards,

Hans
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


<    1   2   3   4   5   6   7   8   9   >