svn commit: r263817 - in stable/9: sys/conf sys/dev/drm2 sys/dev/drm2/i915 sys/dev/drm2/radeon sys/dev/fb sys/dev/syscons sys/dev/vt sys/dev/vt/font sys/dev/vt/hw/fb sys/dev/vt/hw/ofwfb sys/dev/vt/...

Aleksandr Rybalko ray at FreeBSD.org
Thu Mar 27 15:58:24 UTC 2014


Author: ray
Date: Thu Mar 27 15:58:18 2014
New Revision: 263817
URL: http://svnweb.freebsd.org/changeset/base/263817

Log:
  MFC 219886, 226100, 226111, 226341, 242529, 259015, 259016, 259019, 259049,
   259071, 259102, 259110, 259129, 259130, 259178, 259179, 259203, 259221,
   259261, 259532, 259615, 259650, 259651, 259667, 259680, 259727, 259761,
   259772, 259776, 259777, 259830, 259882, 259915, 260160, 260449, 260450,
   260688, 260888, 260953, 261269, 261547, 261551, 261552, 261553, 261585
  o Merge vt(4) virtual terminal (a.k.a. newcons) to stable/9.
  o Merge teken updates.
  o Add few more tty methods required by vt(4).
  o Update syscons(4) to work with fresh teken.
  
  Sponsored by:	The FreeBSD Foundation

Added:
  stable/9/sys/dev/fb/fb_if.m
     - copied unchanged from r259016, head/sys/dev/fb/fb_if.m
  stable/9/sys/dev/fb/fbd.c
     - copied, changed from r259016, head/sys/dev/fb/fbd.c
  stable/9/sys/dev/vt/
     - copied from r259016, head/sys/dev/vt/
  stable/9/sys/kern/subr_terminal.c
     - copied, changed from r259016, head/sys/kern/subr_terminal.c
  stable/9/sys/sys/terminal.h
     - copied, changed from r259016, head/sys/sys/terminal.h
  stable/9/tools/tools/vt/
     - copied from r259019, head/tools/tools/vt/
Modified:
  stable/9/sys/conf/files
  stable/9/sys/conf/files.amd64
  stable/9/sys/conf/files.arm
  stable/9/sys/conf/files.i386
  stable/9/sys/conf/files.powerpc
  stable/9/sys/conf/files.sparc64
  stable/9/sys/conf/kmod.mk
  stable/9/sys/conf/options
  stable/9/sys/dev/drm2/drmP.h
  stable/9/sys/dev/drm2/drm_fb_helper.c
  stable/9/sys/dev/drm2/drm_os_freebsd.h
  stable/9/sys/dev/drm2/i915/i915_drv.c
  stable/9/sys/dev/drm2/i915/intel_fb.c
  stable/9/sys/dev/drm2/radeon/radeon.h
  stable/9/sys/dev/drm2/radeon/radeon_drv.c
  stable/9/sys/dev/drm2/radeon/radeon_fb.c
  stable/9/sys/dev/drm2/radeon/radeon_pm.c
  stable/9/sys/dev/syscons/scterm-teken.c
  stable/9/sys/dev/syscons/scvidctl.c
  stable/9/sys/dev/vt/font/vt_font_default.c
  stable/9/sys/dev/vt/font/vt_mouse_cursor.c
  stable/9/sys/dev/vt/hw/fb/vt_fb.c
  stable/9/sys/dev/vt/hw/ofwfb/ofwfb.c   (contents, props changed)
  stable/9/sys/dev/vt/hw/vga/vga.c
  stable/9/sys/dev/vt/hw/xboxfb/xboxfb.c
  stable/9/sys/dev/vt/vt.h
  stable/9/sys/dev/vt/vt_buf.c
  stable/9/sys/dev/vt/vt_consolectl.c
  stable/9/sys/dev/vt/vt_core.c
  stable/9/sys/dev/vt/vt_font.c
  stable/9/sys/dev/vt/vt_sysmouse.c
  stable/9/sys/kern/tty.c
  stable/9/sys/modules/drm2/drm2/Makefile
  stable/9/sys/modules/drm2/i915kms/Makefile
  stable/9/sys/modules/drm2/radeonkms/Makefile
  stable/9/sys/sparc64/sparc64/machdep.c
  stable/9/sys/sys/consio.h
  stable/9/sys/sys/eventhandler.h
  stable/9/sys/sys/fbio.h
  stable/9/sys/sys/tty.h
  stable/9/sys/teken/demo/Makefile
  stable/9/sys/teken/demo/teken_demo.c
  stable/9/sys/teken/libteken/Symbol.map
  stable/9/sys/teken/stress/teken_stress.c
  stable/9/sys/teken/teken.c
  stable/9/sys/teken/teken.h
  stable/9/sys/teken/teken_subr.h
  stable/9/tools/tools/vt/mkkfont/mkkfont.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/dev/   (props changed)
  stable/9/sys/modules/   (props changed)
  stable/9/sys/sys/   (props changed)
  stable/9/tools/tools/   (props changed)

Modified: stable/9/sys/conf/files
==============================================================================
--- stable/9/sys/conf/files	Thu Mar 27 14:07:36 2014	(r263816)
+++ stable/9/sys/conf/files	Thu Mar 27 15:58:18 2014	(r263817)
@@ -87,7 +87,7 @@ pccarddevs.h			standard				   \
 	compile-with	"${AWK} -f $S/tools/pccarddevs2h.awk $S/dev/pccard/pccarddevs" \
 	no-obj no-implicit-rule before-depend				   \
 	clean		"pccarddevs.h"
-teken_state.h		optional sc					   \
+teken_state.h		optional sc | vt				   \
 	dependency	"$S/teken/gensequences $S/teken/sequences" \
 	compile-with	"${AWK} -f $S/teken/gensequences $S/teken/sequences > teken_state.h" \
 	no-obj no-implicit-rule before-depend				   \
@@ -1143,7 +1143,9 @@ dev/ex/if_ex_isa.c		optional ex isa
 dev/ex/if_ex_pccard.c		optional ex pccard
 dev/exca/exca.c			optional cbb
 dev/fatm/if_fatm.c		optional fatm pci
-dev/fb/splash.c			optional splash
+dev/fb/fbd.c			optional fbd | vt
+dev/fb/fb_if.m			standard
+dev/fb/splash.c			optional sc splash
 dev/fdt/fdt_common.c		optional fdt
 dev/fdt/fdt_pci.c		optional fdt pci
 dev/fdt/fdt_static_dtb.S	optional fdt fdt_dtb_static
@@ -2122,6 +2124,17 @@ dev/utopia/utopia.c		optional utopia
 dev/vge/if_vge.c		optional vge
 dev/vkbd/vkbd.c			optional vkbd
 dev/vr/if_vr.c			optional vr pci
