Subject: Quadra Video Patch
To: 'mrz5149@cs.rit.edu' <mrz5149@cs.rit.edu>
From: Kerios-1 Chris <Chris.Kerios-1@pp.ksc.nasa.gov>
List: port-mac68k
Date: 04/19/1998 19:31:18
Ok....well I've tried the second patch and it didn't work either.  I have
determined one thing.
My last message regarding not booting on a Q650 was inaccurate.  After
further analysis (haha), more
like dumb luck.  I've determined that the boot did continue on normally.
The problem was that the video 
just wasn't there.  I continued typing blindly and was able to bring the
machine down cleanly.  Before
I brought the box down I did a dmesg which I've included.  My monitor is a
21" Radius monochrome,
model 21TPD, a two page display.  It works fine from MACOS.  Also from my
last message I forgot to
tell you I am running 1.3.1 with the build coming from -current sources
(yesterdays).  If you need me
to check anything else out let me know......thanks

NetBSD 1.3 (GENERICCK) #7: Sun Apr 19 15:00:43 EDT 1998    root@:/usr/src/sys/arch/mac68k/compile/GENERICCKApple Macintosh Quadra 650  (68040)cpu: delay factor 355real mem = 25165824avail mem = 21069824using 204 buffers containing 835584 bytes of memorymrg: 'Quadra/Centris ROMs' ROM glue, tracing off, debug off, silent trapsmrg: I/O map kludge for ROMs that use hardware addresses directly.adb: bus subsystem\^H\^H\^H\^H\^H\^Hadb: extended keyboard at 2adb: 200 dpi mouse at 3mainbus0 (root)obio0 at mainbus0adb0 at obio0 (ADB event device)asc0 at obio0: Apple Sound Chipintvid0 at obio0: DAFB: Monitor sense 4.intvid0: 1152 x 870, monochromegrf0 at intvid0ite at grf0 not configuredsn0 at obio0 address 08:00:07:66:12:6cesp0 at obio0 (quick): address 0x894000: NCR53C96, 16MHz, SCSI ID 7scsibus0 at esp0: 8 targetssd0 at scsibus0 targ 0 lun 0: <SEAGATE, ST3600N, 8514> SCSI1 0/direct fixedsd0: 500MB, 1872 cyl, 7 head, 78 sec, 512 bytes/sect x 1025920 sectorssd1 at scsibus0 targ 1 lun 0: <QUANTUM, FIREBALL ST3.2S, 0F0C> SCSI2 0/direct
fixedsd1: 3090MB, 7068 cyl, 4 head, 223 sec, 512 bytes/sect x 6328861 sectorscd0 at scsibus0 targ 3 lun 0: <SONY, CD-ROM CDU-8003A, 1.9a> SCSI2 5/cdrom
removablesd2 at scsibus0 targ 5 lun 0: <CONNER, CP30170E-170Mb, 5.13> SCSI1 0/direct
fixedsd2: 162MB, 1807 cyl, 4 head, 46 sec, 512 bytes/sect x 332488 sectorszsc0 at obio0 chip type 0 zsc0 channel 0: d_speed   9600 DCD clk 0 CTS clk 0zstty0 at zsc0 channel 0zsc0 channel 1: d_speed   9600 DCD clk 0 CTS clk 0zstty1 at zsc0 channel 1nubus0 at mainbus0fpu0 at mainbus0 (mc68040)boot device: sd1root on sd1a dumps on sd1bPRAM: 0x353a4a61, macos_boottime: 0x353a4a59.root file system type: ffs

> ----------
> From: 	mrz5149@cs.rit.edu
> Sent: 	Sunday, April 19, 1998 3:38 PM
> To: 	port-mac68k@netbsd.org
> Subject: 	Quadra Patch Part II
> 
> Ok, here's another shot at a Quadra fix.
> I've FTP'd it so the patch should work this time :-)
> 
> Try it with and without the fast video stuff.
> 
> I think this should really fix the video wrap-around bug.
> 
> Thanks!
> 
> *** grf_iv.c.orig	Sat Apr 18 10:04:56 1998
> --- grf_iv.c	Sun Apr 19 11:17:01 1998
> ***************
> *** 82,87 ****
> --- 82,89 ----
>   	bus_space_handle_t bsh;
>   	int found, sense;
>   	u_int base;
> +         u_char tmp ;
> + 	u_int32_t vbase1, vbase2 ;
>   
>   	found = 1;
>   
> ***************
> *** 121,126 ****
> --- 123,138 ----
>   		bus_space_write_4(oa->oa_tag, bsh, 0x10C, 0);
>   		bus_space_write_4(oa->oa_tag, bsh, 0x110, 0);
>   		bus_space_write_4(oa->oa_tag, bsh, 0x114, 0);
> + 
> + 		/* Enable "fast" video operations */
> + 		tmp = bus_space_read_1(oa->oa_tag, bsh, 0x17) ;
> + 		bus_space_write_1(oa->oa_tag, bsh, 0x17, (tmp | 0x1)) ;
> + 
> + 		/* Compute the current frame buffer base address */
> + 		vbase1 = bus_space_read_4(oa->oa_tag, bsh, 0x0) & 0xfff ;
> + 		vbase2 = bus_space_read_4(oa->oa_tag, bsh, 0x4) & 0xf ;
> + 		mac68k_vidphys = 0xf9000000 | ((vbase1 << 9) | (vbase2 <<
> 5)) ;
> + 		mac68k_vidlog = mac68k_vidphys ;
>   
>   		bus_space_unmap(oa->oa_tag, bsh, 0x1000);
>   		break;
>