From owner-freebsd-ppc@FreeBSD.ORG Mon Jul 11 03:14:27 2005 Return-Path: X-Original-To: freebsd-ppc@freebsd.org Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7B19E16A41C for ; Mon, 11 Jul 2005 03:14:27 +0000 (GMT) (envelope-from seanmwelch@yahoo.com) Received: from smtp110.mail.sc5.yahoo.com (smtp110.mail.sc5.yahoo.com [66.163.170.8]) by mx1.FreeBSD.org (Postfix) with SMTP id D695343D49 for ; Mon, 11 Jul 2005 03:14:26 +0000 (GMT) (envelope-from seanmwelch@yahoo.com) Received: (qmail 50437 invoked from network); 11 Jul 2005 03:14:26 -0000 Received: from unknown (HELO NitroPhys.welchsmnet.net) (seanmwelch@66.41.102.215 with plain) by smtp110.mail.sc5.yahoo.com with SMTP; 11 Jul 2005 03:14:25 -0000 Received: from NitroPhys.welchsmnet.net (localhost [127.0.0.1]) by NitroPhys.welchsmnet.net (8.13.1/8.12.10) with ESMTP id j6B3CXKQ040446; Sun, 10 Jul 2005 22:12:34 -0500 (CDT) (envelope-from seanmwelch@yahoo.com) Received: (from welchsm@localhost) by NitroPhys.welchsmnet.net (8.13.1/8.13.1/Submit) id j6B3CXGN040445; Sun, 10 Jul 2005 22:12:33 -0500 (CDT) (envelope-from seanmwelch@yahoo.com) Date: Sun, 10 Jul 2005 22:12:32 -0500 From: Sean Welch To: Peter Grehan Message-ID: <20050711031232.GB40236@NitroPhys.welchsmnet.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="b5gNqxB1S1yM7hjW" Content-Disposition: inline User-Agent: Mutt/1.5.9i Cc: freebsd-ppc@freebsd.org Subject: Re: Mac Mini and Xorg X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Sean_Welch@alum.wofford.org List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jul 2005 03:14:27 -0000 --b5gNqxB1S1yM7hjW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --b5gNqxB1S1yM7hjW Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="r.diff" *** 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 ---- --b5gNqxB1S1yM7hjW--