+dev/vt/colors/vt_termcolors.c	optional vt
+dev/vt/font/vt_font_default.c	optional vt
+dev/vt/font/vt_mouse_cursor.c	optional vt
+dev/vt/hw/fb/vt_fb.c		optional vt
+dev/vt/hw/vga/vga.c		optional vt vt_vga
+dev/vt/logo/logo_freebsd.c	optional vt splash
+dev/vt/vt_buf.c			optional vt
+dev/vt/vt_consolectl.c		optional vt
+dev/vt/vt_core.c		optional vt
+dev/vt/vt_font.c		optional vt
+dev/vt/vt_sysmouse.c		optional vt
 dev/vte/if_vte.c		optional vte pci
 dev/vx/if_vx.c			optional vx
 dev/vx/if_vx_eisa.c		optional vx eisa
@@ -2543,6 +2556,7 @@ kern/subr_sleepqueue.c		standard
 kern/subr_smp.c			standard
 kern/subr_stack.c		optional ddb | stack | ktr
 kern/subr_taskqueue.c		standard
+kern/subr_terminal.c		optional vt
 kern/subr_trap.c		standard
 kern/subr_turnstile.c		standard
 kern/subr_uio.c			standard
@@ -3431,7 +3445,7 @@ security/mac_portacl/mac_portacl.c optio
 security/mac_seeotheruids/mac_seeotheruids.c optional mac_seeotheruids
 security/mac_stub/mac_stub.c	optional mac_stub
 security/mac_test/mac_test.c	optional mac_test
-teken/teken.c			optional sc
+teken/teken.c			optional sc | vt
 ufs/ffs/ffs_alloc.c		optional ffs
 ufs/ffs/ffs_balloc.c		optional ffs
 ufs/ffs/ffs_inode.c		optional ffs

Modified: stable/9/sys/conf/files.amd64
==============================================================================
--- stable/9/sys/conf/files.amd64	Thu Mar 27 14:07:36 2014	(r263816)
+++ stable/9/sys/conf/files.amd64	Thu Mar 27 15:58:18 2014	(r263817)
@@ -227,7 +227,7 @@ dev/hwpmc/hwpmc_uncore.c	optional	hwpmc
 dev/hwpmc/hwpmc_piv.c		optional	hwpmc
 dev/hwpmc/hwpmc_tsc.c		optional	hwpmc
 dev/hwpmc/hwpmc_x86.c		optional	hwpmc
-dev/kbd/kbd.c			optional	atkbd | sc | ukbd
+dev/kbd/kbd.c			optional	atkbd | sc | ukbd | vt
 dev/lindev/full.c		optional	lindev
 dev/lindev/lindev.c		optional	lindev
 dev/nfe/if_nfe.c		optional	nfe pci

Modified: stable/9/sys/conf/files.arm
==============================================================================
--- stable/9/sys/conf/files.arm	Thu Mar 27 14:07:36 2014	(r263816)
+++ stable/9/sys/conf/files.arm	Thu Mar 27 15:58:18 2014	(r263817)
@@ -58,6 +58,7 @@ geom/geom_bsd.c			optional	geom_bsd
 geom/geom_bsd_enc.c		optional	geom_bsd
 geom/geom_mbr.c			optional	geom_mbr
 geom/geom_mbr_enc.c		optional	geom_mbr
+dev/kbd/kbd.c			optional	sc | vt
 libkern/arm/divsi3.S		standard
 libkern/arm/ffs.S		standard
 libkern/arm/muldi3.c		standard

Modified: stable/9/sys/conf/files.i386
==============================================================================
--- stable/9/sys/conf/files.i386	Thu Mar 27 14:07:36 2014	(r263816)
+++ stable/9/sys/conf/files.i386	Thu Mar 27 15:58:18 2014	(r263817)
@@ -232,7 +232,7 @@ dev/ipmi/ipmi_smbios.c		optional ipmi
 dev/ipmi/ipmi_ssif.c		optional ipmi smbus
 dev/ipmi/ipmi_pci.c		optional ipmi pci
 dev/ipmi/ipmi_linux.c		optional ipmi compat_linux
-dev/kbd/kbd.c			optional atkbd | sc | ukbd
+dev/kbd/kbd.c			optional atkbd | sc | ukbd | vt
 dev/le/if_le_isa.c		optional le isa
 dev/lindev/full.c		optional lindev
 dev/lindev/lindev.c		optional lindev
@@ -275,6 +275,7 @@ dev/uart/uart_cpu_i386.c	optional uart
 dev/viawd/viawd.c		optional viawd
 dev/acpica/acpi_if.m		standard
 dev/acpi_support/acpi_wmi_if.m	standard
+dev/vt/hw/xboxfb/xboxfb.c	optional vt_xboxfb
 dev/wbwd/wbwd.c			optional wbwd
 dev/wpi/if_wpi.c		optional wpi
 dev/isci/isci.c							optional isci

Modified: stable/9/sys/conf/files.powerpc
==============================================================================
--- stable/9/sys/conf/files.powerpc	Thu Mar 27 14:07:36 2014	(r263816)
+++ stable/9/sys/conf/files.powerpc	Thu Mar 27 15:58:18 2014	(r263817)
@@ -31,7 +31,7 @@ dev/hwpmc/hwpmc_powerpc.c	optional	hwpmc
 dev/iicbus/ad7417.c		optional	ad7417 powermac
 dev/iicbus/ds1775.c		optional	ds1775 powermac
 dev/iicbus/max6690.c		optional	max6690 powermac
-dev/kbd/kbd.c			optional	sc
+dev/kbd/kbd.c			optional	sc | vt
 dev/ofw/openfirm.c		optional	aim | fdt
 dev/ofw/openfirmio.c		optional	aim | fdt
 dev/ofw/ofw_bus_if.m		optional	aim | fdt
@@ -57,6 +57,7 @@ dev/syscons/scvtb.c		optional	sc
 dev/tsec/if_tsec.c		optional	tsec
 dev/tsec/if_tsec_fdt.c		optional	tsec fdt
 dev/uart/uart_cpu_powerpc.c	optional	uart aim
+dev/vt/hw/ofwfb/ofwfb.c		optional	vt aim
 kern/kern_clocksource.c		standard
 kern/subr_dummy_vdso_tc.c	standard
 kern/syscalls.c			optional	ktr

