From 09eb07561fc0fdc38ee240308954f2a818fee09e Mon Sep 17 00:00:00 2001 From: Povilas Kanapickas Date: Wed, 6 May 2020 01:05:39 +0300 Subject: [PATCH] genesys: Split simple_scan() into version that accepts ScanSession --- backend/genesys/gl646.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/backend/genesys/gl646.cpp b/backend/genesys/gl646.cpp index 678fdd0d4..5cd4a4e73 100644 --- a/backend/genesys/gl646.cpp +++ b/backend/genesys/gl646.cpp @@ -96,6 +96,9 @@ static void simple_scan(Genesys_Device* dev, const Genesys_Sensor& sensor, Genesys_Settings settings, bool move, bool forward, bool shading, std::vector& data, const char* test_identifier); +static void simple_scan(Genesys_Device* dev, const Genesys_Sensor& sensor, + const ScanSession& session, bool move, bool shading, + std::vector& data, const char* test_identifier); /** * Send the stop scan command * */ @@ -2966,7 +2969,6 @@ static void simple_scan(Genesys_Device* dev, const Genesys_Sensor& sensor, const char* scan_identifier) { DBG_HELPER_ARGS(dbg, "move=%d, forward=%d, shading=%d", do_move, forward, shading); - unsigned lines, bpp; /* round up to multiple of 3 in case of CIS scanner */ if (dev->model->is_cis) { @@ -3014,7 +3016,16 @@ static void simple_scan(Genesys_Device* dev, const Genesys_Sensor& sensor, dev->cmd_set->init_regs_for_scan_session(dev, sensor, regs, session); - /* allocate memory fo scan : LINCNT may have been adjusted for CCD reordering */ + simple_scan(dev, sensor, session, do_move, shading, data, scan_identifier); +} + +static void simple_scan(Genesys_Device* dev, const Genesys_Sensor& sensor, + const ScanSession& session, bool move, + bool shading, std::vector& data, const char* scan_identifier) +{ + unsigned lines, bpp; + + // allocate memory fo scan : LINCNT may have been adjusted for CCD reordering if (dev->model->is_cis) { lines = dev->reg.get24(REG_LINCNT) / 3; } else {