Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 May 2019 20:30:35 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r347406 - stable/11/usr.sbin/bhyve
Message-ID:  <201905092030.x49KUZgs047244@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Thu May  9 20:30:35 2019
New Revision: 347406
URL: https://svnweb.freebsd.org/changeset/base/347406

Log:
  MFC 333235:
  Allow arbitrary numbers of columns for VNC server screen resolution.
  
  The prior code only allowed multiples of 32 for the
  numbers of columns. Remove this restriction to allow
  a forthcoming UEFI firmware update to allow arbitrary
  x,y resolutions.
  
  (the code for handling rows already supported non mult-32 values)

Modified:
  stable/11/usr.sbin/bhyve/rfb.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/bhyve/rfb.c
==============================================================================
--- stable/11/usr.sbin/bhyve/rfb.c	Thu May  9 19:03:52 2019	(r347405)
+++ stable/11/usr.sbin/bhyve/rfb.c	Thu May  9 20:30:35 2019	(r347406)
@@ -544,40 +544,23 @@ 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)) {
-				if (orig_crc[x] != crc_p[x]) {
-					orig_crc[x] = crc_p[x];
-					crc_p[x] = 1;
-					changes++;
-				} else {
-					crc_p[x] = 0;
-				}
-			}
-		}
-
-		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];



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905092030.x49KUZgs047244>