genesys: Add output_line_bytes_requested to the session struct

merge-requests/190/head
Povilas Kanapickas 2019-09-16 09:34:13 +03:00
rodzic 88adea9cd6
commit 20ad0c8c2e
8 zmienionych plików z 12 dodań i 18 usunięć

Wyświetl plik

@ -1042,9 +1042,7 @@ static void gl124_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sens
dev->current_setup.max_shift = session.max_color_shift_lines + session.num_staggered_lines;
dev->total_bytes_read = 0;
dev->total_bytes_to_read =
multiply_by_depth_ceil(session.params.get_requested_pixels() * session.params.lines,
session.params.depth) * session.params.channels;
dev->total_bytes_to_read = session.output_line_bytes_requested * session.params.lines;
DBG(DBG_info, "%s: total bytes to send to frontend = %lu\n", __func__,
(u_long) dev->total_bytes_to_read);

Wyświetl plik

@ -706,9 +706,7 @@ static void gl646_setup_registers(Genesys_Device* dev,
dev->current_setup.max_shift = session.max_color_shift_lines + session.num_staggered_lines;
dev->total_bytes_read = 0;
dev->total_bytes_to_read =
multiply_by_depth_ceil(session.params.get_requested_pixels() * session.params.lines,
session.params.depth) * session.params.channels;
dev->total_bytes_to_read = session.output_line_bytes_requested * session.params.lines;
/* select color filter based on settings */
regs->find_reg(0x04).value &= ~REG04_FILTER;

Wyświetl plik

@ -1864,9 +1864,7 @@ dummy \ scanned lines
dev->current_setup.max_shift = session.max_color_shift_lines + session.num_staggered_lines;
dev->total_bytes_read = 0;
dev->total_bytes_to_read =
multiply_by_depth_ceil(session.params.get_requested_pixels() * session.params.lines,
session.params.depth) * session.params.channels;
dev->total_bytes_to_read = session.output_line_bytes_requested * session.params.lines;
DBG(DBG_info, "%s: total bytes to send = %lu\n", __func__, (u_long) dev->total_bytes_to_read);
}

Wyświetl plik

@ -1292,9 +1292,7 @@ static void gl843_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sens
dev->current_setup.max_shift = session.max_color_shift_lines + session.num_staggered_lines;
dev->total_bytes_read = 0;
dev->total_bytes_to_read =
multiply_by_depth_ceil(session.params.get_requested_pixels() * session.params.lines,
session.params.depth) * session.params.channels;
dev->total_bytes_to_read = session.output_line_bytes_requested * session.params.lines;
DBG(DBG_info, "%s: total bytes to send = %lu\n", __func__, (u_long) dev->total_bytes_to_read);
}

Wyświetl plik

@ -916,9 +916,7 @@ static void gl846_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sens
dev->current_setup.max_shift = session.max_color_shift_lines + session.num_staggered_lines;
dev->total_bytes_read = 0;
dev->total_bytes_to_read =
multiply_by_depth_ceil(session.params.get_requested_pixels() * session.params.lines,
session.params.depth) * session.params.channels;
dev->total_bytes_to_read = session.output_line_bytes_requested * session.params.lines;
DBG(DBG_info, "%s: total bytes to send = %lu\n", __func__, (u_long) dev->total_bytes_to_read);
}

Wyświetl plik

@ -927,9 +927,7 @@ static void gl847_init_scan_regs(Genesys_Device* dev, const Genesys_Sensor& sens
dev->current_setup.max_shift = session.max_color_shift_lines + session.num_staggered_lines;
dev->total_bytes_read = 0;
dev->total_bytes_to_read =
multiply_by_depth_ceil(session.params.get_requested_pixels() * session.params.lines,
session.params.depth) * session.params.channels;
dev->total_bytes_to_read = session.output_line_bytes_requested * session.params.lines;
DBG(DBG_info, "%s: total bytes to send = %lu\n", __func__, (u_long) dev->total_bytes_to_read);
/* END TODO */

Wyświetl plik

@ -1522,6 +1522,9 @@ void compute_session(Genesys_Device* dev, ScanSession& s, const Genesys_Sensor&
s.params.depth);
}
s.output_line_bytes_requested = multiply_by_depth_ceil(
s.params.get_requested_pixels() * s.params.channels, s.params.depth);
s.output_total_bytes_raw = s.output_line_bytes_raw * s.output_line_count;
s.output_total_bytes = s.output_line_bytes * s.output_line_count;

Wyświetl plik

@ -251,6 +251,9 @@ struct ScanSession {
// Equal to output_line_bytes if sensor does not have segments
unsigned output_line_bytes_raw = 0;
// the number of bytes per line as requested by the frontend
unsigned output_line_bytes_requested = 0;
// the number of lines in the output of the scanner. This must be larger than the user
// requested number due to line staggering and color channel shifting.
unsigned output_line_count = 0;