Re: [PATCH] libinput-drv: Move properties to a separate header

2015-01-20 Thread Peter Hutterer
On Tue, Jan 20, 2015 at 01:54:10PM +0100, Olivier Fourdan wrote:
> And install the header as part of the SDK, so that applications interfacing
> with the libinput driver do not have to copy paste all the properties' names.
> 
> Signed-off-by: Olivier Fourdan 
> ---

urg, didn't see that one first so I reverted the original one and applied
this one (7d73602c4b60aedee41986362cee6a460ec91a92).
For next time, please use a subject of [PATCH v2  when you're updating a
patch, together with an outline of what changed right here (after the ---)
that makes reviewing easier and anything after the --- will be stripped by
git-am anyway.

Also: please add the component name inside the brackets [] so it gets
stripped too. e.g. [PATCH v2 libinput] or somesuch. Thanks.

Cheers,
   Peter

>  Makefile.am   |  5 +++-
>  configure.ac  |  4 ++-
>  include/Makefile.am   | 21 +++
>  include/libinput-properties.h | 62 ++
>  src/libinput.c| 63 
> ++-
>  xorg-libinput.pc.in   |  6 +
>  6 files changed, 116 insertions(+), 45 deletions(-)
>  create mode 100644 include/Makefile.am
>  create mode 100644 include/libinput-properties.h
>  create mode 100644 xorg-libinput.pc.in
> 
> diff --git a/Makefile.am b/Makefile.am
> index a963530..99e6808 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -21,9 +21,12 @@
>  
>  DISTCHECK_CONFIGURE_FLAGS = --with-sdkdir='$${includedir}/xorg'
>  
> -SUBDIRS = src man
> +SUBDIRS = src include man
>  MAINTAINERCLEANFILES = ChangeLog INSTALL
>  
> +pkgconfigdir = $(libdir)/pkgconfig
> +pkgconfig_DATA = xorg-libinput.pc
> +
>  .PHONY: ChangeLog INSTALL
>  
>  INSTALL:
> diff --git a/configure.ac b/configure.ac
> index 9a41170..55a1372 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -68,6 +68,8 @@ DRIVER_NAME=libinput
>  AC_SUBST([DRIVER_NAME])
>  
>  AC_CONFIG_FILES([Makefile
> +  include/Makefile
>src/Makefile
> -  man/Makefile])
> +  man/Makefile
> +  xorg-libinput.pc])
>  AC_OUTPUT
> diff --git a/include/Makefile.am b/include/Makefile.am
> new file mode 100644
> index 000..4d3467b
> --- /dev/null
> +++ b/include/Makefile.am
> @@ -0,0 +1,21 @@
> +#  Copyright 2005 Adam Jackson.
> +#
> +#  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
> +#  on 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:
> +#
> +#  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 NON-INFRINGEMENT.  IN NO EVENT SHALL
> +#  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.
> +
> +sdk_HEADERS = libinput-properties.h
> diff --git a/include/libinput-properties.h b/include/libinput-properties.h
> new file mode 100644
> index 000..90899c3
> --- /dev/null
> +++ b/include/libinput-properties.h
> @@ -0,0 +1,62 @@
> +/*
> + * Copyright © 2015 Red Hat, Inc.
> + *
> + * Permission to use, copy, modify, distribute, and sell this software
> + * and its documentation for any purpose is hereby granted without
> + * fee, provided that the above copyright notice appear in all copies
> + * and that both that copyright notice and this permission notice
> + * appear in supporting documentation, and that the name of Red Hat
> + * not be used in advertising or publicity pertaining to distribution
> + * of the software without specific, written prior permission.  Red
> + * Hat makes no representations about the suitability of this software
> + * for any purpose.  It is provided "as is" without express or implied
> + * warranty.
> + *
> + * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
> + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
> + * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
> + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
> + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
> + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
> + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
> + */
> +
> +#ifndef _LIBINPUT_PROPERTIES_H_
> +#defin

[PATCH xts 2/2] libproto: RcvRep: Don't overwrite memory in QueryFont

2015-01-20 Thread Peter Harris
If the server returns a bogus (short) reply to a swapped QueryFont
request, RcvRep swaps past the end of its buffer, smashing the heap.

Signed-off-by: Peter Harris 
---
 xts5/src/libproto/RcvRep.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/xts5/src/libproto/RcvRep.c b/xts5/src/libproto/RcvRep.c
index c375d5a..946ce6f 100644
--- a/xts5/src/libproto/RcvRep.c
+++ b/xts5/src/libproto/RcvRep.c
@@ -374,6 +374,10 @@ int client;   /* */
wbcopy(rbp,valuePtr, 32);
break;
case X_QueryFont:
+   if (rp->generic.length < 7) {
+   
Length_Error(max(bytes_there,calculated_length<<2),client,rp,type,"QueryFont",7);
+   break;
+   }
valuePtr =  (unsigned char *) &(((xQueryFontReply 
*)rp)->minBounds);
Unpack_Shorts((unsigned short *) valuePtr, &rbp, 6, needswap);
rbp += 4;
-- 
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 xts 1/2] libproto: Fix buffer read overrun

2015-01-20 Thread Peter Harris
Found by -fsanitize=address

Signed-off-by: Peter Harris 
---
 xts5/src/libproto/ShowSup.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xts5/src/libproto/ShowSup.c b/xts5/src/libproto/ShowSup.c
index a05ff7d..b8ba796 100644
--- a/xts5/src/libproto/ShowSup.c
+++ b/xts5/src/libproto/ShowSup.c
@@ -581,7 +581,7 @@ int format;
int i;

