Subject: RE: Test this Quadra 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 17:48:28
Hi All:
I just installed the patch below on my Q650.  Bad news.  My new kernal
wouldn't boot.
Got all the way to "asc0 at obio0: Apple Sound Chip" and stopped.  I just
got back on
and saw another patch so I'll try that one and let you know.

> ----------
> From: 	mrz5149@cs.rit.edu
> Sent: 	Saturday, April 18, 1998 4:12 PM
> To: 	port-mac68k@netbsd.org
> Subject: 	Test this Quadra Patch
> 
> Ok folks. Here's a patch for Quadra intvid that should hopefully do
> the following:
> 
> 1. Fix the "shitfted" video problem some users get in X
> 2. Enable fast block copying to video ram
> 
> So if some kind soul with a Quadra could build a kernel with the
> diff I've included below and test it, I'd appreciate it.
> 
> To test it do two things:
> 1. Start X and make sure that works
> 2. Test if there's any speed up on video operations by doing the
>    following:
> 
>    - Boot with an unpatched kernel. Find a really big directory
>      and time an ls -l on the console (scrolling uses lots of
>      block operations)
>    - Boot with the patched kernel and do the same thing.
>    - Run any other graphical tests you can think of
>      (Compile and run some Mesa programs :-)
> 
>    Hopefully there will be an appreciable difference in speed.
>    
> One last note: This is *not* a newbie project! If you've never
> built a kernel before please wait until I get this into the
> regular source. It may not work so I need experienced and
> adventurous people to do this. If the patch works then I
> will do a send-pr with the patch and it will make it into
> the official -current sources.
> 
> Thanks!
> 
> 
> *** grf_iv.c.orig       Mon Mar 23 07:13:43 1998
> --- grf_iv.c    Sat Apr 18 02:43:51 1998
> ***************
> *** 82,87 ****
> --- 82,88 ----
>         bus_space_handle_t bsh;
>         int found, sense;
>         u_int base;
> +       u_long vbase1, vbase2 ;
> 
>         found = 1;
> 
> ***************
> *** 109,115 ****
>                 if (sense == 0)
>                         found = 0;
>   #endif
> -
>                 /* Set "Turbo SCSI" configuration to default */
>                 bus_space_write_4(oa->oa_tag, bsh, 0x24, 0x1d1); /* ch0 */
>                 bus_space_write_4(oa->oa_tag, bsh, 0x28, 0x1d1); /* ch1 */
> --- 110,115 ----
> ***************
> *** 121,126 ****
> --- 121,135 ----
>                 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 */
> +               bus_space_write_4(oa->oa_tag, bsh, 0x14, 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 ;
> +               mac68k_vidphys += ((vbase1 << 9) | (vbase2 << 5)) ;
> 
>                 bus_space_unmap(oa->oa_tag, bsh, 0x1000);
>                 break;
>