From: Nikita Travkin <nikita@trvn.ru>
To: Linus Walleij <linusw@kernel.org>
Cc: Thanh Nguyen <thanhnguyxn07@gmail.com>,
dmitry.torokhov@gmail.com, linux-input@vger.kernel.org,
linux-kernel@vger.kernel.org, linus.walleij@linaro.org,
timon37@lavabit.com
Subject: Re: [PATCH] Input: zinitix: iterate contact slots by finger count
Date: Sun, 05 Jul 2026 12:13:11 +0500 [thread overview]
Message-ID: <8ca5a59eeb522bfd949f31e2416639fd@trvn.ru> (raw)
In-Reply-To: <CAD++jLknVJYLc0-StNFcN67pUDRQunUJvNn-Npz+HJ-j2WXB5g@mail.gmail.com>
Linus Walleij писал(а) 30.06.2026 14:11:
> Hi Thanh,
>
> sorry for slow reply!
>
> On Wed, Apr 8, 2026 at 6:19 AM Thanh Nguyen <thanhnguyxn07@gmail.com> wrote:
>>
>> On affected devices (for example Samsung A3 2015), the value in
>> touch_event.finger_mask appears to behave as a count of reported slots
>> rather than a bitmask. Using for_each_set_bit() can then skip valid
>> contacts and break multitouch gestures.
>>
>> Keep filtering by SUB_BIT_EXIST to avoid reporting shadow contacts, but
>> iterate from slot 0 up to min(finger_mask, MAX_SUPPORTED_FINGER_NUM).
>> This follows the maintainer feedback to treat the field as a possible
>> count while preserving the anti-shadow check.
>>
>> Fixes: e941dc13fd37 ("Input: zinitix - do not report shadow fingers")
>> Link: https://bugzilla.kernel.org/show_bug.cgi?id=221278
>> Signed-off-by: Thanh Nguyen <thanhnguyxn07@gmail.com>
>> ---
>> v2:
>> - Address maintainer feedback: do not revert e941dc13fd37.
>> - Keep SUB_BIT_EXIST filtering to avoid shadow contacts.
>> - Treat finger_mask as a slot-count bound and iterate 0..min(mask, max).
>
> I can test this if need be, but maybe Nikita want to check it
> first?
>
Hi!
I've quickly checked it on my gt58 (bt532) but it made me remember that
on this device/chip it seems like only "TOUCH_MODE=0" is supported and
reported fingers don't have extra "width"/"angle" fields. (I have a
vague recollection that this was somehow related to touchkeys being
enabled or not) Otherwise on this chip (firmware? touch_mode?) the
finger count is indeed a count and not a mask.
Given we have an EXIST bit IMO it still makes sense to make this change.
Maybe also worth adding a short comment why we're treating mask as
count if Linus's devices report mask and your/mine report count...
Nikita
> Yours,
> Linus Walleij
next prev parent reply other threads:[~2026-07-05 7:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-08 5:19 [PATCH] Input: zinitix: iterate contact slots by finger count Thanh Nguyen
2026-06-30 9:11 ` Linus Walleij
2026-07-05 7:13 ` Nikita Travkin [this message]
2026-07-05 11:17 ` Thành Nguyễn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8ca5a59eeb522bfd949f31e2416639fd@trvn.ru \
--to=nikita@trvn.ru \
--cc=dmitry.torokhov@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linusw@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=thanhnguyxn07@gmail.com \
--cc=timon37@lavabit.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox