fpit - fixes and passive-pen support

2005-01-31 Thread David M. Clay
Hello all.
I am new at this, so please gently guide me through this wonderful 
process of open-source coding.

I just recently purchased a Stylistic 3400 and found the current fpit 
driver did not support the passive pen of the 3400. So I modified the 
current driver to support the passive pen.

I am looking to have my changes added to the latest source tree. What is 
the best was to have others test my changes on other systems with 
different hardware, especially the active-pen models? I am pretty sure 
that I have fixed several bugs that had to have affected the active-pen 
systems as well, and I hope that I haven't broken anything. I don't have 
access to any other Stylistic tablets so I am unable to test it myself. 
The driver does work beautifully on my Stylistic 3400 though. Are there 
any testers out there? Whats the best way for me to post the changes? Is 
there a preferred style for diff patches? Is there a FAQ for this?

I would also like to describe the changes and fixes I have made in hopes 
someone will have comments. Keep in mind that this is my first attempt 
at X driver programing (though I've been a Windows application 
programmer for over 10 years), so there will be instances where I have 
no idea what I am talking about.

The POXIMITY_BIT was defined as 0x40 which is bit 6 "Switch status 
change." So I changed it to 0x20 or bit 5 "Proximity" (according to the 
protocol chart in the code). I don't know if on an active-pen system 
0x40 is really the proximity bit, I just made the constant consistent 
with my 3400 and with the bit-assignment chart in the code.

Also, to figure out which buttons have changed state, the current code 
subtracts the old value from the new. This gives an arithmetic 
difference but not a bit-wise difference. I believe what is needed here 
is XOR to show which bits (and therefore switches) have changed: delta = 
buttons ^ priv->fpitOldButtons

Also, the current code searches backward through the read buffer to get 
the last valid pen event. In effect it processes only the last available 
event in the buffer, and discards any events that may be before it. 
Although the pen uses absolute coordinates, those discarded events 
contain useful information. They can be intermediate points when using 
the pen to draw curves, or they can be switch events (especially if the 
switches are quickly cycled or if the buffer contains many events) which 
we want to pass on. On a related issue, some events weren't getting read 
(the pen up event in particular) until more events got put in the buffer 
(like a pen down). xf86FpitReadInput() wasn't getting called even though 
there was data available. So I added a loop on xf86WaitForInput() to 
make sure we got all the data, and the problem cleared up.

Also, the current code didn't seem to support the right mouse button 
(button 3), so I modified the button switch map to {0, 1, 2, 3}. Ive 
read of users getting strange button numbers on switch number 3. This is 
most likely due to the 4th value (3rd button) of the map array not being 
defined, but instead pointing to random data on the stack.

After all these modifications, my 3400 passive pen worked beautifully. 
Then I realized that this same driver should easily be able to work with 
an active-pen system. The only difference I could see would be how the 
buttons behave. So I added a Option parameter called "Passive" to allow 
the driver to be used for either system:

Thanks and I look forward to your comments and directions.
Sincerely,
David Clay
___
Devel mailing list
Devel@XFree86.Org
http://XFree86.Org/mailman/listinfo/devel


Re: fpit - fixes and passive-pen support

2005-01-31 Thread David Dawes
On Mon, Jan 31, 2005 at 03:41:05PM -0500, David M. Clay wrote:
>Hello all.
>
>I am new at this, so please gently guide me through this wonderful 
>process of open-source coding.
>
>I just recently purchased a Stylistic 3400 and found the current fpit 
>driver did not support the passive pen of the 3400. So I modified the 
>current driver to support the passive pen.
>
>I am looking to have my changes added to the latest source tree. What is 
>the best was to have others test my changes on other systems with 
>different hardware, especially the active-pen models? I am pretty sure 
>that I have fixed several bugs that had to have affected the active-pen 
>systems as well, and I hope that I haven't broken anything. I don't have 
>access to any other Stylistic tablets so I am unable to test it myself. 
>The driver does work beautifully on my Stylistic 3400 though. Are there 
>any testers out there? Whats the best way for me to post the changes? Is 
>there a preferred style for diff patches? Is there a FAQ for this?

I don't recall seeing any feedback regarding this driver in the
past, and from your decsription it sounds like you've fixed some
real bugs and improved the driver.  I'd suggest submitting your
patches ('diff -u' format preferred), and we can look at getting
them in for the coming release.  You can either post them here, or
submit them via bugs.xfree86.org.