Modified: stable/9/sys/conf/files.sparc64
==============================================================================
--- stable/9/sys/conf/files.sparc64	Thu Mar 27 14:07:36 2014	(r263816)
+++ stable/9/sys/conf/files.sparc64	Thu Mar 27 15:58:18 2014	(r263817)
@@ -38,7 +38,7 @@ dev/fb/fb.c			optional	sc
 dev/fb/gallant12x22.c		optional	sc
 dev/fb/machfb.c			optional	machfb sc
 dev/hwpmc/hwpmc_sparc64.c	optional	hwpmc
-dev/kbd/kbd.c			optional	atkbd | sc | ukbd
+dev/kbd/kbd.c			optional	atkbd | sc | ukbd | vt
 dev/le/if_le_lebuffer.c		optional	le sbus
 dev/le/if_le_ledma.c		optional	le sbus
 dev/le/lebuffer_sbus.c		optional	le sbus
@@ -58,7 +58,8 @@ dev/syscons/scgfbrndr.c		optional	sc
 dev/syscons/scterm-teken.c	optional	sc
 dev/syscons/scvtb.c		optional	sc
 dev/uart/uart_cpu_sparc64.c	optional	uart
-dev/uart/uart_kbd_sun.c		optional	uart sc
+dev/uart/uart_kbd_sun.c		optional	uart sc | vt
+dev/vt/hw/ofwfb/ofwfb.c		optional	vt
 kern/kern_clocksource.c		standard
 kern/subr_dummy_vdso_tc.c	standard
 kern/syscalls.c			optional	ktr

Modified: stable/9/sys/conf/kmod.mk
==============================================================================
--- stable/9/sys/conf/kmod.mk	Thu Mar 27 14:07:36 2014	(r263816)
+++ stable/9/sys/conf/kmod.mk	Thu Mar 27 15:58:18 2014	(r263817)
@@ -346,6 +346,7 @@ CFLAGS+=	${CONF_CFLAGS}
 
 MFILES?= dev/acpica/acpi_if.m dev/acpi_support/acpi_wmi_if.m \
 	dev/agp/agp_if.m dev/ata/ata_if.m dev/eisa/eisa_if.m \
+	dev/fb/fb_if.m \
 	dev/iicbus/iicbb_if.m dev/iicbus/iicbus_if.m \
 	dev/mmc/mmcbr_if.m dev/mmc/mmcbus_if.m \
 	dev/mii/miibus_if.m dev/mvs/mvs_if.m dev/ofw/ofw_bus_if.m \

Modified: stable/9/sys/conf/options
==============================================================================
--- stable/9/sys/conf/options	Thu Mar 27 14:07:36 2014	(r263816)
+++ stable/9/sys/conf/options	Thu Mar 27 15:58:18 2014	(r263817)
@@ -730,8 +730,10 @@ SAFE_DEBUG		opt_safe.h
 SAFE_NO_RNG		opt_safe.h
 SAFE_RNDTEST		opt_safe.h
 
-# syscons options
+# syscons/vt options
 MAXCONS			opt_syscons.h
+VT_FB_DEFAULT_WIDTH	opt_syscons.h
+VT_FB_DEFAULT_HEIGHT	opt_syscons.h
 SC_ALT_MOUSE_IMAGE	opt_syscons.h
 SC_CUT_SPACES2TABS	opt_syscons.h
 SC_CUT_SEPCHARS		opt_syscons.h
@@ -754,6 +756,9 @@ SC_NORM_REV_ATTR	opt_syscons.h
 SC_PIXEL_MODE		opt_syscons.h
 SC_RENDER_DEBUG		opt_syscons.h
 SC_TWOBUTTON_MOUSE	opt_syscons.h
+DEV_SC			opt_syscons.h
+DEV_VT			opt_syscons.h
+
 
 # teken terminal emulator options
 TEKEN_CONS25		opt_teken.h

Modified: stable/9/sys/dev/drm2/drmP.h
==============================================================================
--- stable/9/sys/dev/drm2/drmP.h	Thu Mar 27 14:07:36 2014	(r263816)
+++ stable/9/sys/dev/drm2/drmP.h	Thu Mar 27 15:58:18 2014	(r263817)
@@ -112,6 +112,7 @@ struct drm_device;
 
 #include "opt_compat.h"
 #include "opt_drm.h"
+#include "opt_syscons.h"
 #ifdef DRM_DEBUG
 #undef DRM_DEBUG
 #define DRM_DEBUG_DEFAULT_ON 1

Modified: stable/9/sys/dev/drm2/drm_fb_helper.c
==============================================================================
--- stable/9/sys/dev/drm2/drm_fb_helper.c	Thu Mar 27 14:07:36 2014	(r263816)
+++ stable/9/sys/dev/drm2/drm_fb_helper.c	Thu Mar 27 15:58:18 2014	(r263817)
@@ -36,6 +36,41 @@ __FBSDID("$FreeBSD$");
 #include <dev/drm2/drm_fb_helper.h>
 #include <dev/drm2/drm_crtc_helper.h>
 
+#if defined(__FreeBSD__)
+struct vt_kms_softc {
+	struct drm_fb_helper *fb_helper;
+	struct task	fb_mode_task;
+};
+
+static fb_enter_t	vt_kms_postswitch;
+static void vt_restore_fbdev_mode(void *, int);
+
+/* Call restore out of vt(9) locks. */
+static void
+vt_restore_fbdev_mode(void *arg, int pending)
+{
+	struct drm_fb_helper *fb_helper;
+	struct vt_kms_softc *sc;
+
+	sc = (struct vt_kms_softc *)arg;
+	fb_helper = sc->fb_helper;
+	sx_xlock(&fb_helper->dev->mode_config.mutex);
+	drm_fb_helper_restore_fbdev_mode(fb_helper);
+	sx_xunlock(&fb_helper->dev->mode_config.mutex);
+}
+
+static int
+vt_kms_postswitch(void *arg)
+{
+	struct vt_kms_softc *sc;
+
+	sc = (struct vt_kms_softc *)arg;
+	taskqueue_enqueue_fast(taskqueue_thread, &sc->fb_mode_task);
+
+	return (0);
+}
+#endif
+
 static DRM_LIST_HEAD(kernel_fb_helper_list);
 
 /* simple single crtc case helper function */
@@ -216,6 +251,10 @@ static int
 fb_get_options(const char *connector_name, char **option)
 {
 
+	/*
+	 * TODO: store mode options pointer in ${option} for connector with
+	 * name ${connector_name}
+	 */
 	return (1);
 }
 
