Re: [PULL 1.13 v2] input fixes and video ABI 13.1

2012-10-25 Thread Timo Aaltonen
On 12.10.2012 09:35, Peter Hutterer wrote:
 On Fri, Oct 12, 2012 at 12:14:21AM -0600, Matt Dew wrote:
 Ack'd.
   Are there any bugzilla tickets (fdo or other?) related to this?
 
 https://bugs.freedesktop.org/show_bug.cgi?id=55752 is the one for the ABI
 bump though it may be a bit sparse.

https://bugs.freedesktop.org/show_bug.cgi?id=54614
for Xi: Don't check for TOUCH_END, it's never set


 On Thu, Oct 11, 2012 at 5:59 PM, Peter Hutterer 
 peter.hutte...@who-t.netwrote:

 Matt,

 This is an updated pull request for server 1.13.1. One more input fix,
 scaling edge
 cases into the correct coordinates. A bigger change is the export of the
 new
 xf86UpdateDesktopDimensions() API as part of ABI 13.1. This is a
 convenience
 API for binary drivers (read: NVIDIA) to update the server's representation
 of the desktop dimensions after changing outputs. That again is needed for
 the transformation matrix to work, e.g. if you want a tablet mapped to a
 single screen only.

 Cheers,
Peter

 The following changes since commit
 f0bad69edd57facd6cffde8cb0863d1a735e2492:

   Version bumped to 1.13 (2012-09-05 14:45:08 -0700)

 are available in the git repository at:

   git://people.freedesktop.org/~whot/xserver server-1.13-branch

 for you to fetch changes up to 8f39a6b0b35764c8d5cac4c7bf66d5902c0ae9a5:

   xfree86: add xf86UpdateDesktopDimensions() (2012-10-12 09:48:10 +1000)

 
 Daniel Drake (1):
   Xi: Don't check for TOUCH_END, it's never set

 Daniel Stone (1):
   Touch: Fix duplicate TouchBegin selection with virtual devices

 Peter Hutterer (3):
   dix: set the device transformation matrix
   dix: fix crash on XI 1.x grabs on disabled devices.  (#54934)
   xfree86: add xf86UpdateDesktopDimensions()

 Yufeng Shen (1):
   dix: fix scale_to_desktop for edge ABS events

  Xi/exevents.c  | 2 --
  Xi/xiselectev.c| 9 +++--
  dix/devices.c  | 3 +++
  dix/events.c   | 9 ++---
  dix/getevents.c| 4 ++--
  hw/xfree86/common/xf86.h   | 4 
  hw/xfree86/common/xf86Helper.c | 6 ++
  hw/xfree86/common/xf86Module.h | 2 +-
  8 files changed, 29 insertions(+), 10 deletions(-)

 ___
 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
 


-- 
t
___
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] macros: clarify documentation

2012-10-25 Thread Yaakov (Cygwin/X)
From: Yaakov Selkowitz yselkow...@users.sourceforge.net

Signed-off-by: Yaakov Selkowitz yselkow...@users.sourceforge.net
---
 xorg-server.m4 |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xorg-server.m4 b/xorg-server.m4
index bdecf62..18255b9 100644
--- a/xorg-server.m4
+++ b/xorg-server.m4
@@ -23,10 +23,10 @@ dnl other dealings in this Software without prior written 
authorization
 dnl from the copyright holders.
 dnl 
 
-# XORG_DRIVER_CHECK_EXT()
+# XORG_DRIVER_CHECK_EXT(MACRO, PROTO)
 # --
-# Checks for the $1 define in xorg-server.h (from the sdk).  If it
-# is defined, then add $1 to $REQUIRED_MODULES.
+# Checks for the MACRO define in xorg-server.h (from the sdk).  If it
+# is defined, then add the given PROTO to $REQUIRED_MODULES.
 
 AC_DEFUN([XORG_DRIVER_CHECK_EXT],[
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-- 
1.7.9

___
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] libpciaccess: support for QNX 6.x platform

2012-10-25 Thread Mike Gorchak
Hi,

I've added support for QNX 6.x platform to the libpciaccess.

Additionally I've added output of 64bit address to scanpci tool.

Thanks.


libpciaccess-0.13.1-qnx.diff
Description: Binary data
___
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] libdrm: support for QNX 6.x platform

