From owner-svn-src-head@freebsd.org Wed Jul 27 00:03:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFFB0BA5AB7; Wed, 27 Jul 2016 00:03:30 +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 mx1.freebsd.org (Postfix) with ESMTPS id CC206195B; Wed, 27 Jul 2016 00:03:30 +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 u6R03UVU030048; Wed, 27 Jul 2016 00:03:30 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6R03UAI030047; Wed, 27 Jul 2016 00:03:30 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201607270003.u6R03UAI030047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Wed, 27 Jul 2016 00:03:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303352 - head/usr.sbin/bhyve X-SVN-Group: head 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.22 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: Wed, 27 Jul 2016 00:03:31 -0000 Author: grehan Date: Wed Jul 27 00:03:29 2016 New Revision: 303352 URL: https://svnweb.freebsd.org/changeset/base/303352 Log: - Change the fbuf "vga" parameter to "vga=on|io|off". "io" is the default, and allows VGA i/o registers to be accessed. This is required by Win7/2k8 graphics guests that use a combination of BIOS int10 and UEFI. "off" disables all VGA i/o and mem accesses. "on" is not yet hooked up, but will enable full VGA rendering. OpenBSD/UEFI >= 5.9 graphics guests can be booted using "vga=off" - Allow "rfb" to be used instead of "tcp" for the fbuf VNC description. "tcp" will be removed at a future point and is kept as an alias. Discussed with: Leon Dang MFC after: 3 days Modified: head/usr.sbin/bhyve/pci_fbuf.c Modified: head/usr.sbin/bhyve/pci_fbuf.c ============================================================================== --- head/usr.sbin/bhyve/pci_fbuf.c Wed Jul 27 00:03:18 2016 (r303351) +++ head/usr.sbin/bhyve/pci_fbuf.c Wed Jul 27 00:03:29 2016 (r303352) @@ -95,7 +95,8 @@ struct pci_fbuf_softc { char *rfb_host; int rfb_port; int rfb_wait; - int use_vga; + int vga_enabled; + int vga_full; uint32_t fbaddr; char *fb_base; @@ -114,7 +115,7 @@ pci_fbuf_usage(char *opt) { fprintf(stderr, "Invalid fbuf emulation \"%s\"\r\n", opt); - fprintf(stderr, "fbuf: {wait,}tcp=:port\r\n"); + fprintf(stderr, "fbuf: {wait,}{vga=on|io|off,}rfb=:port\r\n"); } static void @@ -234,13 +235,6 @@ pci_fbuf_parse_opts(struct pci_fbuf_soft continue; } -#if 0 /* notyet */ - if (strcmp(xopts, "vga") == 0) { - sc->use_vga = 1; - continue; - } -#endif - if ((config = strchr(xopts, '=')) == NULL) { pci_fbuf_usage(xopts); ret = -1; @@ -252,17 +246,31 @@ pci_fbuf_parse_opts(struct pci_fbuf_soft DPRINTF(DEBUG_VERBOSE, ("pci_fbuf option %s = %s\r\n", xopts, config)); - if (!strcmp(xopts, "tcp")) { + if (!strcmp(xopts, "tcp") || !strcmp(xopts, "rfb")) { /* parse host-ip:port */ - tmpstr = strsep(&config, ":"); + tmpstr = strsep(&config, ":"); if (!config) sc->rfb_port = atoi(tmpstr); else { sc->rfb_port = atoi(config); sc->rfb_host = tmpstr; } - } else if (!strcmp(xopts, "w")) { - sc->memregs.width = atoi(config); + } else if (!strcmp(xopts, "vga")) { + if (!strcmp(config, "off")) { + sc->vga_enabled = 0; + } else if (!strcmp(config, "io")) { + sc->vga_enabled = 1; + sc->vga_full = 0; + } else if (!strcmp(config, "on")) { + sc->vga_enabled = 1; + sc->vga_full = 1; + } else { + pci_fbuf_usage(opts); + ret = -1; + goto done; + } + } else if (!strcmp(xopts, "w")) { + sc->memregs.width = atoi(config); if (sc->memregs.width > COLS_MAX) { pci_fbuf_usage(xopts); ret = -1; @@ -299,7 +307,7 @@ pci_fbuf_render(struct bhyvegc *gc, void sc = arg; - if (sc->use_vga && sc->gc_image->vgamode) { + if (sc->vga_full && sc->gc_image->vgamode) { /* TODO: mode switching to vga and vesa should use the special * EFI-bhyve protocol port. */ @@ -352,12 +360,21 @@ pci_fbuf_init(struct vmctx *ctx, struct sc->memregs.height = ROWS_DEFAULT; sc->memregs.depth = 32; + sc->vga_enabled = 1; + sc->vga_full = 0; + sc->fsc_pi = pi; error = pci_fbuf_parse_opts(sc, opts); if (error != 0) goto done; + /* XXX until VGA rendering is enabled */ + if (sc->vga_full != 0) { + fprintf(stderr, "pci_fbuf: VGA rendering not enabled"); + goto done; + } + sc->fb_base = vm_create_devmem(ctx, VM_FRAMEBUFFER, "framebuffer", FB_SIZE); if (sc->fb_base == MAP_FAILED) { error = -1; @@ -382,7 +399,8 @@ pci_fbuf_init(struct vmctx *ctx, struct console_init(sc->memregs.width, sc->memregs.height, sc->fb_base); console_fb_register(pci_fbuf_render, sc); - sc->vgasc = vga_init(!sc->use_vga); + if (sc->vga_enabled) + sc->vgasc = vga_init(!sc->vga_full); sc->gc_image = console_get_image(); fbuf_sc = sc;