Bug 34794

Summary: xf86-input-mouse 1.6.99 broken on BSD systems
Product: xorg Reporter: Matthieu Herrb <matthieu.herrb>
Component: Input/MouseAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: blocker    
Priority: medium CC: peter.hutterer
Version: git   
Hardware: x86 (IA32)   
OS: OpenBSD   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Fix patch
none
ver 2
none
ver 3
none
ver 4
none
ver 4 (git-formatted patch) none

Description Matthieu Herrb 2011-02-27 07:48:00 UTC
Until xf86-input-mouse-1.6.0, the MousePreInit() function exited if an 
os specific PreInit function existed. It let the os-specific function finish all initialisations that remained to be done after osInfo->PreInit() was called. 

The code in master now continues, and does things that the bsdMousePreInit() function in bsd_mouse.c doesn't expect.

I don't have time to look at this deeper for now, but please don't release xf86-input-mouse 1.7 before this is fixed.
Comment 1 Alexandr Shadchin 2011-02-27 11:41:41 UTC
Created attachment 43898 [details] [review]
Fix patch

Try this patch, it must fix
Comment 2 Matthieu Herrb 2011-03-05 07:42:13 UTC
(In reply to comment #1)
> Created an attachment (id=43898) [details]
> Fix patch
> 
> Try this patch, it must fix

Yes it fixes the issue. 
However I think that for the long term a better solution is needed:
- treat the wsmouse protocol as a 1st class protocol in mouse.c
- review and remove code duplication between the OS PreInit code and the 
  generic one.
Comment 3 Alexandr Shadchin 2011-03-05 16:40:11 UTC
Created attachment 44158 [details] [review]
ver 2
Comment 4 Peter Hutterer 2011-03-06 18:24:34 UTC
Review of attachment 44158 [details] [review]:

I think the PreInit hunk should be folded into MousePickProtocol.
Comment 5 Alexandr Shadchin 2011-03-07 01:03:21 UTC
Created attachment 44192 [details] [review]
ver 3

Move PreInit in MousePickProtocol
Comment 6 Matthieu Herrb 2011-03-07 13:06:53 UTC
(In reply to comment #5)
> Created an attachment (id=44192) [details]
> ver 3
> 
> Move PreInit in MousePickProtocol

Looks good to me and works. 

Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr>
Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr>
Comment 7 Peter Hutterer 2011-03-07 14:47:45 UTC
Review of attachment 44192 [details] [review]:

Can we move this into the switch statement? we already have special casing for PROT_UNKNOWN and PROP_UNSUP, so adding another special case there seems to be the better place.
Comment 8 Alexandr Shadchin 2011-03-08 04:27:15 UTC
Created attachment 44226 [details] [review]
ver 4

Move PreInit into the switch statement. Good idea, thanks.
Comment 9 Peter Hutterer 2011-03-08 14:45:36 UTC
ack by me. Matthieu, can you please re-test the latest version and I'll push it. anything else needed before we release the next version?

Alexandr, just noticed this now, can you please attach this as signed-off git-formatted patch. thanks.
http://wiki.x.org/wiki/Development/Documentation/SubmittingPatches
Comment 10 Alexandr Shadchin 2011-03-09 07:17:46 UTC
Created attachment 44276 [details] [review]
ver 4 (git-formatted patch)
Comment 11 Matthieu Herrb 2011-03-09 12:45:47 UTC
Review of attachment 44276 [details] [review]:

Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr>
Comment 12 Matthieu Herrb 2011-03-09 12:49:49 UTC
(In reply to comment #9)
> ack by me. Matthieu, can you please re-test the latest version and I'll push
> it. anything else needed before we release the next version?
> 

No problem with version 4. 
I can't think of anything else blocking a release, although I didn't test any real serial protocol (can't find any old serial mouse around the attic here).

> Alexandr, just noticed this now, can you please attach this as signed-off
> git-formatted patch. thanks.
> http://wiki.x.org/wiki/Development/Documentation/SubmittingPatches
Comment 13 Peter Hutterer 2011-03-09 14:32:05 UTC
commit a22879c6779283684fe4a61543fc95179b4f5d0b
Author: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Date:   Wed Mar 9 20:09:59 2011 +0500

    Fix BSD issues with new ABI12 init process.

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.