summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/arch/macppc/pci/vgafb.c40
-rw-r--r--sys/arch/macppc/pci/vgafb_pci.c8
-rw-r--r--sys/arch/macppc/pci/vgafbvar.h13
3 files changed, 15 insertions, 46 deletions
diff --git a/sys/arch/macppc/pci/vgafb.c b/sys/arch/macppc/pci/vgafb.c
index 281c291e274..82d53b12a1e 100644
--- a/sys/arch/macppc/pci/vgafb.c
+++ b/sys/arch/macppc/pci/vgafb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vgafb.c,v 1.41 2012/08/30 21:54:13 mpi Exp $ */
+/* $OpenBSD: vgafb.c,v 1.42 2013/06/03 23:28:43 mpi Exp $ */
/* $NetBSD: vga.c,v 1.3 1996/12/02 22:24:54 cgd Exp $ */
/*
@@ -57,13 +57,7 @@ void vgafb_setcolor(struct vga_config *vc, unsigned int index,
u_int8_t r, u_int8_t g, u_int8_t b);
void vgafb_restore_default_colors(struct vga_config *vc);
-struct vgafb_devconfig {
- struct rasops_info dc_rinfo; /* raster display data */
- int dc_blanked; /* currently had video disabled */
-};
-
-extern struct vga_config vgafb_pci_console_vc;
-struct vgafb_devconfig vgafb_console_dc;
+extern struct vga_config vgafbcn;
struct wsscreen_descr vgafb_stdscreen = {
"std",
@@ -124,19 +118,8 @@ vgafb_init(bus_space_tag_t iot, bus_space_tag_t memt, struct vga_config *vc,
/* XXX */ppc_proc_is_64b ? 0 : 1, &vc->vc_memh))
panic("vgafb_init: can't map mem space");
- vc->vc_crow = vc->vc_ccol = 0; /* Has to be some onscreen value */
- vc->vc_so = 0;
-
- /* clear screen, frob cursor, etc.? */
- /*
- */
-
- vc->vc_at = 0x00 | 0xf; /* black bg|white fg */
- vc->vc_so_at = 0x00 | 0xf | 0x80; /* black bg|white fg|blink */
-
- if (cons_depth == 8) {
+ if (cons_depth == 8)
vgafb_restore_default_colors(vc);
- }
}
void
@@ -317,9 +300,8 @@ vgafb_mmap(void *v, off_t off, int prot)
int
vgafb_cnattach(bus_space_tag_t iot, bus_space_tag_t memt, int type, int check)
{
- struct vga_config *vc = &vgafb_pci_console_vc;
- struct vgafb_devconfig *dc = &vgafb_console_dc;
- struct rasops_info *ri = &dc->dc_rinfo;
+ struct vga_config *vc = &vgafbcn;
+ struct rasops_info *ri = &vc->ri;
long defattr;
int i;
@@ -331,7 +313,7 @@ vgafb_cnattach(bus_space_tag_t iot, bus_space_tag_t memt, int type, int check)
ri->ri_width = cons_width;
ri->ri_height = cons_height;
ri->ri_stride = cons_linebytes;
- ri->ri_hw = dc;
+ ri->ri_hw = vc;
/* Clear the screen */
for (i = 0; i < cons_linebytes * cons_height; i++)
@@ -450,17 +432,15 @@ vgafb_alloc_screen(void *v, const struct wsscreen_descr *type, void **cookiep,
int *curxp, int *curyp, long *attrp)
{
struct vga_config *vc = v;
- long defattr;
+ struct rasops_info *ri = &vc->ri;
if (vc->nscreens > 0)
return (ENOMEM);
- *cookiep = &vc->dc_rinfo; /* one and only for now */
+ *cookiep = ri;
*curxp = 0;
*curyp = 0;
- vc->dc_rinfo.ri_ops.alloc_attr(&vc->dc_rinfo, 0, 0, 0, &defattr);
- *attrp = defattr;
-
+ ri->ri_ops.alloc_attr(ri, 0, 0, 0, attrp);
vc->nscreens++;
return (0);
@@ -471,7 +451,7 @@ vgafb_free_screen(void *v, void *cookie)
{
struct vga_config *vc = v;
- if (vc == &vgafb_pci_console_vc)
+ if (vc == &vgafbcn)
panic("vgafb_free_screen: console");
vc->nscreens--;
diff --git a/sys/arch/macppc/pci/vgafb_pci.c b/sys/arch/macppc/pci/vgafb_pci.c
index ed764fd3eac..607e88902ff 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.27 2012/12/13 13:55:18 mpi Exp $ */
+/* $OpenBSD: vgafb_pci.c,v 1.28 2013/06/03 23:28:43 mpi Exp $ */
/* $NetBSD: vga_pci.c,v 1.4 1996/12/05 01:39:38 cgd Exp $ */
/*
@@ -69,7 +69,7 @@ struct cfattach vgafb_pci_ca = {
};
pcitag_t vgafb_pci_console_tag;
-struct vga_config vgafb_pci_console_vc;
+struct vga_config vgafbcn;
void
vgafb_pci_mem_init(struct vga_pci_softc *dev, uint32_t *memaddr,
@@ -194,7 +194,7 @@ vgafb_pci_attach(struct device *parent, struct device *self, void *aux)
console = (!bcmp(&pa->pa_tag, &vgafb_pci_console_tag, sizeof(pa->pa_tag)));
if (console)
- vc = sc->sc_vc = &vgafb_pci_console_vc;
+ vc = sc->sc_vc = &vgafbcn;
else {
vc = sc->sc_vc = (struct vga_config *)
malloc(sizeof(struct vga_config), M_DEVBUF, M_WAITOK);
@@ -211,8 +211,6 @@ vgafb_pci_attach(struct device *parent, struct device *self, void *aux)
reg |= PCI_COMMAND_MASTER_ENABLE;
pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, reg);
- vc->vc_mmap = vgafb_mmap;
- vc->vc_ioctl = vgafb_ioctl;
vc->membase = memaddr;
vc->memsize = memsize;
vc->mmiobase = mmioaddr;
diff --git a/sys/arch/macppc/pci/vgafbvar.h b/sys/arch/macppc/pci/vgafbvar.h
index 46786208ddf..8f312d4d1f8 100644
--- a/sys/arch/macppc/pci/vgafbvar.h
+++ b/sys/arch/macppc/pci/vgafbvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vgafbvar.h,v 1.15 2012/08/30 21:54:13 mpi Exp $ */
+/* $OpenBSD: vgafbvar.h,v 1.16 2013/06/03 23:28:43 mpi Exp $ */
/* $NetBSD: vgavar.h,v 1.2 1996/11/23 06:06:43 cgd Exp $ */
/*
@@ -40,21 +40,12 @@ struct vga_config {
u_char vc_cmap_green[256];
u_char vc_cmap_blue[256];
- /*
- * Private to back-end.
- */
- int vc_ncol, vc_nrow; /* screen width & height */
- int vc_ccol, vc_crow; /* current cursor position */
-
- char vc_so; /* in standout mode? */
- char vc_at; /* normal attributes */
- char vc_so_at; /* standout attributes */
int (*vc_ioctl)(void *, u_long,
caddr_t, int, struct proc *);
paddr_t (*vc_mmap)(void *, off_t, int);
- struct rasops_info dc_rinfo; /* raster display data*/
+ struct rasops_info ri;
bus_addr_t membase;
bus_size_t memsize;