Bug 29049 - Assert in xf86-input-mouse on Solaris 10
Summary: Assert in xf86-input-mouse on Solaris 10
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Input/Mouse (show other bugs)
Version: git
Hardware: x86 (IA32) Solaris
: medium major
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-13 14:08 UTC by Pat Kane
Modified: 2010-07-19 13:47 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
A patch for the bug (1.36 KB, patch)
2010-07-13 14:13 UTC, Pat Kane
no flags Details | Splinter Review

Description Pat Kane 2010-07-13 14:08:46 UTC
On Solaris 10 the current git xf86-input-mouse driver gives this error:
 ...
 (II) <default pointer>: Setting Device option to "/dev/mouse"
 (**) <default pointer>: Protocol: VUID
 (**) Option "CorePointer"
 (**) <default pointer>: always reports core events
 (**) Option "Device" "/dev/mouse"
 (II) <default pointer>: Setting Buttons option to "3"
 (==) <default pointer>: Emulate3Buttons, Emulate3Timeout: 50
 (**) <default pointer>: ZAxisMapping: buttons 4 and 5
 (**) <default pointer>: Buttons: 9
 (II) XINPUT: Adding extended input device "<default pointer>" (type: MOUSE)
 Assertion failed: key->initialized, file include/xorg/privates.h, line 130, function dixGetPrivateAddr
 Abort - core dumped
Comment 1 Pat Kane 2010-07-13 14:12:00 UTC
Here is a patch for the bug.

diff --git a/src/sun_mouse.c b/src/sun_mouse.c
index f6e8dbb..80e1111 100644
--- a/src/sun_mouse.c
+++ b/src/sun_mouse.c
@@ -116,13 +116,21 @@ static void vuidMouseSendScreenSize(ScreenPtr pScreen, VuidMsePtr pVuidMse);
 static void vuidMouseAdjustFrame(int index, int x, int y, int flags);
 
 static int vuidMouseGeneration = 0;
-static int vuidMouseScreenIndex;
+DevPrivateKeyRec vuidDevicePrivateKeyRec;
+#define vuidDevicePrivateKey (&vuidDevicePrivateKeyRec)
+
 #define vuidMouseGetScreenPrivate(s) ( \
-    dixLookupPrivate(&(s)->devPrivates, &vuidMouseScreenIndex))
+    dixLookupPrivate(&(s)->devPrivates, vuidDevicePrivateKey))
 #define vuidMouseSetScreenPrivate(s,p) \
-    dixSetPrivate(&(s)->devPrivates, &vuidMouseScreenIndex, (void *) p)
+    dixSetPrivate(&(s)->devPrivates, vuidDevicePrivateKey, (void *) p)
 #endif /* HAVE_ABSOLUTE_MOUSE_SCALING */
 
+static Bool 
+VuidInitPrivates(void)
+{
+    return dixRegisterPrivateKey(vuidDevicePrivateKey, PRIVATE_SCREEN, 0);
+}
+
 static inline
 VuidMsePtr getVuidMsePriv(InputInfoPtr pInfo)
 {
@@ -542,6 +550,7 @@ vuidMouseProc(DeviceIntPtr pPointer, int what)
 
     case DEVICE_INIT:
 #ifdef HAVE_ABSOLUTE_MOUSE_SCALING
+        VuidInitPrivates();
        if (vuidMouseGeneration != serverGeneration) {
                for (i = 0; i < screenInfo.numScreens; i++) {
                    ScreenPtr pScreen = screenInfo.screens[i];
Comment 2 Pat Kane 2010-07-13 14:13:49 UTC
Created attachment 37002 [details] [review]
A patch for the bug
Comment 3 Pat Kane 2010-07-16 11:02:39 UTC
Sent patch to xorg-devel mailing list:
  http://lists.x.org/archives/xorg-devel/2010-July/011253.html


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.