if (nval > 0) {
-   valuePtr = (CARD32 *) ((CARD32 *) rp + size);
+   valuePtr = (CARD32 *) ((CARD8 *) rp + size);
for (i = 0; i < nval; i++) {
Log_Some("\tfontprop %d, name = 0x%lx, value = 
0x%lx\n", i, *valuePtr, *(valuePtr+1));
valuePtr += 2;
@@ -598,7 +598,7 @@ int format;
int i;
 
if (nval > 0) {
-   valuePtr = (CARD16 *) ((CARD16 *) rp + size);
+   valuePtr = (CARD16 *) ((CARD8 *) rp + size);
for (i = 0; i < nval; i++) {
Log_Some("\tcharinfo %d, left-side-bearing = %d, 
right-side-bearing = %d, character-width = %d, ascent = %d, descent = %d, 
attributes = 0x%x\n", i, *valuePtr, *(valuePtr+1), *(valuePtr+2), 
*(valuePtr+3), *(valuePtr+4), *(valuePtr+5));
valuePtr += 6;
-- 
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] Avoid possible null pointer dereference.

2015-01-20 Thread Alan Coopersmith

On 01/20/15 04:44 PM, Carlos Olmedo Escobar wrote:

Signed-off-by: Carlos Olmedo Escobar 
---
  hw/xwayland/xwayland.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 37d6d82..7e8d667 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -513,9 +513,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
  int ret, bpc, green_bpc, i;

  xwl_screen = calloc(sizeof *xwl_screen, 1);
-xwl_screen->wm_fd = -1;
  if (xwl_screen == NULL)
  return FALSE;
+xwl_screen->wm_fd = -1;

  if (!dixRegisterPrivateKey(&xwl_screen_private_key, PRIVATE_SCREEN, 0))
  return FALSE;



Reviewed-by: Alan Coopersmith 

--
-Alan Coopersmith-  alan.coopersm...@oracle.com
 Oracle Solaris Engineering - http://blogs.oracle.com/alanc
___
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] Avoid possible null pointer dereference.

2015-01-20 Thread Carlos Olmedo Escobar
Signed-off-by: Carlos Olmedo Escobar 
---
 hw/xwayland/xwayland.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 37d6d82..7e8d667 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -513,9 +513,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
 int ret, bpc, green_bpc, i;
 
 xwl_screen = calloc(sizeof *xwl_screen, 1);
-xwl_screen->wm_fd = -1;
 if (xwl_screen == NULL)
 return FALSE;
+xwl_screen->wm_fd = -1;
 
 if (!dixRegisterPrivateKey(&xwl_screen_private_key, PRIVATE_SCREEN, 0))
 return FALSE;
-- 
2.1.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 v2] dri2: Reuse unused flags in GetBuffers protocol to pass last SBC

2015-01-20 Thread Ian Romanick
On 01/19/2015 06:29 AM, Chris Wilson wrote:
> Allow mesa/dri2 to implement GLX_EXT_buffer_age by reporting the sbc of
> when the current back buffer was defined. As this may require ddx
> support, only set the value if enabled by the ddx and report the new
> semantics via a DRI2GetParam request.
> 
> Signed-off-by: Chris Wilson 
> ---
>  configure.ac   |  2 +-
>  hw/xfree86/dri2/dri2.c | 25 +
>  hw/xfree86/dri2/dri2.h |  1 +
>  3 files changed, 23 insertions(+), 5 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index b593fc7..e49c35e 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -768,7 +768,7 @@ RECORDPROTO="recordproto >= 1.13.99.1"
>  SCRNSAVERPROTO="scrnsaverproto >= 1.1"
>  RESOURCEPROTO="resourceproto >= 1.2.0"
>  DRIPROTO="xf86driproto >= 2.1.0"
> -DRI2PROTO="dri2proto >= 2.8"
> +DRI2PROTO="dri2proto >= 2.9"
>  DRI3PROTO="dri3proto >= 1.0"
>  XINERAMAPROTO="xineramaproto"
>  BIGFONTPROTO="xf86bigfontproto >= 1.2.0"
> diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
> index 2c0367e..d70a632 100644
> --- a/hw/xfree86/dri2/dri2.c
> +++ b/hw/xfree86/dri2/dri2.c
> @@ -49,6 +49,8 @@
>  #include "damage.h"
>  #include "xf86.h"
>  
> +#include  /* for parameter names */
> +
>  CARD8 dri2_major;   /* version of DRI2 supported by DDX */
>  CARD8 dri2_minor;
>  
> @@ -115,6 +117,7 @@ typedef struct _DRI2Screen {
>  unsigned int lastSequence;
>  int prime_id;
>  int scheduleSwap0;
> +int bufferAge;
>  
>  DRI2CreateBufferProcPtr CreateBuffer;
>  DRI2DestroyBufferProcPtr DestroyBuffer;
> @@ -1117,6 +1120,9 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, 
> CARD64 target_msc,
>  return BadDrawable;
>  }
>  
> +if (ds->bufferAge)
> +pSrcBuffer->flags = *swap_target;
> +
>  /* Old DDX or PRIME, just blit */
>  if (!ds->scheduleSwap0 || pPriv->prime_id) {
>  BoxRec box;
> @@ -1562,6 +1568,7 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
>  
>  if (info->version >= 10) {
>  ds->scheduleSwap0 = info->scheduleSwap0;
> +ds->bufferAge = info->bufferAge;
>  }
>  
>  /*
> @@ -1684,10 +1691,20 @@ DRI2GetParam(ClientPtr client,
>  
>  switch (high_byte) {
>  case 0:
> -/* Parameter names whose high_byte is 0 are reserved for the X
> - * server. The server currently recognizes no parameters.
> - */
> -goto not_recognized;
> + /* Parameter names whose high_byte is 0 are reserved for the X
> +  * server.
> +  */

Why did the whitespace change?  I don't remember what the whitespace
rules are in the server...

> + switch (param) {
> + case DRI2ParamXHasBufferAge:
> + *value = ds->bufferAge;
> + break;
> + default:
> + goto not_recognized;
> + }
> +
> + *is_param_recognized = TRUE;
> + return Success;
> +
>  case 1:
>  /* Parameter names whose high byte is 1 are reserved for the DDX. */
>  if (ds->GetParam)
> diff --git a/hw/xfree86/dri2/dri2.h b/hw/xfree86/dri2/dri2.h
> index 1cf4288..e76f7a8 100644
> --- a/hw/xfree86/dri2/dri2.h
> +++ b/hw/xfree86/dri2/dri2.h
> @@ -255,6 +255,7 @@ typedef struct {
>  
>  /* added in version 10 */
>  int scheduleSwap0;
> +int bufferAge;

Both fields should get added in the patch where the version is bumped,
right?

>  } DRI2InfoRec, *DRI2InfoPtr;
>  
>  extern _X_EXPORT Bool DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info);
> 

___
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: Implement GLX_EXT_buffer_age for DRI2

2015-01-20 Thread Dave Airlie
On 19 January 2015 at 21:00, Chris Wilson  wrote:
> In order to suport GLX_EXT_buffer_age in DRI2, we need to pass back the
> last swap buffer count that the back buffer was defined for. For
> simplicity, we can reuse an existing field in the DRI2GetBuffers reply
> that is not used by current drivers, the flags. Since we change the
> interpretation of this flag, we also declare the semantic change with a
> DRI2 parameter and depend upon the DDX to enable the change
> responsibility (which is just a matter of reviewing whether the flags
> field has ever been used for a non-zero value).
>

This is just missing the why do we need to add this to DRI2 when we
have DRI3/Present that should be solving it.

Doesn't dri3 already do this?

Dave.
___
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] libinput-drv: Move properties to a separate header

2015-01-20 Thread Peter Hutterer
On Tue, Jan 20, 2015 at 12:01:10PM +0100, Olivier Fourdan wrote:
> And install the header as part of the SDK, so that applications interfacing
> with the libinput driver do not have to copy paste all the properties' names.
> 
> Signed-off-by: Olivier Fourdan 

both patches pushed, thanks.

I took the liberty of removing the huge copyright/license block out of
include/Makefile.am. It seems a bit excessive for a one-liner ;)

