+/*
+ * Use CRC to detect which rows have changed. This is only to
+ * improve performance when using stepping mode, as we then only update
+ * rows which have been modified.
+ */
+static int
+memwin_row_changed(int memory_id, int row, unsigned int address)
+{
+ int row_changed;
+ u_int32_t crc_new = 0;
+ u_int8_t *buf8;
+
+ buf8 = memory_getbuf(memory_id, address);
+ crc_new = crc32(0L, Z_NULL, 0);
+ crc_new = crc32(crc_new, buf8, cfg->bytes_per_row);
+
+ if ((memwin_infos->crc_init != false) &&
+ (crc_new == memwin_infos->crc[row])) {
+ row_changed = false;
+ } else {
+ memwin_infos->crc[row] = crc_new;
+ log_debug(" Row %02d value(s) change", row);
+ row_changed = true;
+ }
+
+ return row_changed;
+}
+