Re: [PATCH] Bug 32436 - hw/xfree86/parser/Makefile.am TOP_SRCDIR should be top_srcdir

2010-12-17 Thread Julien Cristau
On Thu, Dec 16, 2010 at 22:32:10 -0800, Alan Coopersmith wrote:

 https://bugs.freedesktop.org/show_bug.cgi?id=32436
 Fix typo introduced in 2416255f7e3fd9190a9 that breaks builds when
 configured --enable-install-libxf86config
 
 Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com
 ---
  hw/xfree86/parser/Makefile.am |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
 
 diff --git a/hw/xfree86/parser/Makefile.am b/hw/xfree86/parser/Makefile.am
 index a5adc01..fb5d49e 100644
 --- a/hw/xfree86/parser/Makefile.am
 +++ b/hw/xfree86/parser/Makefile.am
 @@ -31,7 +31,7 @@ libxf86config_internal_la_SOURCES = \
   $(INTERNAL_SOURCES)
  
  libxf86config_a_SOURCES = \
 - $(TOP_SRCDIR)/os/xprintf.c \
 + $(top_srcdir)/os/xprintf.c \
   $(INTERNAL_SOURCES)
  libxf86config_a_CFLAGS = $(AM_CFLAGS)
  
Reviewed-by: Julien Cristau jcris...@debian.org

Cheers,
Julien
___
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] randr: check for virtual size limits before set crtc

2010-12-17 Thread Tiago Vignatti
Return a error if the screen is configured to an invalid size.

Signed-off-by: Tiago Vignatti tiago.vigna...@nokia.com
Reviewed-by: Adam Jackson a...@redhat.com
---
 randr/rrscreen.c |   12 
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/randr/rrscreen.c b/randr/rrscreen.c
index 292163f..0efc62e 100644
--- a/randr/rrscreen.c
+++ b/randr/rrscreen.c
@@ -939,6 +939,18 @@ ProcRRSetScreenConfig (ClientPtr client)
width = mode-mode.height;
height = mode-mode.width;
 }
+
+if (width  pScrPriv-minWidth || pScrPriv-maxWidth  width) {
+   client-errorValue = width;
+   free(pData);
+   return BadValue;
+}
+if (height  pScrPriv-minHeight || pScrPriv-maxHeight  height) {
+   client-errorValue = height;
+   free(pData);
+   return BadValue;
+}
+
 if (width != pScreen-width || height != pScreen-height)
 {
int c;
-- 
1.7.0.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 1/5] xfree86: Symmetrize xf86AccessEnter and xf86AccessLeave

2010-12-17 Thread Tiago Vignatti
On Thu, Dec 16, 2010 at 03:31:36PM -0500, ext Adam Jackson wrote:
 Enter was changing server operating state, Leave wasn't.  Which was
 wholly redundant, since all callers of Enter would immediately change
 the operating state to exactly what Enter had just done.
 
 Signed-off-by: Adam Jackson a...@redhat.com
 ---
  hw/xfree86/common/xf86Bus.c |2 --
  1 files changed, 0 insertions(+), 2 deletions(-)
 
 diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
 index 90c1914..623b130 100644
 --- a/hw/xfree86/common/xf86Bus.c
 +++ b/hw/xfree86/common/xf86Bus.c
 @@ -484,8 +484,6 @@ xf86AccessEnter(void)
  for (i = 0; i  xf86NumEntities; i++)
  if (xf86Entities[i]-entityEnter)
   xf86Entities[i]-entityEnter(i,xf86Entities[i]-private);
 -
 -xf86EnterServerState(SETUP);
  }

Reviewed-by: Tiago Vignatti tiago.vigna...@nokia.com

BTW, given you're touching bus related stuff, you may get interested on move
on http://cgit.freedesktop.org/~vignatti/xserver/log/?h=bus-cleanup-take3 :)

Thanks!
 Tiago
___
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 libICE] Remove useless line from a table in specs/ice.xml

2010-12-17 Thread Paulo Zanoni
This seems to be a leftover from a manpage/groff conversion.

Signed-off-by: Paulo Zanoni pzan...@mandriva.com
---
 specs/ice.xml |4 
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/specs/ice.xml b/specs/ice.xml
index c851cf7..e60c111 100644
--- a/specs/ice.xml
+++ b/specs/ice.xml
@@ -288,10 +288,6 @@ Encoding/entry
 entry align='left'Type Name/entry
 entry align='left'Type/entry
   /row
-  row
-entry align='left'.TH/entry
-entry align='left'/entry
-  /row
 /thead
 tbody
   row
-- 
1.7.3.4

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


Re: [PATCH 2/5] xfree86: Remove xf86EnterServerState

2010-12-17 Thread Tiago Vignatti
On Thu, Dec 16, 2010 at 03:31:37PM -0500, ext Adam Jackson wrote:
 Back when we had RAC this was a vaguely meaningful thing.  Since then
 it's been a glorified (and confusing) wrapper around xf86BlockSIGIO.
 
 Note that the APM and VT switch code are unusual relative to other code
 that cares about SIGIO state.  Most callers push a SIGIO disable to
 create a critical section for the duration of the caller's stack frame,
 but those two effectively disable SIGIO after their return and re-enable
 on their next entry.
 
 Signed-off-by: Adam Jackson a...@redhat.com
 ---
  hw/xfree86/common/xf86.h   |1 -
  hw/xfree86/common/xf86Bus.c|   33 -
  hw/xfree86/common/xf86Cursor.c |6 +++---
  hw/xfree86/common/xf86Events.c |   13 -
  hw/xfree86/common/xf86Init.c   |   11 ++-
  hw/xfree86/common/xf86PM.c |   20 
  hw/xfree86/common/xf86Priv.h   |1 -
  hw/xfree86/common/xf86str.h|7 ---
  8 files changed, 21 insertions(+), 71 deletions(-)
 
 diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
 index b29ec51..769466c 100644
 --- a/hw/xfree86/common/xf86.h
 +++ b/hw/xfree86/common/xf86.h
 @@ -136,7 +136,6 @@ extern _X_EXPORT EntityInfoPtr xf86GetEntityInfo(int 
 entityIndex);
  extern _X_EXPORT Bool xf86SetEntityFuncs(int entityIndex, EntityProc init,
 EntityProc enter, EntityProc leave, pointer);
  extern _X_EXPORT Bool xf86IsEntityPrimary(int entityIndex);
 -extern _X_EXPORT void xf86EnterServerState(xf86State state);
  extern _X_EXPORT ScrnInfoPtr xf86FindScreenForEntity(int entityIndex);
 
  extern _X_EXPORT int xf86GetLastScrnFlag(int entityIndex);
 diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
 index 623b130..3b08968 100644
 --- a/hw/xfree86/common/xf86Bus.c
 +++ b/hw/xfree86/common/xf86Bus.c
 @@ -497,32 +497,6 @@ xf86AccessLeave(void)
  }
 
  /*
 - * xf86EnterServerState() -- set state the server is in.
 - */
 -
 -typedef enum { TRI_UNSET, TRI_TRUE, TRI_FALSE } TriState;
 -
 -void
 -xf86EnterServerState(xf86State state)
 -{
 -static int sigio_state;
 -static TriState sigio_blocked = TRI_UNSET;
 -
 -/*
 - * This is a good place to block SIGIO during SETUP state. SIGIO should 
 be
 - * blocked in SETUP state otherwise (u)sleep() might get interrupted
 - * early. We take care not to call xf86BlockSIGIO() twice.
 - */
 -if ((state == SETUP)  (sigio_blocked != TRI_TRUE)) {
 -sigio_state = xf86BlockSIGIO();
 -   sigio_blocked = TRI_TRUE;
 -} else if ((state == OPERATING)  (sigio_blocked != TRI_UNSET)) {
 -xf86UnblockSIGIO(sigio_state);
 -sigio_blocked = TRI_FALSE;
 -}
 -}
 -
 -/*
   * xf86PostProbe() -- Allocate all non conflicting resources
   * This function gets called by xf86Init().
   */
 @@ -544,13 +518,6 @@ xf86PostProbe(void)
 xf86Entities[i]-entityInit(i,xf86Entities[i]-private);
  }
 
 -void
 -xf86PostScreenInit(void)
 -{
 -xf86VGAarbiterWrapFunctions();
 -xf86EnterServerState(OPERATING);
 -}
 -
  int
  xf86GetLastScrnFlag(int entityIndex)
  {
 diff --git a/hw/xfree86/common/xf86Cursor.c b/hw/xfree86/common/xf86Cursor.c
 index 0d27fd5..929f047 100644
 --- a/hw/xfree86/common/xf86Cursor.c
 +++ b/hw/xfree86/common/xf86Cursor.c
 @@ -202,7 +202,7 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode)
ScrnInfoPtr pScr = XF86SCRNINFO(pScreen);
ScreenPtr   pCursorScreen;
BoolSwitched;
 -  int px, py;
 +  int px, py, was_blocked;
DeviceIntPtr dev, it;
 
if (!pScr-vtSema || !mode || !pScr-SwitchMode)
 @@ -232,7 +232,7 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode)
if (pScreen == pCursorScreen)
  miPointerGetPosition(dev, px, py);
 
 -  xf86EnterServerState(SETUP);
 +  was_blocked = xf86BlockSIGIO();
Switched = (*pScr-SwitchMode)(pScr-scrnIndex, mode, 0);
if (Switched) {
  pScr-currentMode = mode;
 @@ -269,7 +269,7 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode)
pScr-frameY1 = pScr-virtualY - 1;
  }
}
 -  xf86EnterServerState(OPERATING);
 +  xf86UnblockSIGIO(was_blocked);