If anyone here is using the fpit driver, particularly with an active pen
system, they should speak up now, and test your patches.

David
___
Devel mailing list
Devel@XFree86.Org
http://XFree86.Org/mailman/listinfo/devel


Re: fpit - fixes and passive-pen support

2005-01-31 Thread David M. Clay
David Dawes wrote:
On Mon, Jan 31, 2005 at 03:41:05PM -0500, David M. Clay wrote:
Hello all.
I am new at this, so please gently guide me through this wonderful 
process of open-source coding.

I just recently purchased a Stylistic 3400 and found the current fpit 
driver did not support the passive pen of the 3400. So I modified the 
current driver to support the passive pen.

I am looking to have my changes added to the latest source tree. What is 
the best was to have others test my changes on other systems with 
different hardware, especially the active-pen models? I am pretty sure 
that I have fixed several bugs that had to have affected the active-pen 
systems as well, and I hope that I haven't broken anything. I don't have 
access to any other Stylistic tablets so I am unable to test it myself. 
The driver does work beautifully on my Stylistic 3400 though. Are there 
any testers out there? Whats the best way for me to post the changes? Is 
there a preferred style for diff patches? Is there a FAQ for this?

I don't recall seeing any feedback regarding this driver in the
past, and from your decsription it sounds like you've fixed some
real bugs and improved the driver.  I'd suggest submitting your
patches ('diff -u' format preferred), and we can look at getting
them in for the coming release.  You can either post them here, or
submit them via bugs.xfree86.org.
If anyone here is using the fpit driver, particularly with an active pen
system, they should speak up now, and test your patches.
David
___
Devel mailing list
Devel@XFree86.Org
http://XFree86.Org/mailman/listinfo/devel

Okay, here is my patch for the whole fpit directory. I edited the man
page and readme file to reflect the changes. You will need to apply the
patch in the xc/programs/Xserver/hw/xfree86/input/fpit directory and
specify -p1 option. Forgive me if everyone already knows how to figure
that out (I didn't).
diff -u fpit-1.6/fpit.man fpit/fpit.man
--- fpit-1.6/fpit.man   2002-11-21 22:35:12.0 -0500
+++ fpit/fpit.man   2005-01-31 20:31:06.0 -0500
@@ -33,6 +33,15 @@
 .B setserial /dev/ttyS3 autoconfig
 .TP 4
 .B setserial /dev/ttyS3 IRQ 15 baud_base 115200 port 0xfce8
+.PP
+This driver now supports Stylistic 3400 (and possibly other passive-pen
+systems) with a special \fI"Passive"\fP paramter. Try this serial
+configuration for the 3400:
+
+.TP 4
+.B setserial /dev/ttyS3 autoconfig
+.TP 4
+.B setserial /dev/ttyS3 uart 16450 irq 5 port 0xfd68
 .SH CONFIGURATION DETAILS
 Please refer to XF86Config(5x) for general configuration
@@ -85,6 +94,9 @@
 .TP 4
 .B Option \fI"BaudRate"\fP \fI"38400"\fP, \fI"19200"\fP or \fI"9600"\fP 
(default)
 changes the serial link speed.
+.TP 4
+.B Option \fI"Passive"\fP
+decodes the passive pen.
 .RE
 Example, for Stylistic LT setup is:
@@ -111,6 +123,21 @@
 .B EndSection
 .fi
+For Stylistic 3400:
+.nf
+.B "Section \*qInputDevice\*q"
+.BI "  Identifier \*q" mouse0 \*q
+.B  "  Driver \*qfpit\*q"
+.BI "  Option \*qDevice\*q   \*q"/dev/ttyS3 \*q
+.BI "  Option \*qBaudRate\*q \*q"9600 \*q
+.BI "  Option \*qMaximumXPosition\*q \*q"4070 \*q
+.BI "  Option \*qMaximumYPosition\*q \*q"4020 \*q
+.BI "  Option \*qMinimumXPosition\*q \*q"0 \*q
+.BI "  Option \*qMinimumYPosition\*q \*q"0 \*q
+.BI "  Option \*qPassive\*q"
+.BI "  Option \*qSendCoreEvents\*q"
+.B EndSection
+.fi
 .SH "SEE ALSO"
 XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), 
