[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#392498: palmax touchscreen logic bug prevents use in low loads



Package: xserver-xorg-input-palmax
Version: 1.0.0.5-2

The palmax touchscreen driver contains a bug related to
the parsing of data from the serial port. The problem 
occurs when less than five bytes have been read after the
current package to be processed, a very frequent case
except when the system is under high load. The result is
that touchscreen data is discarded instead of parsed,
rendering the touchscreen unresponsive. 

I have found the faulty logic and am attaching a patch 
which seems to solve the problem correctly for me, though
it could probably use a second set of eyes to check for 
other thinkos. 

I am using a Palmax PD-1100, and with this patch applied
my touchscreen seems to work fine. 
*** xserver-xorg-input-palmax-1.0.0.5/src/xf86Palmax.c	Mon Feb 13 04:47:12 2006
--- xserver-xorg-input-palmax-1.0.0.5.fixed/src/xf86Palmax.c	Thu Oct 12 01:18:17 2006
***************
*** 15,20 ****
--- 15,23 ----
  #include "xf86Module.h"
  #endif
  
+ #include <stdlib.h>
+ #include <string.h>
+ 
  /*
   ***************************************************************************
   *
***************
*** 28,34 ****
  #define DEFAULT_MAX_Y		61592
  #define DEFAULT_MIN_Y		7608
                                
! #define XI_STYLUS		"TOUCHSCREEH"	/* X device name for the stylus device	*/
  
  
  /*
--- 31,37 ----
  #define DEFAULT_MAX_Y		61592
  #define DEFAULT_MIN_Y		7608
                                
! #define XI_STYLUS		"TOUCHSCREEN"	/* X device name for the stylus device	*/
  
  
  /*
***************
*** 301,307 ****
  	bytes_in_packet = 0;
  	start_ptr = ptr;
  
! 	while (num_bytes >= report_size) 
  	{
  		/*
  		 * Skip bytes until we hit a header (FE/FF)
--- 304,310 ----
  	bytes_in_packet = 0;
  	start_ptr = ptr;
  
! 	while (num_bytes >= report_size-bytes_in_packet) 
  	{
  		/*
  		 * Skip bytes until we hit a header (FE/FF)

Reply to: