[PATCH xserver] XKB: Redirect actions defunct with Gtk3 (XInput?)

2012-02-19 Thread Andreas Wettstein
When redirect actions are used with Gtk3, Gtk3 complains about
events not holding a GdkDevice.  This is caused by device IDs not
being set for redirect actions. The patch below sets them, but I
am not quite sure that the values are correct.  Anyway, the
warnings from Gtk3 warnings are gone.

More seriously, Gtk3 does not receive state changes redirect
actions might specify.  This is because event_set_state in
dix/inpututils.c accesses the prev_state field, but the changes
for the redirect action are only put into the state field.

Signed-off-by: Andreas Wettstein wettstein...@solnet.ch
---
 xkb/xkbActions.c |   18 ++
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c
index da0bdea..da874f0 100644
--- a/xkb/xkbActions.c
+++ b/xkb/xkbActions.c
@@ -795,7 +795,7 @@ _XkbFilterRedirectKey(  XkbSrvInfoPtr   xkbi,
 {
 DeviceEventev;
 intx,y;
-XkbStateRecold;
+XkbStateRecold, old_prev;
 unsigned   mods,mask;
 xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(xkbi-device);
 ProcessInputProc backupproc;
@@ -803,6 +803,7 @@ ProcessInputProc backupproc;
 /* never actually used uninitialised, but gcc isn't smart enough
  * to work that out. */
 memset(old, 0, sizeof(old));
+memset(old_prev, 0, sizeof(old_prev));
 memset(ev, 0, sizeof(ev));
 
 if ((filter-keycode!=0)(filter-keycode!=keycode))
@@ -814,6 +815,7 @@ ProcessInputProc backupproc;
 ev.time = GetTimeInMillis();
 ev.root_x = x;
 ev.root_y = y;
+ev.deviceid = ev.sourceid = xkbi-device-id;
 
 if (filter-keycode==0) {  /* initial press */
if ((pAction-redirect.new_keyxkbi-desc-min_key_code)||
@@ -839,6 +841,7 @@ ProcessInputProc backupproc;
 
if ( mask || mods ) {
old= xkbi-state;
+   old_prev= xkbi-prev_state;
xkbi-state.base_mods= ~mask;
xkbi-state.base_mods|= (modsmask);
xkbi-state.latched_mods= ~mask;
@@ -846,15 +849,18 @@ ProcessInputProc backupproc;
xkbi-state.locked_mods= ~mask;
xkbi-state.locked_mods|= (modsmask);
XkbComputeDerivedState(xkbi);
+   xkbi-prev_state= xkbi-state;
}
 
UNWRAP_PROCESS_INPUT_PROC(xkbi-device,xkbPrivPtr, backupproc);
xkbi-device-public.processInputProc((InternalEvent*)ev, 
xkbi-device);
COND_WRAP_PROCESS_INPUT_PROC(xkbi-device, xkbPrivPtr,
 backupproc,xkbUnwrapProc);
-   
-   if ( mask || mods )
+
+   if ( mask || mods ) {
xkbi-state= old;
+   xkbi-prev_state= old_prev;
+   }
 }
 else if (filter-keycode==keycode) {
 
@@ -870,6 +876,7 @@ ProcessInputProc backupproc;
 
if ( mask || mods ) {
old= xkbi-state;
+   old_prev= xkbi-prev_state;
xkbi-state.base_mods= ~mask;
xkbi-state.base_mods|= (modsmask);
xkbi-state.latched_mods= ~mask;
@@ -877,6 +884,7 @@ ProcessInputProc backupproc;
xkbi-state.locked_mods= ~mask;
xkbi-state.locked_mods|= (modsmask);
XkbComputeDerivedState(xkbi);
+   xkbi-prev_state= xkbi-state;
}
 
UNWRAP_PROCESS_INPUT_PROC(xkbi-device,xkbPrivPtr, backupproc);
@@ -884,8 +892,10 @@ ProcessInputProc backupproc;
COND_WRAP_PROCESS_INPUT_PROC(xkbi-device, xkbPrivPtr,
 backupproc,xkbUnwrapProc);
 
-   if ( mask || mods )
+   if ( mask || mods ) {
xkbi-state= old;
+   xkbi-prev_state= old_prev;
+   }
 
filter-keycode= 0;
filter-active= 0;
-- 
1.7.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 libxcb] Fallback to TCP if no protocol is specified and the UNIX connection fails

2012-02-19 Thread Julien Cristau
Signed-off-by: Julien Cristau jcris...@debian.org
---
 src/xcb_util.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/xcb_util.c b/src/xcb_util.c
index fde4f85..6d9efe0 100644
--- a/src/xcb_util.c
+++ b/src/xcb_util.c
@@ -234,6 +234,11 @@ static int _xcb_open(const char *host, char *protocol, 
const int display)
 fd = _xcb_open_unix(protocol, file);
 free(file);
 
+if (fd  0  !protocol  *host == '\0') {
+   unsigned short port = X_TCP_PORT + display;
+   fd = _xcb_open_tcp(host, protocol, port);
+}
+
 return fd;
 #endif /* !_WIN32 */
 return -1; /* if control reaches here then something has gone wrong */
-- 
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 libx11] Revert xcb: Add TCP fallback

2012-02-19 Thread Julien Cristau
This reverts commit f09c5299a381e2729e800a0ac43f1c0e371f65f6.

The TCP fallback ended up falling back to UNIX socket connection if
$DISPLAY was set to e.g. some.host:0 and the initial attempt failed.

Debian bug#659558 http://bugs.debian.org/659558

Signed-off-by: Julien Cristau jcris...@debian.org

Conflicts:

src/OpenDis.c
---
 src/OpenDis.c |   19 ---
 1 files changed, 0 insertions(+), 19 deletions(-)

diff --git a/src/OpenDis.c b/src/OpenDis.c
index e568a30..9379fec 100644
--- a/src/OpenDis.c
+++ b/src/OpenDis.c
@@ -127,28 +127,9 @@ XOpenDisplay (
  */
 
if(!_XConnectXCB(dpy, display, iscreen)) {
-   /* Try falling back on other transports if no transport 
specified */
-   const char *slash = strrchr(display_name, '/');
-   if(slash == NULL) {
-   const char *protocols[] = {local, unix, tcp, 
inet6, inet, NULL};
-   const char **s;
-   size_t buf_size = strlen(display_name) + 7; // max 
strlen + 2 (null + /)
-   char *buf = Xmalloc(buf_size * sizeof(char));
-
-   if(buf) {
-   for(s = protocols; buf  *s; s++) {
-   snprintf(buf, buf_size, %s/%s, *s, 
display_name);
-   if(_XConnectXCB(dpy, buf, iscreen))
-   goto fallback_success;
-   }
-   Xfree(buf);
-   }
-   }
-
OutOfMemory(dpy);
return NULL;
}
-fallback_success:
 
/* Initialize as much of the display structure as we can.
 * Initialize pointers to NULL so that XFreeDisplayStructure will
-- 
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 video-modesetting 00/14] Config review for the new modesetting module

2012-02-19 Thread Gaetan Nadon
An assortment of missing/redundant/unneeded/deprecated code patches

Gaetan Nadon (14):
  Fill the COPYING file with license text
  Add contact information to the README file
  man: missing AM_V_GEN and hard-coded sed command name
  Fix typo in .gitignore
  make: remove redundant AUTOMAKE_OPTIONS
  Remove redundant EXTRA_DIST for the README file.
  Add missing targets for ChangeLog and INSTALL
  Replace obsolete AM_CONFIG_HEADER with AC_CONFIG_HEADERS
  Remove redundant AC_PROG_CC
  Remove unneeded AM_PROG_CC_C_CO
  make: remove empty variable assignment
  make: add all warnings according to the platform
  config: layout and comment the top portion of configure.ac
  config: replace deprecated AC_HELP_STRING with AS_HELP_STRING

 .gitignore  |4 ++--
 COPYING |   48 
 Makefile.am |   13 +++--
 README  |   23 +++
 configure.ac|   30 --
 man/Makefile.am |8 
 src/Makefile.am |5 +
 7 files changed, 93 insertions(+), 38 deletions(-)

-- 
1.7.5.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


[PATCH video-modesetting 01/14] Fill the COPYING file with license text

2012-02-19 Thread Gaetan Nadon
This reflects the copyright license text in the source code

Signed-off-by: Gaetan Nadon mems...@videotron.ca
---
 COPYING |   48 
 1 files changed, 40 insertions(+), 8 deletions(-)

diff --git a/COPYING b/COPYING
index 7f33cbf..9508e25 100644
--- a/COPYING
+++ b/COPYING
@@ -1,12 +1,44 @@
-This is a stub file.  This package has not yet had its complete licensing
-information compiled.  Please see the individual source files for details on
-your rights to use and modify this software.
+Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+Copyright 2011 Dave Airlie
+All Rights Reserved.
 
-Please submit updated COPYING files to the Xorg bugzilla:
+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, sub license, 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:
 
-https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
 
-All licensing questions regarding this software should be directed at the
-Xorg mailing list:
+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 NON-INFRINGEMENT.
+IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS 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.
 
-http://lists.freedesktop.org/mailman/listinfo/xorg
+Copyright © 2007 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.
-- 
1.7.5.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

[PATCH video-modesetting 02/14] Add contact information to the README file

2012-02-19 Thread Gaetan Nadon
Signed-off-by: Gaetan Nadon mems...@videotron.ca
---
 README |   23 +++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/README b/README
index 4578d7f..7ca3286 100644
--- a/README
+++ b/README
@@ -1,3 +1,26 @@
 This is a generic modesetting driver.
 The idea is to piggy-back the X driver on top of the DRM and Gallium3D
 drivers (DRM for modesetting and Gallium3D for Exa acceleration)
+
+All questions regarding this software should be directed at the
+Xorg mailing list:
+
+http://lists.freedesktop.org/mailman/listinfo/xorg
+
+Please submit bug reports to the Xorg bugzilla:
+
+https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+
+The master development code repository can be found at:
+
+git://anongit.freedesktop.org/git/xorg/driver/xf86-video-modesetting
+
+http://cgit.freedesktop.org/xorg/driver/xf86-video-modesetting
+
+For patch submission instructions, see:
+
+   http://www.x.org/wiki/Development/Documentation/SubmittingPatches
+
+For more information on the git code manager, see:
+
+http://wiki.x.org/wiki/GitPage
-- 
1.7.5.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


[PATCH video-modesetting 03/14] man: missing AM_V_GEN and hard-coded sed command name

2012-02-19 Thread Gaetan Nadon
Let's use the common xorg makefile for all drivers.
This ensures no new problems are introduced.
Improvements are welcome and to be applied to all drivers.

Signed-off-by: Gaetan Nadon mems...@videotron.ca
---
 man/Makefile.am |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/man/Makefile.am b/man/Makefile.am
index 936821c..5e96df5 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -25,16 +25,16 @@
 # 
 
 drivermandir = $(DRIVER_MAN_DIR)
-driverman_DATA = $(DRIVER_NAME).$(DRIVER_MAN_SUFFIX)
+driverman_PRE = @DRIVER_NAME@.man
+driverman_DATA = $(driverman_PRE:man=@DRIVER_MAN_SUFFIX@)
 
 EXTRA_DIST = @DRIVER_NAME@.man
 
 CLEANFILES = $(driverman_DATA)
 
-SED = sed
 
+# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
 SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man
 
 .man.$(DRIVER_MAN_SUFFIX):
-   sed $(MAN_SUBSTS)  $  $@
-
+   $(AM_V_GEN)$(SED) $(MAN_SUBSTS)  $  $@
-- 
1.7.5.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


[PATCH video-modesetting 04/14] Fix typo in .gitignore

2012-02-19 Thread Gaetan Nadon
Signed-off-by: Gaetan Nadon mems...@videotron.ca
---
 .gitignore |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore
index 4cada5a..dc5a5cd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -71,9 +71,9 @@ core
 *.tar.bz2
 *.tar.gz
 #
-#  Add  Override patterns for xf86-video-intel 
+#  Add  Override patterns for xf86-video-modesetting
 #
 #  Edit the following section as needed
 # For example, !report.pc overrides *.pc. See 'man gitignore'
-# 
+#
 cscope*
-- 
1.7.5.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


[PATCH video-modesetting 05/14] make: remove redundant AUTOMAKE_OPTIONS

2012-02-19 Thread Gaetan Nadon
Already covered by AM_INIT_AUTOMAKE([foreign dist-bzip2])

Signed-off-by: Gaetan Nadon mems...@videotron.ca
---
 Makefile.am |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 8cbe4a9..9a525f0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -18,7 +18,6 @@
 #  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.
 
-AUTOMAKE_OPTIONS = foreign
 SUBDIRS = src man
 
 EXTRA_DIST = README
-- 
1.7.5.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


[PATCH video-modesetting 06/14] Remove redundant EXTRA_DIST for the README file.

2012-02-19 Thread Gaetan Nadon
Autotools know about it, it is always distributed.

Signed-off-by: Gaetan Nadon mems...@videotron.ca
---
 Makefile.am |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 9a525f0..052c611 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,5 +19,3 @@
 #  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 SUBDIRS = src man
-
-EXTRA_DIST = README
-- 
1.7.5.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


[PATCH video-modesetting 07/14] Add missing targets for ChangeLog and INSTALL

2012-02-19 Thread Gaetan Nadon
Signed-off-by: Gaetan Nadon mems...@videotron.ca
---
 Makefile.am |   12 
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 052c611..8e4dfdb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,3 +19,15 @@
 #  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 SUBDIRS = src man
+
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+   $(INSTALL_CMD)
+
+ChangeLog:
+   $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
-- 
1.7.5.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


[PATCH video-modesetting 08/14] Replace obsolete AM_CONFIG_HEADER with AC_CONFIG_HEADERS

2012-02-19 Thread Gaetan Nadon
Signed-off-by: Gaetan Nadon mems...@videotron.ca
---
 configure.ac |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index fcfe330..01596b5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,7 +27,7 @@ AC_INIT([xf86-video-modesetting],
 [xf86-video-modesetting])
 
 AC_CONFIG_SRCDIR([Makefile.am])
-AM_CONFIG_HEADER([config.h])
+AC_CONFIG_HEADERS([config.h])
 
 m4_ifndef([XORG_MACROS_VERSION],
[m4_fatal([must install xorg-macros 1.8 or later before runnign 
autoconf/autogen])])
-- 
1.7.5.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


[PATCH video-modesetting 09/14] Remove redundant AC_PROG_CC

2012-02-19 Thread Gaetan Nadon
Already covered by XORG_DEFAULT_OPTIONS

Signed-off-by: Gaetan Nadon mems...@videotron.ca
---
 configure.ac |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index 01596b5..c936683 100644
--- a/configure.ac
+++ b/configure.ac
@@ -44,7 +44,6 @@ AM_MAINTAINER_MODE
 # Checks for programs.
 AC_DISABLE_STATIC
 AC_PROG_LIBTOOL
-AC_PROG_CC
 AM_PROG_CC_C_O
 
 if test x$GCC = xyes; then
-- 
1.7.5.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


[PATCH video-modesetting 10/14] Remove unneeded AM_PROG_CC_C_CO

2012-02-19 Thread Gaetan Nadon
There are no objects in subdirs or compiled multiple times
with different flags.

Signed-off-by: Gaetan Nadon mems...@videotron.ca
---
 configure.ac |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index c936683..a2488f2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -44,7 +44,6 @@ AM_MAINTAINER_MODE
 # Checks for programs.
 AC_DISABLE_STATIC
 AC_PROG_LIBTOOL
-AM_PROG_CC_C_O
 
 if test x$GCC = xyes; then
 CPPFLAGS=$CPPFLAGS -Wall
-- 
1.7.5.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


[PATCH video-modesetting 11/14] make: remove empty variable assignment

2012-02-19 Thread Gaetan Nadon
Signed-off-by: Gaetan Nadon mems...@videotron.ca
---
 src/Makefile.am |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index efc4bc0..40ebf0a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -17,7 +17,6 @@
 #  ADAM JACKSON 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.
-SUBDIRS = 
 
 # this is obnoxious:
 # -module lets us name the module exactly how we want
@@ -37,5 +36,3 @@ modesetting_drv_la_SOURCES = \
 driver.h \
 drmmode_display.c \
 drmmode_display.h
-
-EXTRA_DIST =
-- 
1.7.5.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


[PATCH video-modesetting 12/14] make: add all warnings according to the platform

2012-02-19 Thread Gaetan Nadon
The current code only adds -Wall and only for gcc.
Automake reserves the use of CPPFLAGS for the user to override
on the command line.
This also breaks the option --enable-strict-compilation

The variable CWARNFLAGS contains the complete set of warnings
and is platform sensitive.

Signed-off-by: Gaetan Nadon mems...@videotron.ca
---
 configure.ac|4 
 src/Makefile.am |2 +-
 2 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index a2488f2..610c043 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,10 +45,6 @@ AM_MAINTAINER_MODE
 AC_DISABLE_STATIC
 AC_PROG_LIBTOOL
 
-if test x$GCC = xyes; then
-CPPFLAGS=$CPPFLAGS -Wall
-fi
-
 AH_TOP([#include xorg-server.h])
 
 AC_ARG_WITH(xorg-module-dir,
diff --git a/src/Makefile.am b/src/Makefile.am
index 40ebf0a..68a63fa 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -24,7 +24,7 @@
 # _ladir passes a dummy rpath to libtool so the thing will actually link
 # TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
 
-AM_CFLAGS = @XORG_CFLAGS@ @DRM_CFLAGS@ @UDEV_CFLAGS@
+AM_CFLAGS = $(XORG_CFLAGS) $(DRM_CFLAGS) $(UDEV_CFLAGS) $(CWARNFLAGS)
 
 modesetting_drv_la_LTLIBRARIES = modesetting_drv.la
 modesetting_drv_la_LDFLAGS = -module -avoid-version
-- 
1.7.5.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


[PATCH video-modesetting 13/14] config: layout and comment the top portion of configure.ac

2012-02-19 Thread Gaetan Nadon
Reorder statements to be consistent with other modules so things
are easier to find.

Signed-off-by: Gaetan Nadon mems...@videotron.ca
---
 configure.ac |   20 ++--
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/configure.ac b/configure.ac
index 610c043..50a258e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,31 +20,31 @@
 #
 # Process this file with autoconf to produce a configure script
 
+# Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-modesetting],
 [0.1.0],
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
 [xf86-video-modesetting])
-
 AC_CONFIG_SRCDIR([Makefile.am])
 AC_CONFIG_HEADERS([config.h])
-
-m4_ifndef([XORG_MACROS_VERSION],
-   [m4_fatal([must install xorg-macros 1.8 or later before runnign 
autoconf/autogen])])
-XORG_MACROS_VERSION(1.8)
-XORG_DEFAULT_OPTIONS
-
 AC_CONFIG_AUX_DIR(.)
-
-AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AC_SYS_LARGEFILE
 
+# Initialize Automake
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE
 
-# Checks for programs.
+# Initialize libtool
 AC_DISABLE_STATIC
 AC_PROG_LIBTOOL
 
+# Initialize X.Org macros 1.8 or later for MAN_SUBSTS set by 
XORG_MANPAGE_SECTIONS
+m4_ifndef([XORG_MACROS_VERSION],
+   [m4_fatal([must install xorg-macros 1.8 or later before runnign 
autoconf/autogen])])
+XORG_MACROS_VERSION(1.8)
+XORG_DEFAULT_OPTIONS
+
 AH_TOP([#include xorg-server.h])
 
 AC_ARG_WITH(xorg-module-dir,
-- 
1.7.5.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


[PATCH video-modesetting 14/14] config: replace deprecated AC_HELP_STRING with AS_HELP_STRING

2012-02-19 Thread Gaetan Nadon
Signed-off-by: Gaetan Nadon mems...@videotron.ca
---
 configure.ac |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 50a258e..9758d87 100644
--- a/configure.ac
+++ b/configure.ac
@@ -48,12 +48,12 @@ XORG_DEFAULT_OPTIONS
 AH_TOP([#include xorg-server.h])
 
 AC_ARG_WITH(xorg-module-dir,
-AC_HELP_STRING([--with-xorg-module-dir=DIR],
+AS_HELP_STRING([--with-xorg-module-dir=DIR],
[Default xorg module directory 
[[default=$libdir/xorg/modules]]]),
 [moduledir=$withval],
 [moduledir=$libdir/xorg/modules])
 
-AC_ARG_ENABLE(dri, AC_HELP_STRING([--disable-dri],
+AC_ARG_ENABLE(dri, AS_HELP_STRING([--disable-dri],
   [Disable DRI support [[default=auto]]]),
   [DRI=$enableval],
   [DRI=auto])
-- 
1.7.5.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


Re: [PATCH video-intel] Revert Update autotools configuration

2012-02-19 Thread Matthieu Herrb
On Sat, Feb 18, 2012 at 02:33:34PM -0500, Gaetan Nadon wrote:
 This reverts commit 9184af921bc2f332fcb6c9b47001414378eab8e2.
 
 All X.Org modules must be able to be configured with autoconf 2.60.
 In addition, version 2.63 has GPL licensing issues which prevents
 some vendor to release software based on it.
 
 The AM_SILENT_RULES are already handled by XORG_DEFAULT_OPTIONS.
 
 All X.Org modules must be able to be configured with libtool 1.5.
 
 AM_MAINTAINER_MODE default value is enabled already.
 
 We use the same autogen script for all x.org modules.
 There are proposals for changes which should be reviewed and eventually
 applied to all modules together.
 
 The lt*.m4 patterns are already included in the root .gitignore file.
 This can be proposed as a change to all modules, but it invloves
 changing the topvel .gitignore, the m4/.gitignore, the ACLOCAL_AMFLAGS
 and the AC_CONFIG_MACRO_DIR together.
 
 For more information on project wide configuration guidelines,
 consult http://www.x.org/wiki/ModularDevelopersGuide
 and http://www.x.org/wiki/NewModuleGuidelines.
 
 Signed-off-by: Gaetan Nadon mems...@videotron.ca

Although I didn't notice the changes since OpenBSD can't use the based
versions of the intel driver, I fully support this. 

Acked-by: Matthieu Herrb matthieu.he...@laas.fr

 ---
  Makefile.am   |1 -
  autogen.sh|   14 ++
  configure.ac  |   18 ++
  m4/.gitignore |5 -
  4 files changed, 16 insertions(+), 22 deletions(-)
  delete mode 100644 m4/.gitignore
 
 diff --git a/Makefile.am b/Makefile.am
 index 48c3477..b3d37b2 100644
 --- a/Makefile.am
 +++ b/Makefile.am
 @@ -18,7 +18,6 @@
  #  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.
  
 -ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
  
  SUBDIRS = man
  
 diff --git a/autogen.sh b/autogen.sh
 index 30d679f..904cd67 100755
 --- a/autogen.sh
 +++ b/autogen.sh
 @@ -1,6 +1,12 @@
  #! /bin/sh
  
 -test -n $srcdir || srcdir=`dirname $0`
 -test -n $srcdir || srcdir=.
 -autoreconf --force --install --verbose $srcdir
 -test -n $NOCONFIGURE || $srcdir/configure $@
 +srcdir=`dirname $0`
 +test -z $srcdir  srcdir=.
 +
 +ORIGDIR=`pwd`
 +cd $srcdir
 +
 +autoreconf -v --install || exit 1
 +cd $ORIGDIR || exit $?
 +
 +$srcdir/configure --enable-maintainer-mode $@
 diff --git a/configure.ac b/configure.ac
 index 785392a..bee0885 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -21,24 +21,18 @@
  # Process this file with autoconf to produce a configure script
  
  # Initialize Autoconf
 -AC_PREREQ([2.63])
 +AC_PREREQ([2.60])
  AC_INIT([xf86-video-intel],
  [2.17.0],
  [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
  [xf86-video-intel])
  AC_CONFIG_SRCDIR([Makefile.am])
  AC_CONFIG_HEADERS([config.h])
 -AC_CONFIG_AUX_DIR([build-aux])
 -AC_CONFIG_MACRO_DIR([m4])
 +AC_CONFIG_AUX_DIR(.)
  
  # Initialize Automake
 -AM_INIT_AUTOMAKE([1.10 foreign dist-bzip2])
 -AM_MAINTAINER_MODE([enable])
 -
 -# Support silent build rules, requires at least automake-1.11. Disable
 -# by either passing --disable-silent-rules to configure or passing V=1
 -# to make
 -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 +AM_INIT_AUTOMAKE([foreign dist-bzip2])
 +AM_MAINTAINER_MODE
  
  # Require X.Org macros 1.8 or later for MAN_SUBSTS set by 
 XORG_MANPAGE_SECTIONS
  m4_ifndef([XORG_MACROS_VERSION],
 @@ -56,8 +50,8 @@ m4_ifndef([XORG_DRIVER_CHECK_EXT],
depending on your distribution, try package 'xserver-xorg-dev' or 
 'xorg-x11-server-devel'])])
  
  # Initialize libtool
 -LT_PREREQ([2.2])
 -LT_INIT([disable-static])
 +AC_DISABLE_STATIC
 +AC_PROG_LIBTOOL
  
  # Are we in a git checkout?
  dot_git=no
 diff --git a/m4/.gitignore b/m4/.gitignore
 deleted file mode 100644
 index 464ba5c..000
 --- a/m4/.gitignore
 +++ /dev/null
 @@ -1,5 +0,0 @@
 -libtool.m4
 -lt~obsolete.m4
 -ltoptions.m4
 -ltsugar.m4
 -ltversion.m4
 -- 
 1.7.5.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

-- 
Matthieu Herrb
___
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 lib/libX11] Don't use caddr_t casts

2012-02-19 Thread Jon TURNEY
On 18/02/2012 19:11, Jamey Sharp wrote:
 On Sat, Feb 18, 2012 at 05:21:24PM +, Jon TURNEY wrote:
 Casting a (const char *) to (caddr_t) to assign to iovec.io_base
 seems pointless. caddr_t isn't used anywhere else in xcb or libX11
 
 According to the libxcb git history, I replaced (caddr_t) with (char *)
 in 2006 to help DragonFly and Solaris. I'd be fine with this patch if
 it explicitly cast to (char *), which I believe suppresses the constness
 warning.

Updated patch attached.

But you still get a warning that you are discarding constness, because you are 
:-)

Using an explicit (char *) cast just changes the warning from:

/opt/wip/jhbuild/git/xorg/lib/libX11/src/xcb_io.c: In function '_XSend':
/opt/wip/jhbuild/git/xorg/lib/libX11/src/xcb_io.c:481:18: warning: assignment
discards qualifiers from pointer target type
/opt/wip/jhbuild/git/xorg/lib/libX11/src/xcb_io.c:483:18: warning: assignment
discards qualifiers from pointer target type

to:

/opt/wip/jhbuild/git/xorg/lib/libX11/src/xcb_io.c: In function '_XSend':
/opt/wip/jhbuild/git/xorg/lib/libX11/src/xcb_io.c:481:2: warning: cast
discards qualifiers from pointer target type [-Wcast-qual]
/opt/wip/jhbuild/git/xorg/lib/libX11/src/xcb_io.c:483:2: warning: cast
discards qualifiers from pointer target type [-Wcast-qual]

 Note: there's a warning about dropping constness here, but that's
 going to be unfixable as long as xcb_writev() takes a non-const struct
 iovec as a parameter.
 
 C's rules regarding const always confuse me, but I'm pretty sure even
 that wouldn't help. If the struct iovec is declared const, that just
 means XCB won't change where the iov_base pointers point. It doesn't
 mean XCB promises to refrain from writing through those pointers.

You are correct, I mis-stated the issue here. You are always going to get a
warning here because struct iovec can't represent the constness correctly.

I'm guessing xcb functions don't modify the iovec itself, so it could be
const, but that's a separate issue.
From 616b7284ee91c39450f98ac5c93a9e719b148ffd Mon Sep 17 00:00:00 2001
From: Jon TURNEY jon.tur...@dronecode.org.uk
Date: Fri, 28 Oct 2011 11:09:20 -0500
Subject: [PATCH lib/libX11] Don't use caddr_t casts

(caddr_t) isn't used anywhere else in xcb or libX11.
Cast to (char *) for consistency.

Removing this cast allows building for MinGW without patching.

v2: Cast to (char *) rather than just dropping the cast

Signed-off-by: Jon TURNEY jon.tur...@dronecode.org.uk
---
 src/xcb_io.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/xcb_io.c b/src/xcb_io.c
index 0af47d8..300ef57 100644
--- a/src/xcb_io.c
+++ b/src/xcb_io.c
@@ -478,9 +478,9 @@ void _XSend(Display *dpy, const char *data, long size)
 
vec[0].iov_base = dpy-buffer;
vec[0].iov_len = dpy-bufptr - dpy-buffer;
-   vec[1].iov_base = (caddr_t) data;
+   vec[1].iov_base = (char *)data;
vec[1].iov_len = size;
-   vec[2].iov_base = (caddr_t) pad;
+   vec[2].iov_base = (char *)pad;
vec[2].iov_len = -size  3;
 
for(ext = dpy-flushes; ext; ext = ext-next_flush)
-- 
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

Re: [PATCH video-modesetting 13/14] config: layout and comment the top portion of configure.ac

2012-02-19 Thread Tormod Volden
On Sun, Feb 19, 2012 at 2:36 PM, Gaetan Nadon mems...@videotron.ca wrote:
 Reorder statements to be consistent with other modules so things
 are easier to find.

...
 +# Initialize X.Org macros 1.8 or later for MAN_SUBSTS set by 
 XORG_MANPAGE_SECTIONS
 +m4_ifndef([XORG_MACROS_VERSION],
 +       [m4_fatal([must install xorg-macros 1.8 or later before runnign 
 autoconf/autogen])])

Maybe you can s/runnign/running at the same time.

Tormod
___
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] Revert render: don't bother with animated cursors on floating slaves (#39989)

2012-02-19 Thread Jon TURNEY
On 17/02/2012 06:41, Jeremy Huddleston wrote:
 For both:
 Reviewed-by: Jeremy Huddleston jerem...@apple.com
 
 On Feb 15, 2012, at 8:32 PM, Peter Hutterer peter.hutte...@who-t.net wrote:
 
 This reverts commit bbb6b8c834e0e1491ca14403b5d0840dd14380d3.

 With this patch applied, Xorg -retro does not display the default cursor.

 Cause: IsFloating(dev) returns 1 for a master device if that master device
 is not yet paired with the keyboard. This happens for the VCP at startup,
 causing the above issue.

 Correct fix is to replace with !IsMaster()  IsFloating().

 Reported-by: Colin Harrison colin.harri...@virgin.net
 Reported-by: Jon TURNEY jon.tur...@dronecode.org.uk
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
 ---
 I'm sending this as a revert + a new patch to make future cherry-picking
 easier.

Thanks for looking at this, on behalf of all the people who like to run their
1989 style windowing system inside a window on their contemporary windowing
system :-)

This fixes the proximate issue of no default cursor with Xwin -retro, so

Tested-by: Jon TURNEY jon.tur...@dronecode.org.uk

However, I have to report that this doesn't fix things when I try testing it
with Xorg (with the vesa driver on virtualbox).  This might well be something
I'm doing wrong, as I guess you can't reproduce this being introduced with
dc57f89, but only with bbb6b8c.
___
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 video-modesetting 13/14] config: layout and comment the top portion of configure.ac

2012-02-19 Thread Gaetan Nadon
Reorder statements to be consistent with other modules so things
are easier to find.

Signed-off-by: Gaetan Nadon mems...@videotron.ca
---
 configure.ac |   20 ++--
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/configure.ac b/configure.ac
index 610c043..9bbbfb1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,31 +20,31 @@
 #
 # Process this file with autoconf to produce a configure script
 
+# Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-modesetting],
 [0.1.0],
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
 [xf86-video-modesetting])
-
 AC_CONFIG_SRCDIR([Makefile.am])
 AC_CONFIG_HEADERS([config.h])
-
-m4_ifndef([XORG_MACROS_VERSION],
-   [m4_fatal([must install xorg-macros 1.8 or later before runnign 
autoconf/autogen])])
-XORG_MACROS_VERSION(1.8)
-XORG_DEFAULT_OPTIONS
-
 AC_CONFIG_AUX_DIR(.)
-
-AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AC_SYS_LARGEFILE
 
+# Initialize Automake
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE
 
-# Checks for programs.
+# Initialize libtool
 AC_DISABLE_STATIC
 AC_PROG_LIBTOOL
 
+# Initialize X.Org macros 1.8 or later for MAN_SUBSTS set by 
XORG_MANPAGE_SECTIONS
+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_DEFAULT_OPTIONS
+
 AH_TOP([#include xorg-server.h])
 
 AC_ARG_WITH(xorg-module-dir,
-- 
1.7.5.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


Re: [PATCH libxcb] Fallback to TCP if no protocol is specified and the UNIX connection fails

2012-02-19 Thread Jeremy Huddleston
Can we delay the libX11 change until this is in a tagged libxcb (and have 
libX11 require that version to avoid regression)?  All the changes currently on 
xcb/libxcb master look 1.8.1 worthy, so perhaps we can push this one into the 
mix and get a 1.8.1 this week.

--Jeremy

On Feb 19, 2012, at 04:43, Julien Cristau wrote:

 Signed-off-by: Julien Cristau jcris...@debian.org
 ---
 src/xcb_util.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)
 
 diff --git a/src/xcb_util.c b/src/xcb_util.c
 index fde4f85..6d9efe0 100644
 --- a/src/xcb_util.c
 +++ b/src/xcb_util.c
 @@ -234,6 +234,11 @@ static int _xcb_open(const char *host, char *protocol, 
 const int display)
 fd = _xcb_open_unix(protocol, file);
 free(file);
 
 +if (fd  0  !protocol  *host == '\0') {
 + unsigned short port = X_TCP_PORT + display;
 + fd = _xcb_open_tcp(host, protocol, port);
 +}
 +
 return fd;
 #endif /* !_WIN32 */
 return -1; /* if control reaches here then something has gone wrong */
 -- 
 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


Re: [PATCH xserver 1/1] os: Pass the FatalError message to OsVendorFatalError

2012-02-19 Thread Jeremy Huddleston
Ping.  I know this looks pointless, but I need it for a follwup patch which 
uses this info in XQuartz's OsVendorFatalError.

On Feb 17, 2012, at 1:47 PM, Jeremy Huddleston jerem...@apple.com wrote:

 Signed-off-by: Jeremy Huddleston jerem...@apple.com
 ---
 hw/dmx/dmxinit.c |2 +-
 hw/dmx/dmxlog.c  |3 ---
 hw/kdrive/src/kdrive.c   |2 +-
 hw/vfb/InitOutput.c  |2 +-
 hw/xfree86/common/xf86Init.c |2 +-
 hw/xnest/Init.c  |2 +-
 hw/xquartz/darwin.c  |2 +-
 hw/xwin/winerror.c   |2 +-
 include/os.h |2 +-
 os/log.c |   16 ++--
 test/ddxstubs.c  |2 +-
 11 files changed, 19 insertions(+), 18 deletions(-)
 
 diff --git a/hw/dmx/dmxinit.c b/hw/dmx/dmxinit.c
 index 57c2425..9388833 100644
 --- a/hw/dmx/dmxinit.c
 +++ b/hw/dmx/dmxinit.c
 @@ -855,7 +855,7 @@ void OsVendorInit(void)
  * OsVendorVErrorFProc will cause \a VErrorF() (which is called by the
  * two routines mentioned here, as well as by others) to use the
  * referenced routine instead of \a vfprintf().) */
 -void OsVendorFatalError(void)
 +void OsVendorFatalError(const char *f, va_list args)
 {
 }
 
 diff --git a/hw/dmx/dmxlog.c b/hw/dmx/dmxlog.c
 index 94b8035..0ebe9f9 100644
 --- a/hw/dmx/dmxlog.c
 +++ b/hw/dmx/dmxlog.c
 @@ -102,9 +102,6 @@ static void VFatalError(const char *format, va_list args)
 {
 VErrorF(format, args);
 ErrorF(\n);
 -#ifdef DDXOSFATALERROR
 -OsVendorFatalError();
 -#endif
 AbortServer();
 /*NOTREACHED*/
 }
 diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c
 index f6cc351..5d69830 100644
 --- a/hw/kdrive/src/kdrive.c
 +++ b/hw/kdrive/src/kdrive.c
 @@ -1167,7 +1167,7 @@ KdInitOutput (ScreenInfo*pScreenInfo,
 }
 
 void
 -OsVendorFatalError(void)
 +OsVendorFatalError(const char *f, va_list args)
 {
 }
 
 diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c
 index e1af5a4..71c7b6d 100644
 --- a/hw/vfb/InitOutput.c
 +++ b/hw/vfb/InitOutput.c
 @@ -219,7 +219,7 @@ OsVendorInit(void)
 }
 
 void
 -OsVendorFatalError(void)
 +OsVendorFatalError(const char *f, va_list args)
 {
 }
 
 diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
 index 5263b5f..56550c9 100644
 --- a/hw/xfree86/common/xf86Init.c
 +++ b/hw/xfree86/common/xf86Init.c
 @@ -1036,7 +1036,7 @@ AbortDDX(enum ExitCode error)
 }
 
 void
 -OsVendorFatalError(void)
 +OsVendorFatalError(const char *f, va_list args)
 {
 #ifdef VENDORSUPPORT
 ErrorF(\nPlease refer to your Operating System Vendor support pages\n
 diff --git a/hw/xnest/Init.c b/hw/xnest/Init.c
 index af57518..b7e76b5 100644
 --- a/hw/xnest/Init.c
 +++ b/hw/xnest/Init.c
 @@ -138,7 +138,7 @@ void OsVendorInit(void)
 return;
 }
 
 -void OsVendorFatalError(void)
 +void OsVendorFatalError(const char *f, va_list args)
 {
 return;
 }
 diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
 index 465a96d..5d2da03 100644
 --- a/hw/xquartz/darwin.c
 +++ b/hw/xquartz/darwin.c
 @@ -605,7 +605,7 @@ void InitOutput( ScreenInfo *pScreenInfo, int argc, char 
 **argv )
 /*
  * OsVendorFatalError
  */
 -void OsVendorFatalError( void )
 +void OsVendorFatalError(const char *f, va_list args)
 {
 ErrorF(OsVendorFatalError\n );
 }
 diff --git a/hw/xwin/winerror.c b/hw/xwin/winerror.c
 index 0440d13..82ab382 100644
 --- a/hw/xwin/winerror.c
 +++ b/hw/xwin/winerror.c
 @@ -71,7 +71,7 @@ OsVendorVErrorF (const char *pszFormat, va_list va_args)
  * Attempt to do last-ditch, safe, important cleanup here.
  */
 void
 -OsVendorFatalError (void)
 +OsVendorFatalError (const char *f, va_list args)
 {
   /* Don't give duplicate warning if UseMsg was called */
   if (g_fSilentFatalError)
 diff --git a/include/os.h b/include/os.h
 index 48ce329..ae7a6f1 100644
 --- a/include/os.h
 +++ b/include/os.h
 @@ -296,7 +296,7 @@ extern _X_EXPORT void OsInit(void);
 
 extern _X_EXPORT void OsCleanup(Bool);
 
 -extern _X_EXPORT void OsVendorFatalError(void);
 +extern _X_EXPORT void OsVendorFatalError(const char *f, va_list args) 
 _X_ATTRIBUTE_PRINTF(1,0);;
 
 extern _X_EXPORT void OsVendorInit(void);
 
 diff --git a/os/log.c b/os/log.c
 index 671a01b..cdff7d1 100644
 --- a/os/log.c
 +++ b/os/log.c
 @@ -585,6 +585,7 @@ void
 FatalError(const char *f, ...)
 {
 va_list args;
 +va_list args2;
 static Bool beenhere = FALSE;
 
 if (beenhere)
 @@ -592,20 +593,23 @@ FatalError(const char *f, ...)
 else
   ErrorF(\nFatal server error:\n);
 
 -va_start(args, f);
 +/* Make a copy for OsVendorFatalError */
 +va_copy(args2, args);
 +
 #ifdef __APPLE__
 {
 -va_list args2;
 -va_copy(args2, args);
 -(void)vsnprintf(__crashreporter_info_buff__, 
 sizeof(__crashreporter_info_buff__), f, args2);
 -va_end(args2);
 +va_list apple_args;
 +va_copy(apple_args, args);
 +(void)vsnprintf(__crashreporter_info_buff__, 
 sizeof(__crashreporter_info_buff__), f, 

Re: [PATCH libxcb] Fallback to TCP if no protocol is specified and the UNIX connection fails

2012-02-19 Thread Jamey Sharp
I've pushed this patch; thanks!

I'll let you and Jeremy sort out the libX11 side.

Jamey

On Sun, Feb 19, 2012 at 01:43:54PM +0100, Julien Cristau wrote:
 Signed-off-by: Julien Cristau jcris...@debian.org
 ---
  src/xcb_util.c |5 +
  1 files changed, 5 insertions(+), 0 deletions(-)
 
 diff --git a/src/xcb_util.c b/src/xcb_util.c
 index fde4f85..6d9efe0 100644
 --- a/src/xcb_util.c
 +++ b/src/xcb_util.c
 @@ -234,6 +234,11 @@ static int _xcb_open(const char *host, char *protocol, 
 const int display)
  fd = _xcb_open_unix(protocol, file);
  free(file);
  
 +if (fd  0  !protocol  *host == '\0') {
 + unsigned short port = X_TCP_PORT + display;
 + fd = _xcb_open_tcp(host, protocol, port);
 +}
 +
  return fd;
  #endif /* !_WIN32 */
  return -1; /* if control reaches here then something has gone wrong */
 -- 
 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


signature.asc
Description: Digital 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

Re: [PULL] Minor XQuartz, Revert an XWarpPointer regression

2012-02-19 Thread Peter Hutterer
On Sun, Feb 19, 2012 at 02:50:42PM -0800, Jeremy Huddleston wrote:
 This includes two minor XQuartz issues I'd like to address before 1.12 is
 tagged, but the main issue here is the revert.  I emailed the list about
 this about a month ago, and Peter's been too busy to look into the
 regression, so I think we should just revert it on 1.12 (like we did on
 1.11) until someone has time to look into it in more detail.  This change
 is the last one on the branch in case you want to delay merging it until
 there is more discussion, you can easily just merge jeremyhu/xserver^
 instead of jeremyhu/xserver.

ACK to the revert.

Cheers,
  Peter

 The following changes since commit d53235af85d50774c68347720ce132daf9a5bc49:
 
   XQuartz: Build fix for possible conflict of BOOL type (2012-02-13 23:06:07 
 -0800)
 
 are available in the git repository at:
 
   git://people.freedesktop.org/~jeremyhu/xserver master
 
 for you to fetch changes up to 2f2ecafe557cf241022ec34a467a128cc3074c56:
 
   Revert dix: don't XWarpPointer through the last slave anymore (#38313) 
 (2012-02-19 14:46:43 -0800)
 
 
 Jeremy Huddleston (3):
   XQuartz: Actually install the new locales
   XQuartz: Short-circuit activateX:
   Revert dix: don't XWarpPointer through the last slave anymore (#38313)
 
  dix/events.c   |   21 +++--
  hw/xquartz/X11Application.m|3 +++
  hw/xquartz/bundle/mk_bundke.sh |2 +-
  3 files changed, 11 insertions(+), 15 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


[PATCH synaptics] Revert Don't store fake events in the motion history

2012-02-19 Thread Peter Hutterer
This commit introduced a regression. On some touchpads, the pointer keeps
moving in the last direction when the finger movement stops but the finger
is left on the touchpad.

Cause appears to be get_delta() which calculates the deltas based on the
motion history but has no control flow for the lack of fake motion events
in the history after this commit. Thus, under some conditions, the delta is
always non-zero as the history does not change.

Reproducer attached to bug
https://bugs.freedesktop.org/show_bug.cgi?id=45278#c11

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

This reverts commit c8b098214b44cf0585d78c460401ea7d143769f3.

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
---
There is probably a more extensive fix, starting with figuring out why the
timer still fires after enough movement to adding hooks for ignoring the
motion history if we're from a timer. This requires more time that I have
available atm.

 src/synaptics.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/synaptics.c b/src/synaptics.c
index 7b3f680..65b48ee 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2887,7 +2887,7 @@ HandleState(InputInfoPtr pInfo, struct SynapticsHwState 
*hw, CARD32 now,
 priv-lastButtons = buttons;
 
 /* generate a history of the absolute positions */
-if (inside_active_area  !from_timer)
+if (inside_active_area)
store_history(priv, hw-x, hw-y, hw-millis);
 return delay;
 }
-- 
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] dix: IsFloating() on master devices is always false

2012-02-19 Thread Peter Hutterer
There are a few subtle bugs during startup where IsFloating() returns true
if the device is a master device that is not yet paired with its keyboard
device.

Force IsFloating() to always return FALSE for master devices, that was the
intent after all and any code that relies on the other behaviour should be
fixed instead.

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
---
Turned out the vesa test case was another occurence of this same issue, so I
think that instaead of the previous two patches (revert + fix) it's better
to just push this one instead. After all, there may be more lingering bugs
here so we might as well squash all of them preventively. 

It's a bit more bigger than I'd like at this point in the release but given
that this is how the API was intended it should have few repercussions.

 dix/events.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dix/events.c b/dix/events.c
index 3c7d5d0..96e3f9c 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -343,7 +343,7 @@ IsMaster(DeviceIntPtr dev)
 Bool
 IsFloating(DeviceIntPtr dev)
 {
-return GetMaster(dev, MASTER_KEYBOARD) == NULL;
+return !IsMaster(dev)  GetMaster(dev, MASTER_KEYBOARD) == NULL;
 }
 
 
-- 
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 xinput 2/5] Always call XCloseDisplay()

2012-02-19 Thread Peter Hutterer
Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
---
 src/xinput.c |9 ++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/xinput.c b/src/xinput.c
index a336f53..a1bb221 100644
--- a/src/xinput.c
+++ b/src/xinput.c
@@ -368,17 +368,17 @@ main(int argc, char * argv[])
 
 if (display == NULL) {
fprintf(stderr, Unable to connect to X server\n);
-   return EXIT_FAILURE;
+   goto out;
 }
 
 if (!XQueryExtension(display, XInputExtension, xi_opcode, event, 
error)) {
 printf(X Input extension not available.\n);
-return EXIT_FAILURE;
+goto out;
 }
 
 if (!xinput_version(display)) {
fprintf(stderr, %s extension not available\n, INAME);
-   return EXIT_FAILURE;
+   goto out;
 }
 
 while(driver-func_name) {
@@ -394,6 +394,9 @@ main(int argc, char * argv[])
 
 usage();
 
+out:
+if (display)
+XCloseDisplay(display);
 return EXIT_FAILURE;
 }
 
-- 
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 xinput 3/5] Don't leak output_info

2012-02-19 Thread Peter Hutterer
This inverts the logic to have a more obvious flow for freeing the
output_info.

==26716== 1,161 bytes in 8 blocks are definitely lost in loss record 5 of 7
==26716==at 0x4A074CD: malloc (vg_replace_malloc.c:236)
==26716==by 0x395D804ABA: XRRGetOutputInfo (in 
/usr/lib64/libXrandr.so.2.2.0)
==26716==by 0x40932B: map_output_xrandr (transform.c:150)
==26716==by 0x40982F: map_to_output (transform.c:263)
==26716==by 0x4070A4: main (xinput.c:386)

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
---
 src/transform.c |8 +---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/transform.c b/src/transform.c
index 7717ffb..3ea7ff8 100644
--- a/src/transform.c
+++ b/src/transform.c
@@ -148,14 +148,15 @@ map_output_xrandr(Display *dpy, int deviceid, const char 
*output_name)
 for (i = 0; i  res-noutput  !found; i++)
 {
 output_info = XRRGetOutputInfo(dpy, res, res-outputs[i]);
-if (!output_info-crtc || output_info-connection != RR_Connected)
-continue;
 
-if (strcmp(output_info-name, output_name) == 0)
+if (output_info-crtc  output_info-connection == RR_Connected 
+strcmp(output_info-name, output_name) == 0)
 {
 found = 1;
 break;
 }
+
+XRRFreeOutputInfo(output_info);
 }
 
 /* crtc holds our screen info, need to compare to actual screen size */
@@ -169,6 +170,7 @@ map_output_xrandr(Display *dpy, int deviceid, const char 
*output_name)
   crtc_info-width, crtc_info-height);
 rc = apply_matrix(dpy, deviceid, m);
 XRRFreeCrtcInfo(crtc_info);
+XRRFreeOutputInfo(output_info);
 } else
 printf(Unable to find output '%s'. 
 Output may not be connected.\n, output_name);
-- 
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 xinput 4/5] Add find_output_xrandr to check for output presence

2012-02-19 Thread Peter Hutterer
Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
---
 src/transform.c |   31 +--
 1 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/src/transform.c b/src/transform.c
index 3ea7ff8..15fda59 100644
--- a/src/transform.c
+++ b/src/transform.c
@@ -135,13 +135,14 @@ set_transformation_matrix(Display *dpy, Matrix *m, int 
offset_x, int offset_y,
 #endif
 }
 
-static int
-map_output_xrandr(Display *dpy, int deviceid, const char *output_name)
+/* Caller must free return value */
+static XRROutputInfo*
+find_output_xrandr(Display *dpy, const char *output_name)
 {
-int i, found = 0;
-int rc = EXIT_FAILURE;
 XRRScreenResources *res;
-XRROutputInfo *output_info;
+XRROutputInfo *output_info = NULL;
+int i;
+int found = 0;
 
 res = XRRGetScreenResources(dpy, DefaultRootWindow(dpy));
 
@@ -159,8 +160,26 @@ map_output_xrandr(Display *dpy, int deviceid, const char 
*output_name)
 XRRFreeOutputInfo(output_info);
 }
 
+XRRFreeScreenResources(res);
+
+if (!found)
+output_info = NULL;
+
+return output_info;
+}
+
+static int
+map_output_xrandr(Display *dpy, int deviceid, const char *output_name)
+{
+int rc = EXIT_FAILURE;
+XRRScreenResources *res;
+XRROutputInfo *output_info;
+
+res = XRRGetScreenResources(dpy, DefaultRootWindow(dpy));
+output_info = find_output_xrandr(dpy, output_name);
+
 /* crtc holds our screen info, need to compare to actual screen size */
-if (found)
+if (output_info)
 {
 XRRCrtcInfo *crtc_info;
 Matrix m;
-- 
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 xinput 5/5] Replace NVIDIA-specific output checking

2012-02-19 Thread Peter Hutterer
If the binary driver drives at least one screen, the old method did
not allow for randr-style screen binding (on the other screen).

Change the logic to:
- check if the output an randr output
- if not, check if the default randr output is present and the output name
  was HEAD-n
  - if so, use Xinerama-style mapping

This keeps the current behaviour of not allowing Xinerama-style mapping if
all outputs are RandR capable.

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
---
Untested, I don't have this hw configuration available right now.

 src/transform.c |   26 +++---
 1 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/src/transform.c b/src/transform.c
index 15fda59..f80a592 100644
--- a/src/transform.c
+++ b/src/transform.c
@@ -253,10 +253,9 @@ out:
 int
 map_to_output(Display *dpy, int argc, char *argv[], char *name, char *desc)
 {
-int opcode, event, error;
-int maj, min;
 char *output_name;
 XIDeviceInfo *info;
+XRROutputInfo *output_info;
 
 if (argc  2)
 {
@@ -272,14 +271,19 @@ map_to_output(Display *dpy, int argc, char *argv[], char 
*name, char *desc)
 }
 
 output_name = argv[1];
+output_info = find_output_xrandr(dpy, output_name);
+if (!output_info)
+{
+/* Output doesn't exist. Is this a (partial) non-RandR setup?  */
+output_info = find_output_xrandr(dpy, default);
+if (output_info)
+{
+XRRFreeOutputInfo(output_info);
+if (strncmp(HEAD-, output_name, strlen(HEAD-)) == 0)
+return map_output_xinerama(dpy, info-deviceid, output_name);
+}
+} else
+XRRFreeOutputInfo(output_info);
 
-/* Check for RandR 1.2. Server bug causes the NVIDIA driver to
- * report with RandR 1.3 support but it doesn't expose RandR outputs.
- * Force Xinerama if NV-CONTROL is present */
-if (XQueryExtension(dpy, NV-CONTROL, opcode, event, error) ||
-!XQueryExtension(dpy, RANDR, opcode, event, error) ||
-!XRRQueryVersion(dpy, maj, min) || (maj * 1000 + min)  1002)
-   return map_output_xinerama(dpy, info-deviceid, output_name);
-else
-   return map_output_xrandr(dpy, info-deviceid, output_name);
+return map_output_xrandr(dpy, info-deviceid, output_name);
 }
-- 
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


Re: [PATCH] dix: IsFloating() on master devices is always false

2012-02-19 Thread Jeremy Huddleston
This one makes me squirm a bit.  It *looks* right, but whenever I put one 
tidbit of input handling into my brain, another bit falls out, and it's usually 
that fallen-out bit that was the key to understanding why something won't work.

AIUI, this change will affect use cases like these:

xkb/xkbAccessX.c
694:dev = IsFloating(mouse) ? mouse : GetMaster(mouse, MASTER_KEYBOARD);

IsMaster(mouse) can be true because mouse-type == MASTER_POINTER
IsFloating(mouse) was true because GetMaster(mouse, MASTER_KEYBOARD) == NULL
dev was being set to mouse
IsFloating(mouse) is now false, so dev is now NULL.

This particular case is probably fine because we check (dev  dev-key), but I 
wonder if there are other cases this will bring up.

In dix/events.c, ScreenRestructured():

for (pDev = inputInfo.devices; pDev; pDev = pDev-next)
{
if (!IsFloating(pDev)  !DevHasCursor(pDev))
continue;

IsFloating(pDev) was previously true for (pDev-type == MASTER_POINTER, 
GetMaster(pDev, MASTER_KEYBOARD) == NULL).  Now it is false.
IsFloating(pDev) is now false in this case, so !IsFloating(pDev) is now true.  
If !DevHasCursor(pDev) is also true, we now skip this device whereas before we 
would've adjusted ConfineCursorToWindow(pDev).

I think this is actually ok that we're skipping it, and perhaps it was a bug 
that we were were doing ConfineCursorToWindow() previously, so I *think* this 
case is fine ...

I've given up on looking at other uses of IsFloating() because it is starting 
to hurt.  Can you please expand the tests in test/input.c to test floating 
devices.

Reviewed-by: Jeremy Huddleston jerem...@apple.com

--Jeremy

On Feb 19, 2012, at 19:23, Peter Hutterer wrote:

 There are a few subtle bugs during startup where IsFloating() returns true
 if the device is a master device that is not yet paired with its keyboard
 device.
 
 Force IsFloating() to always return FALSE for master devices, that was the
 intent after all and any code that relies on the other behaviour should be
 fixed instead.
 
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
 ---
 Turned out the vesa test case was another occurence of this same issue, so I
 think that instaead of the previous two patches (revert + fix) it's better
 to just push this one instead. After all, there may be more lingering bugs
 here so we might as well squash all of them preventively. 
 
 It's a bit more bigger than I'd like at this point in the release but given
 that this is how the API was intended it should have few repercussions.
 
 dix/events.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
 
 diff --git a/dix/events.c b/dix/events.c
 index 3c7d5d0..96e3f9c 100644
 --- a/dix/events.c
 +++ b/dix/events.c
 @@ -343,7 +343,7 @@ IsMaster(DeviceIntPtr dev)
 Bool
 IsFloating(DeviceIntPtr dev)
 {
 -return GetMaster(dev, MASTER_KEYBOARD) == NULL;
 +return !IsMaster(dev)  GetMaster(dev, MASTER_KEYBOARD) == NULL;
 }
 
 
 -- 
 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


Re: [PATCH 1/9] dri2: Fix can_exchange() to allow page-flipping on new servers.

2012-02-19 Thread Mario Kleiner

On 02/16/2012 11:04 AM, Michel Dänzer wrote:

On Don, 2012-02-16 at 00:45 +0100, Mario Kleiner wrote:

can_exchange() fails on at least Xorg 1.12+. This fixes
it in the same way it was fixed in the ati  intel ddx.

Signed-off-by: Mario Kleinermario.klei...@tuebingen.mpg.de
---
  src/nouveau_dri2.c |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/nouveau_dri2.c b/src/nouveau_dri2.c
index 3aa5ec5..5b62425 100644
--- a/src/nouveau_dri2.c
+++ b/src/nouveau_dri2.c
@@ -160,7 +160,7 @@ can_exchange(DrawablePtr draw, PixmapPtr dst_pix, PixmapPtr 
src_pix)
return ((DRI2CanFlip(draw)  pNv-has_pageflip))
dst_pix-drawable.width == src_pix-drawable.width
dst_pix-drawable.height == src_pix-drawable.height
-   dst_pix-drawable.depth == src_pix-drawable.depth
+   dst_pix-drawable.bitsPerPixel == 
src_pix-drawable.bitsPerPixel
dst_pix-devKind == src_pix-devKind;
  }



Actually, it seems like the pixmap depths really should match, otherwise
one could end up with the front pixmap depth not matching the window
depth. Not sure that's a real problem right now, but it seems wonky at
least...

Have you investigated why the depths don't match?




Depends on the meaning of investigated: One of the pixmaps has depth 
24 bits (the pixmap of the root window) the other 32 bits (as requested 
from the client via DRI2GetBuffersWithFormat for RGBA8 visuals). Both 
have 32 bpp. I checked what the intel and ati ddx do. The ati ddx always 
checked for matching drawable.bitsPerPixel since kms pageflip support 
was implemented. The intel ddx does the same, but the code and comments 
suggests they tried both and checking for matching depths probably 
didn't work:


cd xorg/drivers/xf86-video-intel/
git log -p e2615cdeef078dbd2e834b68c437f098a92b941d

So everybody does it like this currently, and it seems to work.

I also just tried setting DefaultDepth to 30 bits on a NV50 card which 
supports this. xdpyinfo confirms a screen depth of 30 bit == 10 bits per 
red/green/blue channel. glxinfo shows that only RGBA8 visuals are 
supported. Here we have a mismatch of depths 30 vs. 24 and the driver 
reverts correctly from page flipping to copy swaps, although i can't see 
immediately what causes it to correctly switch back to copy swaps.


-mario
___
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 9/9] dri2: Fix corner case crash for swaplimit 1

