Mac Mini and Xorg

Sean Welch Sean_Welch at alum.wofford.org
Mon Jul 11 03:14:27 GMT 2005


On Thu, Jul 07, 2005 at 08:56:00AM +1000, Peter Grehan wrote:
>  I think you have to keep the non ifdef'd lines of the form
> 
>     vgaHWSave(pScrn, &hwp->SavedReg, VGA_SR_ALL);
> 
>  ... since that was the issue when VTY switching.

I'm somewhat confused on this point -- looking through the diffs for this line I see that
it only appears replacing this line:

vgaHWRestore(pScrn, &hwp->SavedReg, VGA_SR_MODE | VGA_SR_FONTS );

which in every case is in the else statement of an #if defined(__powerpc__) in the code.
Are you sure these make a difference on ppc?  Assuming they don't I've hacked out a patch
that combines everything and sections off portions just for ppc (check out the attachment
for a drop-in replacement of the port's files/patch-radeon_driver.c).

Also an interesting observation relating to Xorg resolutions -- it seems that ofw is
remembering monitor modes set in OS X.  In other words, I set my monitor to 1600x1200 and
when I reboot the ofw console is at a similar resolution.  FreeBSD's console takes what
looks to be the same resolution and Xorg only seems to want to work at that resolution.  I
switched monitors and got it to run at 1280x1024 and 640x480.  I brought it back and the
max I could run on the first monitor was 640x480 (320x240 also worked) UNTIL I rebooted
back into OS X, set it to the high resolution and booted back.  The result was that I only
got the 1600x1200 resolution again.

Sean

-------------- next part --------------
*** programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c.orig	Thu Dec 16 18:13:18 2004
--- programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c	Sun Jul 10 22:04:22 2005
***************
*** 164,170 ****
      OPTION_SUBPIXEL_ORDER,
  #endif
      OPTION_SHOWCACHE,
!     OPTION_DYNAMIC_CLOCKS
  } RADEONOpts;
  
  static const OptionInfoRec RADEONOptions[] = {
--- 164,173 ----
      OPTION_SUBPIXEL_ORDER,
  #endif
      OPTION_SHOWCACHE,
!     OPTION_DYNAMIC_CLOCKS,
! #ifdef __powerpc__
!     OPTION_IBOOKHACKS
! #endif
  } RADEONOpts;
  
  static const OptionInfoRec RADEONOptions[] = {
***************
*** 209,214 ****
--- 212,220 ----
  #endif
      { OPTION_SHOWCACHE,      "ShowCache",        OPTV_BOOLEAN, {0}, FALSE },
      { OPTION_DYNAMIC_CLOCKS, "DynamicClocks",    OPTV_BOOLEAN, {0}, FALSE },
+ #ifdef __powerpc__
+     { OPTION_IBOOKHACKS,     "iBookHacks",       OPTV_BOOLEAN, {0}, FALSE },
+ #endif
      { -1,                    NULL,               OPTV_NONE,    {0}, FALSE }
  };
  
***************
*** 2284,2289 ****
--- 2290,2296 ----
      case PCI_CHIP_RV370_5464:
          info->IsMobility = TRUE;
      case PCI_CHIP_RV370_5B60:
+     case PCI_CHIP_RV370_5B62:
      case PCI_CHIP_RV370_5B64:
      case PCI_CHIP_RV370_5B65:
          info->ChipFamily = CHIP_FAMILY_RV380;
***************
*** 5276,5281 ****
--- 5283,5296 ----
      RADEONInfoPtr  info       = RADEONPTR(pScrn);
      unsigned char *RADEONMMIO = info->MMIO;
  
+     /* 
+      * Never do it on Apple iBook to avoid a blank screen.
+      */
+ #ifdef __powerpc__
+     if (xf86ReturnOptValBool(info->Options, OPTION_IBOOKHACKS, FALSE))
+         return;
+ #endif
+ 
      if (info->IsMobility) {
          /* A temporal workaround for the occational blanking on certain laptop panels.
             This appears to related to the PLL divider registers (fail to lock?).
***************
*** 6727,6736 ****
--- 6742,6758 ----
  }
  
  /* Define PLL registers for requested video mode */
+ #if defined(__powerpc__)
+ static void RADEONInitPLLRegisters(RADEONSavePtr save, RADEONInfoPtr info,
+ #else
  static void RADEONInitPLLRegisters(RADEONSavePtr save, RADEONPLLPtr pll,
+ #endif
  				   double dot_clock)
  {
      unsigned long  freq = dot_clock * 100;
+ #if defined(__powerpc__)
+     RADEONPLLPtr pll = &info->pll;
+ #endif
  
      struct {
  	int divider;
***************
*** 6780,6785 ****
--- 6802,6816 ----
  	       save->post_div));
  
      save->ppll_ref_div   = pll->reference_div;
+ 
+     /* 
+      * on iBooks the LCD pannel needs tweaked PLL timings 
+      */
+ #ifdef __powerpc__
+     if (xf86ReturnOptValBool(info->Options, OPTION_IBOOKHACKS, FALSE))
+         save->ppll_div_3 = 0x000600ad;
+     else
+ #endif
      save->ppll_div_3     = (save->feedback_div | (post_div->bitvalue << 16));
      save->htotal_cntl    = 0;
  }
***************
*** 6921,6927 ****
--- 6952,6962 ----
              return FALSE;
          dot_clock = (((RADEONMergedDisplayModePtr)mode->Private)->CRT1)->Clock / 1000.0;
          if (dot_clock) {
+ #if defined(__powerpc__)
+             RADEONInitPLLRegisters(save, info, dot_clock);
+ #else
              RADEONInitPLLRegisters(save, &info->pll, dot_clock);
+ #endif
          } else {
              save->ppll_ref_div = info->SavedReg.ppll_ref_div;
              save->ppll_div_3   = info->SavedReg.ppll_div_3;
***************
*** 6942,6948 ****
--- 6977,6987 ----
                  save->htotal_cntl  = 0;
              }
              else
+ #if defined(__powerpc__)
+ 		RADEONInitPLLRegisters(save, info, dot_clock);
+ #else
  		RADEONInitPLLRegisters(save, &info->pll, dot_clock);
+ #endif
  	} else {
  	    save->ppll_ref_div = info->SavedReg.ppll_ref_div;
  	    save->ppll_div_3   = info->SavedReg.ppll_div_3;
***************
*** 7159,7165 ****
  	RADEONDoAdjustFrame(pScrn, x, y, FALSE);
      }
  
-     RADEONSetFBLocation (pScrn);
  #ifdef XF86DRI
  	if (info->CPStarted) DRIUnlock(pScrn->pScreen);
  #endif
--- 7198,7203 ----


More information about the freebsd-ppc mailing list