From 20debe2ee4d6aa1543890eb65b7ff2237bf83baf Mon Sep 17 00:00:00 2001 From: Shengyu Qu Date: Tue, 21 Jul 2026 21:57:50 +0800 Subject: [PATCH] drivers: aes2550: handle tapping without swiping When tapping on the sensor rather than swiping through it, super RSR will drop slices with 0-3 pixels of Y motion. In such case, self->strips_len is zero and causing protocol error. Handle such cases by calling for a re-scan. Closes: https://gitlab.freedesktop.org/libfprint/libfprint/-/work_items/786 Assisted-by: DeepSeek:deepseek-v4-pro-preview Signed-off-by: Shengyu Qu --- libfprint/drivers/aes2550.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/libfprint/drivers/aes2550.c b/libfprint/drivers/aes2550.c index 66a3b470..950f5d14 100644 --- a/libfprint/drivers/aes2550.c +++ b/libfprint/drivers/aes2550.c @@ -245,13 +245,19 @@ capture_set_idle_reqs_cb (FpiUsbTransfer *transfer, /* marking machine complete will re-trigger finger detection loop */ fpi_ssm_mark_completed (transfer->ssm); } + else if (!error) + { + /* No image frames were captured (e.g. user tapped without swiping). + * Such case is quite easy to happen, since Super RSR is enabled and + * thus "Slices with 0-3 pixels of Y motion are discarded" according + * to the design specification manual. */ + fpi_image_device_retry_scan (dev, FP_DEVICE_RETRY_TOO_SHORT); + fpi_image_device_report_finger_status (dev, FALSE); + fpi_ssm_mark_completed (transfer->ssm); + } else { - if (error) - fpi_ssm_mark_failed (transfer->ssm, error); - else - fpi_ssm_mark_failed (transfer->ssm, - fpi_device_error_new (FP_DEVICE_ERROR_PROTO)); + fpi_ssm_mark_failed (transfer->ssm, error); } }