From: briggs Date: Wed, 12 Mar 1997 13:26:37 +0000 (+0000) Subject: Fix for bizarre internal framebuffers that don't start on page boundaries. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a51f117c522ac7cba2bb8f9683e0e5d23f4c38b3;p=openbsd Fix for bizarre internal framebuffers that don't start on page boundaries. Dave Huang found this one... --- diff --git a/sys/arch/mac68k/dev/grf_iv.c b/sys/arch/mac68k/dev/grf_iv.c index fa295ae6f6f..41ad7c4d893 100644 --- a/sys/arch/mac68k/dev/grf_iv.c +++ b/sys/arch/mac68k/dev/grf_iv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: grf_iv.c,v 1.8 1997/03/08 16:16:51 briggs Exp $ */ +/* $OpenBSD: grf_iv.c,v 1.9 1997/03/12 13:26:37 briggs Exp $ */ /* $NetBSD: grf_iv.c,v 1.17 1997/02/20 00:23:27 scottr Exp $ */ /* @@ -62,7 +62,7 @@ extern unsigned long videosize; static int grfiv_mode __P((struct grf_softc *gp, int cmd, void *arg)); static caddr_t grfiv_phys __P((struct grf_softc *gp, vm_offset_t addr)); -static int grfiv_match __P((struct device *, struct cfdata *, void *)); +static int grfiv_match __P((struct device *, void *, void *)); static void grfiv_attach __P((struct device *, struct device *, void *)); static void grfiv_q700intr __P((void *client_data, int slot)); @@ -92,15 +92,14 @@ grfiv_q700intr(client_data, slot) } static int -grfiv_match(parent, cf, aux) +grfiv_match(parent, vcf, aux) struct device *parent; - struct cfdata *cf; + void *vcf; void *aux; { char *addr = NULL; - static int internal_video_found = 0; - if (internal_video_found || (mac68k_vidlog == 0)) { + if (mac68k_vidlog == 0) { return 0; } @@ -140,8 +139,8 @@ grfiv_attach(parent, self, aux) gm->hres = 80; /* XXX Hack */ gm->vres = 80; /* XXX Hack */ gm->fbsize = gm->rowbytes * gm->height; - gm->fbbase = (caddr_t) mac68k_vidlog; - gm->fboff = 0; + gm->fbbase = (caddr_t) (mac68k_vidlog & ~PGOFSET); + gm->fboff = mac68k_vidlog & PGOFSET; /* Perform common video attachment. */ grf_establish(sc, NULL, grfiv_mode, grfiv_phys); diff --git a/sys/arch/mac68k/dev/ite.c b/sys/arch/mac68k/dev/ite.c index 58fb71bdf6b..37613bab1f7 100644 --- a/sys/arch/mac68k/dev/ite.c +++ b/sys/arch/mac68k/dev/ite.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ite.c,v 1.10 1997/03/08 16:16:54 briggs Exp $ */ +/* $OpenBSD: ite.c,v 1.11 1997/03/12 13:26:38 briggs Exp $ */ /* $NetBSD: ite.c,v 1.32 1997/02/20 00:23:25 scottr Exp $ */ /* @@ -112,7 +112,7 @@ static void putc_getpars __P((char)); static void putc_square __P((char)); static void ite_putchar __P((char)); static int ite_pollforchar __P((void)); -static int itematch __P((struct device *, struct cfdata *, void *)); +static int itematch __P((struct device *, void *, void *)); static void iteattach __P((struct device *, struct device *, void *)); #define dprintf if (0) printf @@ -855,9 +855,9 @@ struct cfdriver ite_cd = { }; static int -itematch(parent, cf, aux) +itematch(parent, vcf, aux) struct device *parent; - struct cfdata *cf; + void *vcf; void *aux; { struct grfbus_attach_args *ga = aux; @@ -866,7 +866,7 @@ itematch(parent, cf, aux) if (strcmp(ga->ga_name, "ite")) return 0; - pa = pmap_extract(pmap_kernel(), (vm_offset_t) gm->fbbase); + pa = pmap_extract(pmap_kernel(), (vm_offset_t) gm->fbbase + gm->fboff); return (pa == (vm_offset_t) mac68k_vidphys); }