Re: [PULL] Accumulated small input changes
On Tue, May 03, 2011 at 01:48:34AM +0100, Daniel Stone wrote: On Fri, Apr 29, 2011 at 07:34:28AM -0700, Keith Packard wrote: Reviewed-by: Keith Packard kei...@keithp.com I think that's all of them. Ta, and yes. Tree updated again (fa965fd..5bf3439). please don't pull this one yet, it introduces a bug. something with grabs breaks. test case is simply to open a gnome-terminal and try to select text, or close a window, or try click anything actually (xev that still sees the events for some reason). Haven't found the actual issue yet, but git bisect points at commit 3b9ab1dd7da48e3230f642b8e351ef76af40d1f8 Input: Make CheckPassiveGrabsOnWindow take InternalEvent Cheers, Peter ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] dix: only transform valuators when we need them.
On 05/03/2011 03:28 AM, Peter Hutterer wrote: On Mon, Apr 25, 2011 at 12:58:17PM -0400, Chase Douglas wrote: On 04/21/2011 03:35 AM, Peter Hutterer wrote: Unconditionally drop the valuators back into the mask when they were there in the first place. Otherwise, sending identical coordinates from the driver on a translated device causes the valuator mask to be alternatively overwritten with the translated value or left as-is. This leads to the device jumping around between the translated and the original position. The same could be achieved with a valuator_mask_unset() combination. Testcase: xsetwacom set device name MapToOutput VGA1 Then press a button on the device, cursor jumps between the two positions. Introduced in 31737fff08ec19b394837341d5e358ec401f5cd8 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- dix/getevents.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dix/getevents.c b/dix/getevents.c index 0fa8046..7afd330 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -1065,9 +1065,10 @@ transformAbsolute(DeviceIntPtr dev, ValuatorMask *mask) pixman_f_transform_point(dev-transform, p); -if (lround(p.v[0]) != dev-last.valuators[0]) +if (valuator_mask_isset(mask, 0)) valuator_mask_set(mask, 0, lround(p.v[0])); -if (lround(p.v[1]) != dev-last.valuators[1]) + +if (valuator_mask_isset(mask, 1)) valuator_mask_set(mask, 1, lround(p.v[1])); } Why don't we change this to: if (lround(p.v[0]) != dev-last.valuators[0]) valuator_mask_set(mask, 0, lround(p.v[0])); else valuator_mask_unset(mask, 0); The proposed fix will cause valuators to be sent with repeated values if they haven't actually changed. I think this would generally need a bigger patch set than just the above (which was my first attempt at the patch, see also the commit message) to be addressed properly. Yeah... We received a bug report for this and I started diving into it and realized it will require a bigger patch. We don't have any guidelines for drivers regarding sending identical coordinates and the server does a pretty poor job in filtering them, especially for core events. https://bugs.freedesktop.org/show_bug.cgi?id=23985 Plus the need for continuous valuator ranges in XI1 also means that even when unsetting valuators in the generation path, they may (should!) get added later anyway. Yeah. At least in the Wacom driver we need the coordinates to not be filtered when identical, for the clients' sake. the specific use-case here is sending a motion event followed by a button event. They have identical coordinates, but if a client only listens to button events and the coordinates are filtered, they cannot get the valuator values from the button event only. Good point. Reviewed-by: Chase Douglas chase.doug...@canonical.com Thanks! ___ 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 xdm] Implement ConsoleKit support.
Hi, (just witnessed I can no longer halt or reboot my computer, and ck-list-sessions pretends it's a non-local session.) Fernando Tarlá Cardoso Lemos fernando...@gmail.com (24/02/2011): Since ConsoleKit 0.4.2, the sessions created by ck-launch-session are no longer marked as local and active. This means that distributions can't simply call ck-launch-session in Xsession.d anymore to get an active local ConsoleKit session. Instead, XDM must create the session directly, providing info such as the UID of the user and the tty used to log in (like GDM does). I so like people breaking stuff which was working. I did not author this patch. I fetched it from the OpenSUSE repositories[1]. It seems to have been initially created by Takashi Iwai and perhaps adapted by Stefan Dirsch[2]. [1]: https://build.opensuse.org/package/view_file?file=xdm-consolekit.diffpackage=xorg-x11project=openSUSE:11.3:Update:Testsrcmd5=5e43d91b0bf84c8a82fc23b1cb550931 [2]: https://bugs.freedesktop.org/show_bug.cgi?id=17325 Signed-off-by: Fernando Tarlá Cardoso Lemos fernando...@gmail.com See “Signing off and reviewing” on that page: http://wiki.x.org/wiki/Development/Documentation/SubmittingPatches I guess it would be nice to have the original authors(s) of that patch to sign off on it before it can be merged. Please note that I didn't check the actual patch yet, but I might give it a try soon-ish. Mraw, KiBi. 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 xdm] Implement ConsoleKit support.
2011/2/24 Fernando Tarlá Cardoso Lemos fernando...@gmail.com: Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=17325 Since ConsoleKit 0.4.2, the sessions created by ck-launch-session are no longer marked as local and active. This means that distributions can't simply call ck-launch-session in Xsession.d anymore to get an active local ConsoleKit session. Instead, XDM must create the session directly, providing info such as the UID of the user and the tty used to log in (like GDM does). It's important that locally logged in users get active local ConsoleKit sessions because that's used by PolicyKit to determine whether certain actions are allowed or not (according to a set of policies, of course). As an example of how this can be used, UDisks can automount devices for locally logged in users without a password prompt with their default PolicyKit policy. This patch allows XDM to create a ConsoleKit session. This is disabled at build time by default, you need to enable it with --with-consolekit. It relies on a very lightweight library called libck-connector (which is distributed with ConsoleKit) to do the DBus magic required for the creation of the active local session. I did not author this patch. I fetched it from the OpenSUSE repositories[1]. It seems to have been initially created by Takashi Iwai and perhaps adapted by Stefan Dirsch[2]. [1]: https://build.opensuse.org/package/view_file?file=xdm-consolekit.diffpackage=xorg-x11project=openSUSE:11.3:Update:Testsrcmd5=5e43d91b0bf84c8a82fc23b1cb550931 [2]: https://bugs.freedesktop.org/show_bug.cgi?id=17325 Signed-off-by: Fernando Tarlá Cardoso Lemos fernando...@gmail.com --- configure.ac | 14 include/dm.h | 3 ++ man/xdm.man | 6 +++ xdm/resource.c | 13 ++- xdm/session.c | 102 5 files changed, 137 insertions(+), 1 deletions(-) diff --git a/configure.ac b/configure.ac index 38717d0..6f3f9ce 100644 --- a/configure.ac +++ b/configure.ac @@ -359,6 +359,20 @@ PKG_CHECK_MODULES(DMCP, xdmcp) PKG_CHECK_MODULES(XLIB, x11) PKG_CHECK_MODULES(AUTH, xau) +# ConsoleKit support +AC_ARG_WITH(consolekit, AC_HELP_STRING([--with-consolekit], [Use ConsoleKit]), + [USE_CONSOLEKIT=$withval], [USE_CONSOLEKIT=yes]) You say in the commit message that this defaults to off, but here this sets USE_CONSOLEKIT=yes as the default. +if test x$USE_CONSOLEKIT != xno; then + PKG_CHECK_MODULES(CK_CONNECTOR, ck-connector, + [USE_CONSOLEKIT=yes], [USE_CONSOLEKIT=no]) Here we just check if CK is available and continue whether it is or not. However, if this feature defaults to off and someone explicitly turns it on passing --with-consolekit, then I think it should fail if CK isn't available. That would make things cleaner since the following conditional would be unnecessary. It would be like: if test x$USE_CONSOLEKIT != xno; then # this will fail if ck-connector not found PKG_CHECK_MODULES(CK_CONNECTOR, ck-connector) # put actions needed for CK here fi + if test x$USE_CONSOLEKIT = xyes; then + AC_DEFINE([USE_CONSOLEKIT], 1, [Define to 1 to use ConsoleKit]) + XDM_CFLAGS=$XDM_CFLAGS $CK_CONNECTOR_CFLAGS + XDM_LIBS=$XDM_LIBS $CK_CONNECTOR_LIBS + fi +fi +dnl AM_CONDITIONAL(USE_CONSOLEKIT, test$USE_CONSOLEKIT = xyes) This last line can be removed since conditional isn't used anywhere. The code looked reasonable to me, but I didn't follow it that closely. -- Dan ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PULL] Accumulated small input changes
On Wed, 4 May 2011 16:18:58 +1000, Peter Hutterer peter.hutte...@who-t.net wrote: please don't pull this one yet, Thanks for the update; I'll sit tight. -- keith.pack...@intel.com pgpOID5fAgk9F.pgp Description: PGP signature ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH xdm] Implement ConsoleKit support.
On 05/ 4/11 02:45 AM, Cyril Brulebois wrote: I so like people breaking stuff which was working. Isn't that ConsoleKit's entire reason for existence? I've still never gotten a good explanation of what problem it's intended to solve or how it makes the system better instead of just more complicated. Even the official ConsoleKit documentation starts out by admitting they can't define the problem it solves. I did not author this patch. I fetched it from the OpenSUSE repositories[1]. It seems to have been initially created by Takashi Iwai and perhaps adapted by Stefan Dirsch[2]. [1]: https://build.opensuse.org/package/view_file?file=xdm-consolekit.diffpackage=xorg-x11project=openSUSE:11.3:Update:Testsrcmd5=5e43d91b0bf84c8a82fc23b1cb550931 [2]: https://bugs.freedesktop.org/show_bug.cgi?id=17325 Signed-off-by: Fernando Tarlá Cardoso Lemos fernando...@gmail.com See “Signing off and reviewing” on that page: http://wiki.x.org/wiki/Development/Documentation/SubmittingPatches I guess it would be nice to have the original authors(s) of that patch to sign off on it before it can be merged. Please note that I didn't check the actual patch yet, but I might give it a try soon-ish. Despite my misgivings about consolekit, I do think we'll eventually get a patch for it integrated into xdm, but that requires people who care to test and review, and not just throw a hissy fit (bug 17325) when no one else does that for them very quickly. (xdm is not high on anyone's priority list - it's not just consolekit patches that get applied slowly. Most systems use gdm or kdm.) Of course, I may change my mind given that I've just read systemd plans to force consolekit out of the system and make it impossible to run the desktop on non-Linux systems. Yay! Please, may I have more pain? -- -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
[PULL xserver] Composite ClipNotify fix and expose event elimination
The following changes since commit 5cb31cd0cbf83fff5f17a475e7b0e45246b19bf3: Merge remote-tracking branch 'jturney/remove-opengl-spec-download' (2011-04-29 09:59:49 -0700) are available in the git repository at: git://gitorious.org/vsyrjala/xserver.git composite_validatetree_2 Ville Syrjälä (6): composite: Call ValidateGC after ChangeGC composite: Initialize borderClip with current values composite: Get rid of the internal UnmapWindow+MapWindow cycle composite: Copy the window contents back from the pixmap composite: Fix pWin-redirectDraw when changing between manual and automatic redirection composite: Recompute clipping when changing between manual and automatic redirection composite/compalloc.c | 147 +++- composite/compint.h|5 +- composite/compwindow.c | 19 +- 3 files changed, 116 insertions(+), 55 deletions(-) -- Ville Syrjälä ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PULL updated] XQuartz: clang, rwlocks, and one more legacy support
The following changes since commit 5cb31cd0cbf83fff5f17a475e7b0e45246b19bf3: Merge remote-tracking branch 'jturney/remove-opengl-spec-download' (2011-04-29 09:59:49 -0700) are available in the git repository at: git://people.freedesktop.org/~jeremyhu/xserver master Jeremy Huddleston (4): XQuartz: Use a rwlock instead of a mutex to protect window_hash in the pthread case XQuartz: Fix incorrect typedefs with XPLUGIN_VERSION 4 XQuartz: Ensure that {CF,NS}_RETURNS{,_NOT}_RETAINED are defined XQuartz: prefs_copy_url and prefs_get_copy return retained objects hw/xquartz/X11Application.h |3 ++- hw/xquartz/applewmExt.h |6 +++--- hw/xquartz/sanitizedCocoa.h | 39 ++- hw/xquartz/xpr/xprFrame.c | 20 ++-- 4 files changed, 53 insertions(+), 15 deletions(-) ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PULL 1.10] GLX fix merge from master
Contains everything from my last 1.10 pull request, plus three more. --- The following changes since commit be3f41d1ec5413d0ad05ef18e145714201d602aa: dix: fix typo in direction calculation (2011-05-04 10:14:10 +1000) are available in the git repository at: ssh://people.freedesktop.org/~ajax/xserver server-1.10-iglx Adam Jackson (11): glx: Remove unused _glapi_get_proc_offset and friends glx: Simplify _glapi_check_multithread glx: Remove unused _glapi_get_proc_name glx: Add texbuffer2 support to swrast glx: Remove noop dispatch table glx: Lobotomize _glapi_get_proc_address glx: Fix _glapi_add_dispatch glx: Reimplement context tags glx: Fix lifetime tracking for pixmaps glx: Use 0 rather than garbage for unknown INTEL_swap_event types glx: Make --disable-dri not disable AIGLX configure.ac |2 +- glx/Makefile.am |6 +- glx/glapi.c | 558 + glx/glapi.h | 28 - glx/glapitemp.h | 6655 -- glx/glxcmds.c| 109 +- glx/glxdri2.c|1 + glx/glxdriswrast.c |8 + glx/glxext.c | 53 +- glx/glxserver.h |7 - hw/xquartz/GL/indirect.c |9 - 11 files changed, 91 insertions(+), 7345 deletions(-) delete mode 100644 glx/glapitemp.h - ajax signature.asc Description: This is a digitally signed message part ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH libX11 0/3] some static analysis fixups
My brain-dead self accidentally git push'd these already, but please still review in case it needs to be changed. ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH libX11 1/3] Annotate _XIOError as _X_NORETURN
Found-by: clang static analyzer Signed-off-by: Jeremy Huddleston jerem...@apple.com --- configure.ac |2 +- include/X11/Xlibint.h |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index ce86c93..a39ab8d 100644 --- a/configure.ac +++ b/configure.ac @@ -77,7 +77,7 @@ AM_CONDITIONAL(HAVE_PERL, test x$PERL != xno) # Checks for pkg-config packages # Always required -X11_REQUIRES='xproto = 7.0.13 xextproto xtrans xcb = 1.1.92' +X11_REQUIRES='xproto = 7.0.17 xextproto xtrans xcb = 1.1.92' X11_EXTRA_DEPS=xcb = 1.1.92 PKG_PROG_PKG_CONFIG() diff --git a/include/X11/Xlibint.h b/include/X11/Xlibint.h index d199a8b..3266e0d 100644 --- a/include/X11/Xlibint.h +++ b/include/X11/Xlibint.h @@ -899,7 +899,7 @@ extern int _XError( ); extern int _XIOError( Display* /* dpy */ -); +) _X_NORETURN; extern int (*_XIOErrorFunction)( Display* /* dpy */ ); -- 1.7.4.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH libX11 3/3] Dead code removal
XKBGeom.c:118:27: warning: Assigned value is always the same as the existing value for (key=row-keys,pos=k=0;krow-num_keys;k++,key++) { ~~~^~~~ XKBGeom.c:115:5: warning: Value stored to 'pos' is never read pos= 0; ^~ Found-by: clang static analyzer Signed-off-by: Jeremy Huddleston jerem...@apple.com --- src/xkb/XKBGeom.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/src/xkb/XKBGeom.c b/src/xkb/XKBGeom.c index 2365f48..71a7d4a 100644 --- a/src/xkb/XKBGeom.c +++ b/src/xkb/XKBGeom.c @@ -112,7 +112,6 @@ XkbBoundsPtrbounds,sbounds; if ((!geom)||(!section)||(!row)) return False; -pos= 0; bounds= row-bounds; bzero(bounds,sizeof(XkbBoundsRec)); for (key=row-keys,pos=k=0;krow-num_keys;k++,key++) { -- 1.7.4.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH libX11 2/3] XKB: Avoid a possible NULL dereference
XKBGeom.c:191:25: warning: Access to field 'x1' results in a dereference of a null pointer (loaded from variable 'rbounds') _XkbCheckBounds(bounds,rbounds-x1,rbounds-y1); ^~~ Found-by: clang static analyzer Signed-off-by: Jeremy Huddleston jerem...@apple.com --- src/xkb/XKBGeom.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xkb/XKBGeom.c b/src/xkb/XKBGeom.c index e9e36d0..2365f48 100644 --- a/src/xkb/XKBGeom.c +++ b/src/xkb/XKBGeom.c @@ -147,7 +147,7 @@ register inti; XkbShapePtrshape; XkbRowPtr row; XkbDoodadPtr doodad; -XkbBoundsPtr bounds,rbounds=NULL; +XkbBoundsPtr bounds,rbounds; if ((!geom)||(!section)) return False; @@ -186,7 +186,7 @@ XkbBoundsPtrbounds,rbounds=NULL; default: tbounds.x1= tbounds.x2= doodad-any.left; tbounds.y1= tbounds.y2= doodad-any.top; - break; + continue; } _XkbCheckBounds(bounds,rbounds-x1,rbounds-y1); _XkbCheckBounds(bounds,rbounds-x2,rbounds-y2); -- 1.7.4.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH libX11 2/3] XKB: Avoid a possible NULL dereference
This is the one that I especially wanted to review on the list because it doesn't sit well with me. Hitting the default switch-case in the first run through the loop results in a NULL dereference (rbounds) when calling _XkbCheckBounds. In subsequent runs, we get lucky in that rbounds was set in an earlier iteration through the loop. I'm not really familiar enough with XKB to know what is going on here. Should we be doing this: rbounds= tbounds; or should we just be skipping the check (which is what I accidentally pushed)? http://people.freedesktop.org/~jeremyhu/analyzer/yuffie/20110504-/libX11/report-F0RlNS.html#EndPath On May 4, 2011, at 11:50, Jeremy Huddleston wrote: XKBGeom.c:191:25: warning: Access to field 'x1' results in a dereference of a null pointer (loaded from variable 'rbounds') _XkbCheckBounds(bounds,rbounds-x1,rbounds-y1); ^~~ Found-by: clang static analyzer Signed-off-by: Jeremy Huddleston jerem...@apple.com --- src/xkb/XKBGeom.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xkb/XKBGeom.c b/src/xkb/XKBGeom.c index e9e36d0..2365f48 100644 --- a/src/xkb/XKBGeom.c +++ b/src/xkb/XKBGeom.c @@ -147,7 +147,7 @@ register int i; XkbShapePtr shape; XkbRowPtr row; XkbDoodadPtr doodad; -XkbBoundsPtr bounds,rbounds=NULL; +XkbBoundsPtr bounds,rbounds; if ((!geom)||(!section)) return False; @@ -186,7 +186,7 @@ XkbBoundsPtr bounds,rbounds=NULL; default: tbounds.x1= tbounds.x2= doodad-any.left; tbounds.y1= tbounds.y2= doodad-any.top; - break; + continue; } _XkbCheckBounds(bounds,rbounds-x1,rbounds-y1); _XkbCheckBounds(bounds,rbounds-x2,rbounds-y2); -- 1.7.4.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 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH xf86-video-ati 1/2] dri2: Update front buffer pixmap and name before exchanging buffers
Buffer exchange assumes that the front buffer pixmap and name information is accurate. That may not be the case eg. if the window has been (un)redirected since the buffer was created. Signed-off-by: Ville Syrjala syrj...@sci.fi --- src/radeon_dri2.c | 45 - 1 files changed, 40 insertions(+), 5 deletions(-) diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c index e618cc5..5d1a382 100644 --- a/src/radeon_dri2.c +++ b/src/radeon_dri2.c @@ -626,12 +626,42 @@ radeon_dri2_schedule_flip(ScrnInfoPtr scrn, ClientPtr client, } static Bool -can_exchange(ScrnInfoPtr pScrn, +update_front(DrawablePtr draw, DRI2BufferPtr front) +{ +int r; +PixmapPtr pixmap; +struct dri2_buffer_priv *priv = front-driverPrivate; +struct radeon_exa_pixmap_priv *driver_priv; + +if (draw-type == DRAWABLE_PIXMAP) + pixmap = (PixmapPtr)draw; +else + pixmap = (*draw-pScreen-GetWindowPixmap)((WindowPtr)draw); + +pixmap-refcnt++; + +exaMoveInPixmap(pixmap); +driver_priv = exaGetPixmapDriverPrivate(pixmap); +r = radeon_gem_get_kernel_name(driver_priv-bo, front-name); +if (r) { + (*draw-pScreen-DestroyPixmap)(pixmap); + return FALSE; +} +(*draw-pScreen-DestroyPixmap)(priv-pixmap); +front-pitch = pixmap-devKind; +front-cpp = pixmap-drawable.bitsPerPixel / 8; +priv-pixmap = pixmap; + +return TRUE; +} + +static Bool +can_exchange(ScrnInfoPtr pScrn, DrawablePtr draw, DRI2BufferPtr front, DRI2BufferPtr back) { struct dri2_buffer_priv *front_priv = front-driverPrivate; struct dri2_buffer_priv *back_priv = back-driverPrivate; -PixmapPtr front_pixmap = front_priv-pixmap; +PixmapPtr front_pixmap; PixmapPtr back_pixmap = back_priv-pixmap; xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); int i; @@ -642,6 +672,11 @@ can_exchange(ScrnInfoPtr pScrn, return FALSE; } +if (!update_front(draw, front)) + return FALSE; + +front_pixmap = front_priv-pixmap; + if (front_pixmap-drawable.width != back_pixmap-drawable.width) return FALSE; @@ -721,7 +756,7 @@ void radeon_dri2_frame_event_handler(unsigned int frame, unsigned int tv_sec, case DRI2_FLIP: if (info-allowPageFlip DRI2CanFlip(drawable) - can_exchange(scrn, event-front, event-back) + can_exchange(scrn, drawable, event-front, event-back) radeon_dri2_schedule_flip(scrn, event-client, drawable, @@ -736,7 +771,7 @@ void radeon_dri2_frame_event_handler(unsigned int frame, unsigned int tv_sec, /* else fall through to exchange/blit */ case DRI2_SWAP: if (DRI2CanExchange(drawable) - can_exchange(scrn, event-front, event-back)) { + can_exchange(scrn, drawable, event-front, event-back)) { radeon_dri2_exchange_buffers(drawable, event-front, event-back); swap_type = DRI2_EXCHANGE_COMPLETE; } else { @@ -1098,7 +1133,7 @@ static int radeon_dri2_schedule_swap(ClientPtr client, DrawablePtr draw, /* Flips need to be submitted one frame before */ if (info-allowPageFlip DRI2CanFlip(draw) - can_exchange(scrn, front, back)) { + can_exchange(scrn, draw, front, back)) { swap_type = DRI2_FLIP; flip = 1; } -- 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
xf86-video-ati page flipping fixes
I came to the conclusion that the xserver DRI2 invalidate patches that have been discussed aren't really fixing the problem. I suppose they may make the problem slightly less likely to happen, but at least for me that likelyhood is still very high. The whole mess looks like a simple driver bug to me. These patches make unredirecting fullscreen windows w/ compiz + page flipping work a lot better for me. I've still seen an occasional complain from the kernel [1] and one time the kernel went into some infinite page fault loop, printing stuff endlessly to the console, but other than those things seem much more solid now. [1] [drm:radeon_crtc_page_flip] *ERROR* failed to reserve new rbo buffer before flip ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH xf86-video-ati 2/2] kms: Move flip_count and co. to a per swap structure
If multiple drawables are doing page flipping, the global drmmode structure can't be used to keep per swap information. For example flip_count can increase prematurely due to another swap request, and then the previous swap request never gets completed, leading to a stuck client. Move the relevant pieces of data to a strucuture that gets allocated once per swap request and shared by all involved CRTCs. Signed-off-by: Ville Syrjala syrj...@sci.fi --- src/drmmode_display.c | 45 ++--- src/drmmode_display.h | 10 +++--- 2 files changed, 33 insertions(+), 22 deletions(-) diff --git a/src/drmmode_display.c b/src/drmmode_display.c index 7873d57..7dd5d86 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -1331,31 +1331,34 @@ drmmode_flip_handler(int fd, unsigned int frame, unsigned int tv_sec, unsigned int tv_usec, void *event_data) { drmmode_flipevtcarrier_ptr flipcarrier = event_data; - drmmode_ptr drmmode = flipcarrier-drmmode; + drmmode_flipdata_ptr flipdata = flipcarrier-flipdata; + drmmode_ptr drmmode = flipdata-drmmode; /* Is this the event whose info shall be delivered to higher level? */ if (flipcarrier-dispatch_me) { /* Yes: Cache msc, ust for later delivery. */ - drmmode-fe_frame = frame; - drmmode-fe_tv_sec = tv_sec; - drmmode-fe_tv_usec = tv_usec; + flipdata-fe_frame = frame; + flipdata-fe_tv_sec = tv_sec; + flipdata-fe_tv_usec = tv_usec; } free(flipcarrier); /* Last crtc completed flip? */ - drmmode-flip_count--; - if (drmmode-flip_count 0) + flipdata-flip_count--; + if (flipdata-flip_count 0) return; /* Release framebuffer */ - drmModeRmFB(drmmode-fd, drmmode-old_fb_id); + drmModeRmFB(drmmode-fd, flipdata-old_fb_id); - if (drmmode-event_data == NULL) + if (flipdata-event_data == NULL) return; /* Deliver cached msc, ust from reference crtc to flip event handler */ - radeon_dri2_flip_event_handler(drmmode-fe_frame, drmmode-fe_tv_sec, - drmmode-fe_tv_usec, drmmode-event_data); + radeon_dri2_flip_event_handler(flipdata-fe_frame, flipdata-fe_tv_sec, + flipdata-fe_tv_usec, flipdata-event_data); + + free(flipdata); } @@ -1399,12 +1402,10 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp) xf86InitialConfiguration(pScrn, TRUE); - drmmode-flip_count = 0; drmmode-event_context.version = DRM_EVENT_CONTEXT_VERSION; drmmode-event_context.vblank_handler = drmmode_vblank_handler; drmmode-event_context.page_flip_handler = drmmode_flip_handler; if (!pRADEONEnt-fd_wakeup_registered info-dri-pKernelDRMVersion-version_minor = 4) { - drmmode-flip_count = 0; AddGeneralSocket(drmmode-fd); RegisterBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA, drm_wakeup_handler, drmmode); @@ -1654,6 +1655,7 @@ Bool radeon_do_pageflip(ScrnInfoPtr scrn, struct radeon_bo *new_front, void *dat int i, old_fb_id; uint32_t tiling_flags = 0; int height; + drmmode_flipdata_ptr flipdata; drmmode_flipevtcarrier_ptr flipcarrier; if (info-allowColorTiling) { @@ -1676,6 +1678,12 @@ Bool radeon_do_pageflip(ScrnInfoPtr scrn, struct radeon_bo *new_front, void *dat new_front-handle, drmmode-fb_id)) goto error_out; +flipdata = calloc(1, sizeof(drmmode_flipdata_rec)); +if (!flipdata) { + xf86DrvMsg(scrn-scrnIndex, X_WARNING, +flip queue: data alloc failed.\n); + goto error_undo; +} /* * Queue flips on all enabled CRTCs * Note that if/when we get per-CRTC buffers, we'll have to update this. @@ -1685,16 +1693,15 @@ Bool radeon_do_pageflip(ScrnInfoPtr scrn, struct radeon_bo *new_front, void *dat * Also, flips queued on disabled or incorrectly configured displays * may never complete; this is a configuration error. */ - drmmode-fe_frame = 0; - drmmode-fe_tv_sec = 0; - drmmode-fe_tv_usec = 0; + +flipdata-event_data = data; +flipdata-drmmode = drmmode; for (i = 0; i config-num_crtc; i++) { if (!config-crtc[i]-enabled) continue; - drmmode-event_data = data; - drmmode-flip_count++; + flipdata-flip_count++; drmmode_crtc = config-crtc[i]-driver_private; flipcarrier = calloc(1, sizeof(drmmode_flipevtcarrier_rec)); @@ -1708,7 +1715,7 @@ Bool radeon_do_pageflip(ScrnInfoPtr scrn, struct
Re: [PATCH] glxproto: make GLX swap event struct match spec
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/03/2011 02:08 PM, Jesse Barnes wrote: On Tue, 3 May 2011 14:02:31 -0700 Jesse Barnes jbar...@virtuousgeek.org wrote: On Tue, 03 May 2011 13:54:38 -0700 Keith Packard kei...@keithp.com wrote: On Tue, 3 May 2011 12:21:24 -0700, Jesse Barnes jbar...@virtuousgeek.org wrote: We only spec a 32 bit swap count, so drop the high sbc field. You're missing the explicit 16-bit padding field after 'event_type' The documented encoding http://www.opengl.org/registry/specs/INTEL/swap_event.txt needs to be fixed to match this, it has the padding at the end which leaves most of the structure mis-aligned. Right, another case where we updated the spec incorrectly then failed to make the code match the broken definition (the complete enums also need to match the final values, which are correct in the first part of the spec). Yay for divergence. Fixed version below. Does this need the B16 cruft? -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iEYEARECAAYFAk3BzwQACgkQX1gOwKyEAw/SowCfaAm1gxkowryhD2ku9oPMlaUY YyoAniZgXMFszpUBwnJH17JDyZwtsOw+ =k7tr -END PGP SIGNATURE- ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [Mesa-dev] [PATCH] glxproto: make GLX swap event struct match spec
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/03/2011 12:21 PM, Jesse Barnes wrote: We only spec a 32 bit swap count, so drop the high sbc field. Signed-off-by: Jesse Barnes jbar...@virtuousgeek.org Is there any way we could do this and NOT break building older versions of Mesa? I'd like to be able to build 7.9, 7.10, and master on my system without having two different versions of glproto. --- configure.ac |2 +- glxproto.h |3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index d88e6df..a3047e4 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ([2.60]) -AC_INIT([GLProto], [1.4.12], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg]) +AC_INIT([GLProto], [1.4.13], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) AM_MAINTAINER_MODE diff --git a/glxproto.h b/glxproto.h index 0ff44e3..a6018a1 100644 --- a/glxproto.h +++ b/glxproto.h @@ -1380,8 +1380,7 @@ typedef struct { CARD32 ust_lo B32; CARD32 msc_hi B32; CARD32 msc_lo B32; -CARD32 sbc_hi B32; -CARD32 sbc_lo B32; +CARD32 sbc B32; } xGLXBufferSwapComplete; // -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iEYEARECAAYFAk3B0HsACgkQX1gOwKyEAw+27gCeLgSzv2Yjq7NQF+3QjeoXS8J0 qoQAn3n+Q8ujE3JFwpAyCM9TYtZ13wy0 =OkZ2 -END PGP SIGNATURE- ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH libX11 3/3] Dead code removal
On Wed, May 04, 2011 at 11:50:49AM -0700, Jeremy Huddleston wrote: XKBGeom.c:118:27: warning: Assigned value is always the same as the existing value for (key=row-keys,pos=k=0;krow-num_keys;k++,key++) { ~~~^~~~ XKBGeom.c:115:5: warning: Value stored to 'pos' is never read pos= 0; ^~ Found-by: clang static analyzer Signed-off-by: Jeremy Huddleston jerem...@apple.com --- src/xkb/XKBGeom.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/src/xkb/XKBGeom.c b/src/xkb/XKBGeom.c index 2365f48..71a7d4a 100644 --- a/src/xkb/XKBGeom.c +++ b/src/xkb/XKBGeom.c @@ -112,7 +112,6 @@ XkbBoundsPtr bounds,sbounds; if ((!geom)||(!section)||(!row)) return False; -pos= 0; bounds= row-bounds; bzero(bounds,sizeof(XkbBoundsRec)); for (key=row-keys,pos=k=0;krow-num_keys;k++,key++) { -- 1.7.4.1 fwiw, Reviewed-by: Peter Hutterer peter.hutte...@who-t.net Cheers, Peter ___ 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] Make swap event handling match the spec
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/03/2011 12:21 PM, Jesse Barnes wrote: Ian reminded me that we changed the spec to fit within an XEvent, but we never updated the code to match. This set of patches (much simpler than the last) does just that. Wrapping support can be added to Mesa if we really want 64 bit values, but that means checking the drawable sbc and adding whenver sbc hits 0. 3/4, 4/4, 5/6, and 6/6: Reviewed-by: Ian Romanick ian.d.roman...@intel.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iEYEARECAAYFAk3B0pAACgkQX1gOwKyEAw8JmwCeKgOPMC733wwz5zCP1OuSYX7f h+wAn05XZhh6akmfUyuaJ2THREQEaDsw =FzuP -END PGP SIGNATURE- ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH libX11 2/3] XKB: Avoid a possible NULL dereference
On Wed, May 04, 2011 at 12:41:57PM -0700, Jeremy Huddleston wrote: This is the one that I especially wanted to review on the list because it doesn't sit well with me. Hitting the default switch-case in the first run through the loop results in a NULL dereference (rbounds) when calling _XkbCheckBounds. In subsequent runs, we get lucky in that rbounds was set in an earlier iteration through the loop. I'm not really familiar enough with XKB to know what is going on here. Should we be doing this: rbounds= tbounds; I think this assigment is the better choice. AIUI, theoretically if we skip the check we may have a default doodad that's outside the section boundaries. Not that it matters much (it's geometry, it doesn't really matter anyway), but by using the above you at least clip it down to the allowed area. given that we haven't seen any actual issues yet, it suggests that this code is never hit by our current layouts. Cheers, Peter or should we just be skipping the check (which is what I accidentally pushed)? http://people.freedesktop.org/~jeremyhu/analyzer/yuffie/20110504-/libX11/report-F0RlNS.html#EndPath On May 4, 2011, at 11:50, Jeremy Huddleston wrote: XKBGeom.c:191:25: warning: Access to field 'x1' results in a dereference of a null pointer (loaded from variable 'rbounds') _XkbCheckBounds(bounds,rbounds-x1,rbounds-y1); ^~~ Found-by: clang static analyzer Signed-off-by: Jeremy Huddleston jerem...@apple.com --- src/xkb/XKBGeom.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xkb/XKBGeom.c b/src/xkb/XKBGeom.c index e9e36d0..2365f48 100644 --- a/src/xkb/XKBGeom.c +++ b/src/xkb/XKBGeom.c @@ -147,7 +147,7 @@ register inti; XkbShapePtr shape; XkbRowPtr row; XkbDoodadPtrdoodad; -XkbBoundsPtr bounds,rbounds=NULL; +XkbBoundsPtr bounds,rbounds; if ((!geom)||(!section)) return False; @@ -186,7 +186,7 @@ XkbBoundsPtrbounds,rbounds=NULL; default: tbounds.x1= tbounds.x2= doodad-any.left; tbounds.y1= tbounds.y2= doodad-any.top; - break; + continue; } _XkbCheckBounds(bounds,rbounds-x1,rbounds-y1); _XkbCheckBounds(bounds,rbounds-x2,rbounds-y2); -- 1.7.4.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH] input: change CHECKEVENT macro to verify_internal_event function
The macro is sufficient if called during a development cycle, but not sufficient information when triggered by a user (e.g. https://bugzilla.redhat.com/show_bug.cgi?id=688693). Expand what this does to print the event content and a backtrace, so at least we know where we're coming from. Only the first 32 bytes are printed since if something goes wrong, the event we have is almost certainly an xEvent or xError, both restricted to 32 bytes. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- Xi/exevents.c|3 ++- dix/events.c |4 ++-- dix/inpututils.c | 28 include/eventstr.h |4 include/inpututils.h |2 ++ mi/mieq.c| 10 +- 6 files changed, 39 insertions(+), 12 deletions(-) diff --git a/Xi/exevents.c b/Xi/exevents.c index 76d5c37..d48d397 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 inpututils.h #include X11/extensions/XKBproto.h #include xkbsrv.h @@ -920,7 +921,7 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device) DeviceIntPtr mouse = NULL, kbd = NULL; DeviceEvent *event = ev-device_event; -CHECKEVENT(ev); +verify_internal_event(ev); if (ev-any.type == ET_RawKeyPress || ev-any.type == ET_RawKeyRelease || diff --git a/dix/events.c b/dix/events.c index 3a90c50..feedff5 100644 --- a/dix/events.c +++ b/dix/events.c @@ -2375,7 +2375,7 @@ DeliverDeviceEvents(WindowPtr pWin, InternalEvent *event, GrabPtr grab, xEvent *xE = NULL, *core = NULL; int rc, mask, count = 0; -CHECKEVENT(event); +verify_internal_event(event); while (pWin) { @@ -2721,7 +2721,7 @@ CheckMotion(DeviceEvent *ev, DeviceIntPtr pDev) WindowPtr prevSpriteWin, newSpriteWin; SpritePtr pSprite = pDev-spriteInfo-sprite; -CHECKEVENT(ev); +verify_internal_event(ev); prevSpriteWin = pSprite-win; diff --git a/dix/inpututils.c b/dix/inpututils.c index 077ffce..aeace6e 100644 --- a/dix/inpututils.c +++ b/dix/inpututils.c @@ -36,6 +36,7 @@ #include xkbsrv.h #include xkbstr.h #include inpututils.h +#include eventstr.h /* Check if a button map change is okay with the device. * Returns -1 for BadValue, as it collides with MappingBusy. */ @@ -556,3 +557,30 @@ CountBits(const uint8_t *mask, int len) return ret; } + +/** + * Verifies sanity of the event. If the event is not an internal event, + * memdumps the first 32 bytes of event to the log, a backtrace, then kill + * the server. + */ +void verify_internal_event(const InternalEvent *ev) +{ +if (ev ev-any.header != ET_Internal) +{ +int i; +unsigned char *data = (unsigned char*)ev; + +ErrorF(dix: invalid event type %d\n, ev-any.header); + +for (i = 0; i sizeof(xEvent); i++, data++) +{ +ErrorF(%02hx , *data); + +if ((i % 8) == 7) +ErrorF(\n); +} + +xorg_backtrace(); +FatalError(Wrong event type %d. Aborting server\n, ev-any.header); +} +} diff --git a/include/eventstr.h b/include/eventstr.h index 673207c..049688c 100644 --- a/include/eventstr.h +++ b/include/eventstr.h @@ -68,10 +68,6 @@ enum EventType { ET_Internal = 0xFF /* First byte */ }; -#define CHECKEVENT(ev) if (ev ((InternalEvent*)(ev))-any.header != 0xFF) \ - FatalError(Wrong event type %d.\n, \ - ((InternalEvent*)(ev))-any.header); - /** * Used for ALL input device events internal in the server until * copied into the matching protocol event. diff --git a/include/inpututils.h b/include/inpututils.h index b8ca6ab..92a7543 100644 --- a/include/inpututils.h +++ b/include/inpututils.h @@ -37,4 +37,6 @@ struct _ValuatorMask { int valuators[MAX_VALUATORS]; /* valuator data */ }; +extern void verify_internal_event(const InternalEvent *ev); + #endif diff --git a/mi/mieq.c b/mi/mieq.c index 08a0c87..3e6f931 100644 --- a/mi/mieq.c +++ b/mi/mieq.c @@ -156,7 +156,7 @@ mieqEnqueue(DeviceIntPtr pDev, InternalEvent *e) pthread_mutex_lock(miEventQueueMutex); #endif -CHECKEVENT(e); +verify_internal_event(e); /* avoid merging events from different devices */ if (e-any.type == ET_Motion) @@ -292,8 +292,8 @@ static void FixUpEventForMaster(DeviceIntPtr mdev, DeviceIntPtr sdev, InternalEvent* original, InternalEvent *master) { -CHECKEVENT(original); -CHECKEVENT(master); +verify_internal_event(original); +verify_internal_event(master); /* Ensure chained button mappings, i.e. that the detail field is the * value of the mapped button on the SD, not the physical button */ if (original-any.type == ET_ButtonPress || @@ -323,7 +323,7 @@ CopyGetMasterEvent(DeviceIntPtr sdev, int type = original-any.type; int mtype; /* which
[PATCH xinput 1/2] Silence compiler warning
Static analysis claims that ptr += size may assign garbage. But since the protocol requires format to be 8, 16 or 32, size should always have a valid value. Initialize to 0 to shut up clang. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- src/property.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/property.c b/src/property.c index f8b21c7..87f9fc6 100644 --- a/src/property.c +++ b/src/property.c @@ -59,7 +59,7 @@ print_property(Display *dpy, XDevice* dev, Atom property) int act_format; unsigned long nitems, bytes_after; unsigned char *data, *ptr; -int j, done = False, size; +int j, done = False, size = 0; name = XGetAtomName(dpy, property); printf(\t%s (%ld):\t, name, property); -- 1.7.4.4 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH xinput 2/2] Initialize a few more values to defaults.
If we ever print undefined for those, we have a buggy X server that's breaking the protocol. Until that happens this is just to shut up clang. All three are assigned constant strings only, no free() needed. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- src/test_xi2.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/test_xi2.c b/src/test_xi2.c index 5b56397..3c3fee3 100644 --- a/src/test_xi2.c +++ b/src/test_xi2.c @@ -99,7 +99,7 @@ static void print_hierarchychangedevent(XIHierarchyEvent *event) for (i = 0; i event-num_info; i++) { -char *use; +char *use = undefined; switch(event-info[i].use) { case XIMasterPointer: use = master pointer; break; @@ -149,7 +149,8 @@ static void print_rawevent(XIRawEvent *event) static void print_enterleave(XILeaveEvent* event) { -char *mode, *detail; +char *mode = undefined, + *detail = undefined; int i; printf(device: %d (%d)\n, event-deviceid, event-sourceid); -- 1.7.4.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: [Mesa-dev] [PATCH] glxproto: make GLX swap event struct match spec
On Wed, 04 May 2011 15:17:31 -0700 Ian Romanick i...@freedesktop.org wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/03/2011 12:21 PM, Jesse Barnes wrote: We only spec a 32 bit swap count, so drop the high sbc field. Signed-off-by: Jesse Barnes jbar...@virtuousgeek.org Is there any way we could do this and NOT break building older versions of Mesa? I'd like to be able to build 7.9, 7.10, and master on my system without having two different versions of glproto. We did that the last time glproto bumped (kept the req at 1.4.10 and added ifdefs), but that added bugs that we didn't find for awhile, so I wanted to try to avoid it this time. Another option for you would be to build 7.9, 7.10, and master against different install roots with PKG_CONFIG_PATH set appropriately... -- Jesse Barnes, Intel Open Source Technology Center ___ 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] [PATCH] glxproto: make GLX swap event struct match spec
On Wed, 4 May 2011 16:16:37 -0700 Jesse Barnes jbar...@virtuousgeek.org wrote: On Wed, 04 May 2011 15:17:31 -0700 Ian Romanick i...@freedesktop.org wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/03/2011 12:21 PM, Jesse Barnes wrote: We only spec a 32 bit swap count, so drop the high sbc field. Signed-off-by: Jesse Barnes jbar...@virtuousgeek.org Is there any way we could do this and NOT break building older versions of Mesa? I'd like to be able to build 7.9, 7.10, and master on my system without having two different versions of glproto. We did that the last time glproto bumped (kept the req at 1.4.10 and added ifdefs), but that added bugs that we didn't find for awhile, so I wanted to try to avoid it this time. Another option for you would be to build 7.9, 7.10, and master against different install roots with PKG_CONFIG_PATH set appropriately... Or just backport the fix to 7.x :) The server is only sending 32 bytes regardless, so having the fix in older client library versions will give either the right sbc number (if the server is new) or 0 if the server is old (unless you've wrapped the sbc_lo field and sbc_hi is set). So an improvement either way. -- Jesse Barnes, Intel Open Source Technology Center ___ 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 xinput 2/2] Initialize a few more values to defaults.
Thanks, Reviewed-by: Jeremy Huddleston jerem...@apple.com On May 4, 2011, at 4:14 PM, Peter Hutterer wrote: If we ever print undefined for those, we have a buggy X server that's breaking the protocol. Until that happens this is just to shut up clang. All three are assigned constant strings only, no free() needed. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- src/test_xi2.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/test_xi2.c b/src/test_xi2.c index 5b56397..3c3fee3 100644 --- a/src/test_xi2.c +++ b/src/test_xi2.c @@ -99,7 +99,7 @@ static void print_hierarchychangedevent(XIHierarchyEvent *event) for (i = 0; i event-num_info; i++) { -char *use; +char *use = undefined; switch(event-info[i].use) { case XIMasterPointer: use = master pointer; break; @@ -149,7 +149,8 @@ static void print_rawevent(XIRawEvent *event) static void print_enterleave(XILeaveEvent* event) { -char *mode, *detail; +char *mode = undefined, + *detail = undefined; int i; printf(device: %d (%d)\n, event-deviceid, event-sourceid); -- 1.7.4.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 xinput 1/2] Silence compiler warning
Reviewed-by: Jeremy Huddleston jerem...@apple.com On May 4, 2011, at 4:14 PM, Peter Hutterer wrote: Static analysis claims that ptr += size may assign garbage. But since the protocol requires format to be 8, 16 or 32, size should always have a valid value. Initialize to 0 to shut up clang. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- src/property.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/property.c b/src/property.c index f8b21c7..87f9fc6 100644 --- a/src/property.c +++ b/src/property.c @@ -59,7 +59,7 @@ print_property(Display *dpy, XDevice* dev, Atom property) int act_format; unsigned long nitems, bytes_after; unsigned char *data, *ptr; -int j, done = False, size; +int j, done = False, size = 0; name = XGetAtomName(dpy, property); printf(\t%s (%ld):\t, name, property); -- 1.7.4.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
Post-1.5.0 cleanup for xf86-input-acecad
Hi, nothing fancy, I hope. Just addressing a few compiler warnings, and following Peter's suggestion, dropping support for input ABI 12. Mraw, KiBi. ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH:xf86-input-acecad 2/6] Silence gcc: report_{x, y} are getting initialized.
Get us rid of: | CC acecad.lo | acecad.c: In function 'USBReadInput': | acecad.c:1052:43: warning: 'report_y' may be used uninitialized in this function [-Wuninitialized] | acecad.c:1052:43: warning: 'report_x' may be used uninitialized in this function [-Wuninitialized] Both code paths (with XORG_BOTCHED_INPUT or not) will lead report_x and report_y to be set, but make sure the compiler stops guessing. Signed-off-by: Cyril Brulebois k...@debian.org --- src/acecad.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/acecad.c b/src/acecad.c index f5a2213..1e2f0c0 100644 --- a/src/acecad.c +++ b/src/acecad.c @@ -919,7 +919,7 @@ USBReadInput (InputInfoPtr local) int x = priv-acecadOldX; int y = priv-acecadOldY; int z = priv-acecadOldZ; -int report_x, report_y; +int report_x = 0, report_y = 0; int prox = priv-acecadOldProximity; int buttons = priv-acecadOldButtons; int is_core_pointer = 0; -- 1.7.4.4 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH:xf86-input-acecad 4/6] Drop support for pre-input ABI 12 servers.
Signed-off-by: Cyril Brulebois k...@debian.org --- configure.ac |2 +- src/acecad.c | 75 +++-- src/acecad.h |5 3 files changed, 5 insertions(+), 77 deletions(-) diff --git a/configure.ac b/configure.ac index 4c76754..5b11092 100644 --- a/configure.ac +++ b/configure.ac @@ -55,7 +55,7 @@ AC_CHECK_HEADERS([linux/input.h sysfs/libsysfs.h]) XORG_DRIVER_CHECK_EXT(RANDR, randrproto) # Obtain compiler/linker options from server and required extensions -PKG_CHECK_MODULES(XORG, [xorg-server = 1.0.99.901] xproto kbproto inputproto $REQUIRED_MODULES) +PKG_CHECK_MODULES(XORG, [xorg-server = 1.9.99.1] xproto kbproto inputproto $REQUIRED_MODULES) # Define a configure option for an alternate input module directory AC_ARG_WITH(xorg-module-dir, diff --git a/src/acecad.c b/src/acecad.c index d60b3b6..17e141f 100644 --- a/src/acecad.c +++ b/src/acecad.c @@ -90,6 +90,10 @@ #endif #define DBG(lvl, f) {if ((lvl) = xf86GetVerbosity()) f;} +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) 12 +#error XINPUT ABI 12 required. +#endif + /* * Local Headers / @@ -331,66 +335,8 @@ ProbeFound: #endif -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) 12 -static int NewAceCadPreInit(InputDriverPtr drv, InputInfoPtr dev, int flags); - -static InputInfoPtr -AceCadPreInit(InputDriverPtr drv, IDevPtr dev, int flags) -{ -InputInfoPtr local = xf86AllocateInput(drv, 0); -AceCadPrivatePtr priv = calloc (1, sizeof(AceCadPrivateRec)); - -if ((!local)) -goto SetupProc_fail; - -local-name = dev-identifier; -local-type_name = XI_TABLET; -local-flags = XI86_SEND_DRAG_EVENTS; -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0 -local-motion_history_proc = xf86GetMotionEvents; -#endif -local-control_proc = NULL; -local-switch_mode = NULL; -local-conversion_proc = ConvertProc; -local-reverse_conversion_proc = ReverseConvertProc; -local-dev = NULL; -local-private = priv; -local-private_flags = 0; -local-conf_idev = dev; -/*local-always_core_feedback = 0;*/ - -xf86CollectInputOptions(local, default_options, NULL); - -xf86OptionListReport(local-options); - -if (NewAceCadPreInit(drv, local, flags) == Success) -return local; - -SetupProc_fail: -return NULL; -} - -static Bool -ReverseConvertProc (InputInfoPtr local, -int x, int y, -int *valuators) -{ -AceCadPrivatePtr priv = (AceCadPrivatePtr)(local-private); - -// xf86Msg(X_INFO, %s: reverse coordinate conversion in : %d, %d\n, local-name, x, y); -valuators[0] = x * priv-acecadMaxX / screenInfo.screens[0]-width; -valuators[1] = y * priv-acecadMaxY / screenInfo.screens[0]-height; -// xf86Msg(X_INFO, %s: reverse coordinate conversion out: %d, %d\n, local-name, valuators[0], valuators[1]); - -return TRUE; -} - -static int -NewAceCadPreInit(InputDriverPtr drv, InputInfoPtr local, int flags) -#else static int AceCadPreInit(InputDriverPtr drv, InputInfoPtr local, int flags) -#endif { AceCadPrivatePtr priv = calloc (1, sizeof(AceCadPrivateRec)); int speed; @@ -500,10 +446,6 @@ AceCadPreInit(InputDriverPtr drv, InputInfoPtr local, int flags) xf86ProcessCommonOptions(local, local-options); -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) 12 -local-flags |= XI86_CONFIGURED; -#endif - if (local-fd != -1) { RemoveEnabledDevice (local-fd); @@ -709,9 +651,6 @@ DeviceInit (DeviceIntPtr dev) #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) = 7 axes_labels, #endif -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) 3 -xf86GetMotionEvents, -#endif history_size, ((priv-flags ABSOLUTE_FLAG)? Absolute: Relative)|OutOfProximity) == FALSE) @@ -818,9 +757,6 @@ ReadInput (InputInfoPtr local) /*xf86Msg(X_INFO, ACECAD Tablet Read Input\n);*/ is_absolute = (priv-flags ABSOLUTE_FLAG); -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0 -is_core_pointer = xf86IsCorePointer(local-dev); -#endif /* * set blocking to -1 on the first call because we know there is data to @@ -923,9 +859,6 @@ USBReadInput (InputInfoPtr local) int prox = priv-acecadOldProximity; int buttons = priv-acecadOldButtons; int is_core_pointer = 0; -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0 -is_core_pointer = xf86IsCorePointer(local-dev); -#endif /* Is autodev active? */ int autodev = priv-flags AUTODEV_FLAG; /* Was the device available last time we checked? */ diff --git a/src/acecad.h b/src/acecad.h index bd8e997..b9291c7 100644 --- a/src/acecad.h +++ b/src/acecad.h @@ -105,12 +105,7 @@ static Bool ConvertProc (InputInfoPtr, int, int, int, int, int, int, int, int, i static Bool QueryHardware (AceCadPrivatePtr); static void NewPacket (AceCadPrivatePtr priv);
[PATCH:xf86-input-acecad 3/6] Fix “initialization from incompatible pointer type” for default_options.
InputDriverRec's last field is a char**, not a const char**, fix this warning accordingly: | CC acecad.lo | acecad.c:132:1: warning: initialization from incompatible pointer type [enabled by default] | acecad.c:132:1: warning: (near initialization for 'ACECAD.default_options') [enabled by default] Signed-off-by: Cyril Brulebois k...@debian.org --- src/acecad.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/acecad.c b/src/acecad.c index 1e2f0c0..d60b3b6 100644 --- a/src/acecad.c +++ b/src/acecad.c @@ -106,7 +106,7 @@ /* max number of input events to read in one read call */ #define MAX_EVENTS 50 -static const char *default_options[] = +static char *default_options[] = { BaudRate, 9600, StopBits, 1, -- 1.7.4.4 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH:xf86-input-acecad 5/6] Remove checks on the ABI now that 12 or higher is required.
Signed-off-by: Cyril Brulebois k...@debian.org --- src/acecad.c | 22 -- 1 files changed, 0 insertions(+), 22 deletions(-) diff --git a/src/acecad.c b/src/acecad.c index 17e141f..de2577e 100644 --- a/src/acecad.c +++ b/src/acecad.c @@ -79,10 +79,8 @@ #endif #endif -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) = 7 #include X11/Xatom.h #include xserver-properties.h -#endif /* Previously found in xf86Xinput.h */ #ifdef DBG @@ -130,9 +128,7 @@ _X_EXPORT InputDriverRec ACECAD = AceCadPreInit, NULL, NULL, -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) = 12 default_options -#endif }; static XF86ModuleVersionInfo VersionRec = @@ -599,7 +595,6 @@ DeviceInit (DeviceIntPtr dev) AceCadPrivatePtr priv = (AceCadPrivatePtr) (local-private); unsigned char map[] = {0, 1, 2, 3}; int history_size; -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) = 7 Atom btn_labels[3]; Atom axes_labels[3]; @@ -618,15 +613,12 @@ DeviceInit (DeviceIntPtr dev) axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y); axes_labels[2] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Z); } -#endif xf86MsgVerb(X_INFO, 4, %s Init\n, local-name); /* 3 boutons */ if (InitButtonClassDeviceStruct (dev, 3, -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) = 7 btn_labels, -#endif map) == FALSE) { xf86Msg(X_ERROR, %s: unable to allocate ButtonClassDeviceStruct\n, local-name); @@ -648,9 +640,7 @@ DeviceInit (DeviceIntPtr dev) /* 3 axes */ if (InitValuatorClassDeviceStruct (dev, 3, -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) = 7 axes_labels, -#endif history_size, ((priv-flags ABSOLUTE_FLAG)? Absolute: Relative)|OutOfProximity) == FALSE) @@ -663,9 +653,7 @@ DeviceInit (DeviceIntPtr dev) InitValuatorAxisStruct(dev, 0, -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) = 7 axes_labels[0], -#endif 0, /* min val */ #if XORG_BOTCHED_INPUT screenInfo.screens[0]-width, @@ -675,15 +663,11 @@ DeviceInit (DeviceIntPtr dev) 1000, /* resolution */ 0, /* min_res */ 1000 /* max_res */ -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) = 12 , Absolute -#endif ); InitValuatorAxisStruct(dev, 1, -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) = 7 axes_labels[1], -#endif 0, /* min val */ #if XORG_BOTCHED_INPUT screenInfo.screens[0]-height, @@ -693,23 +677,17 @@ DeviceInit (DeviceIntPtr dev) 1000, /* resolution */ 0, /* min_res */ 1000 /* max_res */ -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) = 12 , Absolute -#endif ); InitValuatorAxisStruct(dev, 2, -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) = 7 axes_labels[2], -#endif 0, /* min val */ priv-acecadMaxZ, /* max val */ 1000, /* resolution */ 0, /* min_res */ 1000 /* max_res */ -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) = 12 , Absolute -#endif ); } -- 1.7.4.4 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH:xf86-input-acecad 6/6] Remove pointless checks on is_core_pointer.
Signed-off-by: Cyril Brulebois k...@debian.org --- src/acecad.c | 39 +-- 1 files changed, 17 insertions(+), 22 deletions(-) diff --git a/src/acecad.c b/src/acecad.c index de2577e..ad6d793 100644 --- a/src/acecad.c +++ b/src/acecad.c @@ -729,7 +729,7 @@ ReadInput (InputInfoPtr local) { int x, y, z; int prox, buttons; -int is_core_pointer = 0, is_absolute; +int is_absolute; AceCadPrivatePtr priv = (AceCadPrivatePtr) (local-private); /*xf86Msg(X_INFO, ACECAD Tablet Read Input\n);*/ @@ -772,11 +772,10 @@ ReadInput (InputInfoPtr local) if (prox) { if (!(priv-acecadOldProximity)) -if (!is_core_pointer) -{ -/*xf86Msg(X_INFO, ACECAD Tablet ProxIN %d %d %d\n,x, y, z);*/ -xf86PostProximityEvent(local-dev, 1, 0, 3 , x, y, z); -} +{ +/*xf86Msg(X_INFO, ACECAD Tablet ProxIN %d %d %d\n,x, y, z);*/ +xf86PostProximityEvent(local-dev, 1, 0, 3 , x, y, z); +} if ((is_absolute ((priv-acecadOldX != x) || (priv-acecadOldY != y) || (priv-acecadOldZ != z))) || (!is_absolute (x || y))) @@ -809,12 +808,11 @@ ReadInput (InputInfoPtr local) } else { -if (!is_core_pointer) -if (priv-acecadOldProximity) -{ -/*xf86Msg(X_INFO, ACECAD Tablet ProxOUT %d %d %d\n,x, y, z);*/ -xf86PostProximityEvent(local-dev, 0, 0, 3, x,y,z); -} +if (priv-acecadOldProximity) +{ +/*xf86Msg(X_INFO, ACECAD Tablet ProxOUT %d %d %d\n,x, y, z);*/ +xf86PostProximityEvent(local-dev, 0, 0, 3, x,y,z); +} priv-acecadOldProximity = 0; } } @@ -836,7 +834,6 @@ USBReadInput (InputInfoPtr local) int report_x = 0, report_y = 0; int prox = priv-acecadOldProximity; int buttons = priv-acecadOldButtons; -int is_core_pointer = 0; /* Is autodev active? */ int autodev = priv-flags AUTODEV_FLAG; /* Was the device available last time we checked? */ @@ -935,10 +932,9 @@ USBReadInput (InputInfoPtr local) report_y = y; #endif if (!(priv-acecadOldProximity)) -if (!is_core_pointer) -{ -xf86PostProximityEvent(local-dev, 1, 0, 3 , report_x, report_y, z); -} +{ +xf86PostProximityEvent(local-dev, 1, 0, 3 , report_x, report_y, z); +} xf86PostMotionEvent(local-dev, 1, 0, 3, report_x, report_y, z); @@ -957,11 +953,10 @@ USBReadInput (InputInfoPtr local) } else { -if (!is_core_pointer) -if (priv-acecadOldProximity) -{ -xf86PostProximityEvent(local-dev, 0, 0, 3, report_x, report_y, z); -} +if (priv-acecadOldProximity) +{ +xf86PostProximityEvent(local-dev, 0, 0, 3, report_x, report_y, z); +} priv-acecadOldProximity = 0; } -- 1.7.4.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] dix: only transform valuators when we need them.
On Wed, May 04, 2011 at 10:15:22AM +0200, Chase Douglas wrote: On 05/03/2011 03:28 AM, Peter Hutterer wrote: On Mon, Apr 25, 2011 at 12:58:17PM -0400, Chase Douglas wrote: On 04/21/2011 03:35 AM, Peter Hutterer wrote: Unconditionally drop the valuators back into the mask when they were there in the first place. Otherwise, sending identical coordinates from the driver on a translated device causes the valuator mask to be alternatively overwritten with the translated value or left as-is. This leads to the device jumping around between the translated and the original position. The same could be achieved with a valuator_mask_unset() combination. Testcase: xsetwacom set device name MapToOutput VGA1 Then press a button on the device, cursor jumps between the two positions. Introduced in 31737fff08ec19b394837341d5e358ec401f5cd8 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- dix/getevents.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dix/getevents.c b/dix/getevents.c index 0fa8046..7afd330 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -1065,9 +1065,10 @@ transformAbsolute(DeviceIntPtr dev, ValuatorMask *mask) pixman_f_transform_point(dev-transform, p); -if (lround(p.v[0]) != dev-last.valuators[0]) +if (valuator_mask_isset(mask, 0)) valuator_mask_set(mask, 0, lround(p.v[0])); -if (lround(p.v[1]) != dev-last.valuators[1]) + +if (valuator_mask_isset(mask, 1)) valuator_mask_set(mask, 1, lround(p.v[1])); } Why don't we change this to: if (lround(p.v[0]) != dev-last.valuators[0]) valuator_mask_set(mask, 0, lround(p.v[0])); else valuator_mask_unset(mask, 0); The proposed fix will cause valuators to be sent with repeated values if they haven't actually changed. I think this would generally need a bigger patch set than just the above (which was my first attempt at the patch, see also the commit message) to be addressed properly. Yeah... We received a bug report for this and I started diving into it and realized it will require a bigger patch. We don't have any guidelines for drivers regarding sending identical coordinates and the server does a pretty poor job in filtering them, especially for core events. https://bugs.freedesktop.org/show_bug.cgi?id=23985 Plus the need for continuous valuator ranges in XI1 also means that even when unsetting valuators in the generation path, they may (should!) get added later anyway. Yeah. At least in the Wacom driver we need the coordinates to not be filtered when identical, for the clients' sake. the specific use-case here is sending a motion event followed by a button event. They have identical coordinates, but if a client only listens to button events and the coordinates are filtered, they cannot get the valuator values from the button event only. Good point. Reviewed-by: Chase Douglas chase.doug...@canonical.com heh, I just noticed that you had also fixed this in the commit below that was in daniels' for-keith tree. I'll skip the one above and just merge yours in then. commit 65b54548dce80c8e8ff5ff91fc4f0659e9b2d921 Author: Chase Douglas chase.doug...@canonical.com Date: Tue Jan 18 20:08:09 2011 + Input: Pass co-ordinates by reference to transformAbsolute Cheers, Peter ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PULL] input fixes
This is mostly Daniel's branch minus the commit that added the button grab issue (and another cleanup one that conflicted after removing the first). Plus the bugfix for the SD grab issue we've been seeing. The following changes since commit 5cb31cd0cbf83fff5f17a475e7b0e45246b19bf3: Merge remote-tracking branch 'jturney/remove-opengl-spec-download' (2011-04-29 09:59:49 -0700) are available in the git repository at: git://people.freedesktop.org/~whot/xserver.git for-keith Alan Coopersmith (1): Move event filter initializer out of the structure itself Chase Douglas (1): Input: Pass co-ordinates by reference to transformAbsolute Daniel Stone (2): Input: Add DeepestSpriteWin function Input: Fix event size confusion in CheckPassiveGrabsOnWindow Peter Hutterer (1): input: Only release SD buttons for explicit floating/reattachment (#36146) Xi/xichangehierarchy.c |2 ++ dix/devices.c |4 +--- dix/events.c | 23 +++ dix/getevents.c| 28 ++-- include/input.h|2 ++ include/inputstr.h | 10 ++ 6 files changed, 40 insertions(+), 29 deletions(-) ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH resend] input: Only release SD buttons for explicit floating/reattachment (#36146)
On Wed, May 04, 2011 at 10:12:36AM +1000, Peter Hutterer wrote: Grabbing an SD device temporary floats the device but we must not release the buttons. Introduced in commit 9d23459415b84606ee4f38bb2d19054c432c8552 Author: Peter Hutterer peter.hutte...@who-t.net Date: Fri Feb 25 11:08:19 2011 +1000 dix: release all buttons and keys before reattaching a device (#34182) X.Org Bug 36146 http://bugs.freedesktop.org/show_bug.cgi?id=36146 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net Sorry I've taken so long to get around to this one. I haven't tested it (mainly because all my external devices are in the office), but it seems like it should work. Reviewed-by: Daniel Stone dan...@fooishbar.org Cheers, Daniel ___ 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: Post-1.5.0 cleanup for xf86-input-acecad
On Thu, May 05, 2011 at 02:04:06AM +0200, Cyril Brulebois wrote: nothing fancy, I hope. Just addressing a few compiler warnings, and following Peter's suggestion, dropping support for input ABI 12. For the series: Reviewed-by: Daniel Stone dan...@fooishbar.org Cheers, Daniel ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH:xf86-input-acecad 4/6] Drop support for pre-input ABI 12 servers.
On Thu, May 05, 2011 at 02:04:10AM +0200, Cyril Brulebois wrote: Signed-off-by: Cyril Brulebois k...@debian.org --- configure.ac |2 +- src/acecad.c | 75 +++-- src/acecad.h |5 3 files changed, 5 insertions(+), 77 deletions(-) diff --git a/configure.ac b/configure.ac index 4c76754..5b11092 100644 --- a/configure.ac +++ b/configure.ac @@ -55,7 +55,7 @@ AC_CHECK_HEADERS([linux/input.h sysfs/libsysfs.h]) XORG_DRIVER_CHECK_EXT(RANDR, randrproto) # Obtain compiler/linker options from server and required extensions -PKG_CHECK_MODULES(XORG, [xorg-server = 1.0.99.901] xproto kbproto inputproto $REQUIRED_MODULES) +PKG_CHECK_MODULES(XORG, [xorg-server = 1.9.99.1] xproto kbproto inputproto $REQUIRED_MODULES) I wonder if it would be better to just require 1.10 here. I doubt at this point anyone will try a prerelease of 1.10 against this driver and it would save us the need #error below Cheers, Peter # Define a configure option for an alternate input module directory AC_ARG_WITH(xorg-module-dir, diff --git a/src/acecad.c b/src/acecad.c index d60b3b6..17e141f 100644 --- a/src/acecad.c +++ b/src/acecad.c @@ -90,6 +90,10 @@ #endif #define DBG(lvl, f) {if ((lvl) = xf86GetVerbosity()) f;} +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) 12 +#error XINPUT ABI 12 required. +#endif + /* * Local Headers / @@ -331,66 +335,8 @@ ProbeFound: #endif -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) 12 -static int NewAceCadPreInit(InputDriverPtr drv, InputInfoPtr dev, int flags); - -static InputInfoPtr -AceCadPreInit(InputDriverPtr drv, IDevPtr dev, int flags) -{ -InputInfoPtr local = xf86AllocateInput(drv, 0); -AceCadPrivatePtr priv = calloc (1, sizeof(AceCadPrivateRec)); - -if ((!local)) -goto SetupProc_fail; - -local-name = dev-identifier; -local-type_name = XI_TABLET; -local-flags = XI86_SEND_DRAG_EVENTS; -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0 -local-motion_history_proc = xf86GetMotionEvents; -#endif -local-control_proc = NULL; -local-switch_mode = NULL; -local-conversion_proc = ConvertProc; -local-reverse_conversion_proc = ReverseConvertProc; -local-dev = NULL; -local-private = priv; -local-private_flags = 0; -local-conf_idev = dev; -/*local-always_core_feedback = 0;*/ - -xf86CollectInputOptions(local, default_options, NULL); - -xf86OptionListReport(local-options); - -if (NewAceCadPreInit(drv, local, flags) == Success) -return local; - -SetupProc_fail: -return NULL; -} - -static Bool -ReverseConvertProc (InputInfoPtr local, -int x, int y, -int *valuators) -{ -AceCadPrivatePtr priv = (AceCadPrivatePtr)(local-private); - -// xf86Msg(X_INFO, %s: reverse coordinate conversion in : %d, %d\n, local-name, x, y); -valuators[0] = x * priv-acecadMaxX / screenInfo.screens[0]-width; -valuators[1] = y * priv-acecadMaxY / screenInfo.screens[0]-height; -// xf86Msg(X_INFO, %s: reverse coordinate conversion out: %d, %d\n, local-name, valuators[0], valuators[1]); - -return TRUE; -} - -static int -NewAceCadPreInit(InputDriverPtr drv, InputInfoPtr local, int flags) -#else static int AceCadPreInit(InputDriverPtr drv, InputInfoPtr local, int flags) -#endif { AceCadPrivatePtr priv = calloc (1, sizeof(AceCadPrivateRec)); int speed; @@ -500,10 +446,6 @@ AceCadPreInit(InputDriverPtr drv, InputInfoPtr local, int flags) xf86ProcessCommonOptions(local, local-options); -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) 12 -local-flags |= XI86_CONFIGURED; -#endif - if (local-fd != -1) { RemoveEnabledDevice (local-fd); @@ -709,9 +651,6 @@ DeviceInit (DeviceIntPtr dev) #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) = 7 axes_labels, #endif -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) 3 -xf86GetMotionEvents, -#endif history_size, ((priv-flags ABSOLUTE_FLAG)? Absolute: Relative)|OutOfProximity) == FALSE) @@ -818,9 +757,6 @@ ReadInput (InputInfoPtr local) /*xf86Msg(X_INFO, ACECAD Tablet Read Input\n);*/ is_absolute = (priv-flags ABSOLUTE_FLAG); -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0 -is_core_pointer = xf86IsCorePointer(local-dev); -#endif /* * set blocking to -1 on the first call because we know there is data to @@ -923,9 +859,6 @@ USBReadInput (InputInfoPtr local) int prox = priv-acecadOldProximity; int buttons = priv-acecadOldButtons; int is_core_pointer = 0; -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0 -is_core_pointer = xf86IsCorePointer(local-dev); -#endif /* Is autodev active? */
Re: [PATCH] input: change CHECKEVENT macro to verify_internal_event function
On Thu, May 05, 2011 at 08:48:19AM +1000, Peter Hutterer wrote: The macro is sufficient if called during a development cycle, but not sufficient information when triggered by a user (e.g. https://bugzilla.redhat.com/show_bug.cgi?id=688693). Expand what this does to print the event content and a backtrace, so at least we know where we're coming from. Only the first 32 bytes are printed since if something goes wrong, the event we have is almost certainly an xEvent or xError, both restricted to 32 bytes. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net Reviewed-by: Daniel Stone dan...@fooishbar.org Cheers, Daniel ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH:xf86-input-acecad 6/6] Remove pointless checks on is_core_pointer.
On Thu, May 05, 2011 at 02:04:12AM +0200, Cyril Brulebois wrote: Signed-off-by: Cyril Brulebois k...@debian.org Reviewed-by: Peter Hutterer peter.hutte...@who-t.net for the series Feel free to push these once the requires is updated. Cheers, Peter --- src/acecad.c | 39 +-- 1 files changed, 17 insertions(+), 22 deletions(-) diff --git a/src/acecad.c b/src/acecad.c index de2577e..ad6d793 100644 --- a/src/acecad.c +++ b/src/acecad.c @@ -729,7 +729,7 @@ ReadInput (InputInfoPtr local) { int x, y, z; int prox, buttons; -int is_core_pointer = 0, is_absolute; +int is_absolute; AceCadPrivatePtr priv = (AceCadPrivatePtr) (local-private); /*xf86Msg(X_INFO, ACECAD Tablet Read Input\n);*/ @@ -772,11 +772,10 @@ ReadInput (InputInfoPtr local) if (prox) { if (!(priv-acecadOldProximity)) -if (!is_core_pointer) -{ -/*xf86Msg(X_INFO, ACECAD Tablet ProxIN %d %d %d\n,x, y, z);*/ -xf86PostProximityEvent(local-dev, 1, 0, 3 , x, y, z); -} +{ +/*xf86Msg(X_INFO, ACECAD Tablet ProxIN %d %d %d\n,x, y, z);*/ +xf86PostProximityEvent(local-dev, 1, 0, 3 , x, y, z); +} if ((is_absolute ((priv-acecadOldX != x) || (priv-acecadOldY != y) || (priv-acecadOldZ != z))) || (!is_absolute (x || y))) @@ -809,12 +808,11 @@ ReadInput (InputInfoPtr local) } else { -if (!is_core_pointer) -if (priv-acecadOldProximity) -{ -/*xf86Msg(X_INFO, ACECAD Tablet ProxOUT %d %d %d\n,x, y, z);*/ -xf86PostProximityEvent(local-dev, 0, 0, 3, x,y,z); -} +if (priv-acecadOldProximity) +{ +/*xf86Msg(X_INFO, ACECAD Tablet ProxOUT %d %d %d\n,x, y, z);*/ +xf86PostProximityEvent(local-dev, 0, 0, 3, x,y,z); +} priv-acecadOldProximity = 0; } } @@ -836,7 +834,6 @@ USBReadInput (InputInfoPtr local) int report_x = 0, report_y = 0; int prox = priv-acecadOldProximity; int buttons = priv-acecadOldButtons; -int is_core_pointer = 0; /* Is autodev active? */ int autodev = priv-flags AUTODEV_FLAG; /* Was the device available last time we checked? */ @@ -935,10 +932,9 @@ USBReadInput (InputInfoPtr local) report_y = y; #endif if (!(priv-acecadOldProximity)) -if (!is_core_pointer) -{ -xf86PostProximityEvent(local-dev, 1, 0, 3 , report_x, report_y, z); -} +{ +xf86PostProximityEvent(local-dev, 1, 0, 3 , report_x, report_y, z); +} xf86PostMotionEvent(local-dev, 1, 0, 3, report_x, report_y, z); @@ -957,11 +953,10 @@ USBReadInput (InputInfoPtr local) } else { -if (!is_core_pointer) -if (priv-acecadOldProximity) -{ -xf86PostProximityEvent(local-dev, 0, 0, 3, report_x, report_y, z); -} +if (priv-acecadOldProximity) +{ +xf86PostProximityEvent(local-dev, 0, 0, 3, report_x, report_y, z); +} priv-acecadOldProximity = 0; } -- 1.7.4.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
Re: [Mesa-dev] [PATCH] glxproto: make GLX swap event struct match spec
On Thu, 05 May 2011 09:32:46 +1000 Dave Airlie airl...@redhat.com wrote: On Wed, 2011-05-04 at 16:16 -0700, Jesse Barnes wrote: On Wed, 04 May 2011 15:17:31 -0700 Ian Romanick i...@freedesktop.org wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/03/2011 12:21 PM, Jesse Barnes wrote: We only spec a 32 bit swap count, so drop the high sbc field. Signed-off-by: Jesse Barnes jbar...@virtuousgeek.org Is there any way we could do this and NOT break building older versions of Mesa? I'd like to be able to build 7.9, 7.10, and master on my system without having two different versions of glproto. We did that the last time glproto bumped (kept the req at 1.4.10 and added ifdefs), but that added bugs that we didn't find for awhile, so I wanted to try to avoid it this time. Another option for you would be to build 7.9, 7.10, and master against different install roots with PKG_CONFIG_PATH set appropriately... How about you try again, with an increased emphasis on not adding bugs, now that you know what you did wrong the first time? How about you look at git and see what happened last time? We added some dri2 proto requests, and people wanted to build with old versions w/o the new requests. So they added some ifdefs but didn't check all the combos (now not just old server/new server, but multiplied by two) and things were broken for awhile, and it was easy to get breakage without even noticing (I found several bugs for people related to invalidation that were solely due to bad builds). -- Jesse Barnes, Intel Open Source Technology Center ___ 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] [PATCH] glxproto: make GLX swap event struct match spec
On Wed, 4 May 2011 17:49:37 -0700 Jesse Barnes jbar...@virtuousgeek.org wrote: How about you look at git and see what happened last time? We added some dri2 proto requests, and people wanted to build with old versions w/o the new requests. So they added some ifdefs but didn't check all the combos (now not just old server/new server, but multiplied by two) and things were broken for awhile, and it was easy to get breakage without even noticing (I found several bugs for people related to invalidation that were solely due to bad builds). (For those who don't want to look through git and the history: the problem is that making the builds use old and new means you can build client and server with different proto versions and not even notice. That makes debugging all the harder because everything seems to be ok but you're now taking untested paths on the client and/or server side due to #ifdefs and protocol mismatches.) -- Jesse Barnes, Intel Open Source Technology Center ___ 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
glproto changes
So I wasn't watching and glproto broke its interface, and I think its bad. Why? You can no longer bisect things across this point without now moving glproto. glxproto.h:xGLXBufferSwapComplete was a released header file definition, you cannot go back and change history. This should have been handled with xGLXBufferSwapComplete2 struct that newer mesa and X server could would use instead of the older code. Old code would build against the old broken defintion but since its broken it wouldn't matter, and new code would build against the new fixed definition. This doesn't address the I need the latest glproto to build mesa and my distro doesn't have which concerns me less than the I can't bisect anymore and I fully agree with Jesse that the last time we tried using #ifdef for this sort of thing it led to a number of untested combos resulting in impossible to debug issues. 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: [Mesa-dev] glproto changes
On Thu, 5 May 2011 11:17:02 +1000 Dave Airlie airl...@gmail.com wrote: So I wasn't watching and glproto broke its interface, and I think its bad. Why? You can no longer bisect things across this point without now moving glproto. glxproto.h:xGLXBufferSwapComplete was a released header file definition, you cannot go back and change history. This should have been handled with xGLXBufferSwapComplete2 struct that newer mesa and X server could would use instead of the older code. Old code would build against the old broken defintion but since its broken it wouldn't matter, and new code would build against the new fixed definition. This doesn't address the I need the latest glproto to build mesa and my distro doesn't have which concerns me less than the I can't bisect anymore and I fully agree with Jesse that the last time we tried using #ifdef for this sort of thing it led to a number of untested combos resulting in impossible to debug issues. Yes, in hindsight I was too shellshocked by our previous experience with dri2 invalidate, ifdefs, and untested paths to even consider allowing new code to build with old proto. But breaking bisect is bad, no doubt. But in this case adding a separate struct is probably the right thing to do, and I'd be happy to do it if people are willing to put up with the churn (glproto 1.4.14, dri2proto 2.5 plus changes to Mesa and X to use the new struct). -- Jesse Barnes, Intel Open Source Technology Center ___ 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 0/6] XKB event regression fixes and cleanup
Hi, This series cleans up XKB event sending a bit, and hopefully fixes a couple of regressions from f06a9d. If these seem happy in master then I'll nominate them for stable branches too. Cheers, Daniel ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 1/6] XKB: Don't send unnecessary NewKeyboardNotifies
In the XKB GetKeyboardByName handler, we had the following pseudocode: if (device was last slave of its MD) { XkbCopyDeviceKeymap(master, slave); XkbSendNewKeyboardNotify(slave, notify); } Even if the SendNewKeyboardNotify line nominated the correct device, which it didn't, it's unnecessary as XkbCopyDeviceKeymap already sends a NewKeyboardNotify on the destination device. Signed-off-by: Daniel Stone dan...@fooishbar.org --- xkb/xkb.c |4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/xkb/xkb.c b/xkb/xkb.c index 4044d33..c4cb740 100644 --- a/xkb/xkb.c +++ b/xkb/xkb.c @@ -5902,10 +5902,8 @@ ProcXkbGetKbdByName(ClientPtr client) if (!IsMaster(dev)) { DeviceIntPtr master = GetMaster(dev, MASTER_KEYBOARD); - if (master master-lastSlave == dev) { + if (master master-lastSlave == dev) XkbCopyDeviceKeymap(master, dev); - XkbSendNewKeyboardNotify(dev,nkn); - } } } if ((new!=NULL)(new!=xkb)) { -- 1.7.4.4 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 2/6] XKB: Simplify a loop in ProcXkbGetKbdByName
Replace: for (stuff; things; etc) { if (misc || other) { [...] } } with: for (stuff; things; etc) { if (!misc !other) continue; [...] } Signed-off-by: Daniel Stone dan...@fooishbar.org --- xkb/xkb.c | 29 +++-- 1 files changed, 15 insertions(+), 14 deletions(-) diff --git a/xkb/xkb.c b/xkb/xkb.c index c4cb740..e17e216 100644 --- a/xkb/xkb.c +++ b/xkb/xkb.c @@ -5870,21 +5870,22 @@ ProcXkbGetKbdByName(ClientPtr client) xkb-ctrls-num_groups= nTG; for (tmpd = inputInfo.devices; tmpd; tmpd = tmpd-next) { -if ((tmpd == dev) || (!IsMaster(tmpd) GetMaster(tmpd, MASTER_KEYBOARD) == dev)) { -if (tmpd != dev) -XkbCopyDeviceKeymap(tmpd, dev); - -if (tmpd-kbdfeed tmpd-kbdfeed-xkb_sli) { -old_sli = tmpd-kbdfeed-xkb_sli; -tmpd-kbdfeed-xkb_sli = NULL; -sli = XkbAllocSrvLedInfo(tmpd, tmpd-kbdfeed, NULL, 0); -if (sli) { -sli-explicitState = old_sli-explicitState; -sli-effectiveState = old_sli-effectiveState; -} -tmpd-kbdfeed-xkb_sli = sli; -XkbFreeSrvLedInfo(old_sli); +if (tmpd != dev GetMaster(tmpd, MASTER_KEYBOARD) != dev) +continue; + +if (tmpd != dev) +XkbCopyDeviceKeymap(tmpd, dev); + +if (tmpd-kbdfeed tmpd-kbdfeed-xkb_sli) { +old_sli = tmpd-kbdfeed-xkb_sli; +tmpd-kbdfeed-xkb_sli = NULL; +sli = XkbAllocSrvLedInfo(tmpd, tmpd-kbdfeed, NULL, 0); +if (sli) { +sli-explicitState = old_sli-explicitState; +sli-effectiveState = old_sli-effectiveState; } +tmpd-kbdfeed-xkb_sli = sli; +XkbFreeSrvLedInfo(old_sli); } } -- 1.7.4.4 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 4/6] XKB: Send NewKeyboardNotify for dev before its master/slaves
When we change the keymap on a device, send the NewKeyboardNotify for that device before we copy the keymap to and notify for its attached master/slave devices. Signed-off-by: Daniel Stone dan...@fooishbar.org --- xkb/xkb.c | 24 1 files changed, 12 insertions(+), 12 deletions(-) diff --git a/xkb/xkb.c b/xkb/xkb.c index 4d21200..86231a8 100644 --- a/xkb/xkb.c +++ b/xkb/xkb.c @@ -5871,6 +5871,18 @@ ProcXkbGetKbdByName(ClientPtr client) } xkb-ctrls-num_groups= nTG; + nkn.deviceID= nkn.oldDeviceID= dev-id; + nkn.minKeyCode= new-min_key_code; + nkn.maxKeyCode= new-max_key_code; + nkn.oldMinKeyCode= xkb-min_key_code; + nkn.oldMaxKeyCode= xkb-max_key_code; + nkn.requestMajor= XkbReqCode; + nkn.requestMinor= X_kbGetKbdByName; + nkn.changed= XkbNKN_KeycodesMask; + if (geom_changed) + nkn.changed|= XkbNKN_GeometryMask; + XkbSendNewKeyboardNotify(dev,nkn); + /* Update the map and LED info on the device itself, as well as * any slaves if it's an MD, or its MD if it's an SD and was the * last device used on that MD. */ @@ -5894,18 +5906,6 @@ ProcXkbGetKbdByName(ClientPtr client) XkbFreeSrvLedInfo(old_sli); } } - - nkn.deviceID= nkn.oldDeviceID= dev-id; - nkn.minKeyCode= new-min_key_code; - nkn.maxKeyCode= new-max_key_code; - nkn.oldMinKeyCode= xkb-min_key_code; - nkn.oldMaxKeyCode= xkb-max_key_code; - nkn.requestMajor= XkbReqCode; - nkn.requestMinor= X_kbGetKbdByName; - nkn.changed= XkbNKN_KeycodesMask; - if (geom_changed) - nkn.changed|= XkbNKN_GeometryMask; - XkbSendNewKeyboardNotify(dev,nkn); } if ((new!=NULL)(new!=xkb)) { XkbFreeKeyboard(new,XkbAllComponentsMask,TRUE); -- 1.7.4.4 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 3/6] XKB: Remove duplicate keymap-copying loop
Previously we had: foreach (device + slaves of device) { XkbCopyDeviceKeymap(i, device); [...] } if (device was last slave of its MD) { XkbCopyDeviceKeymap(master, device); } and now: foreach (device + slaves of device + MD if device was last slave) { XkbCopyDeviceKeymap(i, device); [...] } As an extra bonus, when changing the keymap on a slave device, we now ensure the LED info on the master is kept in sync. Signed-off-by: Daniel Stone dan...@fooishbar.org --- xkb/xkb.c | 14 +++--- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/xkb/xkb.c b/xkb/xkb.c index e17e216..4d21200 100644 --- a/xkb/xkb.c +++ b/xkb/xkb.c @@ -5586,6 +5586,7 @@ ProcXkbGetKbdByName(ClientPtr client) { DeviceIntPtr dev; DeviceIntPtrtmpd; +DeviceIntPtrmaster; xkbGetKbdByNameReply rep = {0}; xkbGetMapReply mrep = {0}; xkbGetCompatMapReply crep = {0}; @@ -5611,6 +5612,7 @@ ProcXkbGetKbdByName(ClientPtr client) return BadAccess; CHK_KBD_DEVICE(dev, stuff-deviceSpec, client, access_mode); +master = GetMaster(dev, MASTER_KEYBOARD); xkb = dev-key-xkbInfo-desc; status= Success; @@ -5869,8 +5871,12 @@ ProcXkbGetKbdByName(ClientPtr client) } xkb-ctrls-num_groups= nTG; +/* Update the map and LED info on the device itself, as well as + * any slaves if it's an MD, or its MD if it's an SD and was the + * last device used on that MD. */ for (tmpd = inputInfo.devices; tmpd; tmpd = tmpd-next) { -if (tmpd != dev GetMaster(tmpd, MASTER_KEYBOARD) != dev) +if (tmpd != dev GetMaster(tmpd, MASTER_KEYBOARD) != dev +(tmpd != master || dev != master-lastSlave)) continue; if (tmpd != dev) @@ -5900,12 +5906,6 @@ ProcXkbGetKbdByName(ClientPtr client) if (geom_changed) nkn.changed|= XkbNKN_GeometryMask; XkbSendNewKeyboardNotify(dev,nkn); - - if (!IsMaster(dev)) { - DeviceIntPtr master = GetMaster(dev, MASTER_KEYBOARD); - if (master master-lastSlave == dev) - XkbCopyDeviceKeymap(master, dev); - } } if ((new!=NULL)(new!=xkb)) { XkbFreeKeyboard(new,XkbAllComponentsMask,TRUE); -- 1.7.4.4 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 6/6] XKB: Fix sense inversion for core MapNotify events
Due to an unfortunate sense inversion incident while switching from a if (foo) { ... } to if (!foo) continue; style in f06a9d, we punished any client who attempted to use XKB to restrict the MapNotify events they wanted by sending them exactly the events they _didn't_ want, and nothing else. NewKeyboardNotifies (coming from a client setting the map with an XKB request, when switching between master devices, etc) weren't affected, but this would impact anyone using xmodmap-style core requests. Could explain a fair bit. Clarified the comments while I was at it. Signed-off-by: Daniel Stone dan...@fooishbar.org --- xkb/xkbEvents.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/xkb/xkbEvents.c b/xkb/xkbEvents.c index d342acc..dfbf7f2 100644 --- a/xkb/xkbEvents.c +++ b/xkb/xkbEvents.c @@ -88,11 +88,15 @@ XkbSendLegacyMapNotify(DeviceIntPtr kbd, CARD16 xkb_event, CARD16 changed, if (!clients[i] || clients[i]-clientState != ClientStateRunning) continue; -/* Ignore clients which will have already received this. - * Inconsistent with themselves, but consistent with previous - * behaviour.*/ -if (xkb_event == XkbMapNotify (clients[i]-mapNotifyMask changed)) +/* XKB allows clients to restrict the MappingNotify events sent to + * them. This was broken for three years. Sorry. */ +if (xkb_event == XkbMapNotify +(clients[i]-xkbClientFlags _XkbClientInitialized) +!(clients[i]-mapNotifyMask changed)) continue; +/* Emulate previous server behaviour: any client which has activated + * XKB will not receive core events emulated from a NewKeyboardNotify + * at all. */ if (xkb_event == XkbNewKeyboardNotify (clients[i]-xkbClientFlags _XkbClientInitialized)) continue; -- 1.7.4.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: [Mesa-dev] glproto changes
Yeah... so considering the comments in mesa-dev earlier today, I was really surprised to see that glproto and dri2proto were tagged today. I think we need to brownbag retract and rethink this. These changes break API. I'm all for fixing the structs, but anything that breaks API (or worse, protocol) certainly warrants much more than the +0.0.1 version bump. This also makes it impossible to build the current dev and current stable with the same protos installed. I haven't looked at the details specifically, but I suspect that it also changes what is on the wire, meaning clients and the server may disagree depending on which glproto version they were using. Is that the case? If not, can't we solve this with some creative union{}ing? Either way, I think we should retract the glproto 1.4.13 release until we can get this straightened out. On May 4, 2011, at 18:17, Dave Airlie wrote: So I wasn't watching and glproto broke its interface, and I think its bad. Why? You can no longer bisect things across this point without now moving glproto. glxproto.h:xGLXBufferSwapComplete was a released header file definition, you cannot go back and change history. This should have been handled with xGLXBufferSwapComplete2 struct that newer mesa and X server could would use instead of the older code. Old code would build against the old broken defintion but since its broken it wouldn't matter, and new code would build against the new fixed definition. This doesn't address the I need the latest glproto to build mesa and my distro doesn't have which concerns me less than the I can't bisect anymore and I fully agree with Jesse that the last time we tried using #ifdef for this sort of thing it led to a number of untested combos resulting in impossible to debug issues. Dave. ___ mesa-dev mailing list mesa-...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ 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