Apart from your modification, it's bit weird to have SwitchMode stuff inside
xf86Cursor. I guess you could move this somewhere else before apply your
changes.

 
if (pScr-AdjustFrame)
  (*pScr-AdjustFrame)(pScr-scrnIndex, pScr-frameX0, pScr-frameY0, 0);
 diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
 index fdd908a..84c0d18 100644
 --- a/hw/xfree86/common/xf86Events.c
 +++ b/hw/xfree86/common/xf86Events.c
 @@ -414,7 +414,8 @@ xf86ReleaseKeys(DeviceIntPtr pDev)
  static void
  xf86VTSwitch(void)
  {
 -  int i, prevSIGIO;
 +  int i;
 +  static int prevSIGIO;

AFAIU we don't need to use local static here. It will have the same behaviour.


InputInfoPtr pInfo;
IHPtr ih;
 
 @@ -456,7 +457,8 @@ xf86VTSwitch(void)
DisableDevice(pInfo-dev, TRUE);
   

Re: [PATCH 3/5] xfree86: Convert some xf86BlockSIGIO to OsBlockSignals

2010-12-17 Thread Tiago Vignatti
On Thu, Dec 16, 2010 at 03:31:38PM -0500, ext Adam Jackson wrote:
 The DDC1 and int10 code are blocking SIGIO to get some assurance that
 their usleep() calls take as long as they expect.  That's a good start
 but you really want to be blocking more than just SIGIO, SIGALRM too at
 minimum.
 
 At this point, except for SIGIO handler setup itself, BlockSIGIO really
 means block input events.
 
 Signed-off-by: Adam Jackson a...@redhat.com
 ---
  hw/xfree86/ddc/ddc.c   |   11 ---
  hw/xfree86/int10/helper_exec.c |5 +++--
  2 files changed, 7 insertions(+), 9 deletions(-)
 
 diff --git a/hw/xfree86/ddc/ddc.c b/hw/xfree86/ddc/ddc.c
 index 7c7dc9c..179f42c 100644
 --- a/hw/xfree86/ddc/ddc.c
 +++ b/hw/xfree86/ddc/ddc.c
 @@ -235,15 +235,12 @@ EDIDRead_DDC1(ScrnInfoPtr pScrn, DDC1SetSpeedProc 
 DDCSpeed,
   * @return NULL if no monitor attached or failure to interpret the EDID.
   */
  xf86MonPtr
 -xf86DoEDID_DDC1(
 -int scrnIndex, DDC1SetSpeedProc DDC1SetSpeed, 
 -unsigned int (*DDC1Read)(ScrnInfoPtr)
 -)
 +xf86DoEDID_DDC1(int scrnIndex, DDC1SetSpeedProc DDC1SetSpeed, 
 + unsigned int (*DDC1Read)(ScrnInfoPtr))
  {
  ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
  unsigned char *EDID_block = NULL;
  xf86MonPtr tmp = NULL;
 -int sigio;
  /* Default DDC and DDC1 to enabled. */
  Bool noddc = FALSE, noddc1 = FALSE;
  OptionInfoPtr options;
 @@ -259,9 +256,9 @@ xf86DoEDID_DDC1(
  if (noddc || noddc1)
   return NULL;
  
 -sigio = xf86BlockSIGIO();
 +OsBlockSignals();
  EDID_block = EDIDRead_DDC1(pScrn,DDC1SetSpeed,DDC1Read);
 -xf86UnblockSIGIO(sigio);
 +OsReleaseSignals();
  
  if (EDID_block){
   tmp = xf86InterpretEDID(scrnIndex,EDID_block);
 diff --git a/hw/xfree86/int10/helper_exec.c b/hw/xfree86/int10/helper_exec.c
 index 55ab058..b9af473 100644
 --- a/hw/xfree86/int10/helper_exec.c
 +++ b/hw/xfree86/int10/helper_exec.c
 @@ -75,13 +75,14 @@ setup_int(xf86Int10InfoPtr pInt)
  if (pInt-Flags  SET_BIOS_SCRATCH)
   SetResetBIOSVars(pInt, TRUE);
  #endif
 -return xf86BlockSIGIO();
 +OsBlockSignals();
 +return 0;

humm, are we really fine with this return value? You could tweak
xf86ExecX86int10 at least also.

  }
  
  void
  finish_int(xf86Int10InfoPtr pInt, int sig)
  {
 -xf86UnblockSIGIO(sig);
 +OsReleaseSignals();
  pInt-ax = (CARD32) X86_EAX;
  pInt-bx = (CARD32) X86_EBX;
  pInt-cx = (CARD32) X86_ECX;

Reviewed-by: Tiago Vignatti tiago.vigna...@nokia.com

 Tiago
___
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 4/5] xfree86: Reduce SIGIO block/unblock traffic

2010-12-17 Thread Tiago Vignatti
On Thu, Dec 16, 2010 at 03:31:39PM -0500, ext Adam Jackson wrote:
 Push/pop the SIGIO block outside the loop rather than every time through
 it.

I didn't get why we even need this SIGIO actually there. Can you clarify a
bit? 

 
 Signed-off-by: Adam Jackson a...@redhat.com
 ---
  hw/xfree86/common/xf86Events.c |9 +
  1 files changed, 5 insertions(+), 4 deletions(-)
 
 diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
 index 84c0d18..6561292 100644
 --- a/hw/xfree86/common/xf86Events.c
 +++ b/hw/xfree86/common/xf86Events.c
 @@ -250,11 +250,12 @@ xf86Wakeup(pointer blockData, int err, pointer 
 pReadmask)
  
   XFD_ANDSET(devicesWithInput, LastSelectMask, EnabledDevices);
   if (XFD_ANYSET(devicesWithInput)) {
 + int sigstate = xf86BlockSIGIO();
   pInfo = xf86InputDevs;
 +
   while (pInfo) {
   if (pInfo-read_input  pInfo-fd = 0 
   (FD_ISSET(pInfo-fd, devicesWithInput) != 0)) {
 - int sigstate = xf86BlockSIGIO();
  
   /*
* Remove the descriptior from the set because more than one
 @@ -263,10 +264,10 @@ xf86Wakeup(pointer blockData, int err, pointer 
 pReadmask)
   FD_CLR(pInfo-fd, devicesWithInput);
  
   pInfo-read_input(pInfo);
 - xf86UnblockSIGIO(sigstate);
   }
   pInfo = pInfo-next;
   }
 + xf86UnblockSIGIO(sigstate);
   }
  }
  
 @@ -394,17 +395,17 @@ xf86ReleaseKeys(DeviceIntPtr pDev)
   * are reenabled.
   */
  
 +sigstate = xf86BlockSIGIO ();
  for (i = keyc-xkbInfo-desc-min_key_code;
   i  keyc-xkbInfo-desc-max_key_code;
   i++) {
  if (key_is_down(pDev, i, KEY_POSTED)) {
 -sigstate = xf86BlockSIGIO ();
  nevents = GetKeyboardEvents(xf86Events, pDev, KeyRelease, i);
  for (j = 0; j  nevents; j++)
  mieqEnqueue(pDev, (InternalEvent*)(xf86Events + j)-event);
 -xf86UnblockSIGIO(sigstate);
  }
  }
 +xf86UnblockSIGIO(sigstate);
  }
  
  /*
 -- 
 1.7.3.2
 
 ___
 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
 Tiago
___
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 5/5] input: use a thread for the generation of input events

2010-12-17 Thread Tiago Vignatti
On Thu, Dec 16, 2010 at 03:31:40PM -0500, ext Adam Jackson wrote:
 From: Tiago Vignatti tiago.vigna...@nokia.com
 
 If configured, and enabled at runtime, use a separate thread for
 handling input devices.  Use pipes to communicate plug events from main
 thread to input thread, and to communicate event queue updates from
 input thread to main thread.
 
 For the xfree86 DDX, change the SIGIO handler to simply raise enough of
 a dispatch exception to make the main loop interrupt request processing
 and return to input processing.  This has no effect when the input
 thread is active but is a minor optimization when it's not.
 
 v2:
 - Fix memory leak in InputThreadUnregisterDev
 - Fix build with --disable-input-thread

you left MaxInputDevices out of the disabling macro.

Also, I liked in the previous patchset when you used the second commit to
explain that now we have two input processing methods:

- input thread
- main loop dispatch
 
where the SIGIO handler is merely an optimization for the second case.

I'd say to attach this kind of information somewhere in the code, which would
help a lot upcoming developers.

Thanks

Tiago
___
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


xdm - xdmcp

2010-12-17 Thread Trevor Woerner
The following commit in lib/libXdmcp:

commit b64cac63e0bcdd87bbfd19678552fd7ed1a3b58f
Author: Cristian Rodríguez cristian.rodrig...@opensuse.org
Date:   Tue Dec 14 15:40:20 2010 -0500

Export only public API symbols

Reviewed-by: Adam Jackson a...@redhat.com
Signed-off-by: Cristian Rodríguez cristian.rodrig...@opensuse.org

Causes xdm to fail to build because app/xdm/xdm/genauth.c can't find
the following symbols:
 _XdmcpAuthSetup
 _XdmcpAuthDoIt
 _XdmcpWrapperToOddParity
___
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 libICE] Remove useless line from a table in specs/ice.xml

2010-12-17 Thread Matt Dew
Yes,  those are leftovers from the conversion. I thought I'd cleaned
those all up but looks like I missed at least one.

Reviewed-by: Matt Dew



On Fri, Dec 17, 2010 at 9:59 AM, Paulo Zanoni przan...@gmail.com wrote:
 This seems to be a leftover from a manpage/groff conversion.

 Signed-off-by: Paulo Zanoni pzan...@mandriva.com
 ---
  specs/ice.xml |    4 
  1 files changed, 0 insertions(+), 4 deletions(-)

 diff --git a/specs/ice.xml b/specs/ice.xml
 index c851cf7..e60c111 100644
 --- a/specs/ice.xml
 +++ b/specs/ice.xml
 @@ -288,10 +288,6 @@ Encoding/entry
         entry align='left'Type Name/entry
         entry align='left'Type/entry
       /row
 -      row
 -        entry align='left'.TH/entry
 -        entry align='left'/entry
 -      /row
     /thead
     tbody
       row
 --
 1.7.3.4

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

___
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


[PATCHES] Multitouch v3 - please review/test

2010-12-17 Thread Daniel Stone
Hi all,
I've now got multitouch to a stage I'm pretty happy with: grabs and the
'not-for-you' events are implemented basically as discussed and seem to
be working fine, and it's good with both indirect (a Magic Mouse) and
direct (a Lenovo IdeaPad S10-3t) touch devices.

The major difference here is obviously the event delivery: instead of
delivering only to the first applicable target, we now deliver to all
grabbing clients, and the first selecting client.  An 'owner' flag
denotes whether or not the client currently owns the stream: grabbing
clients may accept the touch (which ceases delivery to all other
clients), or reject it (removing them from the delivery list and passing
ownership on to the next client).

Note that adding a grab or a selection does not result in starting to
receive touch events mid-stream: if you did not receive the TouchBegin,
you will never receive any events for that touch stream.

At the moment, the spec wording could definitely use some cleaning up,
and ProcessTouchEvents gets a bit hairy in places[0], which could
definitely be improved by some more pretty macros, or further
refactoring of EventIsDeliverable and friends.

But at this stage, it really just needs some active review and testing -
if you guys could please have a look over it, it'd be much appreciated.
I'll send the patches as followups to this, and they're also in the
'multitouch' branches of the following repos:
git://people.freedesktop.org/~daniels/inputproto[1]
git://people.freedesktop.org/~daniels/xserver
git://people.freedesktop.org/~daniels/libXi
git://people.freedesktop.org/~daniels/xinput[2]

Cheers,
Daniel

[0]: Unfortunately there's a lot of NIH, due to the need to stash the
 grab/selection resource IDs, as well as doing the MD/SD delivery in
 a single pass (so we don't deliver the same touch sequence to one
 client selecting on the SD and another on the MD).
[1]: There's also a 'multitouch-cumulative' branch which builds on
 Chase's old repo to more clearly show the spec changes.
[2]: xinput is actually a pretty good example of how _not_ to write a
 touch client, since it leaves its grabs hanging.  But it does make
 for a good testcase of a client which leaves its grabs hanging. :)


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

[PATCH 2/2] mi: Sync: Don't free managed screen private

2010-12-17 Thread Daniel Stone
misync allocates space for its screen private with
dixRegisterPrivateKey, which means it doesn't have to free it at
CloseScreen time; doing so will, in fact, result in a crash.

Signed-off-by: Daniel Stone dan...@fooishbar.org
---
 miext/sync/misync.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/miext/sync/misync.c b/miext/sync/misync.c
index bcc68a2..50226d9 100644
--- a/miext/sync/misync.c
+++ b/miext/sync/misync.c
@@ -167,7 +167,6 @@ SyncCloseScreen (int i, ScreenPtr pScreen)
 SyncScreenPrivPtr pScreenPriv = SYNC_SCREEN_PRIV(pScreen);
 
 pScreen-CloseScreen = pScreenPriv-CloseScreen;
-free(pScreenPriv);
 
 return (*pScreen-CloseScreen) (i, pScreen);
 }
-- 
1.7.2.3

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


Re: [PATCH] randr: check for virtual size limits before set crtc

2010-12-17 Thread Daniel Stone
On Fri, Dec 17, 2010 at 04:09:35PM +0200, Tiago Vignatti wrote:
 Return a error if the screen is configured to an invalid size.
 
 Signed-off-by: Tiago Vignatti tiago.vigna...@nokia.com
 Reviewed-by: Adam Jackson a...@redhat.com

Reviewed-by: Daniel Stone dan...@fooishbar.org


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

[PATCH inputproto 1/2] Include stdint.h

2010-12-17 Thread Daniel Stone
From: Chase Douglas chase.doug...@ubuntu.com

I'm now getting build failures due to missing stdint.h. It seems we
should include it explicitly in XI2proto.h anyways.

Signed-off-by: Chase Douglas chase.doug...@canonical.com
Signed-off-by: Daniel Stone dan...@fooishbar.org
---
 XI2proto.h |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/XI2proto.h b/XI2proto.h
index 2fd91eb..84574a5 100644
--- a/XI2proto.h
+++ b/XI2proto.h
@@ -60,6 +60,7 @@
 #include X11/Xproto.h
 #include X11/X.h
 #include X11/extensions/XI2.h
+#include stdint.h
 
 /* make sure types have right sizes for protocol structures. */
 #define Window  uint32_t
-- 
1.7.2.3

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


[PATCH inputproto 2/2] Add touch classes and events, bump to 2.1

2010-12-17 Thread Daniel Stone
From: Chase Douglas chase.doug...@canonical.com

Introduce multitouch support through a new TouchClass, as well as new
TouchBegin, TouchEnd and TouchMotion events.  Bump to version 2.1.

Based on an initial patch by Daniel Stone (headers) and Peter Hutterer
(protocol documentation).

Signed-off-by: Daniel Stone dan...@fooishbar.org
Signed-off-by: Chase Douglas chase.doug...@canonical.com
---
 XI2.h|   29 +-
 XI2proto.h   |   44 -
 XI2proto.txt |  303 +++--
 configure.ac |2 +-
 4 files changed, 362 insertions(+), 16 deletions(-)

diff --git a/XI2.h b/XI2.h
index 6ba1377..18602f8 100644
--- a/XI2.h
+++ b/XI2.h
@@ -36,6 +36,7 @@
 
 #define XI_2_Major  2
 #define XI_2_Minor  0
+#define XI_2_1_Minor1
 
 /* Property event flags */
 #define XIPropertyDeleted   0
@@ -65,6 +66,7 @@
 #define XIGrabtypeKeycode   1
 #define XIGrabtypeEnter 2
 #define XIGrabtypeFocusIn   3
+#define XIGrabtypeTouchBegin4
 
 /* Passive grab modifier */
 #define XIAnyModifier   (1U  31)
@@ -79,6 +81,11 @@
 #define XIAsyncPair 4
 #define XISyncPair  5
 
+/* XIAllowTouchEvents bitmask event-modes */
+#define XITouchOwnerAccept  (1  0)
+#define XITouchOwnerReject  (1  1)
+#define XITouchNoPointerEmulation   (1  2)
+
 /* DeviceChangedEvent change reasons */
 #define XISlaveSwitch   1
 #define XIDeviceChange  2
@@ -113,15 +120,27 @@
 #define XISlaveKeyboard 4
 #define XIFloatingSlave 5
 
-/* Device classes */
+/* Device classes: classes that are not identical to Xi 1.x classes must be
+ * numbered starting from 8. */
 #define XIKeyClass  0
 #define XIButtonClass   1
 #define XIValuatorClass 2
+#define XITouchClass8
+#define XITouchValuatorClass9
 
 /* Device event flags (common) */
 /* Device event flags (key events only) */
 #define XIKeyRepeat (1  16)
 /* Device event flags (pointer events only) */
+#define XITouchPointer  (1  16)
+/* Device event flags (touch events only) */
+#define XITouchOwner(1  16)
+#define XITouchOwnerAccepted(1  17)
+#define XITouchPendingFinish(1  18)
+
+/* Touch modes */
+#define XIDirectTouch   1
+#define XIDependentTouch2
 
 /* XI2 event mask macros */
 #define XISetMask(ptr, event)   (((unsigned char*)(ptr))[(event)3] |=  (1  
((event)  7)))
@@ -151,7 +170,10 @@
 #define XI_RawButtonPress15
 #define XI_RawButtonRelease  16
 #define XI_RawMotion 17
-#define XI_LASTEVENT XI_RawMotion
+#define XI_TouchBegin18
+#define XI_TouchEnd  19
+#define XI_TouchMotion   20
+#define XI_LASTEVENT XI_TouchMotion
 /* NOTE: XI2LASTEVENT in xserver/include/inputstr.h must be the same value
  * as XI_LASTEVENT if the server is supposed to handle masks etc. for this
  * type of event. */
@@ -177,5 +199,8 @@
 #define XI_RawButtonPressMask(1  XI_RawButtonPress)
 #define XI_RawButtonReleaseMask  (1  XI_RawButtonRelease)
 #define XI_RawMotionMask (1  XI_RawMotion)
+#define XI_TouchBeginMask(1  XI_TouchBegin)
+#define XI_TouchEndMask  (1  XI_TouchEnd)
+#define XI_TouchMotionMask   (1  XI_TouchMotion)
 
 #endif /* _XI2_H_ */
diff --git a/XI2proto.h b/XI2proto.h
index 84574a5..f7510cc 100644
--- a/XI2proto.h
+++ b/XI2proto.h
@@ -92,9 +92,10 @@
 #define X_XIDeleteProperty  58
 #define X_XIGetProperty 59
 #define X_XIGetSelectedEvents   60
+#define X_XIAllowTouchEvents61
 
 /** Number of XI requests */
-#define XI2REQUESTS (X_XIGetSelectedEvents - X_XIQueryPointer + 1)
+#define XI2REQUESTS (X_XIAllowTouchEvents - X_XIQueryPointer + 1)
 /** Number of XI2 events */
 #define XI2EVENTS   (XI_LASTEVENT + 1)
 
@@ -188,6 +189,31 @@ typedef struct {
 uint16_tpad2;
 } xXIValuatorInfo;
 
+/**
+ * Denotes multitouch capability on a device.
+ */
+typedef struct {
+uint16_ttype;   /** Always TouchClass */
+uint16_tlength; /** Length in 4 byte units */
+uint16_tsourceid;   /** source device for this class */
+uint8_t mode;   /** DirectTouch or DependentTouch */
+uint8_t num_touches;/** Maximum number of touches */
+} xXITouchInfo;
+
+/**
+ * 

[PATCH xserver 02/10] Export all valuator_mask_* functions

2010-12-17 Thread Daniel Stone
From: Chase Douglas chase.doug...@canonical.com

Input drivers may use valuator masks for internal state. Having all the
valuator_mask_* functions available will help.

Signed-off-by: Chase Douglas chase.doug...@canonical.com
Reviewed-by: Daniel Stone dan...@fooishbar.org
---
 include/input.h  |8 +++-
 include/inpututils.h |8 
 2 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/include/input.h b/include/input.h
index 8feac28..fef69a1 100644
--- a/include/input.h
+++ b/include/input.h
@@ -554,7 +554,6 @@ extern _X_HIDDEN void valuator_set_mode(DeviceIntPtr dev, 
int axis, int mode);
xfixes/cursor.c uses it to determine if the cursor is enabled */
 extern Bool EnableCursor;
 
-/* For server-internal functions, see inpututil.h */
 extern _X_EXPORT ValuatorMask  *valuator_mask_new(int num_valuators);
 extern _X_EXPORT void valuator_mask_set_range(ValuatorMask *mask,
int first_valuator, int num_valuators,
@@ -563,5 +562,12 @@ extern _X_EXPORT void valuator_mask_set(ValuatorMask *mask,
 int valuator,
 int data);
 extern _X_EXPORT void valuator_mask_zero(ValuatorMask *mask);
+extern _X_EXPORT int valuator_mask_size(const ValuatorMask *mask);
+extern _X_EXPORT int valuator_mask_isset(const ValuatorMask *mask, int bit);
+extern _X_EXPORT void valuator_mask_unset(ValuatorMask *mask, int bit);
+extern _X_EXPORT int valuator_mask_num_valuators(const ValuatorMask *mask);
+extern _X_EXPORT void valuator_mask_copy(ValuatorMask *dest,
+ const ValuatorMask *src);
+extern _X_EXPORT int valuator_mask_get(const ValuatorMask *mask, int valnum);
 
 #endif /* INPUT_H */
diff --git a/include/inpututils.h b/include/inpututils.h
index 54b5764..b8ca6ab 100644
--- a/include/inpututils.h
+++ b/include/inpututils.h
@@ -37,12 +37,4 @@ struct _ValuatorMask {
 int valuators[MAX_VALUATORS]; /* valuator data */
 };
 
-/* server-internal */
-extern _X_HIDDEN int valuator_mask_size(const ValuatorMask *mask);
-extern _X_HIDDEN int valuator_mask_isset(const ValuatorMask *mask, int bit);
-extern _X_HIDDEN void valuator_mask_unset(ValuatorMask *mask, int bit);
-extern _X_HIDDEN int valuator_mask_num_valuators(const ValuatorMask *mask);
-extern _X_HIDDEN void valuator_mask_copy(ValuatorMask *dest, const 
ValuatorMask *src);
-extern _X_HIDDEN int valuator_mask_get(const ValuatorMask *mask, int valnum);
-
 #endif
-- 
1.7.2.3

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


[PATCH xserver 01/10] Resources: Move rClient to resource.h

2010-12-17 Thread Daniel Stone
The definition of rClient was duplicated across three source files, so
move it to resource.h.

Signed-off-by: Daniel Stone dan...@fooishbar.org
---
 Xext/geext.c   |2 --
 Xext/security.c|2 --
 dix/events.c   |2 --
 include/resource.h |2 ++
 4 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/Xext/geext.c b/Xext/geext.c
index 8319c92..b37c1a0 100644
--- a/Xext/geext.c
+++ b/Xext/geext.c
@@ -33,8 +33,6 @@
 #include geext.h
 #include protocol-versions.h
 
-#define rClient(obj) (clients[CLIENT_ID((obj)-resource)])
-
 DevPrivateKeyRec GEClientPrivateKeyRec;
 
 int RT_GECLIENT  = 0;
diff --git a/Xext/security.c b/Xext/security.c
index 7eb95de..8673880 100644
--- a/Xext/security.c
+++ b/Xext/security.c
@@ -154,8 +154,6 @@ SecurityLookupRequestName(ClientPtr client)
 }
 
 
-#define rClient(obj) (clients[CLIENT_ID((obj)-resource)])
-
 /* SecurityDeleteAuthorization
  *
  * Arguments:
diff --git a/dix/events.c b/dix/events.c
index ac07923..4e2dd89 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -195,8 +195,6 @@ typedef const char *string;
 #define XE_KBPTR (xE-u.keyButtonPointer)
 
 
-#define rClient(obj) (clients[CLIENT_ID((obj)-resource)])
-
 CallbackListPtr EventCallback;
 CallbackListPtr DeviceEventCallback;
 
diff --git a/include/resource.h b/include/resource.h
index 0c5a59d..080061f 100644
--- a/include/resource.h
+++ b/include/resource.h
@@ -121,6 +121,8 @@ typedef unsigned long RESTYPE;
 
 #define BAD_RESOURCE 0xe000
 
+#define rClient(obj) (clients[CLIENT_ID((obj)-resource)])
+
 /* Resource state callback */
 extern _X_EXPORT CallbackListPtr ResourceStateCallback;
 
-- 
1.7.2.3

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


[PATCH xserver 03/10] Input: Pass sprite instead of device to FixUpEventFromWindow

2010-12-17 Thread Daniel Stone
Since FixUpEventFromWindow only uses the sprite trace to determine the
window stack, pass in a sprite instead of hardcoding the device sprite,
so we can deliver to windows other than the one currently containing the
sprite.

Signed-off-by: Daniel Stone dan...@fooishbar.org
---
 Xi/exevents.c  |3 ++-
 dix/events.c   |   43 +--
 include/input.h|3 ++-
 include/inputstr.h |4 ++--
 4 files changed, 27 insertions(+), 26 deletions(-)

diff --git a/Xi/exevents.c b/Xi/exevents.c
index 8615fd4..327873e 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1261,7 +1261,8 @@ DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, 
int detail,
 xi2event-group.effective_group = dev-key-xkbInfo-state.group;
 }
 
-FixUpEventFromWindow(dev, (xEvent*)xi2event, pWin, None, FALSE);
+FixUpEventFromWindow(dev-spriteInfo-sprite, (xEvent*)xi2event, pWin,
+ None, FALSE);
 
 DeliverEventsToWindow(dev, pWin, (xEvent*)xi2event, 1,
   GetEventFilter(dev, (xEvent*)xi2event), NullGrab);
diff --git a/dix/events.c b/dix/events.c
index 4e2dd89..4aa71c1 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -2181,9 +2181,8 @@ MaybeDeliverEventsToClient(WindowPtr pWin, xEvent 
*pEvents,
 return 2;
 }
 
-static Window FindChildForEvent(DeviceIntPtr dev, WindowPtr event)
+static Window FindChildForEvent(SpritePtr pSprite, WindowPtr event)
 {
-SpritePtr pSprite = dev-spriteInfo-sprite;
 WindowPtr w = pSprite-spriteTrace[pSprite-spriteTraceGood-1];
 Window child = None;
 
@@ -,16 +2221,14 @@ static Window FindChildForEvent(DeviceIntPtr dev, 
WindowPtr event)
  */
 void
 FixUpEventFromWindow(
-DeviceIntPtr pDev,
+SpritePtr pSprite,
 xEvent *xE,
 WindowPtr pWin,
 Window child,
 Bool calcChild)
 {
-SpritePtr pSprite = pDev-spriteInfo-sprite;
-
 if (calcChild)
-child = FindChildForEvent(pDev, pWin);
+child = FindChildForEvent(pSprite, pWin);
 
 if (XI2_EVENT(xE))
 {
@@ -2247,7 +2244,7 @@ FixUpEventFromWindow(
 event-evtype == XI_PropertyEvent)
 return;
 
-event-root = RootWindow(pDev)-drawable.id;
+event-root = pSprite-spriteTrace[0]-drawable.id;
 event-event = pWin-drawable.id;
 if (pSprite-hot.pScreen == pWin-drawable.pScreen)
 {
@@ -2268,7 +2265,7 @@ FixUpEventFromWindow(
 
 } else
 {
-XE_KBPTR.root = RootWindow(pDev)-drawable.id;
+XE_KBPTR.root = pSprite-spriteTrace[0]-drawable.id;
 XE_KBPTR.event = pWin-drawable.id;
 if (pSprite-hot.pScreen == pWin-drawable.pScreen)
 {
@@ -2385,6 +2382,7 @@ int
 DeliverDeviceEvents(WindowPtr pWin, InternalEvent *event, GrabPtr grab,
 WindowPtr stopAt, DeviceIntPtr dev)
 {
+SpritePtr pSprite = dev-spriteInfo-sprite;
 Window child = None;
 Mask filter;
 int deliveries = 0;
@@ -2407,7 +2405,7 @@ DeliverDeviceEvents(WindowPtr pWin, InternalEvent *event, 
GrabPtr grab,
 {
 /* XXX: XACE */
 filter = GetEventFilter(dev, xi2);
-FixUpEventFromWindow(dev, xi2, pWin, child, FALSE);
+FixUpEventFromWindow(pSprite, xi2, pWin, child, FALSE);
 deliveries = DeliverEventsToWindow(dev, pWin, xi2, 1,
filter, grab);
 free(xi2);
@@ -2425,7 +2423,7 @@ DeliverDeviceEvents(WindowPtr pWin, InternalEvent *event, 
GrabPtr grab,
 if (rc == Success) {
 if (XaceHook(XACE_SEND_ACCESS, NULL, dev, pWin, xE, count) 
== Success) {
 filter = GetEventFilter(dev, xE);
-FixUpEventFromWindow(dev, xE, pWin, child, FALSE);
+FixUpEventFromWindow(pSprite, xE, pWin, child, FALSE);
 deliveries = DeliverEventsToWindow(dev, pWin, xE, 
count,
filter, grab);
 if (deliveries  0)
@@ -2443,7 +2441,7 @@ DeliverDeviceEvents(WindowPtr pWin, InternalEvent *event, 
GrabPtr grab,
 if (rc == Success) {
 if (XaceHook(XACE_SEND_ACCESS, NULL, dev, pWin, core, 1) 
== Success) {
 filter = GetEventFilter(dev, core);
-FixUpEventFromWindow(dev, core, pWin, child, FALSE);
+FixUpEventFromWindow(pSprite, core, pWin, child, 
FALSE);
 deliveries = DeliverEventsToWindow(dev, pWin, core, 1,
filter, grab);
 if (deliveries  0)
@@ -3378,6 +3376,7 @@ CheckPassiveGrabsOnWindow(
 DeviceEvent *event,
 BOOL checkCore)
 {
+SpritePtr pSprite = device-spriteInfo-sprite;
 GrabPtr grab = wPassiveGrabs(pWin);
 GrabRec 

[PATCH xserver 06/10] Make CheckPassiveGrabsOnWindow return grab, export

2010-12-17 Thread Daniel Stone
Change CheckPassiveGrabsOnWindow to return the GrabPtr it used (or NULL
if none) rather than a boolean, and export it.  Also add an additional
boolean 'activate' parameter; use TRUE for existing behaviour, or FALSE
to only find the grab and then return it.

This will be used in forthcoming touch patches to find the grabs, rather
than open-coding same.

Signed-off-by: Daniel Stone dan...@fooishbar.org
---
 dix/events.c  |   44 
 include/dix.h |7 +++
 2 files changed, 31 insertions(+), 20 deletions(-)

diff --git a/dix/events.c b/dix/events.c
index cb98daf..77e76ac 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -209,10 +209,6 @@ static void CheckPhysLimits(DeviceIntPtr pDev,
 Bool generateEvents,
 Bool confineToScreen,
 ScreenPtr pScreen);
-static Bool CheckPassiveGrabsOnWindow(WindowPtr pWin,
-  DeviceIntPtr device,
-  DeviceEvent *event,
-  BOOL checkCore);
 
 /** Key repeat hack. Do not use but in TryClientEvents */
 extern BOOL EventIsKeyRepeat(xEvent *event);
@@ -2607,7 +2603,6 @@ XYToWindow(SpritePtr pSprite, int x, int y)
 BOOL
 ActivateFocusInGrab(DeviceIntPtr dev, WindowPtr old, WindowPtr win)
 {
-BOOL rc = FALSE;
 DeviceEvent event;
 
 if (dev-deviceGrab.grab)
@@ -2632,10 +2627,13 @@ ActivateFocusInGrab(DeviceIntPtr dev, WindowPtr old, 
WindowPtr win)
 event.deviceid = dev-id;
 event.sourceid = dev-id;
 event.detail.button = 0;
-rc = CheckPassiveGrabsOnWindow(win, dev, event, FALSE);
-if (rc)
+if (CheckPassiveGrabsOnWindow(win, dev, event, FALSE, TRUE))
+{
 DoEnterLeaveEvents(dev, dev-id, old, win, XINotifyPassiveUngrab);
-return rc;
+return TRUE;
+}
+
+return FALSE;
 }
 
 /**
@@ -2647,7 +2645,6 @@ ActivateFocusInGrab(DeviceIntPtr dev, WindowPtr old, 
WindowPtr win)
 static BOOL
 ActivateEnterGrab(DeviceIntPtr dev, WindowPtr old, WindowPtr win)
 {
-BOOL rc = FALSE;
 DeviceEvent event;
 
 if (dev-deviceGrab.grab)
@@ -2669,11 +2666,13 @@ ActivateEnterGrab(DeviceIntPtr dev, WindowPtr old, 
WindowPtr win)
 event.deviceid = dev-id;
 event.sourceid = dev-id;
 event.detail.button = 0;
-rc = CheckPassiveGrabsOnWindow(win, dev, event, FALSE);
-if (rc)
+if (CheckPassiveGrabsOnWindow(win, dev, event, FALSE, TRUE))
+{
 DoEnterLeaveEvents(dev, dev-id, old, win, XINotifyPassiveGrab);
+return TRUE;
+}
 
-return rc;
+return FALSE;
 }
 
 /**
@@ -3342,20 +3341,23 @@ BorderSizeNotEmpty(DeviceIntPtr pDev, WindowPtr pWin)
 /**
  * CheckPassiveGrabsOnWindow checks to see if the event passed in causes a
  * passive grab set on the window to be activated.
- * If a passive grab is activated, the event will be delivered to the client.
+ * If activate is true and a passive grab is found, it will be activated,
+ * and the event will be delivered to the client.
  *
  * @param pWin The window that may be subject to a passive grab.
  * @param device Device that caused the event.
  * @param event The current device event.
  * @param checkCore Check for core grabs too.
+ * @param activate If a grab is found, activate it and deliver the event.
  */
 
-static Bool
+GrabPtr
 CheckPassiveGrabsOnWindow(
 WindowPtr pWin,
 DeviceIntPtr device,
 DeviceEvent *event,
-BOOL checkCore)
+BOOL checkCore,
+BOOL activate)
 {
 SpritePtr pSprite = device-spriteInfo-sprite;
 GrabPtr grab = wPassiveGrabs(pWin);
@@ -3367,7 +3369,7 @@ CheckPassiveGrabsOnWindow(
 int match = 0;
 
 if (!grab)
-   return FALSE;
+   return NULL;
 /* Fill out the grab details, but leave the type for later before
  * comparing */
 tempGrab.window = pWin;
@@ -3481,6 +3483,8 @@ CheckPassiveGrabsOnWindow(
 continue;
 }
 
+if (!activate)
+return grab;
 
 if (match  CORE_MATCH)
 {
@@ -3538,10 +3542,10 @@ CheckPassiveGrabsOnWindow(
 
 if (match  (XI_MATCH | XI2_MATCH))
 free(xE); /* on core match xE == core */
-   return TRUE;
+   return grab;
}
 }
-return FALSE;
+return NULL;
 #undef CORE_MATCH
 #undef XI_MATCH
 #undef XI2_MATCH
@@ -3607,7 +3611,7 @@ CheckDeviceGrabs(DeviceIntPtr device, DeviceEvent *event, 
WindowPtr ancestor)
for (; i  focus-traceGood; i++)
{
pWin = focus-trace[i];
-   if (CheckPassiveGrabsOnWindow(pWin, device, event, sendCore))
+   if (CheckPassiveGrabsOnWindow(pWin, device, event, sendCore, TRUE))
return TRUE;
}
 
@@ -3620,7 +3624,7 @@ CheckDeviceGrabs(DeviceIntPtr device, DeviceEvent *event, 
WindowPtr ancestor)
 for (; i  device-spriteInfo-sprite-spriteTraceGood; i++)
 {
pWin = 

[PATCH xserver 05/10] Make EventIsDeliverable non-static

2010-12-17 Thread Daniel Stone
From: Chase Douglas chase.doug...@canonical.com

Will be used outside dix/events.c in proceeding XI 2.1 MT changes.

Signed-off-by: Chase Douglas chase.doug...@canonical.com
Reviewed-by: Daniel Stone dan...@fooishbar.org
---
 dix/events.c|   13 +
 include/input.h |   12 
 2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/dix/events.c b/dix/events.c
index 8e3e1d3..cb98daf 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -2281,17 +2281,6 @@ FixUpEventFromWindow(
 }
 
 /**
- * Return masks for EventIsDeliverable.
- * @defgroup EventIsDeliverable return flags
- * @{
- */
-#define XI_MASK (1  0) /** XI mask set on window */
-#define CORE_MASK   (1  1) /** Core mask set on window */
-#define DONT_PROPAGATE_MASK (1  2) /** DontPropagate mask set on window 
*/
-#define XI2_MASK(1  3) /** XI2 mask set on window */
-/* @} */
-
-/**
  * Check if a given event is deliverable at all on a given window.
  *
  * This function only checks if any client wants it, not for a specific
@@ -2304,7 +2293,7 @@ FixUpEventFromWindow(
  * @return Bitmask of ::XI2_MASK, ::XI_MASK, ::CORE_MASK, and
  * ::DONT_PROPAGATE_MASK.
  */
-static int
+int
 EventIsDeliverable(DeviceIntPtr dev, InternalEvent* event, WindowPtr win)
 {
 int rc = 0;
diff --git a/include/input.h b/include/input.h
index ef7ef04..c1db544 100644
--- a/include/input.h
+++ b/include/input.h
@@ -534,6 +534,18 @@ void FixUpEventFromWindow(SpritePtr pSprite,
   Window child,
   Bool calcChild);
 extern WindowPtr XYToWindow(SpritePtr pSprite, int x, int y);
+extern int EventIsDeliverable(DeviceIntPtr dev, InternalEvent* event,
+  WindowPtr win);
+/**
+ * Return masks for EventIsDeliverable.
+ * @defgroup EventIsDeliverable return flags
+ * @{
+ */
+#define XI_MASK (1  0) /** XI mask set on window */
+#define CORE_MASK   (1  1) /** Core mask set on window */
+#define DONT_PROPAGATE_MASK (1  2) /** DontPropagate mask set on window 
*/
+#define XI2_MASK(1  3) /** XI2 mask set on window */
+/* @} */
 
 /* Implemented by the DDX. */
 extern _X_EXPORT int NewInputDeviceRequest(
-- 
1.7.2.3

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


[PATCH xserver 07/10] Reorder AxisInfo elements

2010-12-17 Thread Daniel Stone
From: Chase Douglas chase.doug...@canonical.com

Reorder elements so they can be uniform with the upcoming TouchAxisInfo
elements required for coordinate scaling.

Signed-off-by: Chase Douglas chase.doug...@canonical.com
Reviewed-by: Daniel Stone dan...@fooishbar.org
---
 include/inputstr.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/inputstr.h b/include/inputstr.h
index bada398..264d715 100644
--- a/include/inputstr.h
+++ b/include/inputstr.h
@@ -213,11 +213,11 @@ typedef struct _KeyClassRec {
 
 typedef struct _AxisInfo {
 intresolution;
-intmin_resolution;
-intmax_resolution;
 intmin_value;
 intmax_value;
 Atom   label;
+intmin_resolution;
+intmax_resolution;
 CARD8  mode;
 } AxisInfo, *AxisInfoPtr;
 
-- 
1.7.2.3

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


[PATCH xserver 10/10] test: input - set all touch events at once

2010-12-17 Thread Daniel Stone
From: Chase Douglas chase.doug...@canonical.com

Clients can't select for the three touch events individually, so ensure
the test doesn't try to do so.

Signed-off-by: Chase Douglas chase.doug...@canonical.com
Reviewed-by: Peter Hutterer peter.hutte...@who-t.net
Reviewed-by: Daniel Stone dan...@fooishbar.org
---
 test/xi2/protocol-xiselectevents.c |   44 
 1 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/test/xi2/protocol-xiselectevents.c 
b/test/xi2/protocol-xiselectevents.c
index fe1c26d..b6ae1cb 100644
--- a/test/xi2/protocol-xiselectevents.c
+++ b/test/xi2/protocol-xiselectevents.c
@@ -159,7 +159,18 @@ static void 
request_XISelectEvents_masks(xXISelectEventsReq *req)
 memset(bits, 0, mask-mask_len * 4);
 for (j = 0; j = XI_LASTEVENT; j++)
 {
+/* Can't select for these events alone */
+if (j == XI_TouchMotion || j == XI_TouchEnd)
+continue;
+
 SetBit(bits, j);
+
+/* Must select for all touch events at once */
+if (j == XI_TouchBegin) {
+SetBit(bits, XI_TouchMotion);
+SetBit(bits, XI_TouchEnd);
+}
+
 request_XISelectEvent(req, Success);
 ClearBit(bits, j);
 }
@@ -175,7 +186,18 @@ static void 
request_XISelectEvents_masks(xXISelectEventsReq *req)
 
 for (j = 0; j = XI_LASTEVENT; j++)
 {
+/* Can't select for these events alone */
+if (j == XI_TouchMotion || j == XI_TouchEnd)
+continue;
+
 SetBit(bits, j);
+
+/* Must select for all touch events at once */
+if (j == XI_TouchBegin) {
+SetBit(bits, XI_TouchMotion);
+SetBit(bits, XI_TouchEnd);
+}
+
 request_XISelectEvent(req, Success);
 }
 
@@ -189,7 +211,18 @@ static void 
request_XISelectEvents_masks(xXISelectEventsReq *req)
 
 for (j = XI_LASTEVENT + 1; j  mask-mask_len * 4; j++)
 {
+/* Can't select for these events alone */
+if (j == XI_TouchMotion || j == XI_TouchEnd)
+continue;
+
 SetBit(bits, j);
+
+/* Must select for all touch events at once */
+if (j == XI_TouchBegin) {
+SetBit(bits, XI_TouchMotion);
+SetBit(bits, XI_TouchEnd);
+}
+
 request_XISelectEvent(req, BadValue);
 ClearBit(bits, j);
 }
@@ -202,7 +235,18 @@ static void 
request_XISelectEvents_masks(xXISelectEventsReq *req)
 memset(bits, 0, mask-mask_len * 4);
 for (j = 0; j = XI_LASTEVENT; j++)
 {
+/* Can't select for these events alone */
+if (j == XI_TouchMotion || j == XI_TouchEnd)
+continue;
+
 SetBit(bits, j);
+
+/* Must select for all touch events at once */
+if (j == XI_TouchBegin) {
+SetBit(bits, XI_TouchMotion);
+SetBit(bits, XI_TouchEnd);
+}
+
 request_XISelectEvent(req, Success);
 }
 
-- 
1.7.2.3

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


[PATCH xserver 09/10] Input: Set client error value for invalid mask bits

2010-12-17 Thread Daniel Stone
When we send BadValue back to the client for having invalid mask bits,
at least tell them what the (first) invalid bit was.

Signed-off-by: Daniel Stone dan...@fooishbar.org
---
 Xi/xigrabdev.c |2 +-
 Xi/xipassivegrab.c |2 +-
 Xi/xiselectev.c|   15 +--
 include/exevents.h |2 +-
 4 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/Xi/xigrabdev.c b/Xi/xigrabdev.c
index 24ededc..0adc878 100644
--- a/Xi/xigrabdev.c
+++ b/Xi/xigrabdev.c
@@ -79,7 +79,7 @@ ProcXIGrabDevice(ClientPtr client)
 if (!IsMaster(dev))
 stuff-paired_device_mode = GrabModeAsync;
 
-if (XICheckInvalidMaskBits((unsigned char*)stuff[1],
+if (XICheckInvalidMaskBits(client, (unsigned char*)stuff[1],
stuff-mask_len * 4) != Success)
 return BadValue;
 
diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c
index c5f7bf0..972988e 100644
--- a/Xi/xipassivegrab.c
+++ b/Xi/xipassivegrab.c
@@ -129,7 +129,7 @@ ProcXIPassiveGrabDevice(ClientPtr client)
 return BadValue;
 }
 
-if (XICheckInvalidMaskBits((unsigned char*)stuff[1],
+if (XICheckInvalidMaskBits(client, (unsigned char*)stuff[1],
stuff-mask_len * 4) != Success)
 return BadValue;
 
diff --git a/Xi/xiselectev.c b/Xi/xiselectev.c
index 64ee173..edbd156 100644
--- a/Xi/xiselectev.c
+++ b/Xi/xiselectev.c
@@ -42,14 +42,19 @@
  *
  * @return BadValue if at least one invalid bit is set or Success otherwise.
  */
-int XICheckInvalidMaskBits(unsigned char *mask, int len)
+int XICheckInvalidMaskBits(ClientPtr client, unsigned char *mask, int len)
 {
 if (len = XIMaskLen(XI2LASTEVENT))
 {
 int i;
 for (i = XI2LASTEVENT + 1; i  len * 8; i++)
+{
 if (BitIsOn(mask, i))
+{
+client-errorValue = i;
 return BadValue;
+}
+}
 }
 
 return Success;
@@ -126,7 +131,10 @@ ProcXISelectEvents(ClientPtr client)
 {
 unsigned char *bits = (unsigned char*)evmask[1];
 if (BitIsOn(bits, XI_HierarchyChanged))
+{
+client-errorValue = XI_HierarchyChanged;
 return BadValue;
+}
 }
 
 /* Raw events may only be selected on root windows */
@@ -138,7 +146,10 @@ ProcXISelectEvents(ClientPtr client)
 BitIsOn(bits, XI_RawButtonPress) ||
 BitIsOn(bits, XI_RawButtonRelease) ||
 BitIsOn(bits, XI_RawMotion))
+{
+client-errorValue = XI_RawKeyPress;
 return BadValue;
+}
 }
 
 if (evmask-mask_len = 1)
@@ -182,7 +193,7 @@ ProcXISelectEvents(ClientPtr client)
 }
 }
 
-if (XICheckInvalidMaskBits((unsigned char*)evmask[1],
+if (XICheckInvalidMaskBits(client, (unsigned char*)evmask[1],
evmask-mask_len * 4) != Success)
 return BadValue;
 
diff --git a/include/exevents.h b/include/exevents.h
index ae45054..32a3962 100644
--- a/include/exevents.h
+++ b/include/exevents.h
@@ -327,6 +327,6 @@ XISetEventMask(DeviceIntPtr dev, WindowPtr win, ClientPtr 
client,
unsigned int len, unsigned char* mask);
 
 extern int
-XICheckInvalidMaskBits(unsigned char *mask, int len);
+XICheckInvalidMaskBits(ClientPtr client, unsigned char *mask, int len);
 
 #endif /* EXEVENTS_H */
-- 
1.7.2.3

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


[PATCH xserver 08/10] Input: Add initial multitouch support from Xi 2.1

2010-12-17 Thread Daniel Stone
Xi 2.1 adds TouchClasses to devices, as well as TouchBegin, TouchMotion
and TouchEnd events, to allow support for multiple touchpoints on a
single device.

Based on work from both myself and Chase Douglas.

Signed-off-by: Daniel Stone dan...@fooishbar.org
Signed-off-by: Chase Douglas chase.doug...@canonical.com
---
 Xi/exevents.c  |  346 
 Xi/extinit.c   |9 +-
 Xi/xiallowev.c |  110 +
 Xi/xiallowev.h |2 +
 Xi/xipassivegrab.c |   18 ++-
 Xi/xiquerydevice.c |   95 +++
 Xi/xiquerydevice.h |3 +
 Xi/xiselectev.c|   41 +
 configure.ac   |2 +-
 dix/devices.c  |   93 +++
 dix/eventconvert.c |   13 ++
 dix/events.c   |7 +-
 dix/getevents.c|  113 +
 dix/grabs.c|   55 +++
 dix/inpututils.c   |   58 +++
 dix/window.c   |9 +-
 hw/xfree86/common/xf86Xinput.c |   21 +++
 hw/xfree86/common/xf86Xinput.h |4 +
 include/eventstr.h |5 +
 include/exevents.h |   20 +++
 include/input.h|   17 ++
 include/inputstr.h |  118 +-
 include/protocol-versions.h|2 +-
 mi/mieq.c  |3 +
 24 files changed,  insertions(+), 53 deletions(-)

diff --git a/Xi/exevents.c b/Xi/exevents.c
index 327873e..c401634 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -77,6 +77,7 @@ SOFTWARE.
 #include xiquerydevice.h /* For List*Info */
 #include eventconvert.h
 #include eventstr.h
+#include xserver-properties.h
 
 #include X11/extensions/XKBproto.h
 #include xkbsrv.h
@@ -926,6 +927,263 @@ ProcessRawEvent(RawDeviceEvent *ev, DeviceIntPtr device)
 }
 
 /**
+ * Processes and delivers a TouchBegin, TouchMotion or a TouchEnd event.
+ *
+ * Due to having rather different delivery semantics (see the Xi 2.1 protocol
+ * spec for more information), this implements its own grab and selection
+ * delivery logic.
+ */
+static void
+ProcessTouchEvent(DeviceEvent *ev, DeviceIntPtr sourcedev)
+{
+TouchClassPtr t;
+TouchPointInfoPtr ti;
+DeviceIntPtr masterdev = NULL, deliverdev = NULL;
+Window child;
+WindowPtr win;
+SpritePtr sprite;
+xXIDeviceEvent *xi2;
+Mask filter;
+int err, touch, i, j, deliveries;
+
+/* We handle deliveries to MDs through the SD, rather than copying
+ * the event and processing it twice. */
+if (ev-sourceid != ev-deviceid)
+return;
+
+if (sourcedev-u.master)
+masterdev = sourcedev-u.master;
+
+if (!sourcedev-touch)
+return;
+t = sourcedev-touch;
+
+touch = FindTouchPoint(sourcedev, ev-detail.touch);
+if (touch  0)
+{
+DebugF([Xi] %s: Received event for inactive touchpoint %d\n,
+   sourcedev-name, ev-detail.touch);
+return;
+}
+ti = t-touches[touch];
+
+/* Find our window trace, or construct one if necessary.  In direct touch
+ * mode, we focus immediately under the touchpoint, so we need to build a
+ * window trace; in Relative, we just use the device's sprite, or reuse
+ * an existing touch's sprite if possible. */
+sprite = ti-sprite;
+if (ev-type == ET_TouchBegin)
+{
+if (t-mode == XIDirectTouch)
+{
+/* XXX: Do we need to handle crossing screens here? */
+sprite-spriteTrace[0] =
+sourcedev-spriteInfo-sprite-hotPhys.pScreen-root;
+XYToWindow(sprite, ev-root_x, ev-root_y);
+}
+else
+{
+WindowPtr *trace;
+SpritePtr srcsprite;
+
+for (i = 0; i  t-num_touches; i++)
+if (t-touches[i].sprite.spriteTraceGood  0)
+break;
+if (i  t-num_touches)
+srcsprite = t-touches[i].sprite;
+else if (sourcedev-spriteInfo-sprite)
+srcsprite = sourcedev-spriteInfo-sprite;
+else
+return;
+
+if (srcsprite-spriteTraceGood  sprite-spriteTraceSize)
+{
+trace = realloc(sprite-spriteTrace,
+srcsprite-spriteTraceSize * sizeof(*trace));
+if (!trace)
+{
+sprite-spriteTraceGood = 0;
+return;
+}
+sprite-spriteTrace = trace;
+sprite-spriteTraceSize = srcsprite-spriteTraceGood;
+}
+memcpy(sprite-spriteTrace, srcsprite-spriteTrace,
+   srcsprite-spriteTraceGood * sizeof(*trace));
+sprite-spriteTraceGood = srcsprite-spriteTraceGood;
+}
+
+if (sprite-spriteTraceGood = 0)
+return;
+
+/* Mark which grabs/selections we're delivering to: max one grab per
+   

[PATCH libXi 1/1] Add multitouch support from Xi 2.1

2010-12-17 Thread Daniel Stone
Add support to libXi for touch events.

Based on work by myself and Chase Douglas.

Signed-off-by: Daniel Stone dan...@fooishbar.org
Signed-off-by: Chase Douglas chase.doug...@canonical.com
---
 configure.ac |4 +-
 include/X11/extensions/XInput2.h |   45 
 src/XExtInt.c|   47 +-
 src/XIAllowEvents.c  |   24 +++
 src/XIPassiveGrab.c  |   21 +
 5 files changed, 138 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 0a4b384..173537a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@ dnl Process this file with autoconf to create configure.
 
 AC_PREREQ([2.60])
 
-AC_INIT(libXi, 1.4.0, 
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXi)
+AC_INIT(libXi, 1.4.99.1, 
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXi)
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE
 
@@ -24,7 +24,7 @@ AC_PROG_LIBTOOL
 AC_PROG_SED
 
 # Checks for pkg-config packages
-PKG_CHECK_MODULES(XI, [xproto = 7.0.13] [x11 = 1.2.99.1] [xextproto = 
7.0.3] [xext = 1.0.99.1] [inputproto = 1.9.99.902])
+PKG_CHECK_MODULES(XI, [xproto = 7.0.13] [x11 = 1.2.99.1] [xextproto = 
7.0.3] [xext = 1.0.99.1] [inputproto = 2.0.99.1])
 
 # Check for xmlto and asciidoc for man page conversion
 # (only needed by people building tarballs)
diff --git a/include/X11/extensions/XInput2.h b/include/X11/extensions/XInput2.h
index e6c7b30..88a21f0 100644
--- a/include/X11/extensions/XInput2.h
+++ b/include/X11/extensions/XInput2.h
@@ -135,6 +135,25 @@ typedef struct
 
 typedef struct
 {
+int  type;
+int  sourceid;
+int  mode;
+int  num_touches;
+} XITouchClassInfo;
+
+typedef struct
+{
+int  type;
+int  sourceid;
+int  number;
+Atom label;
+double   min;
+double   max;
+int  resolution;
+} XITouchValuatorClassInfo;
+
+typedef struct
+{
 int deviceid;
 char*name;
 int use;
@@ -415,6 +434,13 @@ extern Status XIAllowEvents(
 Timetime
 );
 
+extern Status XIAllowTouchEvents(
+Display*display,
+int deviceid,
+unsigned long   touchid,
+int event_mode
+);
+
 extern int XIGrabButton(
 Display*display,
 int deviceid,
@@ -466,6 +492,17 @@ extern int XIGrabFocusIn(
 int num_modifiers,
 XIGrabModifiers *modifiers_inout
 );
+
+extern int XIGrabTouchBegin(
+Display*display,
+int deviceid,
+Window  grab_window,
+int owner_events,
+XIEventMask *mask,
+int num_modifiers,
+XIGrabModifiers *modifiers_inout
+);
+
 extern Status XIUngrabButton(
 Display*display,
 int deviceid,
@@ -500,6 +537,14 @@ extern Status XIUngrabFocusIn(
 XIGrabModifiers *modifiers
 );
 
+extern Status XIUngrabTouchBegin(
+Display*display,
+int deviceid,
+Window  grab_window,
+int num_modifiers,
+XIGrabModifiers *modifiers
+);
+
 
 extern Atom *XIListProperties(
 Display*display,
diff --git a/src/XExtInt.c b/src/XExtInt.c
index f96e3ff..9f995b6 100644
--- a/src/XExtInt.c
+++ b/src/XExtInt.c
@@ -268,7 +268,8 @@ static XExtensionVersion versions[] = { {XI_Absent, 0, 0},
  XI_Add_DevicePresenceNotify_Minor},
 {XI_Present, XI_Add_DeviceProperties_Major,
  XI_Add_DeviceProperties_Minor},
-{XI_Present, XI_2_Major, XI_2_Minor}
+{XI_Present, XI_2_Major, XI_2_Minor},
+{XI_Present, XI_2_Major, XI_2_1_Minor}
 };
 
 /***
@@ -924,6 +925,9 @@ XInputWireToCookie(
 case XI_ButtonRelease:
 case XI_KeyPress:
 case XI_KeyRelease:
+case XI_TouchBegin:
+case XI_TouchMotion:
+case XI_TouchEnd:
 *cookie = *(XGenericEventCookie*)save;
 if (!wireToDeviceEvent((xXIDeviceEvent*)event, cookie))
 {
@@ -1037,6 +1041,12 @@ sizeDeviceClassType(int type, int num_elements)
 case XIValuatorClass:
 l = sizeof(XIValuatorClassInfo);
 break;
+case XITouchClass:
+l = sizeof(XITouchClassInfo);
+break;
+case XITouchValuatorClass:
+l = sizeof(XITouchValuatorClassInfo);
+break;
 default:
 printf(sizeDeviceClassType: unknown type %d\n, type);
 break;
@@ -1427,6 +1437,12 @@ size_classes(xXIAnyInfo* from, int nclasses)
 case XIValuatorClass:
 l = sizeDeviceClassType(XIValuatorClass, 0);
 break;
+case XITouchClass:

[PATCH xinput 1/1] Add experimental multitouch support from XI 2.1

2010-12-17 Thread Daniel Stone
From: Chase Douglas chase.doug...@canonical.com

This patch adds experimental support for listening to touch streams
(TouchBegin, TouchMotion and TouchEnd) with test-xi2, as well as showing
TouchClass information with list.

Based on an initial patch by Daniel Stone.

Signed-off-by: Daniel Stone dan...@fooishbar.org
Signed-off-by: Chase Douglas chase.doug...@canonical.com
---
 configure.ac   |6 
 src/list.c |   28 
 src/test_xi2.c |   76 +++-
 3 files changed, 98 insertions(+), 12 deletions(-)

diff --git a/configure.ac b/configure.ac
index 1dc2ce2..d657a59 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,6 +28,12 @@ PKG_CHECK_MODULES(XI2, [xi = 1.2.99.2] [inputproto = 
1.9.99.15],
   HAVE_XI2=no);
 AM_CONDITIONAL(HAVE_XI2, [ test $HAVE_XI2 = yes ])
 
+# XI2.1 support
+PKG_CHECK_MODULES(XI2_1, [xi = 1.4.99.1] [inputproto = 2.0.99.1],
+  HAVE_XI2_1=yes; AC_DEFINE(HAVE_XI2_1, 1, [XI2_1 
available]),
+  HAVE_XI2_1=no);
+AM_CONDITIONAL(HAVE_XI2_1, [ test $HAVE_XI2_1 = yes ])
+
 AC_SUBST(XINPUT_CFLAGS)
 AC_SUBST(XINPUT_LIBS)
 AC_SUBST(HAVE_XI2)
diff --git a/src/list.c b/src/list.c
index 8633c62..8920cad 100644
--- a/src/list.c
+++ b/src/list.c
@@ -24,6 +24,9 @@
 #include xinput.h
 #include string.h
 #include X11/extensions/XIproto.h /* for XI_Device***ChangedNotify */
+#ifdef HAVE_XI2_1
+#include X11/extensions/XI2proto.h /* for XITouch* */
+#endif
 
 static void
 print_info(Display* dpy, XDeviceInfo   *info, Bool shortformat)
@@ -178,6 +181,31 @@ print_classes_xi2(Display* display, XIAnyClassInfo 
**classes,
 XFree(name);
 }
 break;
+#ifdef HAVE_XI2_1
+case XITouchClass:
+{
+XITouchClassInfo *t = (XITouchClassInfo *)classes[i];
+
+printf(\t\tMultitouch capable (max %d touches):\n,
+   t-num_touches);
+printf(\t\t  Mode: %s\n,
+   t-mode == XIDirectTouch ? direct : dependent);
+}
+break;
+case XITouchValuatorClass:
+{
+XITouchValuatorClassInfo *tv =
+(XITouchValuatorClassInfo *)classes[i];
+char *name = tv-label ?
+XGetAtomName(display, tv-label) : NULL;
+
+printf(\t\tDetail for Touch Valuator %d:\n, tv-number);
+printf(\t\t  Label: %s\n,  (name) ? name : None);
+printf(\t\t  Range: %f - %f\n, tv-min, tv-max);
+printf(\t\t  Resolution: %d units/m\n, tv-resolution);
+}
+break;
+#endif /* HAVE_XI2_1 */
 }
 }
 
diff --git a/src/test_xi2.c b/src/test_xi2.c
index 5b56397..443bbd8 100644
--- a/src/test_xi2.c
+++ b/src/test_xi2.c
@@ -29,26 +29,41 @@
 extern void print_classes_xi2(Display*, XIAnyClassInfo **classes,
   int num_classes);
 
-static Window create_win(Display *dpy)
+static void create_win(Display *dpy, Window *win, Window *subwin)
 {
-Window win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 0, 0, 200,
-200, 0, 0, WhitePixel(dpy, 0));
-Window subwindow = XCreateSimpleWindow(dpy, win, 50, 50, 50, 50, 0, 0,
-BlackPixel(dpy, 0));
-
-XMapWindow(dpy, subwindow);
-XSelectInput(dpy, win, ExposureMask);
-return win;
+*win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 0, 0, 200,
+   200, 0, 0, WhitePixel(dpy, 0));
+*subwin = XCreateSimpleWindow(dpy, *win, 50, 50, 50, 50, 0, 0,
+  BlackPixel(dpy, 0));
+XMapWindow(dpy, *subwin);
+XSelectInput(dpy, *win, ExposureMask);
 }
 
 static void print_deviceevent(XIDeviceEvent* event)
 {
 double *val;
 int i;
+static int touch_events_received = 0;
+static int thong = 0;
 
 printf(device: %d (%d)\n, event-deviceid, event-sourceid);
 printf(detail: %d\n, event-detail);
-printf(flags: %s\n, (event-flags  XIKeyRepeat) ? repeat : );
+
+switch (event-evtype)
+{
+case XI_KeyPress:
+case XI_KeyRelease:
+printf(flags: %s\n, (event-flags  XIKeyRepeat) ? repeat : 
);
+break;
+case XI_TouchBegin:
+case XI_TouchMotion:
+case XI_TouchEnd:
+printf(flags: %s%s%s\n,
+(event-flags  XITouchOwner) ? owner  : ,
+(event-flags  XITouchOwnerAccepted) ? owner accepted  : ,
+(event-flags  XITouchPendingFinish) ? pending finish  : 
);
+break;
+}
 
 printf(root: %.2f/%.2f\n, event-root_x, event-root_y);
 printf(event: %.2f/%.2f\n, event-event_x, event-event_y);
@@ -74,6 +89,14 @@ static void print_deviceevent(XIDeviceEvent* event)
 
 printf(windows: root 0x%lx event 0x%lx child 

Re: [PATCH 2/2] mi: Sync: Don't free managed screen private

2010-12-17 Thread James Jones
On 12/17/10 8:57 AM, Daniel Stone dan...@fooishbar.org wrote:

 misync allocates space for its screen private with
 dixRegisterPrivateKey, which means it doesn't have to free it at
 CloseScreen time; doing so will, in fact, result in a crash.
 
 Signed-off-by: Daniel Stone dan...@fooishbar.org
 ---
  miext/sync/misync.c |1 -
  1 files changed, 0 insertions(+), 1 deletions(-)
 
 diff --git a/miext/sync/misync.c b/miext/sync/misync.c
 index bcc68a2..50226d9 100644
 --- a/miext/sync/misync.c
 +++ b/miext/sync/misync.c
 @@ -167,7 +167,6 @@ SyncCloseScreen (int i, ScreenPtr pScreen)
  SyncScreenPrivPtr pScreenPriv = SYNC_SCREEN_PRIV(pScreen);
 
  pScreen-CloseScreen = pScreenPriv-CloseScreen;
 -free(pScreenPriv);
 
  return (*pScreen-CloseScreen) (i, pScreen);
  }
 --
 1.7.2.3

Reviewed-by: James Jones jajo...@nvidia.com

Thanks,
-James

 ___
 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


nvpublic

___
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: [PATCHES] Multitouch v3 - please review/test

2010-12-17 Thread Daniel Stone
On Fri, Dec 17, 2010 at 05:09:24PM +, Daniel Stone wrote:
 But at this stage, it really just needs some active review and testing -
 if you guys could please have a look over it, it'd be much appreciated.
 I'll send the patches as followups to this, and they're also in the
 'multitouch' branches of the following repos:
 git://people.freedesktop.org/~daniels/inputproto[1]
 git://people.freedesktop.org/~daniels/xserver
 git://people.freedesktop.org/~daniels/libXi
 git://people.freedesktop.org/~daniels/xinput[2]

Oh right, and there's also:
  git://people.freedesktop.org/~daniels/xf86-input-evdev

I'm not 100% happy with this yet though; in particular, to support the
Magic Mouse, we need to forward-port Chase's mixed rel/abs valuators
work, which isn't entirely trivial.  At the moment I'm using a pretty
horrific local hack to get the Magic Mouse working, but it works out of
the box for touchscreens and apparently for the Magic Trackpad as well.

Cheers,
Daniel


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: [PATCH 1/2] GetTimeInMillis: Use CLOCK_MONOTONIC_COARSE where available

2010-12-17 Thread Julien Cristau
On Fri, Dec 17, 2010 at 16:57:14 +, Daniel Stone wrote:

 On some systems, using CLOCK_MONOTONIC forces a readback of HPET or some
 similarly expensive timer.  CLOCK_MONOTONIC_COARSE can alleviate this,
 at the cost of negligibly-reduced resolution, so prefer that where we
 can.
 
 Signed-off-by: Daniel Stone dan...@fooishbar.org
 ---
  os/utils.c |   16 +++-
  1 files changed, 15 insertions(+), 1 deletions(-)
 
Reviewed-by: Julien Cristau jcris...@debian.org

Cheers,
Julien
___
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] ClickPad support v4

2010-12-17 Thread Chris Bagwell
OK, I've re-reviewed patch and I've decided I understand what its
trying to do now.  Most my original comments still apply but I've
added new ones.

First, I need to confirm intent of patch is this:

* Create a rectangle defined by {Top|Bottom|Left|Right}Edge that
excludes button area in attempt to cause cursor not to move when in
that area.

* Allow edge scrolling, circular scrolling, and tap gestures; but not
cursor movement; to work even when outside this smaller area.

Can you confirm this is intent?  Once I know then I can provide better
feedback and maybe even re-send updated patches.

We have Area*Edge defined to reduce touchpad area for movement and
gestures but it sounds like clickpads may need  a new setting to
define area that stops only movement but allows gestures?

The definition of {Top|Bottom|Left|Right}Edge is a little fuzzy to me.
 Maybe its OK for movement only control.  Peter, what do you think?

More below.

On Wed, Dec 8, 2010 at 1:55 AM, Yan Li yan.i...@intel.com wrote:
 This patch adds the support for Synaptics Clickpad devices.
 It requires the change in Linux kernel synaptics input driver, found in
    https://patchwork.kernel.org/patch/92435/
 The kernel patch is already included in 2.6.34 and later releases.

 When the kernel driver sets only the left-button bit evbit and no
 multi-finger is possible, Clickpad mode is activated.  In this mode,
 the bottom touch area is used as button emulations.  Clicking at the
 bottom-left, bottom-center and bottom-right zone corresponds to a left,
 center and right click.

 v2-v3: Fix the mis-detection of Clickpad device with double-tap feature
        (e.g. MacBook)
        Fix one forgotten spacing issue Peter suggested

 v3-v4: Ported to HEAD by Yan Li for MeeGo, also added ClickPad
        description to man page.

 Signed-off-by: Takashi Iwai tiwai at suse.de
 Signed-off-by: Yan Li yan.i...@intel.com
 ---
  man/synaptics.man  |    8 ++
  src/eventcomm.c    |    7 +
  src/synaptics.c    |   72 
 +++-
  src/synapticsstr.h |    2 +
  4 files changed, 88 insertions(+), 1 deletions(-)

 diff --git a/man/synaptics.man b/man/synaptics.man
 index 3f1ca9d..25f1115 100644
 --- a/man/synaptics.man
 +++ b/man/synaptics.man
 @@ -56,6 +56,14 @@ Pressure dependent motion speed.
  .IP \(bu 4
  Run-time configuration using shared memory. This means you can change
  parameter settings without restarting the X server.
 +.IP \(bu 4
 +Synaptics ClickPad support: ClickPad is a new kind of device from
 +Synaptics that has no visible physical keys. Instead, the whole board
 +is clickable and the device sends out BTN_MIDDLE only. It's the
 +driver's duty to judge whether the click is a left or right one
 +according to finger location. If the driver detects that the touchpad
 +has only one button, the ClickPad mode will be activated and handles
 +the action correctly.
  .LP
  Note that depending on the touchpad firmware, some of these features
  might be available even without using the synaptics driver. Note also
 diff --git a/src/eventcomm.c b/src/eventcomm.c
 index faa66ab..7da5a40 100644
 --- a/src/eventcomm.c
 +++ b/src/eventcomm.c
 @@ -269,6 +269,13 @@ event_query_axis_ranges(LocalDevicePtr local)
        }

        xf86Msg(X_PROBED, %s: buttons:%s\n, local-name, buf);
 +
 +       /* clickpad device reports only the single left button mask */
 +       if (priv-has_left  !priv-has_right  !priv-has_middle  
 !priv-has_double) {
 +               priv-is_clickpad = TRUE;
 +               xf86Msg(X_INFO, %s: is Clickpad device\n, local-name);
 +       }
 +
     }
  }

 diff --git a/src/synaptics.c b/src/synaptics.c
 index 53c3685..2e5f8ae 100644
 --- a/src/synaptics.c
 +++ b/src/synaptics.c
 @@ -506,6 +506,18 @@ static void set_default_parameters(LocalDevicePtr local)
         vertResolution = priv-resy;
     }

 +    /* Clickpad mode -- bottom area is used as buttons */
 +    if (priv-is_clickpad) {
 +        int button_bottom;
 +    /* Clickpad devices usually the button area at the bottom, and
 +     * its size seems ca. 20% of the touchpad height no matter how
 +     * large the pad is.
 +     */
 +    button_bottom = priv-maxy - (abs(priv-maxy - priv-miny) * 20) / 100;
 +    if (button_bottom  b  button_bottom = t)
 +        b = button_bottom;
 +    }
 +
     /* set the parameters */
     pars-left_edge = xf86SetIntOption(opts, LeftEdge, l);
     pars-right_edge = xf86SetIntOption(opts, RightEdge, r);
 @@ -2153,6 +2165,59 @@ handle_clickfinger(SynapticsParameters *para, struct 
 SynapticsHwState *hw)
     }
  }

 +/* clickpad event handling */
 +static void
 +HandleClickpad(LocalDevicePtr local, struct SynapticsHwState *hw, edge_type 
 edge)
 +{
 +    SynapticsPrivate *priv = (SynapticsPrivate *) (local-private);
 +    SynapticsParameters *para = priv-synpara;
 +
 +    if (edge  BOTTOM_EDGE) {
 +   /* button area */
 +   int width = priv-maxx - priv-minx;
 +   int left_button_x, right_button_x;
 +
 +  

Re: [PATCH 5/5] input: use a thread for the generation of input events

2010-12-17 Thread Adam Jackson
On Fri, 2010-12-17 at 15:24 +0200, Tiago Vignatti wrote:

 you left MaxInputDevices out of the disabling macro.
 
 Also, I liked in the previous patchset when you used the second commit to
 explain that now we have two input processing methods:
 
 - input thread
 - main loop dispatch
  
 where the SIGIO handler is merely an optimization for the second case.
 
 I'd say to attach this kind of information somewhere in the code, which would
 help a lot upcoming developers.

It's sort of there in the comment above time_to_yield().  I can
elaborate on it there though.

- ajax

___
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] Bug 32436 - hw/xfree86/parser/Makefile.am TOP_SRCDIR should be top_srcdir

2010-12-17 Thread Simon Thum
On 12/17/2010 07:32 AM, Alan Coopersmith wrote:
 https://bugs.freedesktop.org/show_bug.cgi?id=32436
 Fix typo introduced in 2416255f7e3fd9190a9 that breaks builds when
 configured --enable-install-libxf86config
 
 Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com
Tested-by: Simon Thum simon.t...@gmx.de

Cheers,

Simon

 ---
  hw/xfree86/parser/Makefile.am |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
 
 diff --git a/hw/xfree86/parser/Makefile.am b/hw/xfree86/parser/Makefile.am
 index a5adc01..fb5d49e 100644
 --- a/hw/xfree86/parser/Makefile.am
 +++ b/hw/xfree86/parser/Makefile.am
 @@ -31,7 +31,7 @@ libxf86config_internal_la_SOURCES = \
   $(INTERNAL_SOURCES)
  
  libxf86config_a_SOURCES = \
 - $(TOP_SRCDIR)/os/xprintf.c \
 + $(top_srcdir)/os/xprintf.c \
   $(INTERNAL_SOURCES)
  libxf86config_a_CFLAGS = $(AM_CFLAGS)
  

___
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: [PATCHES] Multitouch v3 - please review/test

2010-12-17 Thread Chase Douglas
On 12/17/2010 12:09 PM, Daniel Stone wrote:
 Hi all,
 I've now got multitouch to a stage I'm pretty happy with: grabs and the
 'not-for-you' events are implemented basically as discussed and seem to
 be working fine, and it's good with both indirect (a Magic Mouse) and
 direct (a Lenovo IdeaPad S10-3t) touch devices.
 
 The major difference here is obviously the event delivery: instead of
 delivering only to the first applicable target, we now deliver to all
 grabbing clients, and the first selecting client.  An 'owner' flag
 denotes whether or not the client currently owns the stream: grabbing
 clients may accept the touch (which ceases delivery to all other
 clients), or reject it (removing them from the delivery list and passing
 ownership on to the next client).
 
 Note that adding a grab or a selection does not result in starting to
 receive touch events mid-stream: if you did not receive the TouchBegin,
 you will never receive any events for that touch stream.
 
 At the moment, the spec wording could definitely use some cleaning up,
 and ProcessTouchEvents gets a bit hairy in places[0], which could
 definitely be improved by some more pretty macros, or further
 refactoring of EventIsDeliverable and friends.
 
 But at this stage, it really just needs some active review and testing -
 if you guys could please have a look over it, it'd be much appreciated.
 I'll send the patches as followups to this, and they're also in the
 'multitouch' branches of the following repos:
 git://people.freedesktop.org/~daniels/inputproto[1]
 git://people.freedesktop.org/~daniels/xserver
 git://people.freedesktop.org/~daniels/libXi
 git://people.freedesktop.org/~daniels/xinput[2]

Awesome work!

I haven't reviewed the protocol specification changes yet, nor have I
performed any code review. I built some test packages, but I found that
touches sometimes do not come through. I believe I saw some touches from
my magic trackpad on the first run of xinput test-xi2, but I can't get
any more now. Seems like it gets stuck. I think I may have seen the same
issue during one test of my touchscreen too.

I won't really have time to debug this myself until I get back after new
years, but I hope that's enough information for you to try to reproduce.
My testing base is my 1.9 server backport, but I didn't come across any
odd conflicts that make me wonder if they were a cause of this, but of
course there could be rebase bugs even without conflicts. You can find
the code at:

git://anongit.freedesktop.org/~cndougla/xserver multitouch-stable.

Denis, you've been the primary user of my backport PPA. Would you like
me to upload this update into the PPA now, or wait until this touch bug
is fixed?

Thanks again Daniel!

-- Chase
___
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: [PATCHES] Multitouch v3 - please review/test

2010-12-17 Thread Daniel Stone
Hi,

On Fri, Dec 17, 2010 at 03:59:30PM -0500, Chase Douglas wrote:
 Awesome work!

Thanks. :)

 I haven't reviewed the protocol specification changes yet, nor have I
 performed any code review.

Yeah, I should've removed your S-o-b/R-b tags from the significantly
changed parts -- my bad.

 I built some test packages, but I found that
 touches sometimes do not come through. I believe I saw some touches from
 my magic trackpad on the first run of xinput test-xi2, but I can't get
 any more now. Seems like it gets stuck. I think I may have seen the same
 issue during one test of my touchscreen too.

Hmm, I haven't seen that, but admittedly have been bouncing my X server
up and down rather than doing sustained long-term testing.  I'll have a
closer look next week, but any insight you'd have (especially any easy
way to reproduce, or even just which environment/test clients you were
using) would be great.

 Thanks again Daniel!

No problem, thank you too.

Cheers,
Daniel


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: [PATCH libICE] Remove useless line from a table in specs/ice.xml

2010-12-17 Thread Alan Coopersmith
Paulo Zanoni wrote:
 This seems to be a leftover from a manpage/groff conversion.

Yep, good catch.  Thanks for the patch - pushed.


-- 
-Alan Coopersmith-alan.coopersm...@oracle.com
 Oracle Solaris Platform Engineering: X Window System

___
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:xorg-docs] Add fop.xsl stylesheet to set fonts in ps pdf output

2010-12-17 Thread Alan Coopersmith
Matt Dew wrote:
 I'm able to get the Chinese characters to show up in the PDFs by
 adding the Chinese font 'AR PL UMing CN' to the symbol.font.family.
 
 
 xsl:param name=body.font.familyDejaVu Serif/xsl:param
 xsl:param name=symbol.font.familyTimes,Symbol,GNU Unifont,AR PL
 UMing CN/xsl:param

The Chinese was showing up for me with GNU Unifont, but not a very
good quality rendering - the AR PL... fonts are better.   For some
reason, on my system the arphic/uming.ttf font has the family name
of AR PL ShanHeiSun Uni, not the Uming name you saw, so I needed
this to get it to work for me:

  xsl:param name=symbol.font.familyserif,Symbol,AR PL UMing CN,AR PL
ShanHeiSun Uni,GNU Unifont/xsl:param

It doesn't complain about not finding the font under the Uming name so
it seems to be safe for people without all the alternative fonts installed.

I'll go ahead and push this for now, and let further fine tuning of the
fonts happen after the 7.6 release, since I think we're looking pretty
good now.   Thanks for all your help here.

-- 
-Alan Coopersmith-alan.coopersm...@oracle.com
 Oracle Solaris Platform Engineering: X Window System

___
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: [PATCHES] Multitouch v3 - please review/test

2010-12-17 Thread Denis Dzyubenko
Hi,

On 17 December 2010 21:59, Chase Douglas chase.doug...@canonical.com wrote:

 Denis, you've been the primary user of my backport PPA. Would you like
 me to upload this update into the PPA now, or wait until this touch bug
 is fixed?

I guess it doesn't make sense to upload known to be broken packages to
ppa which is available to everyone. However I would like to be able to
test it.

Is there an easy way to have them uploaded to ppa but so that only
people who really want them be able to install?
Alternatively - is it possible to upload source packages somewhere so
that I could build them with just debuild - i.e. in an easy way for a
person who has built xorg from scratch only once?

-- 
Best regards,
Denis.
___
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: [PATCHES] Multitouch v3 - please review/test

2010-12-17 Thread Chase Douglas
On 12/17/2010 05:12 PM, Denis Dzyubenko wrote:
 Hi,
 
 On 17 December 2010 21:59, Chase Douglas chase.doug...@canonical.com wrote:
 
 Denis, you've been the primary user of my backport PPA. Would you like
 me to upload this update into the PPA now, or wait until this touch bug
 is fixed?
 
 I guess it doesn't make sense to upload known to be broken packages to
 ppa which is available to everyone. However I would like to be able to
 test it.
 
 Is there an easy way to have them uploaded to ppa but so that only
 people who really want them be able to install?
 Alternatively - is it possible to upload source packages somewhere so
 that I could build them with just debuild - i.e. in an easy way for a
 person who has built xorg from scratch only once?

You can follow the instructions at
https://wiki.ubuntu.com/Multitouch/XDevelopment#Building%20Development%20Packages
to build source packages from the git repos. I've update the
documentation to include the sources from Daniel.

There are two alternatives. I can upload source packages somewhere like
people.canonical.com. Or, I can go further and build the binary packages.

Let me know what you need.

Thanks,

-- Chase
___
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