Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp2340444imm; Sat, 30 Jun 2018 17:23:32 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd/V9YlFQ7DaK2YBTpio6qyInXuH237sp3RNSK1cKcojhqxz/+QuIocB6ZJWR0YmQDLtTvv X-Received: by 2002:a63:6345:: with SMTP id x66-v6mr17278532pgb.43.1530404612242; Sat, 30 Jun 2018 17:23:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530404612; cv=none; d=google.com; s=arc-20160816; b=UlJ2GHsakBXBxOxfM4FUubb2TeL6ENWkOBhGK5HYjWGAfky4VGp3MzhPPFmi3oCZ5J RHSpH4TAKBy4o+TNkT5GyPNNNWxjSe+92BzTVhM1UImgOlIphdbQ+b/n5hn99IOkh9VQ +J9Tb7C8MY+ShAcfc+c/5+trtVG4GdRp7I97hSIQKcjIcfOSDqMrwVdSCYYqb1+Gk8gV lIj7fC30hf4wtYUlvs7GQUZd2kLsiTeBjqRgCaHt4HUh69F0UV3bbBZ1NFjI3ZCkjxK2 zvYHkz/CvotQf4Nou0Rr9vS2FoUpmIW7qHkS35p5i20JxdM+1ZdbwdlwTBiS98DqbHNS TBKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=lP4IG4mDY9DgV+tOoDW146wl3lit/aOFC7RSHZ9QL6c=; b=mL/j9h7AKQIz62EwReD083j69umz8xybfDrIYGYBIUtyXbpfKRJcX0mQ6DVA81Ku+e +Ya6c2qEecMgr/9F3cud1pJG9NLSTRwc9IuW8QofjlF1pYUkPmEOLhIQW1Fy2Cqkwn9K YIiFp66WXs+ixlyX8rT22vVWBoFoYCYhTsnPnA0Ej5wV783jkEJ/iJ3Qf4dIWiHbqsKZ JetAatWiDPderW5lsXdvxZvIXI7JXM2o23I3kT0dIaW9+3Vq4Hu81YofoaFiKGLrhN21 LtjwkSKVqCdm/NNyfUc9cglyA01tU2JcaSVPj5O5HW/xtON9zE2GPRmJOfnqkmIgL2EZ Pz8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=E84xo5eQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i62-v6si12205177pfc.255.2018.06.30.17.22.40; Sat, 30 Jun 2018 17:23:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=E84xo5eQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752164AbeGAAUG (ORCPT + 99 others); Sat, 30 Jun 2018 20:20:06 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:41827 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751995AbeGAAUB (ORCPT ); Sat, 30 Jun 2018 20:20:01 -0400 Received: by mail-pg0-f66.google.com with SMTP id l65-v6so5537930pgl.8; Sat, 30 Jun 2018 17:20:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lP4IG4mDY9DgV+tOoDW146wl3lit/aOFC7RSHZ9QL6c=; b=E84xo5eQKz4KNGxu7uDS0UKfA3B1D62Zw1K/4tHTOorVNsDWjRY04O1nJH3uDAafsK 7P6C/8dARm1FEPPiOLTvUU9gz7OUP3IEeeCf4nNnJvFjj1nR8Tuz+m77Lj+P20S3GmMI sIFwmRCixl00l2EgStY7IRXBQ3MW26Fg5+FjA8uYUCiGLTnotKaBGTTho10eC/TtneTt 4oGEW/oyjHb5d02c3XAgnJYCRsBcgX5LcTLYms1yjvNgiCCRhFWWnj03YMYf1IpFg9Xb 2pUVw9RUG9idZX2cs2rYBXtwcMx/4NJyVAkpdyA7Nc0pJH4/xBox9xIfZFG+CDclKk3T 5qLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=lP4IG4mDY9DgV+tOoDW146wl3lit/aOFC7RSHZ9QL6c=; b=aAI/0Uc6rzG4mpn/wcdXoT2YnIE5uVIMLJlA+9GDphe6Yh4qTaoKC3ZnjtxjZkOy8C 4lFH1wWsl2Y9Yc3qwVlMliOHTGKDCV1P11Cd/gDbpMeZoDAH7Fxmm6d+HKsaGCdqIGSq peJ3CP8NtXOvM+XXf3KVho5+AzNzr0LRee8VuagbEO8TTPqOpmlHmYkmJAOsWgh4Ip2m ydHyfY/zCRs0kEw8yimP8NNQbzQpjz1ISeBjiokZCFK1EnjZcvL4jwY7el0GogxOMyVc 6KhNtMWEV5Ldw+J0AsbFkeb5ecKgEreJqX3EP5BcoBaBnVCtMBlN3WotF5+uvcBwRyWP 05jw== X-Gm-Message-State: APt69E3Lni98y2u0CftrIjjkDi7hnSlMi+yLGN7/KU3oRubolNVFqR7l /l8sNvRynpzPjMso927K+D0kIw== X-Received: by 2002:a62:ae08:: with SMTP id q8-v6mr19171813pff.126.1530404400761; Sat, 30 Jun 2018 17:20:00 -0700 (PDT) Received: from hobbes.alyptik.lan ([2605:e000:1117:c002:2e0:1bff:fe70:ea]) by smtp.gmail.com with ESMTPSA id b123-v6sm8424566pfb.156.2018.06.30.17.19.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 Jun 2018 17:20:00 -0700 (PDT) From: Joey Pabalinas To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Jiri Kosina , Benjamin Tissoires , Daniel Martin Subject: [PATCH 3/4] HID: multitouch: drop reports containing invalid values Date: Sat, 30 Jun 2018 14:19:52 -1000 Message-Id: <29ad484c1b357fd7fd670a6f252d097677b808f8.1530402641.git.joeypabalinas@gmail.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Avoid processing reports containing invalid values to reduce multitouch input stutter. Signed-off-by: Joey Pabalinas 1 file changed, 9 insertions(+) diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index c0654db0b736543ca0..08b50e5908cecdda66 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c @@ -694,10 +694,19 @@ static void mt_complete_slot(struct mt_device *td, struct input_dev *input) { if ((td->mtclass.quirks & MT_QUIRK_CONTACT_CNT_ACCURATE) && td->num_received >= td->num_expected) return; + /* drop invalid values after counting them */ + if (td->curdata.x == 0xffff && + td->curdata.y == 0xffff && + td->curdata.w == 0xffff && + td->curdata.h == 0xffff) { + td->num_received++; + return; + } + if (td->curvalid || (td->mtclass.quirks & MT_QUIRK_ALWAYS_VALID)) { int active; int slotnum = mt_compute_slot(td, input); struct mt_slot *s = &td->curdata; struct input_mt *mt = input->mt; -- 2.18.0