2012-10-25 Thread Mike Gorchak
Hi,

I've added support for QNX 6.x platform to the libdrm.

Thanks.


libdrm-2.4.39-qnx.diff
Description: Binary data
___
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

xserver stable branch management

2012-10-25 Thread Matt Dew

I've taken on the stable xserver branch manager stuff.

My apologies for dropping off like that folks.

I'm still alive but work has been completely kicking my butt due to 
major deadline next week, so it's taken me some time to get things 
going.  I've now managed successfully build the xserver and pull in 
Peter's patch to test it.  Schedule coming soon, as are more pokes to 
people.



I'll get there,
Matt
___
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


[PULL] unreviewed patches

2012-10-25 Thread Peter Hutterer
All these need review lovin'. 

Pull request is on top of my for-keith branch
from last Friday.
http://lists.freedesktop.org/archives/xorg-devel/2012-October/034064.html

The following changes since commit c5396ec05a5c6cab6608ba677f703c5227b1de13:

  xf86: Fix build against recent Linux kernel (2012-10-19 13:12:33 +1000)

are available in the git repository at:

  git://people.freedesktop.org/~whot/xserver unreviewed

for you to fetch changes up to c97467d449c30da7529bdcc68c3ed344828a6baa:

  dix: don't filter RawEvents if the grab window is not the root window 
(#53897) (2012-10-25 15:54:02 +1000)


Peter Hutterer (7):
  dix: don't allow disabling XTest devices
  xkb: ProcesssPointerEvent must work on the VCP if it gets the VCP
  Xi: set xChangeDeviceControlReply.status to Success by default
  Xi: don't deliver TouchEnd to a client waiting for TouchBegin (#55738)
  dix: fix zaphod screen scrossing (#54654)
  xfree86: remove unused variable sigstate
  dix: don't filter RawEvents if the grab window is not the root window 
(#53897)

 Xi/chgdctl.c   | 8 ++--
 Xi/exevents.c  | 5 +
 dix/devices.c  | 6 --
 dix/events.c   | 9 ++---
 dix/getevents.c| 5 +++--
 hw/xfree86/common/xf86Events.c | 2 +-
 xkb/xkbAccessX.c   | 2 +-
 7 files changed, 26 insertions(+), 11 deletions(-)


pgpNrzp8QFMEX.pgp
Description: PGP signature
___
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

[PULL] Pixman glyph cache

2012-10-25 Thread Søren Sandmann
The following changes since commit a69429a17bf4630f6e26f61630a1c2b287202627:

  Fix 'make distcheck' for hw/xwin (2012-10-11 12:54:12 +0100)

are available in the git repository at:

  git+ssh://sandm...@people.freedesktop.org/~sandmann/xserver for-keithp

Søren Sandmann Pedersen (1):
  Use new pixman_glyph_cache_t API that will be in pixman 0.28.0

 configure.ac  |2 +-
 fb/fb.h   |3 +
 fb/fbpict.c   |  153 -
 fb/fbscreen.c |1 +
 4 files changed, 157 insertions(+), 2 deletions(-)
___
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] macros: clarify documentation

2012-10-25 Thread Peter Hutterer
On Wed, Oct 24, 2012 at 11:58:49PM -0500, Yaakov (Cygwin/X) wrote:
 From: Yaakov Selkowitz yselkow...@users.sourceforge.net
 
 Signed-off-by: Yaakov Selkowitz yselkow...@users.sourceforge.net
 ---
  xorg-server.m4 |6 +++---
  1 files changed, 3 insertions(+), 3 deletions(-)
 
 diff --git a/xorg-server.m4 b/xorg-server.m4
 index bdecf62..18255b9 100644
 --- a/xorg-server.m4
 +++ b/xorg-server.m4
 @@ -23,10 +23,10 @@ dnl other dealings in this Software without prior written 
 authorization
  dnl from the copyright holders.
  dnl 
  
 -# XORG_DRIVER_CHECK_EXT()
 +# XORG_DRIVER_CHECK_EXT(MACRO, PROTO)
  # --
 -# Checks for the $1 define in xorg-server.h (from the sdk).  If it
 -# is defined, then add $1 to $REQUIRED_MODULES.
 +# Checks for the MACRO define in xorg-server.h (from the sdk).  If it
 +# is defined, then add the given PROTO to $REQUIRED_MODULES.
  
  AC_DEFUN([XORG_DRIVER_CHECK_EXT],[
   AC_REQUIRE([PKG_PROG_PKG_CONFIG])
 -- 
 1.7.9

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


___
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 xorg-gtest 1/4] xserver: increase timout to 3 seconds

2012-10-25 Thread Peter Hutterer
A server without a config file that inits all input devices takes just over
a second on my machine. Up this timeout so we don't get spurious signals
later.

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
---
 src/xserver.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/xserver.cpp b/src/xserver.cpp
index 29c0430..9b163bb 100644
--- a/src/xserver.cpp
+++ b/src/xserver.cpp
@@ -419,7 +419,7 @@ void xorg::testing::XServer::Start(const std::string 
program) {
   std::string err_msg;
 
   sigset_t sig_mask;
-  struct timespec sig_timeout = {1, 0}; /* 1 sec + 0 nsec */
+  struct timespec sig_timeout = {3, 0}; /* 3 sec + 0 nsec */
 
   /* add SIGUSR1 to the signal mask */
   sigemptyset(sig_mask);
-- 
1.7.11.7

___
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 xorg-gtest 2/4] process: split Fork() and Start() into (optionally) two calls

2012-10-25 Thread Peter Hutterer
Process::Start() will fork() and execvp() the child process. For use-cases
where the child process must have specific signal masks or other properties
before the execvp() call this is unfeasable, the caller cannot control the
properties of the child between forking and execvp.

Split the fork() call out into Process::Fork(), making it optional. Start()
will fork on demand if it hasn't been called before. Behaviour stays the
same for callers of Start(), only those that call Fork() first need to pay
attention to details.

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
---
 include/xorg/gtest/xorg-gtest-process.h | 27 +
 src/process.cpp | 17 +---
 test/process-test.cpp   | 35 +
 3 files changed, 76 insertions(+), 3 deletions(-)

diff --git a/include/xorg/gtest/xorg-gtest-process.h 
b/include/xorg/gtest/xorg-gtest-process.h
index 8c581db..30fe30b 100644
--- a/include/xorg/gtest/xorg-gtest-process.h
+++ b/include/xorg/gtest/xorg-gtest-process.h
@@ -112,11 +112,32 @@ class Process {
   Process();
 
   /**
+   * Fork manually. Usually, fork() is called as part of Start() but for
+   * use-cases where the parent process and the child process need special
+   * processing before the child is replaced by an execvp call Fork() may be
+   * called manually.
+   *
+   * A process may only be forked once.
+   *
+   * The state of both the parent and the child after a Fork() is
+   * Process::RUNNING. If Fork() is called directly, Start() may only be
+   * called on the child process.
+   *
+   * @throws std::runtime_error on failure.
+   *
+   * @return The pid of the child, or 0 for the child process.
+   */
+  pid_t Fork();
+
+  /**
* Starts a program as a child process.
*
* See 'man execvp' for further information on the elements in
* the vector.
*
+   * If Fork() was called previously, Start() may only be called on the child
+   * process.
+   *
* @param program The program to start.
* @param args Vector of arguments passed to the program.
*
@@ -132,6 +153,9 @@ class Process {
*
* See 'man execvp' for further information on the variadic argument list.
*
+   * If Fork() was called previously, Start() may only be called on the child
+   * process.
+   *
* @param program The program to start.
* @param args Variadic list of arguments passed to the program. This list
* must end with NULL.
@@ -150,6 +174,9 @@ class Process {
* must end with NULL.
* See 'man execvp' for further information on the variadic argument list.
*
+   * If Fork() was called previously, Start() may only be called on the child
+   * process.
+   *
* @param program The program to start.
*
* @throws std::runtime_error on failure.
diff --git a/src/process.cpp b/src/process.cpp
index 7f7d330..a743346 100644
--- a/src/process.cpp
+++ b/src/process.cpp
@@ -66,12 +66,11 @@ enum xorg::testing::Process::State 
xorg::testing::Process::GetState() {
   return d_-state;
 }
 
-void xorg::testing::Process::Start(const std::string program, const 
std::vectorstd::string argv) {
+pid_t xorg::testing::Process::Fork() {
   if (d_-pid != -1)
-throw std::runtime_error(Attempting to start an already started process);
+throw std::runtime_error(A process may only be forked once);
 
   d_-pid = fork();
-
   if (d_-pid == -1) {
 d_-state = ERROR;
 throw std::runtime_error(Failed to fork child process);
@@ -85,7 +84,19 @@ void xorg::testing::Process::Start(const std::string 
program, const std::vector
 #ifdef __linux
 prctl(PR_SET_PDEATHSIG, SIGTERM);
 #endif
+  }
+
+  d_-state = RUNNING;
+  return d_-pid;
+}
+
+void xorg::testing::Process::Start(const std::string program, const 
std::vectorstd::string argv) {
+  if (d_-pid == -1)
+d_-pid = Fork();
+  else if (d_-pid  0)
+throw std::runtime_error(Start() may only be called on the child 
process);
 
+  if (d_-pid == 0) { /* Child */
 std::vectorchar* args;
 std::vectorstd::string::const_iterator it;
 
diff --git a/test/process-test.cpp b/test/process-test.cpp
index 725663b..59f96c2 100644
--- a/test/process-test.cpp
+++ b/test/process-test.cpp
@@ -229,6 +229,41 @@ TEST(Process, DoubleStart)
   sigprocmask(SIG_UNBLOCK, sig_mask, 0);
 }
 
+TEST(Process, ForkedParentStart)
+{
+  XORG_TESTCASE(Fork() and calling Start() on the parent causes an 
exception);
+  Process p;
+  if (p.Fork()  0) {
+ASSERT_GT(p.Pid(), 0);
+ASSERT_EQ(p.GetState(), Process::RUNNING);
+ASSERT_THROW({ p.Start(ls, NULL); }, std::runtime_error);
+  }
+}
+
+TEST(Process, ForkedChildStart)
+{
+  XORG_TESTCASE(Fork() and calling Start() executes the process);
+  Process p;
+  if (p.Fork() == 0) {
+ASSERT_EQ(p.GetState(), Process::RUNNING);
+p.Start(ls, NULL);
+ASSERT_GT(p.Pid(), 0);
+  }
+}
+
+TEST(Process, ForkedChildDoubleStart)
+{
+  XORG_TESTCASE(Fork() and calling Start() twice causes an exception);
+  

[PATCH xorg-gtest 3/4] xserver: use new fork handling for signal masks

2012-10-25 Thread Peter Hutterer
The child must have SIGUSR1 set to SIG_IGN so the XServer will notify us
when it is ready to accept connection.
The parent must block SIGUSR1 until ready to receive them, but the server
must _not_ have that mask blocked. Otherwise, it won't react to VT switches.

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
---
 src/xserver.cpp | 74 +++--
 1 file changed, 46 insertions(+), 28 deletions(-)

diff --git a/src/xserver.cpp b/src/xserver.cpp
index 9b163bb..9f91e7d 100644
--- a/src/xserver.cpp
+++ b/src/xserver.cpp
@@ -430,42 +430,60 @@ void xorg::testing::XServer::Start(const std::string 
program) {
 err_msg.append(std::strerror(errno));
 throw std::runtime_error(err_msg);
   }
-  /* set SIGUSR1 handler to SIG_IGN, XServer tests for this and will
-   * send SIGUSR1 when ready */
-  if (SIG_ERR == signal(SIGUSR1, SIG_IGN)) {
-err_msg.append(Failed to set signal handler: );
-err_msg.append(std::strerror(errno));
-throw std::runtime_error(err_msg);
-  }
 
-  args.push_back(std::string(GetDisplayString()));
+  pid_t pid = Fork();
+  if (pid == 0) {
+/* set SIGUSR1 handler to SIG_IGN, XServer tests for this and will
+ * send SIGUSR1 when ready */
+sighandler_t old_handler;
+old_handler = signal(SIGUSR1, SIG_IGN);
+if (old_handler == SIG_ERR) {
+  err_msg.append(Failed to set signal handler: );
+  err_msg.append(std::strerror(errno));
+  throw std::runtime_error(err_msg);
+}
 
-  for (it = d_-options.begin(); it != d_-options.end(); it++) {
-args.push_back(it-first);
-if (!it-second.empty())
-  args.push_back(it-second);
-  }
+/* unblock for the child process so the server receives SIGUSR1, needed
+   for VT switching */
+sigemptyset(sig_mask);
+sigaddset(sig_mask, SIGUSR1);
+if (sigprocmask(SIG_UNBLOCK, sig_mask, NULL)) {
+  err_msg.append(Failed to unblock signal mask: );
+  err_msg.append(std::strerror(errno));
+  throw std::runtime_error(err_msg);
+}
+
+args.push_back(std::string(GetDisplayString()));
 
-  Process::Start(program.empty() ? d_-path_to_server : program, args);
-
-  if (Pid()  0) {
-char *sleepwait = getenv(XORG_GTEST_XSERVER_SIGSTOP);
-if (sleepwait)
-  raise(SIGSTOP);
-
-/* wait for SIGUSR1 from XServer */
-int recv_sig = sigtimedwait(sig_mask, NULL, sig_timeout);
-if (recv_sig == SIGCHLD) {
-  GetState();
-} else if (recv_sig != SIGUSR1  errno != EAGAIN) {
-err_msg.append(Error while waiting for XServer startup: );
-err_msg.append(std::strerror(errno));
-throw std::runtime_error(err_msg);
+for (it = d_-options.begin(); it != d_-options.end(); it++) {
+  args.push_back(it-first);
+  if (!it-second.empty())
+args.push_back(it-second);
 }
+
+Process::Start(program.empty() ? d_-path_to_server : program, args);
+/* noreturn */
+
+  }
+
+  /* parent */
+  char *sleepwait = getenv(XORG_GTEST_XSERVER_SIGSTOP);
+  if (sleepwait)
+raise(SIGSTOP);
+
+  /* wait for SIGUSR1 from XServer */
+  int recv_sig = sigtimedwait(sig_mask, NULL, sig_timeout);
+  if (recv_sig == SIGCHLD) {
+GetState();
+  } else if (recv_sig != SIGUSR1  errno != EAGAIN) {
+err_msg.append(Error while waiting for XServer startup: );
+err_msg.append(std::strerror(errno));
+throw std::runtime_error(err_msg);
   }
 
   sigemptyset(sig_mask);
   sigaddset(sig_mask, SIGCHLD);
+  sigaddset(sig_mask, SIGUSR1);
   sigprocmask(SIG_UNBLOCK, sig_mask, NULL);
 
   RegisterXIOErrorHandler();
-- 
1.7.11.7

___
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 xorg-gtest 4/4] xserver: add XORG_GTEST_XSERVER_KEEPALIVE environment variable

2012-10-25 Thread Peter Hutterer
If set, XServer will ignore Terminate() and Kill() requests, and will not
die if the parent process dies. This enables a user to hook up gdb to a
server, wait for the test case to trigger some code in the server and
continue debugging from there, without the test case terminating the server.

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
---
 README|  4 +++
 src/xserver.cpp   | 11 +
 test/xserver-test.cpp | 67 +++
 3 files changed, 82 insertions(+)

diff --git a/README b/README
index 6c660b0..53475db 100644
--- a/README
+++ b/README
@@ -78,6 +78,10 @@ Environment variables
 -
 XORG_GTEST_XSERVER_SIGSTOP
   If set, an XServer object will raise a SIGSTOP signal after startup.
+XORG_GTEST_XSERVER_KEEPALIVE
+  If set, the XServer object will ignore calls to Terminate() or Kill().
+  This is useful for debugging a server without having the test terminate
+  the process while still looking at gdb output.
 XORG_GTEST_CHILD_STDOUT
   If set to any value, Process::Start() will _not_ close stdout/stdin/stderr
   for the forked child.
diff --git a/src/xserver.cpp b/src/xserver.cpp
index 9f91e7d..c7117f3 100644
--- a/src/xserver.cpp
+++ b/src/xserver.cpp
@@ -433,6 +433,11 @@ void xorg::testing::XServer::Start(const std::string 
program) {
 
   pid_t pid = Fork();
   if (pid == 0) {
+#ifdef __linux
+if (getenv(XORG_GTEST_XSERVER_KEEPALIVE) != NULL)
+  prctl(PR_SET_PDEATHSIG, 0);
+#endif
+
 /* set SIGUSR1 handler to SIG_IGN, XServer tests for this and will
  * send SIGUSR1 when ready */
 sighandler_t old_handler;
@@ -490,6 +495,9 @@ void xorg::testing::XServer::Start(const std::string 
program) {
 }
 
 bool xorg::testing::XServer::Terminate(unsigned int timeout) {
+  if (getenv(XORG_GTEST_XSERVER_KEEPALIVE))
+return true;
+
   if (!Process::Terminate(timeout)) {
 std::cerr  Warning: Failed to terminate Xorg server: 
std::strerror(errno)  \n;
@@ -499,6 +507,9 @@ bool xorg::testing::XServer::Terminate(unsigned int 
timeout) {
 }
 
 bool xorg::testing::XServer::Kill(unsigned int timeout) {
+  if (getenv(XORG_GTEST_XSERVER_KEEPALIVE))
+return true;
+
   if (!Process::Kill(timeout)) {
 std::cerr  Warning: Failed to kill Xorg server: 
std::strerror(errno)  \n;
diff --git a/test/xserver-test.cpp b/test/xserver-test.cpp
index 4088baa..ccbc2e9 100644
--- a/test/xserver-test.cpp
+++ b/test/xserver-test.cpp
@@ -207,6 +207,73 @@ TEST(XServer, IOErrorException)
   }, XIOError);
 }
 
+TEST(XServer, KeepAlive)
+{
+  XORG_TESTCASE(If XORG_GTEST_XSERVER_KEEPALIVE is set,\n
+XServer::Terminate() and XServer::Kill() have no 
+effect);
+
+  int pipefd[2];
+  ASSERT_NE(pipe(pipefd), -1);
+
+  if (fork() == 0) {
+close(pipefd[0]);
+
+ASSERT_EQ(setenv(XORG_GTEST_XSERVER_KEEPALIVE, 1, 1), 0);
+ASSERT_TRUE(getenv(XORG_GTEST_XSERVER_KEEPALIVE) != NULL);
+
+XServer server;
+server.SetOption(-logfile, /tmp/Xorg-keepalive.log);
+server.SetOption(-noreset, );
+server.Start();
+ASSERT_EQ(server.GetState(), Process::RUNNING);
+::Display *dpy = XOpenDisplay(server.GetDisplayString().c_str());
+ASSERT_TRUE(dpy != NULL);
+
+server.Terminate();
+ASSERT_EQ(server.GetState(), Process::RUNNING);
+server.Kill();
+ASSERT_EQ(server.GetState(), Process::RUNNING);
+
+char *buffer;
+ASSERT_GT(asprintf(buffer, %d, server.Pid()), 0);
+ASSERT_EQ(write(pipefd[1], buffer, strlen(buffer)), (int)strlen(buffer));
+close(pipefd[1]);
+free(buffer);
+return;
+  }
+
+  sigset_t sig_mask;
+  sigemptyset(sig_mask);
+  sigaddset(sig_mask, SIGCHLD);
+  struct timespec tv = { 1, 0 };
+  sigprocmask(SIG_BLOCK, sig_mask, NULL);
+
+  /* parent */
+  close(pipefd[1]);
+
+  char buffer[20] = {0};
+  ASSERT_GT(read(pipefd[0], buffer, sizeof(buffer)), 0);
+  close(pipefd[0]);
+
+  /* wait for forked child to die */
+  ASSERT_EQ(sigtimedwait(sig_mask, NULL, tv), SIGCHLD);
+
+  pid_t server_pid = atoi(buffer);
+
+  /* server must still be running, kill it */
+  ASSERT_EQ(kill(server_pid, 0), 0);
+  kill(server_pid, SIGTERM);
+
+  int i = 0;
+
+  while(kill(server_pid, 0) == 0  i++  10)
+usleep(5);
+
+  ASSERT_EQ(kill(server_pid, 0), -1);
+  ASSERT_EQ(errno, ESRCH);
+}
+
 int main(int argc, char *argv[]) {
   testing::InitGoogleTest(argc, argv);
   return RUN_ALL_TESTS();
-- 
1.7.11.7

___
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


[xproto] Xmd: Add FP3232 to the core proto

2012-10-25 Thread Jasper St. Pierre
From: Jasper St. Pierre jstpie...@mecheye.net

So that these can be shared between other extensions besides
XInput2.
---
 Xmd.h | 9 +
 1 file changed, 9 insertions(+)

diff --git a/Xmd.h b/Xmd.h
index 96cc08f..6947fcc 100644
--- a/Xmd.h
+++ b/Xmd.h
@@ -44,6 +44,9 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
OF THIS
 SOFTWARE.
 
 **/
+
+#include stdint.h
+
 #ifndef XMD_H
 # define XMD_H 1
 /*
@@ -144,6 +147,12 @@ typedef CARD16 BITS16;
 typedef CARD8  BYTE;
 typedef CARD8  BOOL;
 
+typedef int32_t FP1616;
+typedef struct _FP3232 {
+int32_t integral;
+uint32_tfrac;
+} FP3232;
+
 /*
  * definitions for sign-extending bitfields on 64-bit architectures
  */
-- 
1.7.12.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


[PATCH libxkbcommon 1/2] build: Make autoreconf honour ACLOCAL_FLAGS

2012-10-25 Thread Damien Lespiau
From: Damien Lespiau damien.lesp...@intel.com

When running autoreconf, it's possible to give flags to the underlying
aclocal by declaring a ACLOCAL_AMFLAGS variable in the top level
Makefile.am.

Putting ${ACLOCAL_FLAGS} there allows the user to set an environment
variable up before running autogen.sh and pull in the right directories
to look for m4 macros, say an up-to-date version of the xorg-util macros.

Signed-off-by: Damien Lespiau damien.lesp...@intel.com
Cc: Daniel Stone dan...@fooishbar.org
---
 Makefile.am |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index c08bca1..8f10bbb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-ACLOCAL_AMFLAGS = -I m4
+ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = xkbcommon.pc
-- 
1.7.7.5

___
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 libxkbcommon 2/2] build: Require xorg macros 1.16

2012-10-25 Thread Damien Lespiau
From: Damien Lespiau damien.lesp...@intel.com

For XORG_TESTSET_CFLAG and XORG_MEMORY_CHECK_FLAGS.

Signed-off-by: Damien Lespiau damien.lesp...@intel.com
Cc: Daniel Stone dan...@fooishbar.org
---
 configure.ac |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index eda593c..ebefbd9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -41,7 +41,7 @@ LT_INIT
 # Require xorg-macros minimum of 1.8 for AM_SILENT_RULES
 m4_ifndef([XORG_MACROS_VERSION],
  [m4_fatal([must install xorg-macros 1.8 or later before running 
autoconf/autogen])])
-XORG_MACROS_VERSION(1.8)
+XORG_MACROS_VERSION(1.16)
 XORG_DEFAULT_OPTIONS
 XORG_MEMORY_CHECK_FLAGS
 XORG_ENABLE_DOCS
-- 
1.7.7.5

___
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] XI2proto: Remove our own FP3232/FP1616

2012-10-25 Thread Jasper St. Pierre
From: Jasper St. Pierre jstpie...@mecheye.net

These are in the upstream Xmd.h now.
---
 XI2proto.h | 8 
 1 file changed, 8 deletions(-)

diff --git a/XI2proto.h b/XI2proto.h
index 1260200..e54d228 100644
--- a/XI2proto.h
+++ b/XI2proto.h
@@ -103,14 +103,6 @@
  *   COMMON STRUCTS
  *
  * 
  *
  
*/
-/** Fixed point 16.16 */
-typedef int32_t FP1616;
-
-/** Fixed point 32.32 */
-typedef struct {
-int32_t integral;
-uint32_tfrac;
-} FP3232;
 
 /**
  * Struct to describe a device.
-- 
1.7.12.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