Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 May 2014 22:12:47 +0000 (UTC)
From:      Aleksandr Rybalko <ray@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r265403 - head/sys/dev/vt/hw/vga
Message-ID:  <201405052212.s45MCldG097169@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ray
Date: Mon May  5 22:12:46 2014
New Revision: 265403
URL: http://svnweb.freebsd.org/changeset/base/265403

Log:
  Switch vga drivers to use names and new vt(4) driver probe method.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/dev/vt/hw/vga/vga.c

Modified: head/sys/dev/vt/hw/vga/vga.c
==============================================================================
--- head/sys/dev/vt/hw/vga/vga.c	Mon May  5 22:10:31 2014	(r265402)
+++ head/sys/dev/vt/hw/vga/vga.c	Mon May  5 22:12:46 2014	(r265403)
@@ -71,6 +71,7 @@ struct vga_softc {
 #define	VT_VGA_HEIGHT	480
 #define	VT_VGA_MEMSIZE	(VT_VGA_WIDTH * VT_VGA_HEIGHT / 8)
 
+static vd_probe_t	vga_probe;
 static vd_init_t	vga_init;
 static vd_blank_t	vga_blank;
 static vd_bitbltchr_t	vga_bitbltchr;
@@ -81,6 +82,8 @@ static vd_putchar_t	vga_putchar;
 static vd_postswitch_t	vga_postswitch;
 
 static const struct vt_driver vt_vga_driver = {
+	.vd_name	= "vga",
+	.vd_probe	= vga_probe,
 	.vd_init	= vga_init,
 	.vd_blank	= vga_blank,
 	.vd_bitbltchr	= vga_bitbltchr,
@@ -97,8 +100,7 @@ static const struct vt_driver vt_vga_dri
  * buffer is always big enough to support both.
  */
 static struct vga_softc vga_conssoftc;
-VT_CONSDEV_DECLARE(vt_vga_driver, MAX(80, PIXEL_WIDTH(VT_VGA_WIDTH)),
-    MAX(25, PIXEL_HEIGHT(VT_VGA_HEIGHT)), &vga_conssoftc);
+VT_DRIVER_DECLARE(vt_vga, vt_vga_driver);
 
 static inline void
 vga_setcolor(struct vt_device *vd, term_color_t color)
@@ -631,10 +633,22 @@ vga_initialize(struct vt_device *vd, int
 }
 
 static int
+vga_probe(struct vt_device *vd)
+{
+
+	return (CN_INTERNAL);
+}
+
+static int
 vga_init(struct vt_device *vd)
 {
-	struct vga_softc *sc = vd->vd_softc;
-	int textmode = 0;
+	struct vga_softc *sc;
+	int textmode;
+
+	if (vd->vd_softc == NULL)
+		vd->vd_softc = (void *)&vga_conssoftc;
+	sc = vd->vd_softc;
+	textmode = 0;
 
 #if defined(__amd64__) || defined(__i386__)
 	sc->vga_fb_tag = X86_BUS_SPACE_MEM;



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