Skip to content

Commit 5a6c865

Browse files
cbagwelldtor
authored andcommitted
Input: wacom - ignore unwanted bamboo packets
Bamboo's Pen and Touch packets always start with a value of 0x02 in first byte. In 3rd gen Bamboo's, the hw is now periodically sending some additional packets with unrelated data and uses a value other than 0x02 to inform driver this. Ignore those packets now. This was reported by users as bad behavior in Gimp. The invalid packets being processed made the stylus report out of proximity for the 1 packet and this triggered some secondary bug which caused Gimp to stop drawing until user really took pen out of proximity of tablet. Signed-off-by: Chris Bagwell <chris@cnpbagwell.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
1 parent d2cc817 commit 5a6c865

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎drivers/input/tablet/wacom_wac.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,9 @@ static int wacom_bpt_touch(struct wacom_wac *wacom)
799799
unsigned char *data = wacom->data;
800800
int i;
801801

802+
if (data[0] != 0x02)
803+
return 0;
804+
802805
for (i = 0; i < 2; i++) {
803806
int p = data[9 * i + 2];
804807
bool touch = p && !wacom->shared->stylus_in_proximity;
@@ -875,6 +878,9 @@ static int wacom_bpt3_touch(struct wacom_wac *wacom)
875878
int count = data[1] & 0x03;
876879
int i;
877880

881+
if (data[0] != 0x02)
882+
return 0;
883+
878884
/* data has up to 7 fixed sized 8-byte messages starting at data[2] */
879885
for (i = 0; i < count; i++) {
880886
int offset = (8 * i) + 2;
@@ -900,6 +906,9 @@ static int wacom_bpt_pen(struct wacom_wac *wacom)
900906
unsigned char *data = wacom->data;
901907
int prox = 0, x = 0, y = 0, p = 0, d = 0, pen = 0, btn1 = 0, btn2 = 0;
902908

909+
if (data[0] != 0x02)
910+
return 0;
911+
903912
prox = (data[1] & 0x20) == 0x20;
904913

905914
/*

0 commit comments

Comments
 (0)