2012-02-19 Thread Mario Kleiner

On 02/16/2012 10:46 AM, Michel Dänzer wrote:

On Don, 2012-02-16 at 00:45 +0100, Mario Kleiner wrote:

If a swaplimit  1 is set on a server which
supports the swaplimit api (XOrg 1.12.0+),
the following can happen:

1. Client calls glXSwapBuffersMscOML() with a
swap target  1 vblank in the future, or a
client calls glXSwapbuffers() while the swap
interval is set to  1 (unusual but possible).

2. nouveau_dri2_finish_swap() is therefore called
only at the target vblank, instead of immediately.

3. Because of the deferred execution of
nouveu_dri2_finish_swap(), the OpenGL client
can call x-servers DRI2GetBuffersWithFormat()
before nouveau_dri2_finish_swap() executes and
it deletes pixmaps that would be needed by
nouveau_dri2_finish_swap() --  Segfault --  Crash.


Pixmaps are reference counted, so it should be possible to fix this via
proper reference counting.




Thanks for the tip. I'll try that.

-mario
___
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 xserver] XKB: Redirect actions defunct with Gtk3 (XInput?)

2012-02-19 Thread Peter Hutterer
On Sun, Feb 19, 2012 at 11:18:19AM +0100, Andreas Wettstein wrote:
 When redirect actions are used with Gtk3, Gtk3 complains about
 events not holding a GdkDevice.  This is caused by device IDs not
 being set for redirect actions. The patch below sets them, but I
 am not quite sure that the values are correct.  Anyway, the
 warnings from Gtk3 warnings are gone.
 
 More seriously, Gtk3 does not receive state changes redirect
 actions might specify.  This is because event_set_state in
 dix/inpututils.c accesses the prev_state field, but the changes
 for the redirect action are only put into the state field.
 
 Signed-off-by: Andreas Wettstein wettstein...@solnet.ch
 ---
  xkb/xkbActions.c |   18 ++
  1 files changed, 14 insertions(+), 4 deletions(-)
 
 diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c
 index da0bdea..da874f0 100644
 --- a/xkb/xkbActions.c
 +++ b/xkb/xkbActions.c
 @@ -795,7 +795,7 @@ _XkbFilterRedirectKey(XkbSrvInfoPtr   xkbi,
  {
  DeviceEvent  ev;
  int  x,y;
 -XkbStateRec  old;
 +XkbStateRec  old, old_prev;
  unsigned mods,mask;
  xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(xkbi-device);
  ProcessInputProc backupproc;
 @@ -803,6 +803,7 @@ ProcessInputProc backupproc;
  /* never actually used uninitialised, but gcc isn't smart enough
   * to work that out. */
  memset(old, 0, sizeof(old));
 +memset(old_prev, 0, sizeof(old_prev));
  memset(ev, 0, sizeof(ev));
  
  if ((filter-keycode!=0)(filter-keycode!=keycode))
 @@ -814,6 +815,7 @@ ProcessInputProc backupproc;
  ev.time = GetTimeInMillis();
  ev.root_x = x;
  ev.root_y = y;
 +ev.deviceid = ev.sourceid = xkbi-device-id;

not sure about this one. the actual device and source ID is in the caller
and you need to pass this down. they aren't always the same.
I think the rest is ok though.

Cheers,
  Peter
  
  if (filter-keycode==0) {/* initial press */
   if ((pAction-redirect.new_keyxkbi-desc-min_key_code)||
 @@ -839,6 +841,7 @@ ProcessInputProc backupproc;
  
   if ( mask || mods ) {
   old= xkbi-state;
 + old_prev= xkbi-prev_state;
   xkbi-state.base_mods= ~mask;
   xkbi-state.base_mods|= (modsmask);
   xkbi-state.latched_mods= ~mask;
 @@ -846,15 +849,18 @@ ProcessInputProc backupproc;
   xkbi-state.locked_mods= ~mask;
   xkbi-state.locked_mods|= (modsmask);
   XkbComputeDerivedState(xkbi);
 + xkbi-prev_state= xkbi-state;
   }
  
   UNWRAP_PROCESS_INPUT_PROC(xkbi-device,xkbPrivPtr, backupproc);
   xkbi-device-public.processInputProc((InternalEvent*)ev, 
 xkbi-device);
   COND_WRAP_PROCESS_INPUT_PROC(xkbi-device, xkbPrivPtr,
backupproc,xkbUnwrapProc);
 - 
 - if ( mask || mods )
 +
 + if ( mask || mods ) {
   xkbi-state= old;
 + xkbi-prev_state= old_prev;
 + }
  }
  else if (filter-keycode==keycode) {
  
 @@ -870,6 +876,7 @@ ProcessInputProc backupproc;
  
   if ( mask || mods ) {
   old= xkbi-state;
 + old_prev= xkbi-prev_state;
   xkbi-state.base_mods= ~mask;
   xkbi-state.base_mods|= (modsmask);
   xkbi-state.latched_mods= ~mask;
 @@ -877,6 +884,7 @@ ProcessInputProc backupproc;
   xkbi-state.locked_mods= ~mask;
   xkbi-state.locked_mods|= (modsmask);
   XkbComputeDerivedState(xkbi);
 + xkbi-prev_state= xkbi-state;
   }
  
   UNWRAP_PROCESS_INPUT_PROC(xkbi-device,xkbPrivPtr, backupproc);
 @@ -884,8 +892,10 @@ ProcessInputProc backupproc;
   COND_WRAP_PROCESS_INPUT_PROC(xkbi-device, xkbPrivPtr,
backupproc,xkbUnwrapProc);
  
 - if ( mask || mods )
 + if ( mask || mods ) {
   xkbi-state= old;
 + xkbi-prev_state= old_prev;
 + }
  
   filter-keycode= 0;
   filter-active= 0;
 -- 
 1.7.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