Thu Jan 28 01:57:31 2021 UTC ()
Remove x86_genfb_mtrr_init. PATs have been available since the Pentium III
and this code has been #if notyet'd shortly after being introduced.


(jmcneill)
diff -r1.4 -r1.5 src/sys/arch/x86/include/genfb_machdep.h
diff -r1.87 -r1.88 src/sys/arch/x86/pci/pci_machdep.c
diff -r1.15 -r1.16 src/sys/arch/x86/x86/genfb_machdep.c
diff -r1.12 -r1.13 src/sys/arch/x86/x86/hyperv.c

cvs diff -r1.4 -r1.5 src/sys/arch/x86/include/genfb_machdep.h (expand / switch to context diff)
--- src/sys/arch/x86/include/genfb_machdep.h 2019/11/30 05:28:28 1.4
+++ src/sys/arch/x86/include/genfb_machdep.h 2021/01/28 01:57:31 1.5
@@ -1,4 +1,4 @@
-/* $NetBSD: genfb_machdep.h,v 1.4 2019/11/30 05:28:28 nonaka Exp $ */
+/* $NetBSD: genfb_machdep.h,v 1.5 2021/01/28 01:57:31 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2009 Jared D. McNeill <jmcneill@invisible.ca>
@@ -31,7 +31,6 @@
 
 int	x86_genfb_init(void);
 int	x86_genfb_cnattach(void);
-void	x86_genfb_mtrr_init(uint64_t, uint32_t);
 void	x86_genfb_set_console_dev(device_t);
 void	x86_genfb_ddb_trap_callback(int);
 

cvs diff -r1.87 -r1.88 src/sys/arch/x86/pci/pci_machdep.c (expand / switch to context diff)
--- src/sys/arch/x86/pci/pci_machdep.c 2020/05/04 15:55:56 1.87
+++ src/sys/arch/x86/pci/pci_machdep.c 2021/01/28 01:57:31 1.88
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_machdep.c,v 1.87 2020/05/04 15:55:56 jdolecek Exp $	*/
+/*	$NetBSD: pci_machdep.c,v 1.88 2021/01/28 01:57:31 jmcneill 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.87 2020/05/04 15:55:56 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.88 2021/01/28 01:57:31 jmcneill Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -1018,8 +1018,6 @@
 
 	switch (newmode) {
 	case WSDISPLAYIO_MODE_EMUL:
-		x86_genfb_mtrr_init(sc->sc_fboffset,
-		    sc->sc_height * sc->sc_stride);
 # if NACPICA > 0 && defined(VGA_POST)
 		if (curmode != newmode) {
 			if (vga_posth != NULL && acpi_md_vesa_modenum != 0) {

cvs diff -r1.15 -r1.16 src/sys/arch/x86/x86/genfb_machdep.c (expand / switch to context diff)
--- src/sys/arch/x86/x86/genfb_machdep.c 2019/11/30 05:28:28 1.15
+++ src/sys/arch/x86/x86/genfb_machdep.c 2021/01/28 01:57:31 1.16
@@ -1,4 +1,4 @@
-/* $NetBSD: genfb_machdep.c,v 1.15 2019/11/30 05:28:28 nonaka Exp $ */
+/* $NetBSD: genfb_machdep.c,v 1.16 2021/01/28 01:57:31 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2009 Jared D. McNeill <jmcneill@invisible.ca>
@@ -31,10 +31,8 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfb_machdep.c,v 1.15 2019/11/30 05:28:28 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfb_machdep.c,v 1.16 2021/01/28 01:57:31 jmcneill Exp $");
 
-#include "opt_mtrr.h"
-
 #include <sys/param.h>
 #include <sys/conf.h>
 #include <sys/device.h>
@@ -45,7 +43,6 @@
 
 #include <sys/bus.h>
 #include <machine/bootinfo.h>
-#include <machine/mtrr.h>
 
 #include <dev/wscons/wsconsio.h>
 #include <dev/wscons/wsdisplayvar.h>
@@ -97,42 +94,6 @@
 	} else {
 		genfb_disable_polling(x86_genfb_console_dev);
 	}
-}
-
-void
-x86_genfb_mtrr_init(uint64_t physaddr, uint32_t size)
-{
-#if notyet
-#ifdef MTRR
-	struct mtrr mtrr;
-	int error, n;
-
-	if (mtrr_funcs == NULL) {
-		aprint_debug("%s: no mtrr funcs\n", __func__);
-		return;
-	}
-
-	mtrr.base = physaddr;
-	mtrr.len = size;
-	mtrr.type = MTRR_TYPE_WC;
-	mtrr.flags = MTRR_VALID;
-	mtrr.owner = 0;
-
-	aprint_debug("%s: 0x%" PRIx64 "-0x%" PRIx64 "\n", __func__,
-	    mtrr.base, mtrr.base + mtrr.len - 1);
-
-	n = 1;
-	KERNEL_LOCK(1, NULL);
-	error = mtrr_set(&mtrr, &n, curlwp->l_proc, MTRR_GETSET_KERNEL);
-	if (n != 0)
-		mtrr_commit();
-	KERNEL_UNLOCK_ONE(NULL);
-
-	aprint_debug("%s: mtrr_set returned %d\n", __func__, error);
-#else
-	aprint_debug("%s: kernel lacks MTRR option\n", __func__);
-#endif
-#endif
 }
 
 int

cvs diff -r1.12 -r1.13 src/sys/arch/x86/x86/hyperv.c (expand / switch to context diff)
--- src/sys/arch/x86/x86/hyperv.c 2020/10/12 12:11:03 1.12
+++ src/sys/arch/x86/x86/hyperv.c 2021/01/28 01:57:31 1.13
@@ -1,4 +1,4 @@
-/*	$NetBSD: hyperv.c,v 1.12 2020/10/12 12:11:03 ryoon Exp $	*/
+/*	$NetBSD: hyperv.c,v 1.13 2021/01/28 01:57:31 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2009-2012,2016-2017 Microsoft Corp.
@@ -33,7 +33,7 @@
  */
 #include <sys/cdefs.h>
 #ifdef __KERNEL_RCSID
-__KERNEL_RCSID(0, "$NetBSD: hyperv.c,v 1.12 2020/10/12 12:11:03 ryoon Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hyperv.c,v 1.13 2021/01/28 01:57:31 jmcneill Exp $");
 #endif
 #ifdef __FBSDID
 __FBSDID("$FreeBSD: head/sys/dev/hyperv/vmbus/hyperv.c 331757 2018-03-30 02:25:12Z emaste $");
@@ -1056,14 +1056,6 @@
 static bool
 x86_genfb_setmode(struct genfb_softc *sc, int newmode)
 {
-#if NGENFB > 0
-	switch (newmode) {
-	case WSDISPLAYIO_MODE_EMUL:
-		x86_genfb_mtrr_init(sc->sc_fboffset,
-		    sc->sc_height * sc->sc_stride);
-		break;
-	}
-#endif
 	return true;
 }