Cheers,
   Peter

> ---
>  Makefile.am   |  2 +-
>  configure.ac  |  1 +
>  include/Makefile.am   | 21 +++
>  include/libinput-properties.h | 62 ++
>  src/libinput.c| 63 
> ++-
>  5 files changed, 105 insertions(+), 44 deletions(-)
>  create mode 100644 include/Makefile.am
>  create mode 100644 include/libinput-properties.h
> 
> diff --git a/Makefile.am b/Makefile.am
> index a963530..9035843 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -21,7 +21,7 @@
>  
>  DISTCHECK_CONFIGURE_FLAGS = --with-sdkdir='$${includedir}/xorg'
>  
> -SUBDIRS = src man
> +SUBDIRS = src include man
>  MAINTAINERCLEANFILES = ChangeLog INSTALL
>  
>  .PHONY: ChangeLog INSTALL
> diff --git a/configure.ac b/configure.ac
> index 9a41170..ee7f100 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -68,6 +68,7 @@ DRIVER_NAME=libinput
>  AC_SUBST([DRIVER_NAME])
>  
>  AC_CONFIG_FILES([Makefile
> +  include/Makefile
>src/Makefile
>man/Makefile])
>  AC_OUTPUT
> diff --git a/include/Makefile.am b/include/Makefile.am
> new file mode 100644
> index 000..4d3467b
> --- /dev/null
> +++ b/include/Makefile.am
> @@ -0,0 +1,21 @@
> +#  Copyright 2005 Adam Jackson.
> +#
> +#  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
> +#  on 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:
> +#
> +#  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 NON-INFRINGEMENT.  IN NO EVENT SHALL
> +#  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.
> +
> +sdk_HEADERS = libinput-properties.h
> diff --git a/include/libinput-properties.h b/include/libinput-properties.h
> new file mode 100644
> index 000..90899c3
> --- /dev/null
> +++ b/include/libinput-properties.h
> @@ -0,0 +1,62 @@
> +/*
> + * Copyright © 2015 Red Hat, Inc.
> + *
> + * Permission to use, copy, modify, distribute, and sell this software
> + * and its documentation for any purpose is hereby granted without
> + * fee, provided that the above copyright notice appear in all copies
> + * and that both that copyright notice and this permission notice
> + * appear in supporting documentation, and that the name of Red Hat
> + * not be used in advertising or publicity pertaining to distribution
> + * of the software without specific, written prior permission.  Red
> + * Hat makes no representations about the suitability of this software
> + * for any purpose.  It is provided "as is" without express or implied
> + * warranty.
> + *
> + * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
> + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
> + * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
> + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
> + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
> + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
> + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
> + */
> +
> +#ifndef _LIBINPUT_PROPERTIES_H_
> +#define _LIBINPUT_PROPERTIES_H_
> +
> +/* Tapping enabled/disabled: BOOL, 1 value */
> +#define LIBINPUT_PROP_TAP "libinput Tapping Enabled"
> +
> +/* Calibration matrix: FLOAT, 9 values of a 3x3 matrix, in rows */
> +#define LIBINPUT_PROP_CALIBRATION "libinput Calibration Matrix"
> +
> +/* Pointer accel speed: FLOAT, 1 value, 32 bit */
> +#define LIBINPUT_PROP_ACCEL "libinput Accel Speed"
> +
> +/* Natural scrolling: BOOL, 1 value */
> +#define LIBINPUT_PROP_NATURAL_SCROLL "libinput Natural Scrolling Enabled"
> +
> +/* Send-events mode: BOOL read-only, 2 values in order disabled,
> + 

Re: [Mesa-dev] [dri2proto] Declare DRI2ParamXHasBufferAge

2015-01-20 Thread Ian Romanick
On 01/19/2015 03:00 AM, Chris Wilson wrote:
> In order for X/DDX to reuse a driver specific field of the DRI2GetBuffers
> reply, we need to declare the change in semantics. To indicate that the
> flags field now continues the last swap buffers count instead, we
> introduce the has-buffer-age parameter.
> 
> Signed-off-by: Chris Wilson 

Reviewed-by: Ian Romanick 

> ---
>  configure.ac  |  2 +-
>  dri2proto.h   |  2 ++
>  dri2proto.txt | 11 ---
>  3 files changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 5fadf56..9f4c4a0 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1,5 +1,5 @@
>  AC_PREREQ([2.60])
> -AC_INIT([DRI2Proto], [2.8], 
> [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
> +AC_INIT([DRI2Proto], [2.9], 
> [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
>  AM_INIT_AUTOMAKE([foreign dist-bzip2])
>  
>  # Require xorg-macros: XORG_DEFAULT_OPTIONS
> diff --git a/dri2proto.h b/dri2proto.h
> index 128b807..086dc96 100644
> --- a/dri2proto.h
> +++ b/dri2proto.h
> @@ -340,6 +340,8 @@ typedef struct {
>  } xDRI2GetParamReq;
>  #define sz_xDRI2GetParamReq 12
>  
> +#define DRI2ParamXHasBufferAge 0
> +
>  typedef struct {
>  BYTEtype; /*X_Reply*/
>  BOOLis_param_recognized;
> diff --git a/dri2proto.txt b/dri2proto.txt
> index 9921301..9daa58e 100644
> --- a/dri2proto.txt
> +++ b/dri2proto.txt
> @@ -454,9 +454,14 @@ The name of this extension is "DRI2".
>   the screen associated with 'drawable'.
>  
>   Parameter names in which the value of the most significant byte is
> - 0 are reserved for the X server. Currently, no such parameter names
> - are defined. (When any such names are defined, they will be defined in
> - this extension specification and its associated headers).
> + 0 are reserved for the X server. The complete list of known parameter
> +names for the X server are:
> +
> +0 - DRI2ParamXHasBufferAge
> +
> +Query whether the X server and DDX support passing the
> +buffers last swap buffer count in the flags field of
> +the DRI2GetBuffers reply.
>  
>   Parameter names in which the byte's value is 1 are reserved for the
>   DDX. Such names are private to each driver and shall be defined in the
> 

___
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: [Mesa-dev] [mesa 9/9] glx/dri2: Implement getBufferAge