X(__miscmansuffix__).
diff -u fpit-1.6/readme.txt fpit/readme.txt
--- fpit-1.6/readme.txt 2002-11-21 22:37:36.0 -0500
+++ fpit/readme.txt 2005-01-31 20:32:40.0 -0500
@@ -30,7 +30,7 @@
project into the XFree86 4.0.2 Elographics driver by Patrick Lecoanet.
 -  John Apfelbaum continuted the work to produce a working XFree86 4.0.x 
driver for the
Stylistic 1200.
-
+-  David Clay added support for Stylistic 3400 passive pen.
 Please visit http://linuxslate.com for the latest information.
@@ -93,6 +93,34 @@
tracks the pen correctly.
+New for Ver 4.5.0
+
+ * supports Stylistic 3400 (and possibly other passive-pen systems)
+ * Fixed processing of all packets
+ * Fixed hover-mode pointer movement
+ * Added Passive parameter for passive displays
+ * Added switch 3 for "right" mouse button
+
+Try this serial configuration for the 3400:
+
+setserial /dev/ttyS3 autoconfig
+setserial /dev/ttyS3 uart 16450 irq 5 port 0xfd68
+
+Try this config for the 3400:
+Section "InputDevice"
+Identifier "mouse0"
+Driver "fpit"
+Option "Device"   "/dev/ttyS3"
+Option "BaudRate" "9600"
+Option "Passive"
+Option "MaximumXPosition" "4070"
+Option "MaximumYPosition" "4020"
+Option "MinimumXPosition" "0"
+Option "MinimumYPosition" "0"
+Option "SendCoreEvents"
+EndSection
+
+
 Hints if you are having problems (Thanks to Aron Hsiao):
 Problem 1:  Side switch being reported as wild button numbers
diff -u fpit-1.6/xf86Fpit.c fpit/xf86F

Re: fpit - fixes and passive-pen support

2005-02-01 Thread David Dawes
On Mon, Jan 31, 2005 at 09:33:40PM -0500, David M. Clay wrote:
>David Dawes wrote:
>>On Mon, Jan 31, 2005 at 03:41:05PM -0500, David M. Clay wrote:
>>
>>>Hello all.
>>>
>>>I am new at this, so please gently guide me through this wonderful 
>>>process of open-source coding.
>>>
>>>I just recently purchased a Stylistic 3400 and found the current fpit 
>>>driver did not support the passive pen of the 3400. So I modified the 
>>>current driver to support the passive pen.
>>>
>>>I am looking to have my changes added to the latest source tree. What is 
>>>the best was to have others test my changes on other systems with 
>>>different hardware, especially the active-pen models? I am pretty sure 
>>>that I have fixed several bugs that had to have affected the active-pen 
>>>systems as well, and I hope that I haven't broken anything. I don't have 
>>>access to any other Stylistic tablets so I am unable to test it myself. 
>>>The driver does work beautifully on my Stylistic 3400 though. Are there 
>>>any testers out there? Whats the best way for me to post the changes? Is 
>>>there a preferred style for diff patches? Is there a FAQ for this?
>>
>>
>>I don't recall seeing any feedback regarding this driver in the
>>past, and from your decsription it sounds like you've fixed some
>>real bugs and improved the driver.  I'd suggest submitting your
>>patches ('diff -u' format preferred), and we can look at getting
>>them in for the coming release.  You can either post them here, or
>>submit them via bugs.xfree86.org.
>>
>>If anyone here is using the fpit driver, particularly with an active pen
>>system, they should speak up now, and test your patches.
>>
>>David
>>___
>>Devel mailing list
>>Devel@XFree86.Org
>>http://XFree86.Org/mailman/listinfo/devel
>>
>>
>
>Okay, here is my patch for the whole fpit directory. I edited the man
>page and readme file to reflect the changes. You will need to apply the
>patch in the xc/programs/Xserver/hw/xfree86/input/fpit directory and
>specify -p1 option. Forgive me if everyone already knows how to figure
>that out (I didn't).

I'm committing your patch now.  Thanks for the submission.

David.
___
Devel mailing list
Devel@XFree86.Org
http://XFree86.Org/mailman/listinfo/devel