Subject: Re: Powerbook 15 XFree
To: =?ISO-8859-1?Q?Johan_Wall=E9n?= <johan@tcs.hut.fi>
From: None <tmdraney@cox.net>
List: port-macppc
Date: 01/28/2006 17:47:59
I did google the patch and found this site

http://www.monkey.org/openbsd/archive2/tech/200501/msg00067.html

If you look at his posted jpg it shows what my screen looks like.  Guess 
I will have to download xsrc and give it a shot.  I will report back. 
Thanks

Johan Wallén wrote:
> tmdraney@cox.net writes:
> 
> 
>>I am again attempting to install NetBSD onto my powerbook.  With 3.0
>>it is been much more successful so far.  I have a fairly new 15"
>>powerbook 1.67 ghz.  I am attempting to get XFree running version 4.5
>>which comes with netbsd 3.0.  It is a Radeon card.  I have set it all
>>up and when I try start X, X comes up but it is all jumbled up.  Best
>>way to describe it is that it is a jig saw puzzle.  When I type exit I
>>think I see a window close so at least my keyboard functions.  Anyone
>>have this problem before and what is the solution. Thank you before
>>hand.
> 
> 
> This sounds very familiar.  I have a slightly older (?) PowerBook, and I
> have only tried -current, but you might try the patch below for the
> radeon driver.  I do not remember where I found this patch, but it was
> from the XFree86 or Xorg bug reports, or from their mailing lists.
> Google would probably give you the author of the patch.  And I have no
> clue what this patch does -- it just seems to work (also without the
> OFB_FAKE_VGA_FB option in -current).
> 
> -- Johan
> 
> Index: radeon_driver.c
> ===================================================================
> RCS file: /cvsroot/xsrc/xfree/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c,v
> retrieving revision 1.10
> diff -u -r1.10 radeon_driver.c
> --- radeon_driver.c	18 Mar 2005 14:55:14 -0000	1.10
> +++ radeon_driver.c	29 Jan 2006 01:53:28 -0000
> @@ -1824,7 +1824,7 @@
>  		    break;
>  		default:
>  		    pll->reference_freq = 2700;
> -		    pll->reference_div  = 67;
> +		    pll->reference_div  = 12;
>  		    pll->xclk           = 16615;
>  		    break;
>  	    }
> @@ -4854,9 +4854,9 @@
>  
>      OUTREGP(RADEON_CRTC_EXT_CNTL,
>  	    restore->crtc_ext_cntl,
> -	    RADEON_CRTC_VSYNC_DIS |
> -	    RADEON_CRTC_HSYNC_DIS |
> -	    RADEON_CRTC_DISPLAY_DIS);
> +	    ~(RADEON_CRTC_VSYNC_DIS |
> +	      RADEON_CRTC_HSYNC_DIS |
> +	      RADEON_CRTC_DISPLAY_DIS));
>  
>      OUTREGP(RADEON_DAC_CNTL,
>  	    restore->dac_cntl,
> @@ -4926,6 +4926,7 @@
>      RADEONInfoPtr  info       = RADEONPTR(pScrn);
>      unsigned char *RADEONMMIO = info->MMIO;
>      unsigned long  tmp;
> +    int i;
>  
>      OUTREG(RADEON_FP_CRTC_H_TOTAL_DISP, restore->fp_crtc_h_total_disp);
>      OUTREG(RADEON_FP_CRTC_V_TOTAL_DISP, restore->fp_crtc_v_total_disp);
> @@ -4937,6 +4938,12 @@
>      OUTREG(RADEON_FP_VERT_STRETCH,      restore->fp_vert_stretch);
>      OUTREG(RADEON_FP_GEN_CNTL,          restore->fp_gen_cntl);
>  
> +    for (i = 0; i < 8; i++) {
> +        OUTREG(RADEON_SURFACE0_LOWER_BOUND + 0x10*i, 0);
> +        OUTREG(RADEON_SURFACE0_UPPER_BOUND + 0x10*i, 0x1f);
> +        OUTREG(RADEON_SURFACE0_INFO + 0x10*i, 0);
> +    }
> +
>      /* old AIW Radeon has some BIOS initialization problem
>       * with display buffer underflow, only occurs to DFP
>       */
> @@ -5913,7 +5920,7 @@
>  	      RADEON_GRPH_STOP_CNTL);
>      /*
>        Write the result into the register.
> -    */
> +v    */
>      OUTREG(RADEON_GRPH_BUFFER_CNTL, ((temp & ~RADEON_GRPH_CRITICAL_POINT_MASK) |
>  				     (critical_point << RADEON_GRPH_CRITICAL_POINT_SHIFT)));
>  
> @@ -5971,9 +5978,7 @@
>  /* Define CRTC registers for requested video mode */
>  static Bool RADEONInitCrtcRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save,
>  				  DisplayModePtr mode, RADEONInfoPtr info)
> -{
> -    unsigned char *RADEONMMIO = info->MMIO;
> -
> +{  
>      int  format;
>      int  hsync_start;
>      int  hsync_wid;
> @@ -6084,7 +6089,7 @@
>  				     : 0));
>  
>      save->crtc_offset      = 0;
> -    save->crtc_offset_cntl = INREG(RADEON_CRTC_OFFSET_CNTL);
> +    save->crtc_offset_cntl = 0;
>  
>      save->crtc_pitch  = (((pScrn->displayWidth * pScrn->bitsPerPixel) +
>  			  ((pScrn->bitsPerPixel * 8) -1)) /
>