summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/arch/macppc/pci/vgafb.c34
-rw-r--r--sys/arch/macppc/pci/vgafb_pci.c12
2 files changed, 15 insertions, 31 deletions
diff --git a/sys/arch/macppc/pci/vgafb.c b/sys/arch/macppc/pci/vgafb.c
index 4d0c0e4f9ba..b0ff2f60c6e 100644
--- a/sys/arch/macppc/pci/vgafb.c
+++ b/sys/arch/macppc/pci/vgafb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vgafb.c,v 1.45 2013/06/04 02:20:18 mpi Exp $ */
+/* $OpenBSD: vgafb.c,v 1.46 2013/06/04 02:26:36 mpi Exp $ */
/* $NetBSD: vga.c,v 1.3 1996/12/02 22:24:54 cgd Exp $ */
/*
@@ -30,25 +30,19 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
#include <sys/device.h>
-#include <sys/buf.h>
-
-#include <uvm/uvm_extern.h>
#include <machine/bus.h>
-#include <dev/cons.h>
-#include <dev/ofw/openfirm.h>
-#include <macppc/macppc/ofw_machdep.h>
-
#include <dev/wscons/wsconsio.h>
#include <dev/wscons/wsdisplayvar.h>
#include <dev/rasops/rasops.h>
-#include <dev/wsfont/wsfont.h>
+#include <dev/ofw/openfirm.h>
+#include <macppc/macppc/ofw_machdep.h>
#include <macppc/pci/vgafbvar.h>
+
struct cfdriver vgafb_cd = {
NULL, "vgafb", DV_DULL,
};
@@ -68,19 +62,19 @@ extern struct vga_config vgafbcn;
struct wsscreen_descr vgafb_stdscreen = {
"std",
- 0, 0, /* will be filled in -- XXX shouldn't, it's global */
+ 0, 0,
0,
0, 0,
WSSCREEN_UNDERLINE | WSSCREEN_HILIT |
WSSCREEN_REVERSE | WSSCREEN_WSCOLORS
};
+
const struct wsscreen_descr *vgafb_scrlist[] = {
&vgafb_stdscreen,
- /* XXX other formats, graphics screen? */
};
struct wsscreen_list vgafb_screenlist = {
- sizeof(vgafb_scrlist) / sizeof(struct wsscreen_descr *), vgafb_scrlist
+ nitems(vgafb_scrlist), vgafb_scrlist
};
struct wsdisplay_accessops vgafb_accessops = {
@@ -98,14 +92,10 @@ struct wsdisplay_accessops vgafb_accessops = {
int vgafb_getcmap(struct vga_config *vc, struct wsdisplay_cmap *cm);
int vgafb_putcmap(struct vga_config *vc, struct wsdisplay_cmap *cm);
-#define FONT_WIDTH 8
-#define FONT_HEIGHT 16
-
#ifdef APERTURE
extern int allowaperture;
#endif
-
void
vgafb_init(bus_space_tag_t iot, bus_space_tag_t memt, struct vga_config *vc,
u_int32_t membase, size_t memsize)
@@ -307,6 +297,10 @@ vgafb_cnattach(bus_space_tag_t iot, bus_space_tag_t memt, int type, int check)
if (cons_depth == 8)
vgafb_restore_default_colors(vc);
+ /* Clear the screen */
+ for (i = 0; i < cons_linebytes * cons_height; i++)
+ bus_space_write_1(memt, vc->vc_memh, i, 0);
+
ri->ri_flg = RI_CENTER;
ri->ri_depth = cons_depth;
ri->ri_bits = (void *)vc->vc_memh;
@@ -315,11 +309,7 @@ vgafb_cnattach(bus_space_tag_t iot, bus_space_tag_t memt, int type, int check)
ri->ri_stride = cons_linebytes;
ri->ri_hw = vc;
- /* Clear the screen */
- for (i = 0; i < cons_linebytes * cons_height; i++)
- bus_space_write_1(memt, vc->vc_memh, i, 0);
-
- rasops_init(ri, 160, 160); /* XXX */
+ rasops_init(ri, 160, 160);
vgafb_stdscreen.nrows = ri->ri_rows;
vgafb_stdscreen.ncols = ri->ri_cols;
diff --git a/sys/arch/macppc/pci/vgafb_pci.c b/sys/arch/macppc/pci/vgafb_pci.c
index 7709b551365..a1994ee5815 100644
--- a/sys/arch/macppc/pci/vgafb_pci.c
+++ b/sys/arch/macppc/pci/vgafb_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vgafb_pci.c,v 1.30 2013/06/04 02:16:14 mpi Exp $ */
+/* $OpenBSD: vgafb_pci.c,v 1.31 2013/06/04 02:26:36 mpi Exp $ */
/* $NetBSD: vga_pci.c,v 1.4 1996/12/05 01:39:38 cgd Exp $ */
/*
@@ -30,14 +30,9 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
#include <sys/device.h>
#include <sys/malloc.h>
-#include <machine/autoconf.h>
-#include <machine/pte.h>
-
-#include <dev/cons.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
#include <dev/pci/pcidevs.h>
@@ -45,7 +40,6 @@
#include <dev/wscons/wsconsio.h>
#include <dev/wscons/wsdisplayvar.h>
#include <dev/rasops/rasops.h>
-#include <dev/wsfont/wsfont.h>
#include "drm.h"
@@ -64,8 +58,8 @@ void vgafb_pci_attach(struct device *, struct device *, void *);
void vgafb_pci_mem_init(struct vga_pci_softc *, uint32_t *, uint32_t *,
uint32_t *, uint32_t *);
-struct cfattach vgafb_pci_ca = {
- sizeof(struct vga_pci_softc), (cfmatch_t)vgafb_pci_match, vgafb_pci_attach,
+const struct cfattach vgafb_pci_ca = {
+ sizeof(struct vga_pci_softc), vgafb_pci_match, vgafb_pci_attach,
};
pcitag_t vgafb_pci_console_tag;