Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86 EFI console is drawing faster by shadowfb.



details:   https://anonhg.NetBSD.org/src/rev/a8aa6acc9ce5
branches:  trunk
changeset: 821999:a8aa6acc9ce5
user:      nonaka <nonaka%NetBSD.org@localhost>
date:      Sat Feb 25 01:13:50 2017 +0000

description:
EFI console is drawing faster by shadowfb.

diffstat:

 sys/arch/x86/pci/pci_machdep.c   |  11 +++++++++--
 sys/arch/x86/x86/genfb_machdep.c |  18 +++++++++++++++---
 2 files changed, 24 insertions(+), 5 deletions(-)

diffs (92 lines):

diff -r c3804cd2c3e5 -r a8aa6acc9ce5 sys/arch/x86/pci/pci_machdep.c
--- a/sys/arch/x86/pci/pci_machdep.c    Sat Feb 25 01:11:55 2017 +0000
+++ b/sys/arch/x86/pci/pci_machdep.c    Sat Feb 25 01:13:50 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci_machdep.c,v 1.77 2017/02/09 03:38:01 msaitoh Exp $ */
+/*     $NetBSD: pci_machdep.c,v 1.78 2017/02/25 01:13:50 nonaka Exp $  */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.77 2017/02/09 03:38:01 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.78 2017/02/25 01:13:50 nonaka Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -1095,6 +1095,8 @@
                                if (ri->ri_bits != NULL) {
                                        prop_dictionary_set_uint64(dict,
                                            "virtual_address",
+                                           ri->ri_hwbits != NULL ?
+                                           (vaddr_t)ri->ri_hworigbits :
                                            (vaddr_t)ri->ri_origbits);
                                }
 #endif
@@ -1121,6 +1123,11 @@
 
 #if NWSDISPLAY > 0 && NGENFB > 0
                                if (device_is_a(dev, "genfb")) {
+                                       prop_dictionary_set_bool(dict,
+                                           "enable_shadowfb",
+                                           ri->ri_hwbits != NULL ?
+                                             true : false);
+
                                        x86_genfb_set_console_dev(dev);
 #ifdef DDB
                                        db_trap_callback =
diff -r c3804cd2c3e5 -r a8aa6acc9ce5 sys/arch/x86/x86/genfb_machdep.c
--- a/sys/arch/x86/x86/genfb_machdep.c  Sat Feb 25 01:11:55 2017 +0000
+++ b/sys/arch/x86/x86/genfb_machdep.c  Sat Feb 25 01:13:50 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: genfb_machdep.c,v 1.11 2013/07/25 15:09:27 macallan Exp $ */
+/* $NetBSD: genfb_machdep.c,v 1.12 2017/02/25 01:13:50 nonaka Exp $ */
 
 /*-
  * Copyright (c) 2009 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfb_machdep.c,v 1.11 2013/07/25 15:09:27 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfb_machdep.c,v 1.12 2017/02/25 01:13:50 nonaka Exp $");
 
 #include "opt_mtrr.h"
 
@@ -40,6 +40,7 @@
 #include <sys/device.h>
 #include <sys/ioctl.h>
 #include <sys/kernel.h>
+#include <sys/kmem.h>
 #include <sys/lwp.h>
 
 #include <sys/bus.h>
@@ -61,6 +62,7 @@
 
 #if NWSDISPLAY > 0 && NGENFB > 0
 struct vcons_screen x86_genfb_console_screen;
+bool x86_genfb_use_shadowfb = true;
 
 #if NACPICA > 0
 extern int acpi_md_vesa_modenum;
@@ -182,7 +184,17 @@
        ri->ri_height = fbinfo->height;
        ri->ri_depth = fbinfo->depth;
        ri->ri_stride = fbinfo->stride;
-       ri->ri_bits = bits;
+       if (x86_genfb_use_shadowfb && lookup_bootinfo(BTINFO_EFI) != NULL) {
+               /* XXX The allocated memory is never released... */
+               ri->ri_bits = kmem_alloc(ri->ri_stride * ri->ri_height,
+                   KM_NOSLEEP);
+               if (ri->ri_bits == NULL) {
+                       aprint_error("%s: couldn't alloc shadowfb\n", __func__);
+                       ri->ri_bits = bits;
+               } else
+                       ri->ri_hwbits = bits;
+       } else
+               ri->ri_bits = bits;
        ri->ri_flg = RI_CENTER | RI_FULLCLEAR | RI_CLEAR;
        rasops_init(ri, ri->ri_width / 8, ri->ri_height / 8);
        ri->ri_caps = WSSCREEN_WSCOLORS;



Home | Main Index | Thread Index | Old Index