Subject: Re: Maddhatter Source
To: Stephen C. Brown <sbrown@shellx.best.com>
From: Dave Huang <khym@bga.com>
List: port-mac68k
Date: 03/11/1997 17:10:56
On Sun, 9 Mar 1997, Stephen C. Brown wrote:
> >I know some changes were made to the intvid driver in the MadHatter kernels
> >for the AV Macs.
> 
> Actually, I made no changes related specifically to the AV macs.
> I believe Dave Huang has one of these beasts and actually got the
> getphys() routine to work in addition to making some changes to
> support multiple screen resolutions.  Perhaps he can comment on that.

> >If I remember correctly the corrections were so that video memory was aligned
> >on a page boundary or something? What other changes were made?
> >
> >Anybody know where I can pick up the diffs from this kernel?

The change I made shouldn't be AV-specific or anything; apparently mmap()
only maps memory on page boundaries... however, video memory doesn't
necessarily start on a page boundary. My patch just sets fbbase to the
start of video memory, rounded down to the page size, and sets fboff to
the offset within that page.

The second section of the patch to grf_iv.c probably isn't neccessary, but
I thought it looked better that way :) And the patch to ite.c is just to
let the ite device get configured.

--- /usr/src/sys/arch/mac68k/dev/grf_iv.c	Wed Feb 19 22:30:43 1997
+++ grf_iv.c	Fri Feb 21 14:15:27 1997
@@ -108,8 +108,8 @@
 	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);
@@ -144,5 +144,5 @@
 	 * If we're using IIsi or similar, this will be 0.
 	 * If we're using IIvx or similar, this will be correct.
 	 */
-	return (caddr_t) mac68k_vidphys;
+	return (caddr_t) (mac68k_vidphys + addr - mac68k_vidlog);
 }
--- /usr/src/sys/arch/mac68k/dev/ite.c	Wed Feb 19 22:30:44 1997
+++ ite.c	Fri Feb 21 14:15:28 1997
@@ -864,7 +864,7 @@
 
 	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);
 }

Name: Dave Huang     |   Mammal, mammal / their names are called /
INet: khym@bga.com   |   they raise a paw / the bat, the cat /
FurryMUCK: Dahan     |   dolphin and dog / koala bear and hog -- TMBG
Dahan: Hani G Y+C 21 Y++ L+++ W- C++ T++ A+ E+ S++ V++ F- Q+++ P+ B+ PA+ PL++