aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorPeter Grehan <grehan@FreeBSD.org>2018-05-04 01:36:49 +0000
committerPeter Grehan <grehan@FreeBSD.org>2018-05-04 01:36:49 +0000
commit51688c129fa2766deb9fff2ba702bb3c3bd1889c (patch)
tree9965222bc090ec783fc74d6c5d6da1df4c35876b /usr.sbin
parent3804f572a3c06dd5cd4343449acdf4d8a02768ab (diff)
Notes
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bhyve/rfb.c33
1 files changed, 8 insertions, 25 deletions
diff --git a/usr.sbin/bhyve/rfb.c b/usr.sbin/bhyve/rfb.c
index 0f492e1b9d48..db4d33cbd0f7 100644
--- a/usr.sbin/bhyve/rfb.c
+++ b/usr.sbin/bhyve/rfb.c
@@ -541,16 +541,21 @@ rfb_send_screen(struct rfb_softc *rc, int cfd, int all)
}
for (x = 0; x < xcells; x++) {
+ if (x == (xcells - 1) && rem_x > 0)
+ cellwidth = rem_x;
+ else
+ cellwidth = PIX_PER_CELL;
+
if (rc->hw_crc)
crc_p[x] = fast_crc32(p,
- PIX_PER_CELL * sizeof(uint32_t),
+ cellwidth * sizeof(uint32_t),
crc_p[x]);
else
crc_p[x] = (uint32_t)crc32(crc_p[x],
(Bytef *)p,
- PIX_PER_CELL * sizeof(uint32_t));
+ cellwidth * sizeof(uint32_t));
- p += PIX_PER_CELL;
+ p += cellwidth;
/* check for crc delta if last row in cell */
if ((y & PIXCELL_MASK) == PIXCELL_MASK || y == (h-1)) {
@@ -563,28 +568,6 @@ rfb_send_screen(struct rfb_softc *rc, int cfd, int all)
}
}
}
-
- if (rem_x) {
- if (rc->hw_crc)
- crc_p[x] = fast_crc32(p,
- rem_x * sizeof(uint32_t),
- crc_p[x]);
- else
- crc_p[x] = (uint32_t)crc32(crc_p[x],
- (Bytef *)p,
- rem_x * sizeof(uint32_t));
- p += rem_x;
-
- if ((y & PIXCELL_MASK) == PIXCELL_MASK || y == (h-1)) {
- if (orig_crc[x] != crc_p[x]) {
- orig_crc[x] = crc_p[x];
- crc_p[x] = 1;
- changes++;
- } else {
- crc_p[x] = 0;
- }
- }
- }
}
/* If number of changes is > THRESH percent, send the whole screen */