2015-01-20 Thread Ian Romanick
On 01/20/2015 12:35 PM, Ian Romanick wrote:
> On 01/19/2015 03:00 AM, Chris Wilson wrote:
>> +   DRI2Buffer *buffers;
>> +
>> +   for (i = 0; i < priv->bufferCount; i++)
>> +   attachments[i] = priv->buffers[i].attachment;
>> +
>> +   buffers = DRI2GetBuffers(priv->base.psc->dpy, priv->base.xDrawable,
>> +&priv->width, &priv->height,
>> +attachments, i, &i);
> 
> Most drivers prefer DRI2GetBuffersWithFormat, and some drivers only use
> DRI2GetBuffersWithFormat.  Is mixing DRI2GetBuffersWithFormat and
> DRI2GetBuffers going to cause problems or unexpected behavior changes?

Okay... I hadn't seen the server change until after I sent this review.
 I sent some comments there.

This should be fine, but can we get a comment that it relies on
DRI2GetBuffers re-using the format from the previous
DRI2GetBuffersWithFormat?  That way the next person to look at the code
won't make the same mistake I made.

___
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: [Mesa-dev] [xorg 1/3] dri2: Allow GetBuffers to match any format

2015-01-20 Thread Ian Romanick
On 01/19/2015 03:00 AM, Chris Wilson wrote:
> Since the introduction of DRI2GetBuffersWithFormat, the old
> DRI2GetBuffers interface would always recreate all buffers all the time
> as it was no longer agnostic to the format value being set by the DDXes.
> This causes an issue with clients intermixing the two requests,
> rendering any sharing or caching of buffers (e.g. for triple buffering)
> void.
> 
> Signed-off-by: Chris Wilson 
> ---
>  hw/xfree86/dri2/dri2.c | 13 -
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
> index 43a1899..f9f594d 100644
> --- a/hw/xfree86/dri2/dri2.c
> +++ b/hw/xfree86/dri2/dri2.c
> @@ -464,14 +464,16 @@ find_attachment(DRI2DrawablePtr pPriv, unsigned 
> attachment)
>  static Bool
>  allocate_or_reuse_buffer(DrawablePtr pDraw, DRI2ScreenPtr ds,
>   DRI2DrawablePtr pPriv,
> - unsigned int attachment, unsigned int format,
> + unsigned int attachment,
> + int has_format, unsigned int format,
>   int dimensions_match, DRI2BufferPtr * buffer)
>  {
>  int old_buf = find_attachment(pPriv, attachment);
>  
>  if ((old_buf < 0)
>  || attachment == DRI2BufferFrontLeft
> -|| !dimensions_match || (pPriv->buffers[old_buf]->format != format)) 
> {
> +|| !dimensions_match
> +|| (has_format && pPriv->buffers[old_buf]->format != format)) {
>  *buffer = create_buffer(ds, pDraw, attachment, format);

Shouldn't the create_buffer change if !has_format?  If !has_format and,
say, !dimensions_match, create_buffer will get format = 0 when it should
get format = pPriv->buffers[old_buf]->format.  Right?

Another alternative would be to have the caller always pass a format:
either the format supplied in the protocol or the format of the old
buffer.  That might be more messy.  Dunno.

>  return TRUE;
>  
> @@ -549,7 +551,8 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height,
>  const unsigned format = (has_format) ? *(attachments++) : 0;
>  
>  if (allocate_or_reuse_buffer(pDraw, ds, pPriv, attachment,
> - format, dimensions_match, &buffers[i]))
> + has_format, format, dimensions_match,
> + &buffers[i]))
>  buffers_changed = 1;
>  
>  if (buffers[i] == NULL)
> @@ -584,7 +587,7 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height,
>  
>  if (need_real_front > 0) {
>  if (allocate_or_reuse_buffer(pDraw, ds, pPriv, DRI2BufferFrontLeft,
> - front_format, dimensions_match,
> + has_format, front_format, 
> dimensions_match,
>   &buffers[i]))
>  buffers_changed = 1;
>  
> @@ -595,7 +598,7 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height,
>  
>  if (need_fake_front > 0) {
>  if (allocate_or_reuse_buffer(pDraw, ds, pPriv, 
> DRI2BufferFakeFrontLeft,
> - front_format, dimensions_match,
> + has_format, front_format, 
> dimensions_match,
>   &buffers[i]))
>  buffers_changed = 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: [Mesa-dev] [mesa 9/9] glx/dri2: Implement getBufferAge

2015-01-20 Thread Ian Romanick
On 01/19/2015 03:00 AM, Chris Wilson wrote:
> Within the DRI2GetBuffers return packet there is a 4-byte field that is
> currently unused by any driver, i.e. flags. With the co-operation of a
> suitably modified X server, we can pass the last SBC on which the buffer
> was defined (i.e. the last SwapBuffers for which it was used) and 0 if
> it is fresh (with a slight loss of precision). We can then compare the
> flags field of the DRIBuffer against the current swap buffers count and
> so compute the age of the back buffer (thus satisfying
> GLX_EXT_buffer_age).
> 
> As we reuse a driver specific field within the DRI2GetBuffers packet, we
> first query whether the X/DDX are ready to supply the new value using a
> DRI2GetParam request.
> 
> Another caveat is that we need to complete the SwapBuffers/GetBuffers
> roundtrip before reporting the back buffer age so that it tallies
> against the buffer used for rendering. As with all things X, there is a
> race between the query and the rendering where the buffer may be
> invalidated by the server. However, for the primary usecase (that of a
> compositing manager), the DRI2Drawable is only accessible to a single
> client mitigating the impact of the issue.
> 
> Signed-off-by: Chris Wilson 
> ---
>  configure.ac   |  2 +-
>  src/glx/dri2_glx.c | 65 
> ++
>  2 files changed, 66 insertions(+), 1 deletion(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 870435c..ca1da86 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -65,7 +65,7 @@ LIBDRM_INTEL_REQUIRED=2.4.52
>  LIBDRM_NVVIEUX_REQUIRED=2.4.33
>  LIBDRM_NOUVEAU_REQUIRED="2.4.33 libdrm >= 2.4.41"
>  LIBDRM_FREEDRENO_REQUIRED=2.4.57
> -DRI2PROTO_REQUIRED=2.6
> +DRI2PROTO_REQUIRED=2.9
>  DRI3PROTO_REQUIRED=1.0
>  PRESENTPROTO_REQUIRED=1.0
>  LIBUDEV_REQUIRED=151
> diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
> index 0577804..b43f115 100644
> --- a/src/glx/dri2_glx.c
> +++ b/src/glx/dri2_glx.c
> @@ -917,6 +917,67 @@ dri2GetBuffersWithFormat(__DRIdrawable * driDrawable,
>  }
>  
>  static int
> +dri2HasBufferAge(int screen, struct glx_display * priv)
> +{
> +   const struct dri2_display *const pdp =
> +(struct dri2_display *)priv->dri2Display;
> +   CARD64 value;
> +
> +   if (pdp->driMajor <= 1 && pdp->driMinor < 4)
> +return 0;
> +
> +   value = 0;
> +   if (!DRI2GetParam(priv->dpy, RootWindow(priv->dpy, screen),
> + DRI2ParamXHasBufferAge, &value))
> +  return 0;
> +
> +   return value;
> +}
> +
> +static int
> +dri2GetBufferAge(__GLXDRIdrawable *pdraw)
> +{
> +   struct dri2_drawable *priv = (struct dri2_drawable *) pdraw;
> +   int i, age = 0;
> +
> +   if (priv->swap_pending) {
> +unsigned int attachments[5];

I see other callers that have attachments of at least 8 (although it
appears that intel_query_dri2_buffers only needs 2).  Could we at least
get an assertion or something that priv->bufferCount <=
ARRAY_SIZE(attachments)?  A (hypothetical) driver doing stereo rendering
with separate, DDX managed, depth and stencil buffers would need 6.  A
(again, hypothetical) driver with AUX buffers could need... more.

> +DRI2Buffer *buffers;
> +
> +for (i = 0; i < priv->bufferCount; i++)
> +attachments[i] = priv->buffers[i].attachment;
> +
> +buffers = DRI2GetBuffers(priv->base.psc->dpy, priv->base.xDrawable,
> + &priv->width, &priv->height,
> + attachments, i, &i);

Most drivers prefer DRI2GetBuffersWithFormat, and some drivers only use
DRI2GetBuffersWithFormat.  Is mixing DRI2GetBuffersWithFormat and
DRI2GetBuffers going to cause problems or unexpected behavior changes?

> +if (buffers == NULL)
> +return 0;
> +
> +process_buffers(priv, buffers, i);
> +free(buffers);
> +
> +dri2XcbSwapBuffersComplete(priv);
> +   }
> +
> +   if (!priv->have_back)
> +  return 0;
> +
> +   for (i = 0; i < priv->bufferCount; i++) {
> +if (priv->buffers[i].attachment != __DRI_BUFFER_BACK_LEFT)
> +continue;
> +
> +if (priv->buffers[i].flags == 0)
> +continue;
> +
> +age = priv->last_swap_sbc - priv->buffers[i].flags + 1;
> +if (age < 0)
> +age = 0;

I was going to comment that this looked like it calculated age wrong
when the buffers had different ages.  Then I realized that age should
only be calculated once.  I think this would be more obvious if the body
of the loop were:

  if (priv->buffers[i].attachment == __DRI_BUFFER_BACK_LEFT &&
  priv->buffers[i].flags != 0) {
 age = priv->last_swap_sbc - priv->buffers[i].flags + 1;
 if (age < 0)
age = 0;

 break;
  }

I also just noticed that your patches are mixing tabs and spaces (use
spaces only) and are using a mix of 3-space and 8-space (maybe?) indents
(use 3 spaces only).

> +   }
> +
> +  

Re: [Mesa-dev] [mesa 8/9] glx/dri2: Move the wait after SwapBuffers into the next GetBuffers

2015-01-20 Thread Ian Romanick
On 01/19/2015 03:00 AM, Chris Wilson wrote:
> As the SBC from the reply from SwapBuffers is not used immediately and
> can be easily determined by counting the new of SwapBuffers requests
> made by the client, we can defer the synchronisation point to the
> pending GetBuffers round trip. (We force the invalidation event in order
> to require the GetBuffers round trip - we know that all X servers will
> send the invalidation after SwapBuffers and that invalidation will
> arrive before the SwapBuffers reply, so no extra roundtrips are forced.)

This is a pretty big change in behavior.  How much testing has it
received?  I'm nervous that applications that "work fine" today could
misbehave in subtle ways.  How much work would it be to add a way to
disable the new behavior, perhaps via an environment variable, at
run-time?  That would make it much easier for users to determine whether
this change was responsible for a problem in some game we don't have.

Additional comments in-line below.

> An important side-effect is demonstrated in the next patch where we can
> detect when the buffers are stale before querying properties.
> 
> Signed-off-by: Chris Wilson 
> ---
>  src/glx/dri2_glx.c | 73 
> --
>  1 file changed, 38 insertions(+), 35 deletions(-)
> 
> diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
> index 462d560..0577804 100644
> --- a/src/glx/dri2_glx.c
> +++ b/src/glx/dri2_glx.c
> @@ -93,6 +93,10 @@ struct dri2_drawable
> int have_back;
> int have_fake_front;
> int swap_interval;
> +   int swap_pending;
> +
> +   xcb_dri2_swap_buffers_cookie_t swap_buffers_cookie;
> +   int64_t last_swap_sbc;
>  
> uint64_t previous_time;
> unsigned frames;
> @@ -778,50 +782,51 @@ static void show_fps(struct dri2_drawable *draw)
> }
>  }
>  
> -static int64_t
> -dri2XcbSwapBuffers(Display *dpy,
> -  __GLXDRIdrawable *pdraw,
> +static void
> +dri2XcbSwapBuffers(struct dri2_drawable *priv,
>int64_t target_msc,
>int64_t divisor,
>int64_t remainder)
>  {
> -   xcb_dri2_swap_buffers_cookie_t swap_buffers_cookie;
> -   xcb_dri2_swap_buffers_reply_t *swap_buffers_reply;
> +   xcb_connection_t *c = XGetXCBConnection(priv->base.psc->dpy);
> uint32_t target_msc_hi, target_msc_lo;
> uint32_t divisor_hi, divisor_lo;
> uint32_t remainder_hi, remainder_lo;
> -   int64_t ret = 0;
> -   xcb_connection_t *c = XGetXCBConnection(dpy);
>  
> split_counter(target_msc, &target_msc_hi, &target_msc_lo);
> split_counter(divisor, &divisor_hi, &divisor_lo);
> split_counter(remainder, &remainder_hi, &remainder_lo);
>  
> -   swap_buffers_cookie =
> -  xcb_dri2_swap_buffers_unchecked(c, pdraw->xDrawable,
> +   priv->swap_buffers_cookie =
> +  xcb_dri2_swap_buffers_unchecked(c, priv->base.xDrawable,
>target_msc_hi, target_msc_lo,
>divisor_hi, divisor_lo,
>remainder_hi, remainder_lo);
> +   xcb_flush(c);
> +   priv->swap_pending++;
>  
> -   /* Immediately wait on the swapbuffers reply.  If we didn't, we'd have
> -* to do so some time before reusing a (non-pageflipped) backbuffer.
> -* Otherwise, the new rendering could get ahead of the X Server's
> -* dispatch of the swapbuffer and you'd display garbage.
> -*
> -* We use XSync() first to reap the invalidate events through the event
> -* filter, to ensure that the next drawing doesn't use an invalidated
> -* buffer.
> -*/
> -   XSync(dpy, False);
> +   /* Force a synchronous completion prior to the next rendering */
> +   dri2InvalidateBuffers(priv->base.psc->dpy, priv->base.xDrawable);
> +}
> +
> +static void dri2XcbSwapBuffersComplete(struct dri2_drawable *priv)

static void
dri2XcbSwapBuffersComplete(struct dri2_drawable *priv)

> +{
> +   xcb_dri2_swap_buffers_reply_t *swap_buffers_reply;
> +
> +   if (!priv->swap_pending)
> +  return;
> +
> +   priv->swap_pending = 0;

Is this actually right?  dri2XcbSwapBuffers increments the count, do we
know the single reply will be for all pending swaps?

>  
> swap_buffers_reply =
> -  xcb_dri2_swap_buffers_reply(c, swap_buffers_cookie, NULL);
> -   if (swap_buffers_reply) {
> -  ret = merge_counter(swap_buffers_reply->swap_hi,
> -  swap_buffers_reply->swap_lo);
> -  free(swap_buffers_reply);
> -   }
> -   return ret;
> +xcb_dri2_swap_buffers_reply(XGetXCBConnection(priv->base.psc->dpy),
> + priv->swap_buffers_cookie, NULL);
> +   if (swap_buffers_reply == NULL)
> +  return;
> +
> +   priv->last_swap_sbc = merge_counter(swap_buffers_reply->swap_hi,
> +   swap_buffers_reply->swap_lo);
> +   free(swap_buffers_reply);
>  }
>  
>  static int64_t
> @@ -833,11 +838,10 @@ dri2SwapBuffers(__GLXDRIdrawable *pdra

Re: [Mesa-dev] [mesa 7/9] glx/dri2: Add DRI2GetParam()

2015-01-20 Thread Ian Romanick
On 01/19/2015 03:00 AM, Chris Wilson wrote:
> Available since the inclusion of dri2proto 1.4 is a DRI2 request to
> query and set certain parameters about the X/DDX configuration. This
> implements the getter request.
> 
> Signed-off-by: Chris Wilson 

This patch is

Reviewed-by: Ian Romanick 

> ---
>  src/glx/dri2.c | 29 +
>  src/glx/dri2.h |  4 
>  2 files changed, 33 insertions(+)
> 
> diff --git a/src/glx/dri2.c b/src/glx/dri2.c
> index cc6c164..6d9403e 100644
> --- a/src/glx/dri2.c
> +++ b/src/glx/dri2.c
> @@ -546,4 +546,33 @@ DRI2CopyRegion(Display * dpy, XID drawable, 
> XserverRegion region,
> SyncHandle();
>  }
>  
> +Bool
> +DRI2GetParam(Display * dpy, XID drawable, CARD32 param, CARD64 *value)
> +{
> +   XExtDisplayInfo *info = DRI2FindDisplay(dpy);
> +   xDRI2GetParamReply rep;
> +   xDRI2GetParamReq *req;
> +
> +   XextCheckExtension(dpy, info, dri2ExtensionName, False);
> +
> +   LockDisplay(dpy);
> +   GetReq(DRI2GetParam, req);
> +   req->reqType = info->codes->major_opcode;
> +   req->dri2ReqType = X_DRI2GetParam;
> +   req->drawable = drawable;
> +   req->param = param;
> +
> +   if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) {
> +  UnlockDisplay(dpy);
> +  SyncHandle();
> +  return False;
> +   }
> +
> +   *value = (CARD64)rep.value_hi << 32 | rep.value_lo;
> +   UnlockDisplay(dpy);
> +   SyncHandle();
> +
> +   return rep.is_param_recognized;
> +}
> +
>  #endif /* GLX_DIRECT_RENDERING */
> diff --git a/src/glx/dri2.h b/src/glx/dri2.h
> index 4be5bf8..a5b23f0 100644
> --- a/src/glx/dri2.h
> +++ b/src/glx/dri2.h
> @@ -88,4 +88,8 @@ DRI2CopyRegion(Display * dpy, XID drawable,
> XserverRegion region,
> CARD32 dest, CARD32 src);
>  
> +extern Bool
> +DRI2GetParam(Display * dpy, XID drawable,
> +  CARD32 param, CARD64 *value);
> +
>  #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: [xf86-video-ati] dri2: Enable BufferAge support

2015-01-20 Thread Alex Deucher
On Mon, Jan 19, 2015 at 6:00 AM, Chris Wilson  wrote:
> For BufferAge support, we just have to guarrantee that we were not using
> the DRI2Buffer->flags field for anything else (i.e. it is always 0) and
> then to make sure that we exchange the flags field after buffer
> exchanges. radeon does not support TripleBuffering so we do not have to
> worry about perserving the flags when injecting the third buffer.
>
> Signed-off-by: Chris Wilson 
> Cc: Dave Airlie 
> Cc: Jerome Glisse 
> Cc: Alex Deucher 
> Cc: Michel Dänzer 

Reviewed-by: Alex Deucher 

> ---
>  src/radeon_dri2.c | 10 ++
>  1 file changed, 10 insertions(+)
>
> diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
> index 0fbe96c..091cd06 100644
> --- a/src/radeon_dri2.c
> +++ b/src/radeon_dri2.c
> @@ -764,6 +764,11 @@ radeon_dri2_exchange_buffers(DrawablePtr draw, 
> DRI2BufferPtr front, DRI2BufferPt
>  front->name = back->name;
>  back->name = tmp;
>
> +/* Swap flags so BufferAge works */
> +tmp = front->flags;
> +front->flags = back->flags;
> +back->flags = tmp;
> +
>  /* Swap pixmap bos */
>  front_bo = radeon_get_pixmap_bo(front_priv->pixmap);
>  back_bo = radeon_get_pixmap_bo(back_priv->pixmap);
> @@ -1647,6 +1652,11 @@ radeon_dri2_screen_init(ScreenPtr pScreen)
>  dri2_info.CopyRegion2 = radeon_dri2_copy_region2;
>  #endif
>
> +#if DRI2INFOREC_VERSION >= 10
> +dri2_info.version = 10;
> +dri2_info.bufferAge = 1;
> +#endif
> +
>  info->dri2.enabled = DRI2ScreenInit(pScreen, &dri2_info);
>  return info->dri2.enabled;
>  }
> --
> 2.1.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
___
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 
---
 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

[PATCH] libinput-drv: Move properties to a separate header

2015-01-20 Thread Olivier Fourdan
And install the header as part of the SDK, so that applications interfacing
with the libinput driver do not have to copy paste all the properties' names.

Signed-off-by: Olivier Fourdan 
---
 Makefile.am   |  5 +++-
 configure.ac  |  4 ++-
 include/Makefile.am   | 21 +++
 include/libinput-properties.h | 62 ++
 src/libinput.c| 63 ++-
 xorg-libinput.pc.in   |  6 +
 6 files changed, 116 insertions(+), 45 deletions(-)
 create mode 100644 include/Makefile.am
 create mode 100644 include/libinput-properties.h
 create mode 100644 xorg-libinput.pc.in

diff --git a/Makefile.am b/Makefile.am
index a963530..99e6808 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -21,9 +21,12 @@
 
 DISTCHECK_CONFIGURE_FLAGS = --with-sdkdir='$${includedir}/xorg'
 
-SUBDIRS = src man
+SUBDIRS = src include man
 MAINTAINERCLEANFILES = ChangeLog INSTALL
 
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = xorg-libinput.pc
+
 .PHONY: ChangeLog INSTALL
 
 INSTALL:
diff --git a/configure.ac b/configure.ac
index 9a41170..55a1372 100644
--- a/configure.ac
+++ b/configure.ac
@@ -68,6 +68,8 @@ DRIVER_NAME=libinput
 AC_SUBST([DRIVER_NAME])
 
 AC_CONFIG_FILES([Makefile
+include/Makefile
 src/Makefile
-man/Makefile])
+man/Makefile
+xorg-libinput.pc])
 AC_OUTPUT
diff --git a/include/Makefile.am b/include/Makefile.am
new file mode 100644
index 000..4d3467b
--- /dev/null
+++ b/include/Makefile.am
@@ -0,0 +1,21 @@
+#  Copyright 2005 Adam Jackson.
+#
+#  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
+#  on 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:
+#
+#  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 NON-INFRINGEMENT.  IN NO EVENT SHALL
+#  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.
+
+sdk_HEADERS = libinput-properties.h
diff --git a/include/libinput-properties.h b/include/libinput-properties.h
new file mode 100644
index 000..90899c3
--- /dev/null
+++ b/include/libinput-properties.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright © 2015 Red Hat, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of Red Hat
+ * not be used in advertising or publicity pertaining to distribution
+ * of the software without specific, written prior permission.  Red
+ * Hat makes no representations about the suitability of this software
+ * for any purpose.  It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
+ * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef _LIBINPUT_PROPERTIES_H_
+#define _LIBINPUT_PROPERTIES_H_
+
+/* Tapping enabled/disabled: BOOL, 1 value */
+#define LIBINPUT_PROP_TAP "libinput Tapping Enabled"
+
+/* Calibration matrix: FLOAT, 9 values of a 3x3 matrix, in rows */
+#define LIBINPUT_PROP_CALIBRATION "libinput Calibration Matrix"
+
+/* Pointer accel speed: FLOAT, 1 value, 32 bit */
+#define LIBINPUT_PROP_ACCEL "libinput Accel Speed"
+
+/* Natural scrolling: BOOL, 1 value */
+#define LIBINPUT_PROP_NATURAL_SCROLL "libinput Natural Scrolling Enabled"
+
+/* Send-events mode: BOOL read-only, 2 values in order disabled,
+   disabled-on-external-mouse */
+#define LIBINPUT_PROP_SENDEVENTS_AVAILABLE "libinput Send Events Modes 
Available"
+
+/* Send-events mode: BOOL, 2 values in order disabled,
+   disabled-on-external-mouse */
+#define LIBINPUT_PROP_SEN

Re: xorg in openvz container

2015-01-20 Thread basteon
hello,
I still have problem.
I want use x2go and do that well.
i.e. I can run X-session on remote controll, but Xorg is not run at this time.
But I need make keyboard languadge switches and anyway need the
Xorg-server to run.

here my log of it after I do /etc/init.d/xdm start on gentoo:

X.Org X Server 1.14.7
Release Date: 2014-06-05
[  1680.554] X Protocol Version 11, Revision 0
[  1680.554] Build Operating System: Linux 2.6.32-32-pve x86_64 Gentoo
[  1680.554] Current Operating System: Linux konsultant 2.6.32-32-pve
#1 SMP Thu Aug 21 08:50:19 CEST 2014 x86_64
[  1680.554] Kernel command line: quiet
[  1680.554] Build Date: 02 January 2015  04:38:54AM
[  1680.554]
[  1680.554] Current version of pixman: 0.32.6
[  1680.554]Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
[  1680.554] Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[  1680.554] (==) Log file: "/var/log/Xorg.0.log", Time: Tue Jan 20
08:45:46 2015
[  1680.555] (==) Using config directory: "/etc/X11/xorg.conf.d"
[  1680.555] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[  1680.555] (==) No Layout section.  Using the first Screen section.
[  1680.555] (==) No screen section available. Using defaults.
[  1680.555] (**) |-->Screen "Default Screen Section" (0)
[  1680.555] (**) |   |-->Monitor ""
[  1680.555] (==) No monitor specified for screen "Default Screen Section".
Using a default monitor configuration.
[  1680.555] (==) Automatically adding devices
[  1680.555] (==) Automatically enabling devices
[  1680.555] (==) Automatically adding GPU devices
[  1680.555] (==) FontPath set to:
/usr/share/fonts/misc/,
/usr/share/fonts/TTF/,
/usr/share/fonts/OTF/,
/usr/share/fonts/Type1/,
/usr/share/fonts/100dpi/,
/usr/share/fonts/75dpi/
[  1680.555] (==) ModulePath set to "/usr/lib64/xorg/modules"
[  1680.555] (II) The server relies on udev to provide the list of
input devices.
If no devices become available, reconfigure udev or disable
AutoAddDevices.
[  1680.555] (II) Loader magic: 0x7ffc00
[  1680.555] (II) Module ABI versions:
[  1680.555]X.Org ANSI C Emulation: 0.4
[  1680.555]X.Org Video Driver: 14.1
[  1680.555]X.Org XInput driver : 19.1
[  1680.555]X.Org Server Extension : 7.0
[  1680.555] Initializing built-in extension Generic Event Extension
[  1680.555] Initializing built-in extension SHAPE
[  1680.555] Initializing built-in extension MIT-SHM
[  1680.555] Initializing built-in extension XInputExtension
[  1680.555] Initializing built-in extension XTEST
[  1680.555] Initializing built-in extension BIG-REQUESTS
[  1680.555] Initializing built-in extension SYNC
[  1680.555] Initializing built-in extension XKEYBOARD
[  1680.555] Initializing built-in extension XC-MISC
[  1680.555] Initializing built-in extension XINERAMA
[  1680.555] Initializing built-in extension XFIXES
[  1680.555] Initializing built-in extension RENDER
[  1680.555] Initializing built-in extension RANDR
[  1680.555] Initializing built-in extension COMPOSITE
[  1680.555] Initializing built-in extension DAMAGE
[  1680.555] Initializing built-in extension MIT-SCREEN-SAVER
[  1680.555] Initializing built-in extension DOUBLE-BUFFER
[  1680.555] Initializing built-in extension RECORD
[  1680.555] Initializing built-in extension DPMS
[  1680.555] Initializing built-in extension X-Resource
[  1680.555] Initializing built-in extension XVideo
[  1680.555] Initializing built-in extension XVideo-MotionCompensation
[  1680.555] Initializing built-in extension XFree86-VidModeExtension
[  1680.555] Initializing built-in extension XFree86-DGA
[  1680.555] Initializing built-in extension XFree86-DRI
[  1680.555] Initializing built-in extension DRI2
[  1680.555] (II) "glx" will be loaded by default.
[  1680.555] (II) LoadModule: "dri2"
[  1680.555] (II) Module "dri2" already built-in
[  1680.555] (II) LoadModule: "glamoregl"
[  1680.555] (II) Loading /usr/lib64/xorg/modules/libglamoregl.so
[  1680.556] (II) Module glamoregl: vendor="X.Org Foundation"
[  1680.556]compiled for 1.14.7, module version = 0.6.0
[  1680.556]ABI class: X.Org ANSI C Emulation, version 0.4
[  1680.556] (II) LoadModule: "glx"
[  1680.556] (II) Loading /usr/lib64/xorg/modules/extensions/libglx.so
[  1680.556] (II) Module glx: vendor="X.Org Foundation"
[  1680.556]compiled for 1.14.7, module version = 1.0.0
[  1680.556]ABI class: X.Org Server Extension, version 7.0
[  1680.556] (==) AIGLX enabled
[  1680.556] Loading extension GLX
[  1680.556] (==) Matched vesa as autoconfigured driver 0
[  1680.556] (==) Matched modesetting as autoconfigured driver 1
[  1680.556] (==) Matched fbdev as autoconfigured driver 2
[  1680.556] (==) Assigned the driver to the xf86ConfigLayout
[  1680.556] (II) LoadModule:

[PATCH 1/2] libinput-drv: Add autogen.sh

2015-01-20 Thread Olivier Fourdan
Signed-off-by: Olivier Fourdan 
---
 autogen.sh | 15 +++
 1 file changed, 15 insertions(+)
 create mode 100755 autogen.sh

diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 000..4d3c878
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,15 @@
+#! /bin/sh
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+autoreconf -v --install || exit 1
+cd $ORIGDIR || exit $?
+
+if test -z "$NOCONFIGURE"; then
+exec $srcdir/configure "$@"
+fi
+
-- 
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 2/2] libinput-drv: Move properties to a separate header

2015-01-20 Thread Olivier Fourdan
And install the header as part of the SDK, so that applications interfacing
with the libinput driver do not have to copy paste all the properties' names.

Signed-off-by: Olivier Fourdan 
---
 Makefile.am   |  2 +-
 configure.ac  |  1 +
 include/Makefile.am   | 21 +++
 include/libinput-properties.h | 62 ++
 src/libinput.c| 63 ++-
 5 files changed, 105 insertions(+), 44 deletions(-)
 create mode 100644 include/Makefile.am
 create mode 100644 include/libinput-properties.h

diff --git a/Makefile.am b/Makefile.am
index a963530..9035843 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -21,7 +21,7 @@
 
 DISTCHECK_CONFIGURE_FLAGS = --with-sdkdir='$${includedir}/xorg'
 
-SUBDIRS = src man
+SUBDIRS = src include man
 MAINTAINERCLEANFILES = ChangeLog INSTALL
 
 .PHONY: ChangeLog INSTALL
diff --git a/configure.ac b/configure.ac
index 9a41170..ee7f100 100644
--- a/configure.ac
+++ b/configure.ac
@@ -68,6 +68,7 @@ DRIVER_NAME=libinput
 AC_SUBST([DRIVER_NAME])
 
 AC_CONFIG_FILES([Makefile
+include/Makefile
 src/Makefile
 man/Makefile])
 AC_OUTPUT
diff --git a/include/Makefile.am b/include/Makefile.am
new file mode 100644
index 000..4d3467b
--- /dev/null
+++ b/include/Makefile.am
@@ -0,0 +1,21 @@
+#  Copyright 2005 Adam Jackson.
+#
+#  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
+#  on 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:
+#
+#  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 NON-INFRINGEMENT.  IN NO EVENT SHALL
+#  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.
+
+sdk_HEADERS = libinput-properties.h
diff --git a/include/libinput-properties.h b/include/libinput-properties.h
new file mode 100644
index 000..90899c3
--- /dev/null
+++ b/include/libinput-properties.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright © 2015 Red Hat, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of Red Hat
+ * not be used in advertising or publicity pertaining to distribution
+ * of the software without specific, written prior permission.  Red
+ * Hat makes no representations about the suitability of this software
+ * for any purpose.  It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
+ * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef _LIBINPUT_PROPERTIES_H_
+#define _LIBINPUT_PROPERTIES_H_
+
+/* Tapping enabled/disabled: BOOL, 1 value */
+#define LIBINPUT_PROP_TAP "libinput Tapping Enabled"
+
+/* Calibration matrix: FLOAT, 9 values of a 3x3 matrix, in rows */
+#define LIBINPUT_PROP_CALIBRATION "libinput Calibration Matrix"
+
+/* Pointer accel speed: FLOAT, 1 value, 32 bit */
+#define LIBINPUT_PROP_ACCEL "libinput Accel Speed"
+
+/* Natural scrolling: BOOL, 1 value */
+#define LIBINPUT_PROP_NATURAL_SCROLL "libinput Natural Scrolling Enabled"
+
+/* Send-events mode: BOOL read-only, 2 values in order disabled,
+   disabled-on-external-mouse */
+#define LIBINPUT_PROP_SENDEVENTS_AVAILABLE "libinput Send Events Modes 
Available"
+
+/* Send-events mode: BOOL, 2 values in order disabled,
+   disabled-on-external-mouse */
+#define LIBINPUT_PROP_SENDEVENTS_ENABLED "libinput Send Events Mode Enabled"
+
+/* Left-handed enabled/disabled: BOOL, 1 value */
+#define LIBINPUT_PROP_LEFT_HANDED "libinput Left Handed Enabled"
+
+/* Scroll method: BOOL read-only, 3 values in order 2fg, edge, b