From owner-svn-src-head@freebsd.org Fri May 4 01:36:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47838FC2D88; Fri, 4 May 2018 01:36:50 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E9BF07E488; Fri, 4 May 2018 01:36:49 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE6DA27EFC; Fri, 4 May 2018 01:36:49 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w441an1c054213; Fri, 4 May 2018 01:36:49 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w441anGr054212; Fri, 4 May 2018 01:36:49 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201805040136.w441anGr054212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Fri, 4 May 2018 01:36:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333235 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: grehan X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 333235 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 May 2018 01:36:50 -0000 Author: grehan Date: Fri May 4 01:36:49 2018 New Revision: 333235 URL: https://svnweb.freebsd.org/changeset/base/333235 Log: 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) Reviewed by: Leon Dang (original author) MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D15274 Modified: head/usr.sbin/bhyve/rfb.c Modified: head/usr.sbin/bhyve/rfb.c ============================================================================== --- head/usr.sbin/bhyve/rfb.c Fri May 4 00:56:41 2018 (r333234) +++ head/usr.sbin/bhyve/rfb.c Fri May 4 01:36:49 2018 (r333235) @@ -541,40 +541,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];