A hardened Linux desktop, rebuilt from scratch, with your Windows apps built in. Free and open source.
diff -ruN a/libfprint/drivers/goodix53x5/device/base.c b/libfprint/drivers/goodix53x5/device/base.c
--- a/libfprint/drivers/goodix53x5/device/base.c 2026-11-15 22:03:58.000000000 +0000
+++ b/libfprint/drivers/goodix53x5/device/base.c 2026-11-15 22:05:03.830002900 +0000
@@ -354,6 +354,118 @@
#include "device/persistence.h"
#include "device/transport.h"
+#include <time.h>
+
+/* A kept reference is only trusted this long, counting time asleep, since
+ * the empty-sensor plane drifts with temperature. */
+#define GOODIX_KEPT_REFERENCE_MAX_AGE_US (10 * 60 * G_USEC_PER_SEC)
+
+static gint64
+goodix_boottime_us (void)
+{
+ struct timespec ts;
+
+ if (clock_gettime (CLOCK_BOOTTIME, &ts) != 0)
+ return 0;
+ return (gint64) ts.tv_sec * G_USEC_PER_SEC + ts.tv_nsec / 1000;
+}
+
+void
+goodix_kept_reference_clear (FpDevice *dev)
+{
+ FpiDeviceGoodix53x5 *self = FPI_DEVICE_GOODIX53X5 (dev);
+
+ g_clear_pointer (&self->kept_reference, g_free);
+ self->kept_reference_at_us = 0;
+}
+
+/* Called on a clean close, before the session's reference is dropped. */
+void
+goodix_kept_reference_save (FpDevice *dev)
+{
+ FpiDeviceGoodix53x5 *self = FPI_DEVICE_GOODIX53X5 (dev);
+
+ goodix_kept_reference_clear (dev);
+ if (!self->hardware_reference || !self->profile9_fdt.base_valid)
+ return;
+ self->kept_reference = g_memdup2 (self->hardware_reference,
+ GOODIX_SENSOR_PIXELS * sizeof (guint16));
+ self->kept_reference_at_us = goodix_boottime_us ();
+ memcpy (self->kept_base_down, self->profile9_fdt.base_down,
+ sizeof (self->kept_base_down));
+ memcpy (self->kept_base_up, self->profile9_fdt.base_up,
+ sizeof (self->kept_base_up));
+ memcpy (self->kept_base_manual, self->profile9_fdt.base_manual,
+ sizeof (self->kept_base_manual));
+ memcpy (self->kept_drift_anchor, self->profile9_fdt.drift_anchor,
+ sizeof (self->kept_drift_anchor));
+ self->kept_drift_anchor_empty = self->profile9_fdt.drift_anchor_empty;
+}
+
+/* Reference acquisition at open needs an empty sensor. When a finger is
+ * already there, use the reference kept from the last session instead of
+ * waiting for the finger to lift and touch again. Used once: the next open
+ * acquires a fresh one, and drift inside the session is handled by the
+ * usual false-down and invalid-base refreshes. */
+static gboolean
+goodix_kept_reference_restore (FpDevice *dev)
+{
+ FpiDeviceGoodix53x5 *self = FPI_DEVICE_GOODIX53X5 (dev);
+ GoodixMilanGeneration *generation;
+ g_autoptr(GError) error = NULL;
+ guint64 generation_id;
+ gint64 now = goodix_boottime_us ();
+
+ if (!self->kept_reference)
+ return FALSE;
+ if (now == 0 || now < self->kept_reference_at_us ||
+ now - self->kept_reference_at_us > GOODIX_KEPT_REFERENCE_MAX_AGE_US)
+ {
+ goodix_kept_reference_clear (dev);
+ return FALSE;
+ }
+ if (!goodix_milan_generation_allocate_id (&self->last_milan_generation_id,
+ &generation_id, &error))
+ {
+ goodix_kept_reference_clear (dev);
+ return FALSE;
+ }
+
+ generation = g_new0 (GoodixMilanGeneration, 1);
+ generation->generation_id = generation_id;
+ generation->setup_tx_on = g_memdup2 (self->kept_reference,
+ GOODIX_SENSOR_PIXELS * sizeof (guint16));
+ generation->admitted = TRUE;
+ goodix_milan_generation_reset_preprocess (generation);
+ if (self->milan_retained_generation)
+ goodix_milan_generation_transfer_process_state (
+ generation, self->milan_retained_generation);
+ goodix_milan_generation_invalidate (&self->milan_generation);
+ goodix_milan_generation_invalidate (&self->milan_retained_generation);
+ self->milan_generation = generation;
+
+ g_clear_pointer (&self->hardware_reference, g_free);
+ self->hardware_reference = g_steal_pointer (&self->kept_reference);
+ self->hardware_reference_id = generation_id;
+ self->hardware_refresh_pending = FALSE;
+ self->kept_reference_at_us = 0;
+
+ memcpy (self->profile9_fdt.base_down, self->kept_base_down,
+ sizeof (self->kept_base_down));
+ memcpy (self->profile9_fdt.base_up, self->kept_base_up,
+ sizeof (self->kept_base_up));
+ memcpy (self->profile9_fdt.base_manual, self->kept_base_manual,
+ sizeof (self->kept_base_manual));
+ memcpy (self->profile9_fdt.drift_anchor, self->kept_drift_anchor,
+ sizeof (self->kept_drift_anchor));
+ self->profile9_fdt.drift_anchor_empty = self->kept_drift_anchor_empty;
+ self->profile9_fdt.base_valid = TRUE;
+ self->profile9_fdt.event.pending = FALSE;
+ self->profile9_fdt.initial_recovery_pending = FALSE;
+ fp_info ("Finger on the sensor at open: using the reference kept from the last session");
+ return TRUE;
+}
+
void
goodix_milan_generation_retain_process (FpDevice *dev)
{
@@ -554,6 +666,14 @@
fpi_ssm_mark_completed (ssm);
return;
}
+
+ if (goodix_kept_reference_restore (dev))
+ {
+ data->leave_powered = TRUE;
+ goodix_base_timing_done (self, dev, "kept_reference");
+ fpi_ssm_mark_completed (ssm);
+ return;
+ }
goodix_milan_generation_retain_process (dev);
memset (&self->profile9_fdt.event, 0, sizeof (self->profile9_fdt.event));
diff -ruN a/libfprint/drivers/goodix53x5/device/base.h b/libfprint/drivers/goodix53x5/device/base.h
--- a/libfprint/drivers/goodix53x5/device/base.h 2026-11-15 22:03:58.000000000 +0000
+++ b/libfprint/drivers/goodix53x5/device/base.h 2026-11-15 22:04:40.307169600 +0000
@@ -174,6 +174,8 @@
void goodix_milan_generation_free (GoodixMilanGeneration *generation);
void goodix_milan_generation_invalidate (GoodixMilanGeneration **generation);
void goodix_milan_generation_retain_process (FpDevice *dev);
+void goodix_kept_reference_save (FpDevice *dev);
+void goodix_kept_reference_clear (FpDevice *dev);
guint64 goodix_milan_generation_note_use (GoodixMilanGeneration *generation);
void goodix_milan_generation_note_identify_prelude (GoodixMilanGeneration *generation);
diff -ruN a/libfprint/drivers/goodix53x5/device/session.c b/libfprint/drivers/goodix53x5/device/session.c
--- a/libfprint/drivers/goodix53x5/device/session.c 2026-11-15 22:03:58.000000000 +0000
+++ b/libfprint/drivers/goodix53x5/device/session.c 2026-11-15 22:05:14.794084300 +0000
@@ -1101,6 +1101,7 @@
* A completion winning idle cancellation may have just appended it. */
goodix_transport_invalidate (dev);
self->open_ref_powered = FALSE;
+ goodix_kept_reference_clear (dev);
goodix_milan_generation_retain_process (dev);
g_clear_pointer (&self->hardware_reference, g_free);
self->hardware_refresh_pending = FALSE;
@@ -1192,6 +1193,7 @@
fp_info ("Reinitializing hardware session");
self->action_epoch++;
+ goodix_kept_reference_clear (dev);
goodix_milan_generation_retain_process (dev);
g_clear_pointer (&self->hardware_reference, g_free);
self->hardware_refresh_pending = FALSE;
@@ -1289,6 +1291,7 @@
#endif
g_clear_pointer (&self->captured_raw_image, g_free);
g_clear_pointer (&self->pending_persistence_state, g_free);
+ goodix_kept_reference_save (dev);
goodix_milan_generation_retain_process (dev);
g_clear_pointer (&self->hardware_reference, g_free);
self->hardware_refresh_pending = FALSE;
diff -ruN a/libfprint/drivers/goodix53x5/driver-private.h b/libfprint/drivers/goodix53x5/driver-private.h
--- a/libfprint/drivers/goodix53x5/driver-private.h 2026-11-15 22:03:58.000000000 +0000
+++ b/libfprint/drivers/goodix53x5/driver-private.h 2026-11-15 22:04:38.972179900 +0000
@@ -153,6 +153,16 @@
guint16 *hardware_reference;
guint64 hardware_reference_id;
gboolean hardware_refresh_pending;
+ /* Wild OS: the last admitted reference and FDT bases, kept across a clean
+ * close (goodix_kept_reference_save) so a finger already on the sensor at
+ * the next open can be read instead of blocking reference acquisition. */
+ guint16 *kept_reference;
+ gint64 kept_reference_at_us;
+ guint8 kept_base_down[GOODIX_FDT_BASE_LEN];
+ guint8 kept_base_up[GOODIX_FDT_BASE_LEN];
+ guint8 kept_base_manual[GOODIX_FDT_BASE_LEN];
+ guint16 kept_drift_anchor[GOODIX_PROFILE9_FDT_AREA_COUNT];
+ gboolean kept_drift_anchor_empty;
/* Installed hardware callback/count outlive an individual read attempt. */
guint capture_unread;
gboolean captured_enroll_allowed;
diff -ruN a/libfprint/drivers/goodix53x5/goodix53x5.c b/libfprint/drivers/goodix53x5/goodix53x5.c
--- a/libfprint/drivers/goodix53x5/goodix53x5.c 2026-11-15 22:03:58.000000000 +0000
+++ b/libfprint/drivers/goodix53x5/goodix53x5.c 2026-11-15 22:05:14.794084300 +0000
@@ -152,6 +152,7 @@
goodix_family (self)->link.discard (self);
if (goodix_family (self)->channel.discard)
goodix_family (self)->channel.discard (self);
+ g_clear_pointer (&self->kept_reference, g_free);
g_clear_pointer (&self->hardware_reference, g_free);
g_clear_object (&self->session_cancel);
G_OBJECT_CLASS (fpi_device_goodix53x5_parent_class)->finalize (object);