@@ -892,11 +931,13 @@ int drm_fb_helper_single_fb_probe(struct
 	int new_fb = 0;
 	int crtc_count = 0;
 	int i;
-#if 0
 	struct fb_info *info;
-#endif
 	struct drm_fb_helper_surface_size sizes;
 	int gamma_size = 0;
+#if defined(__FreeBSD__)
+	struct vt_kms_softc *sc;
+	device_t kdev;
+#endif
 
 	memset(&sizes, 0, sizeof(struct drm_fb_helper_surface_size));
 	sizes.surface_depth = 24;
@@ -973,8 +1014,21 @@ int drm_fb_helper_single_fb_probe(struct
 	if (new_fb < 0)
 		return new_fb;
 
-#if 0
+#if defined(__FreeBSD__)
+	sc = malloc(sizeof(struct vt_kms_softc), DRM_MEM_KMS,
+	    M_WAITOK | M_ZERO);
+	sc->fb_helper = fb_helper;
+	TASK_INIT(&sc->fb_mode_task, 0, vt_restore_fbdev_mode, sc);
+
 	info = fb_helper->fbdev;
+
+	info->fb_name = device_get_nameunit(fb_helper->dev->device);
+	info->fb_depth = fb_helper->fb->bits_per_pixel;
+	info->fb_height = fb_helper->fb->height;
+	info->fb_width = fb_helper->fb->width;
+	info->fb_stride = fb_helper->fb->pitches[0];
+	info->fb_priv = sc;
+	info->enter = &vt_kms_postswitch;
 #endif
 
 	/* set the fb pointer */
@@ -982,7 +1036,23 @@ int drm_fb_helper_single_fb_probe(struct
 		fb_helper->crtc_info[i].mode_set.fb = fb_helper->fb;
 	}
 
-#if 0
+#if defined(__FreeBSD__)
+	if (new_fb) {
+		device_t fbd;
+		int ret;
+
+		kdev = fb_helper->dev->device;
+		fbd = device_add_child(kdev, "fbd", device_get_unit(kdev));
+		if (fbd != NULL) 
+			ret = device_probe_and_attach(fbd);
+		else
+			ret = ENODEV;
+#ifdef DEV_VT
+		if (ret != 0)
+			DRM_ERROR("Failed to attach fbd device: %d\n", ret);
+#endif
+	}
+#else
 	if (new_fb) {
 		info->var.pixclock = 0;
 		if (register_framebuffer(info) < 0) {
@@ -1006,7 +1076,6 @@ int drm_fb_helper_single_fb_probe(struct
 	if (new_fb)
 		list_add(&fb_helper->kernel_fb_list, &kernel_fb_helper_list);
 #endif
-
 	return 0;
 }
 

Modified: stable/9/sys/dev/drm2/drm_os_freebsd.h
==============================================================================
--- stable/9/sys/dev/drm2/drm_os_freebsd.h	Thu Mar 27 14:07:36 2014	(r263816)
+++ stable/9/sys/dev/drm2/drm_os_freebsd.h	Thu Mar 27 15:58:18 2014	(r263817)
@@ -6,6 +6,8 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
+#include <sys/fbio.h>
+
 #if _BYTE_ORDER == _BIG_ENDIAN
 #define	__BIG_ENDIAN 4321
 #else

Modified: stable/9/sys/dev/drm2/i915/i915_drv.c
==============================================================================
--- stable/9/sys/dev/drm2/i915/i915_drv.c	Thu Mar 27 14:07:36 2014	(r263816)
+++ stable/9/sys/dev/drm2/i915/i915_drv.c	Thu Mar 27 15:58:18 2014	(r263817)
@@ -40,6 +40,8 @@ __FBSDID("$FreeBSD$");
 #include <dev/drm2/drm_pciids.h>
 #include <dev/drm2/i915/intel_drv.h>
 
+#include "fb_if.h"
+
 /* drv_PCI_IDs comes from drm_pciids.h, generated from drm_pciids.txt. */
 static drm_pci_id_list_t i915_pciidlist[] = {
 	i915_PCI_IDS
@@ -380,6 +382,25 @@ i915_attach(device_t kdev)
 	return (drm_attach(kdev, i915_pciidlist));
 }
 
+static struct fb_info *
+i915_fb_helper_getinfo(device_t kdev)
+{
+	struct intel_fbdev *ifbdev;
+	drm_i915_private_t *dev_priv;
+	struct drm_device *dev;
+	struct fb_info *info;
+
+	dev = device_get_softc(kdev);
+	dev_priv = dev->dev_private;
+	ifbdev = dev_priv->fbdev;
+	if (ifbdev == NULL)
+		return (NULL);
+
+	info = ifbdev->helper.fbdev;
+
+	return (info);
+}
+
 const struct intel_device_info *
 i915_get_device_id(int device)
 {
@@ -400,6 +421,10 @@ static device_method_t i915_methods[] = 
 	DEVMETHOD(device_suspend,	i915_suspend),
 	DEVMETHOD(device_resume,	i915_resume),
 	DEVMETHOD(device_detach,	drm_detach),
+
+	/* Framebuffer service methods */
+	DEVMETHOD(fb_getinfo,		i915_fb_helper_getinfo),
+
 	DEVMETHOD_END
 };
 

Modified: stable/9/sys/dev/drm2/i915/intel_fb.c
==============================================================================
--- stable/9/sys/dev/drm2/i915/intel_fb.c	Thu Mar 27 14:07:36 2014	(r263816)
+++ stable/9/sys/dev/drm2/i915/intel_fb.c	Thu Mar 27 15:58:18 2014	(r263817)
@@ -41,8 +41,8 @@ static int intelfb_create(struct intel_f
 	struct drm_device *dev = ifbdev->helper.dev;
 #if 0
 	struct drm_i915_private *dev_priv = dev->dev_private;
-	struct fb_info *info;
 #endif
+	struct fb_info *info;
 	struct drm_framebuffer *fb;
 	struct drm_mode_fb_cmd2 mode_cmd;
 	struct drm_i915_gem_object *obj;
@@ -86,6 +86,16 @@ static int intelfb_create(struct intel_f
 	}
 
 	info->par = ifbdev;
+#else
+	info = malloc(sizeof(struct fb_info), DRM_MEM_KMS, M_WAITOK | M_ZERO);
+	info->fb_size = size;
+	info->fb_bpp = sizes->surface_bpp;
+	info->fb_width = sizes->fb_width;
+	info->fb_height = sizes->fb_height;
+	info->fb_pbase = dev->agp->base + obj->gtt_offset;
+	info->fb_vbase = (vm_offset_t)pmap_mapdev_attr(info->fb_pbase, size,
+	    PAT_WRITE_COMBINING);
+
 #endif
 
 	ret = intel_framebuffer_init(dev, &ifbdev->ifb, &mode_cmd, obj);
@@ -95,8 +105,8 @@ static int intelfb_create(struct intel_f
 	fb = &ifbdev->ifb.base;
 
 	ifbdev->helper.fb = fb;
-#if 0
 	ifbdev->helper.fbdev = info;
+#if 0
 
 	strcpy(info->fix.id, "inteldrmfb");
 
@@ -135,9 +145,8 @@ static int intelfb_create(struct intel_f
 
 	/* Use default scratch pixmap (info->pixmap.flags = FB_PIXMAP_SYSTEM) */
 #endif
-
-	DRM_DEBUG_KMS("allocated %dx%d fb: 0x%08x, bo %p\n",
-		      fb->width, fb->height,
+	DRM_DEBUG_KMS("allocated %dx%d (s %dbits) fb: 0x%08x, bo %p\n",
+		      fb->width, fb->height, fb->depth,
 		      obj->gtt_offset, obj);
 
 	DRM_UNLOCK(dev);

Modified: stable/9/sys/dev/drm2/radeon/radeon.h
==============================================================================
--- stable/9/sys/dev/drm2/radeon/radeon.h	Thu Mar 27 14:07:36 2014	(r263816)
+++ stable/9/sys/dev/drm2/radeon/radeon.h	Thu Mar 27 15:58:18 2014	(r263817)
@@ -2041,6 +2041,9 @@ void	radeon_pm_acpi_event_handler(struct
 int	radeon_ttm_init(struct radeon_device *rdev);
 void	radeon_ttm_fini(struct radeon_device *rdev);
 
+/* radeon_fb.c */
+struct fb_info *	radeon_fb_helper_getinfo(device_t kdev);
+
 /* r600.c */
 int r600_ih_ring_alloc(struct radeon_device *rdev);
 void r600_ih_ring_fini(struct radeon_device *rdev);

Modified: stable/9/sys/dev/drm2/radeon/radeon_drv.c
==============================================================================
--- stable/9/sys/dev/drm2/radeon/radeon_drv.c	Thu Mar 27 14:07:36 2014	(r263816)
+++ stable/9/sys/dev/drm2/radeon/radeon_drv.c	Thu Mar 27 15:58:18 2014	(r263817)
@@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
 
 #include <dev/drm2/drm_pciids.h>
 
+#include "fb_if.h"
 
 /*
  * KMS wrapper.
@@ -495,6 +496,8 @@ radeon_resume(device_t kdev)
 	return (-ret);
 }
 
+extern struct fb_info *	radeon_fb_helper_getinfo(device_t kdev);
+
 static device_method_t radeon_methods[] = {
 	/* Device interface */
 	DEVMETHOD(device_probe,		radeon_probe),
@@ -502,6 +505,10 @@ static device_method_t radeon_methods[] 
 	DEVMETHOD(device_suspend,	radeon_suspend),
 	DEVMETHOD(device_resume,	radeon_resume),
 	DEVMETHOD(device_detach,	drm_detach),
+
+	/* Framebuffer service methods */
+	DEVMETHOD(fb_getinfo,		radeon_fb_helper_getinfo),
+
 	DEVMETHOD_END
 };
 

Modified: stable/9/sys/dev/drm2/radeon/radeon_fb.c
==============================================================================
--- stable/9/sys/dev/drm2/radeon/radeon_fb.c	Thu Mar 27 14:07:36 2014	(r263816)
+++ stable/9/sys/dev/drm2/radeon/radeon_fb.c	Thu Mar 27 15:58:18 2014	(r263817)
@@ -27,6 +27,8 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
+#include <machine/_inttypes.h>
+
 #include <dev/drm2/drmP.h>
 #include <dev/drm2/drm_crtc.h>
 #include <dev/drm2/drm_crtc_helper.h>
@@ -46,7 +48,7 @@ struct radeon_fbdev {
 	struct radeon_device *rdev;
 };
 
-#ifdef DUMBBELL_WIP
+#if defined(__linux__)
 static struct fb_ops radeonfb_ops = {
 	.owner = THIS_MODULE,
 	.fb_check_var = drm_fb_helper_check_var,
@@ -60,7 +62,7 @@ static struct fb_ops radeonfb_ops = {
 	.fb_debug_enter = drm_fb_helper_debug_enter,
 	.fb_debug_leave = drm_fb_helper_debug_leave,
 };
-#endif /* DUMBBELL_WIP */
+#endif
 
 
 int radeon_align_pitch(struct radeon_device *rdev, int width, int bpp, bool tiled)
@@ -191,20 +193,13 @@ static int radeonfb_create(struct radeon
 			   struct drm_fb_helper_surface_size *sizes)
 {
 	struct radeon_device *rdev = rfbdev->rdev;
-#ifdef DUMBBELL_WIP
 	struct fb_info *info;
-#endif /* DUMBBELL_WIP */
 	struct drm_framebuffer *fb = NULL;
 	struct drm_mode_fb_cmd2 mode_cmd;
 	struct drm_gem_object *gobj = NULL;
 	struct radeon_bo *rbo = NULL;
-#ifdef DUMBBELL_WIP
-	device_t device = rdev->dev;
-#endif /* DUMBBELL_WIP */
 	int ret;
-#ifdef DUMBBELL_WIP
 	unsigned long tmp;
-#endif /* DUMBBELL_WIP */
 
 	mode_cmd.width = sizes->surface_width;
 	mode_cmd.height = sizes->surface_height;
@@ -224,16 +219,7 @@ static int radeonfb_create(struct radeon
 
 	rbo = gem_to_radeon_bo(gobj);
 
-#ifdef DUMBBELL_WIP
-	/* okay we have an object now allocate the framebuffer */
-	info = framebuffer_alloc(0, device);
-	if (info == NULL) {
-		ret = -ENOMEM;
-		goto out_unref;
-	}
-
-	info->par = rfbdev;
-#endif /* DUMBBELL_WIP */
+	info = malloc(sizeof(*info), DRM_MEM_KMS, M_WAITOK | M_ZERO);
 
 	ret = radeon_framebuffer_init(rdev->ddev, &rfbdev->rfb, &mode_cmd, gobj);
 	if (ret) {
@@ -245,61 +231,29 @@ static int radeonfb_create(struct radeon
 
 	/* setup helper */
 	rfbdev->helper.fb = fb;
-#ifdef DUMBBELL_WIP
 	rfbdev->helper.fbdev = info;
 
-	memset_io(rbo->kptr, 0x0, radeon_bo_size(rbo));
-
-	strcpy(info->fix.id, "radeondrmfb");
-
-	drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth);
-
-	info->flags = FBINFO_DEFAULT | FBINFO_CAN_FORCE_OUTPUT;
-	info->fbops = &radeonfb_ops;
+	memset(rbo->kptr, 0x0, radeon_bo_size(rbo));
 
 	tmp = radeon_bo_gpu_offset(rbo) - rdev->mc.vram_start;
-	info->fix.smem_start = rdev->mc.aper_base + tmp;
-	info->fix.smem_len = radeon_bo_size(rbo);
-	info->screen_base = rbo->kptr;
-	info->screen_size = radeon_bo_size(rbo);
-
-	drm_fb_helper_fill_var(info, &rfbdev->helper, sizes->fb_width, sizes->fb_height);
-
-	/* setup aperture base/size for vesafb takeover */
-	info->apertures = alloc_apertures(1);
-	if (!info->apertures) {
-		ret = -ENOMEM;
-		goto out_unref;
-	}
-	info->apertures->ranges[0].base = rdev->ddev->mode_config.fb_base;
-	info->apertures->ranges[0].size = rdev->mc.aper_size;
+	info->fb_size  = radeon_bo_size(rbo);
+	info->fb_bpp = sizes->surface_bpp;
+	info->fb_width = sizes->surface_width;
+	info->fb_height = sizes->surface_height;
+	info->fb_pbase = rdev->mc.aper_base + tmp;
+	info->fb_vbase = (vm_offset_t)rbo->kptr;
 
-	/* Use default scratch pixmap (info->pixmap.flags = FB_PIXMAP_SYSTEM) */
-
-	if (info->screen_base == NULL) {
-		ret = -ENOSPC;
-		goto out_unref;
-	}
-
-	ret = fb_alloc_cmap(&info->cmap, 256, 0);
-	if (ret) {
-		ret = -ENOMEM;
-		goto out_unref;
-	}
-
-	DRM_INFO("fb mappable at 0x%lX\n",  info->fix.smem_start);
+	DRM_INFO("fb mappable at 0x%" PRIXPTR "\n",  info->fb_pbase);
 	DRM_INFO("vram apper at 0x%lX\n",  (unsigned long)rdev->mc.aper_base);
 	DRM_INFO("size %lu\n", (unsigned long)radeon_bo_size(rbo));
 	DRM_INFO("fb depth is %d\n", fb->depth);
 	DRM_INFO("   pitch is %d\n", fb->pitches[0]);
 
-	vga_switcheroo_client_fb_set(rdev->ddev->pdev, info);
-#endif /* DUMBBELL_WIP */
 	return 0;
 
 out_unref:
 	if (rbo) {
-
+		/* TODO? dumbbell@ */
 	}
 	if (fb && ret) {
 		drm_gem_object_unreference(gobj);
@@ -332,21 +286,13 @@ void radeon_fb_output_poll_changed(struc
 
 static int radeon_fbdev_destroy(struct drm_device *dev, struct radeon_fbdev *rfbdev)
 {
-#ifdef DUMBBELL_WIP
 	struct fb_info *info;
-#endif /* DUMBBELL_WIP */
 	struct radeon_framebuffer *rfb = &rfbdev->rfb;
 
-#ifdef DUMBBELL_WIP
 	if (rfbdev->helper.fbdev) {
 		info = rfbdev->helper.fbdev;
-
-		unregister_framebuffer(info);
-		if (info->cmap.len)
-			fb_dealloc_cmap(&info->cmap);
-		framebuffer_release(info);
+		free(info, DRM_MEM_KMS);
 	}
-#endif /* DUMBBELL_WIP */
 
 	if (rfb->obj) {
 		DRM_UNLOCK(dev); /* Work around lock recursion. dumbbell@ */
@@ -431,3 +377,22 @@ bool radeon_fbdev_robj_is_fb(struct rade
 		return true;
 	return false;
 }
+
+struct fb_info *
+radeon_fb_helper_getinfo(device_t kdev)
+{
+	struct drm_device *dev;
+	struct radeon_device *rdev;
+	struct radeon_fbdev *rfbdev;
+	struct fb_info *info;
+
+	dev = device_get_softc(kdev);
+	rdev = dev->dev_private;
+	rfbdev = rdev->mode_info.rfbdev;
+	if (rfbdev == NULL)
+		return (NULL);
+
+	info = rfbdev->helper.fbdev;
+
+	return (info);
+}

Modified: stable/9/sys/dev/drm2/radeon/radeon_pm.c
==============================================================================
--- stable/9/sys/dev/drm2/radeon/radeon_pm.c	Thu Mar 27 14:07:36 2014	(r263816)
+++ stable/9/sys/dev/drm2/radeon/radeon_pm.c	Thu Mar 27 15:58:18 2014	(r263817)
@@ -248,7 +248,7 @@ static void radeon_pm_set_clocks(struct 
 	    (rdev->pm.requested_power_state_index == rdev->pm.current_power_state_index))
 		return;
 
-	DRM_LOCK(rdev->ddev);
+	//DRM_LOCK(rdev->ddev); XXX Recursion, already locked in drm_attach/drm_load -- dumbbell@
 	sx_xlock(&rdev->pm.mclk_lock);
 	sx_xlock(&rdev->ring_lock);
 
@@ -263,7 +263,7 @@ static void radeon_pm_set_clocks(struct 
 			/* needs a GPU reset dont reset here */
 			sx_xunlock(&rdev->ring_lock);
 			sx_xunlock(&rdev->pm.mclk_lock);
-			DRM_UNLOCK(rdev->ddev);
+			//DRM_UNLOCK(rdev->ddev); XXX Recursion, already locked in drm_attach/drm_load -- dumbbell@
 			return;
 		}
 	}
@@ -299,7 +299,7 @@ static void radeon_pm_set_clocks(struct 
 
 	sx_xunlock(&rdev->ring_lock);
 	sx_xunlock(&rdev->pm.mclk_lock);
-	DRM_UNLOCK(rdev->ddev);
+	//DRM_UNLOCK(rdev->ddev); XXX Recursion, already locked in drm_attach/drm_load -- dumbbell@
 }
 
 static void radeon_pm_print_states(struct radeon_device *rdev)

Copied: stable/9/sys/dev/fb/fb_if.m (from r259016, head/sys/dev/fb/fb_if.m)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/9/sys/dev/fb/fb_if.m	Thu Mar 27 15:58:18 2014	(r263817, copy of r259016, head/sys/dev/fb/fb_if.m)
@@ -0,0 +1,13 @@
+#include <sys/bus.h>
+#include <sys/fbio.h>
+
+INTERFACE fb;
+
+METHOD int pin_max {
+	device_t dev;
+	int *npins;
+};
+
+METHOD struct fb_info * getinfo {
+	device_t dev;
+};

Copied and modified: stable/9/sys/dev/fb/fbd.c (from r259016, head/sys/dev/fb/fbd.c)
==============================================================================
--- head/sys/dev/fb/fbd.c	Thu Dec  5 22:38:53 2013	(r259016, copy source)
+++ stable/9/sys/dev/fb/fbd.c	Thu Mar 27 15:58:18 2014	(r263817)
@@ -255,8 +255,12 @@ fb_probe(struct fb_info *info)
 		info->wr4 = &vt_fb_indir_wr4;
 		info->copy = &vt_fb_indir_copy;
 	} else if (info->fb_vbase != 0) {
-		if (info->fb_pbase == 0)
+		if (info->fb_pbase == 0) {
 			info->fb_flags |= FB_FLAG_NOMMAP;
+		} else {
+			if (info->fb_mmap == NULL)
+				info->fb_mmap = &fb_mmap;
+		}
 		info->wr1 = &vt_fb_mem_wr1;
 		info->wr2 = &vt_fb_mem_wr2;
 		info->wr4 = &vt_fb_mem_wr4;
@@ -264,6 +268,10 @@ fb_probe(struct fb_info *info)
 	} else
 		return (ENXIO);
 
+	if (info->fb_ioctl == NULL)
+		info->fb_ioctl = &fb_ioctl;
+
+
 	return (0);
 }
 
@@ -277,6 +285,7 @@ fb_init(struct fb_list_entry *entry, int
 	entry->fb_si = make_dev(&fb_cdevsw, unit, UID_ROOT, GID_WHEEL,
 	    0600, "fb%d", unit);
 	entry->fb_si->si_drv1 = info;
+	info->fb_cdev = entry->fb_si;
 
 	return (0);
 }

Modified: stable/9/sys/dev/syscons/scterm-teken.c
==============================================================================
--- stable/9/sys/dev/syscons/scterm-teken.c	Thu Mar 27 14:07:36 2014	(r263816)
+++ stable/9/sys/dev/syscons/scterm-teken.c	Thu Mar 27 15:58:18 2014	(r263817)
@@ -542,7 +542,14 @@ scteken_putchar(void *arg, const teken_p
 	vm_offset_t p;
 	int cursor, attr;
 
+	/*
+	 * No support for printing right hand sides for CJK fullwidth
+	 * characters. Simply print a space and assume that the left
+	 * hand side describes the entire character.
+	 */
 	attr = scteken_attr(a) << 8;
+	if (a->ta_format & TF_CJK_RIGHT)
+		c = ' ';
 #ifdef TEKEN_UTF8
 	scteken_get_cp437(&c, &attr);
 #endif /* TEKEN_UTF8 */

Modified: stable/9/sys/dev/syscons/scvidctl.c
==============================================================================
--- stable/9/sys/dev/syscons/scvidctl.c	Thu Mar 27 14:07:36 2014	(r263816)
+++ stable/9/sys/dev/syscons/scvidctl.c	Thu Mar 27 15:58:18 2014	(r263817)
@@ -137,6 +137,7 @@ sc_set_text_mode(scr_stat *scp, struct t
 		 int fontsize, int fontwidth)
 {
     video_info_t info;
+    struct winsize wsz;
     u_char *font;
     int prev_ysize;
     int error;
@@ -234,16 +235,9 @@ sc_set_text_mode(scr_stat *scp, struct t
 
     if (tp == NULL)
 	return 0;
-    DPRINTF(5, ("ws_*size (%d,%d), size (%d,%d)\n",
-	tp->t_winsize.ws_col, tp->t_winsize.ws_row, scp->xsize, scp->ysize));
-    if (tp->t_winsize.ws_col != scp->xsize
-	|| tp->t_winsize.ws_row != scp->ysize) {
-	tp->t_winsize.ws_col = scp->xsize;
-	tp->t_winsize.ws_row = scp->ysize;
-
-	tty_signal_pgrp(tp, SIGWINCH);
-    }
-
+    wsz.ws_col = scp->xsize;
+    wsz.ws_row = scp->ysize;
+    tty_set_winsize(tp, &wsz);
     return 0;
 }
 
@@ -254,6 +248,7 @@ sc_set_graphics_mode(scr_stat *scp, stru
     return ENODEV;
 #else
     video_info_t info;
+    struct winsize wsz;
     int error;
     int s;
 
@@ -300,14 +295,9 @@ sc_set_graphics_mode(scr_stat *scp, stru
 
     if (tp == NULL)
 	return 0;
-    if (tp->t_winsize.ws_xpixel != scp->xpixel
-	|| tp->t_winsize.ws_ypixel != scp->ypixel) {
-	tp->t_winsize.ws_xpixel = scp->xpixel;
-	tp->t_winsize.ws_ypixel = scp->ypixel;
-
-	tty_signal_pgrp(tp, SIGWINCH);
-    }
-
+    wsz.ws_col = scp->xsize;
+    wsz.ws_row = scp->ysize;
+    tty_set_winsize(tp, &wsz);
     return 0;
 #endif /* SC_NO_MODE_CHANGE */
 }
@@ -320,7 +310,7 @@ sc_set_pixel_mode(scr_stat *scp, struct 
     return ENODEV;
 #else
     video_info_t info;
-    ksiginfo_t ksi;
+    struct winsize wsz;
     u_char *font;
     int prev_ysize;
     int error;
@@ -425,20 +415,9 @@ sc_set_pixel_mode(scr_stat *scp, struct 
 
     if (tp == NULL)
 	return 0;
-    if (tp->t_winsize.ws_col != scp->xsize
-	|| tp->t_winsize.ws_row != scp->ysize) {
-	tp->t_winsize.ws_col = scp->xsize;
-	tp->t_winsize.ws_row = scp->ysize;
-	if (tp->t_pgrp != NULL) {
-	    ksiginfo_init(&ksi);
-	    ksi.ksi_signo = SIGWINCH;
-	    ksi.ksi_code = SI_KERNEL;
-	    PGRP_LOCK(tp->t_pgrp);
-	    pgsignal(tp->t_pgrp, SIGWINCH, 1, &ksi);
-	    PGRP_UNLOCK(tp->t_pgrp);
-	}
-    }
-
+    wsz.ws_col = scp->xsize;
+    wsz.ws_row = scp->ysize;
+    tty_set_winsize(tp, &wsz);
     return 0;
 #endif /* SC_PIXEL_MODE */
 }

Modified: stable/9/sys/dev/vt/font/vt_font_default.c
==============================================================================
--- head/sys/dev/vt/font/vt_font_default.c	Thu Dec  5 22:38:53 2013	(r259016)
+++ stable/9/sys/dev/vt/font/vt_font_default.c	Thu Mar 27 15:58:18 2014	(r263817)
@@ -2194,9 +2194,12 @@ struct vt_font vt_font_default = {
 	.vf_width		= 8,
 	.vf_height		= 16,
 	.vf_bytes		= font_bytes,
-	.vf_normal		= font_mapping_normal,
-	.vf_normal_length	= 248,
-	.vf_bold		= font_mapping_bold,
-	.vf_bold_length		= 260,
+	.vf_map			= {
+				    font_mapping_normal,
+				    NULL,
+				    font_mapping_bold,
+				    NULL,
+				  },
+	.vf_map_count		= { 248, 0, 260, 0 },
 	.vf_refcount		= 1,
 };

Modified: stable/9/sys/dev/vt/font/vt_mouse_cursor.c
==============================================================================
--- head/sys/dev/vt/font/vt_mouse_cursor.c	Thu Dec  5 22:38:53 2013	(r259016)
+++ stable/9/sys/dev/vt/font/vt_mouse_cursor.c	Thu Mar 27 15:58:18 2014	(r263817)
@@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$");
 
 #include <dev/vt/vt.h>
 
+#ifndef SC_NO_CUTPASTE
 struct mouse_cursor vt_default_mouse_pointer = {
 	.map = {
 		0x00, /* "__      " */
@@ -66,3 +67,4 @@ struct mouse_cursor vt_default_mouse_poi
 	.w = 8,
 	.h = 13,
 };
+#endif

Modified: stable/9/sys/dev/vt/hw/fb/vt_fb.c
==============================================================================
--- head/sys/dev/vt/hw/fb/vt_fb.c	Thu Dec  5 22:38:53 2013	(r259016)
+++ stable/9/sys/dev/vt/hw/fb/vt_fb.c	Thu Mar 27 15:58:18 2014	(r263817)
@@ -41,14 +41,103 @@ __FBSDID("$FreeBSD$");
 #include <dev/vt/hw/fb/vt_fb.h>
 #include <dev/vt/colors/vt_termcolors.h>
 
+static int vt_fb_ioctl(struct vt_device *vd, u_long cmd, caddr_t data,
+    struct thread *td);
+static int vt_fb_mmap(struct vt_device *vd, vm_ooffset_t offset,
+    vm_paddr_t *paddr, int prot, vm_memattr_t *memattr);
+void vt_fb_drawrect(struct vt_device *vd, int x1, int y1, int x2, int y2,
+    int fill, term_color_t color);
+void vt_fb_setpixel(struct vt_device *vd, int x, int y, term_color_t color);
+
 static struct vt_driver vt_fb_driver = {
 	.vd_init = vt_fb_init,
 	.vd_blank = vt_fb_blank,
 	.vd_bitbltchr = vt_fb_bitbltchr,
+	.vd_drawrect = vt_fb_drawrect,
+	.vd_setpixel = vt_fb_setpixel,
 	.vd_postswitch = vt_fb_postswitch,
 	.vd_priority = VD_PRIORITY_GENERIC+10,
+	.vd_fb_ioctl = vt_fb_ioctl,
+	.vd_fb_mmap = vt_fb_mmap,
 };
 
+static int
+vt_fb_ioctl(struct vt_device *vd, u_long cmd, caddr_t data, struct thread *td)
+{
+	struct fb_info *info;
+
+	info = vd->vd_softc;
+
+	if (info->fb_ioctl == NULL)
+		return (-1);
+
+	return (info->fb_ioctl(info->fb_cdev, cmd, data, 0, td));
+}
+
+static int
+vt_fb_mmap(struct vt_device *vd, vm_ooffset_t offset, vm_paddr_t *paddr,
+    int prot, vm_memattr_t *memattr)
+{
+	struct fb_info *info;
+
+	info = vd->vd_softc;
+
+	if (info->fb_ioctl == NULL)
+		return (ENXIO);
+
+	return (info->fb_mmap(info->fb_cdev, offset, paddr, prot, memattr));
+}
+
+void
+vt_fb_setpixel(struct vt_device *vd, int x, int y, term_color_t color)
+{
+	struct fb_info *info;
+	uint32_t c;
+	u_int o;
+
+	info = vd->vd_softc;
+	c = info->fb_cmap[color];
+	o = info->fb_stride * y + x * FBTYPE_GET_BYTESPP(info);
+
+	switch (FBTYPE_GET_BYTESPP(info)) {
+	case 1:
+		info->wr1(info, o, c);
+		break;
+	case 2:
+		info->wr2(info, o, c);
+		break;
+	case 3:
+		info->wr1(info, o, (c >> 16) & 0xff);
+		info->wr1(info, o + 1, (c >> 8) & 0xff);
+		info->wr1(info, o + 2, c & 0xff);
+		break;
+	case 4:
+		info->wr4(info, o, c);
+		break;
+	default:
+		/* panic? */
+		return;
+	}
+
+}
+
+void
+vt_fb_drawrect(struct vt_device *vd, int x1, int y1, int x2, int y2, int fill,
+    term_color_t color)
+{
+	int x, y;
+
+	for (y = y1; y <= y2; y++) {
+		if (fill || (y == y1) || (y == y2)) {
+			for (x = x1; x <= x2; x++)
+				vt_fb_setpixel(vd, x, y, color);
+		} else {
+			vt_fb_setpixel(vd, x1, y, color);
+			vt_fb_setpixel(vd, x2, y, color);
+		}
+	}
+}
+
 void
 vt_fb_blank(struct vt_device *vd, term_color_t color)
 {

Modified: stable/9/sys/dev/vt/hw/ofwfb/ofwfb.c
==============================================================================
--- head/sys/dev/vt/hw/ofwfb/ofwfb.c	Thu Dec  5 22:38:53 2013	(r259016)
+++ stable/9/sys/dev/vt/hw/ofwfb/ofwfb.c	Thu Mar 27 15:58:18 2014	(r263817)
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: user/ed/newcons/sys/dev/vt/hw/ofwfb/ofwfb.c 219888 2011-03-22 21:31:31Z ed $");
+__FBSDID("$FreeBSD$");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -78,17 +78,19 @@ static void
 ofwfb_blank(struct vt_device *vd, term_color_t color)
 {
 	struct ofwfb_softc *sc = vd->vd_softc;
-	u_int ofs;
+	u_int ofs, size;
 	uint32_t c;
 
+	size = sc->sc_stride * vd->vd_height;
 	switch (sc->sc_depth) {
 	case 8:
-		for (ofs = 0; ofs < sc->sc_stride*vd->vd_height; ofs++)
-			*(uint8_t *)(sc->sc_addr + ofs) = color;
+		c = (color << 24) | (color << 16) | (color << 8) | color;
+		for (ofs = 0; ofs < size/4; ofs++)
+			*(uint32_t *)(sc->sc_addr + 4*ofs) = c;
 		break;
 	case 32:

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-src-all mailing list