From a8df8201e9d8c083fcc65c5836d231d8eb95e4f3 Mon Sep 17 00:00:00 2001 From: Povilas Kanapickas Date: Sat, 14 Dec 2019 09:42:57 +0200 Subject: [PATCH] genesys: Fix stagger configuration on 8400F --- backend/genesys/low.cpp | 12 +++++++++--- backend/genesys/tables_sensor.cpp | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/backend/genesys/low.cpp b/backend/genesys/low.cpp index 277fdd03a..6130c9696 100644 --- a/backend/genesys/low.cpp +++ b/backend/genesys/low.cpp @@ -944,9 +944,15 @@ void compute_session_pixel_offsets(const Genesys_Device* dev, ScanSession& s, s.pixel_endx /= s.hwdpi_divisor; // in case of stagger we have to start at an odd coordinate - if (s.num_staggered_lines > 0 && (s.pixel_startx & 1) == 0) { - s.pixel_startx++; - s.pixel_endx++; + bool stagger_starts_even = dev->model->model_id == ModelId::CANON_8400F; + if (s.num_staggered_lines > 0) { + if (!stagger_starts_even && (s.pixel_startx & 1) == 0) { + s.pixel_startx++; + s.pixel_endx++; + } else if (stagger_starts_even && (s.pixel_startx & 1) != 0) { + s.pixel_startx++; + s.pixel_endx++; + } } } else if (dev->model->asic_type == AsicType::GL845 || diff --git a/backend/genesys/tables_sensor.cpp b/backend/genesys/tables_sensor.cpp index c957a8cb3..419974525 100644 --- a/backend/genesys/tables_sensor.cpp +++ b/backend/genesys/tables_sensor.cpp @@ -2263,7 +2263,7 @@ void genesys_init_sensor_tables() sensor.fau_gain_white_ref = 160; sensor.gain_white_ref = 160; sensor.exposure = { 0x9c40, 0x9c40, 0x9c40 }; - sensor.stagger_config = StaggerConfig{ 1600, 4 }; // FIXME: may be incorrect + sensor.stagger_config = StaggerConfig{ 3200, 6 }; sensor.custom_regs = {}; sensor.gamma = { 1.0f, 1.0f, 1.0f }; sensor.get_logical_hwdpi_fun = get_sensor_optical_with_ccd_divisor;