Date: Wed, 6 Jul 2005 10:30:05 -0500 From: Sean Welch <Sean_Welch@alum.wofford.org> To: Peter Grehan <grehan@freebsd.org> Cc: freebsd-ppc@freebsd.org Subject: Re: Mac Mini and Xorg Message-ID: <20050706153005.GA22632@NitroPhys.welchsmnet.net> In-Reply-To: <42CB3243.2010804@freebsd.org> References: <20050705163155.GA18493@NitroPhys.welchsmnet.net> <42CB0C67.7030705@freebsd.org> <20050706011247.GA20055@NitroPhys.welchsmnet.net> <42CB3243.2010804@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--9jxsPFA5p3P2qPhR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Jul 06, 2005 at 11:22:11AM +1000, Peter Grehan wrote: > >Of course if you want to > >throw together a new snapshot I'd be more than willing to test it > >out for you. ;-) > > Let's do both :) I got the kernel and modules built (pulled in the sound patches as well as the rs6000.c and sysv4.h patches) but I've not tried them yet because I did it remotely. I'll give it a shot when I get home this afternoon. > I think the main changes were #ifdef'd ppc, so if you have success > I'll file a PR. I have to say, the freebsd-x11 guys were *GREAT* in > getting my PR's pulled into the xorg port so quickly. I did a diff -c with the unpatched version of radeon_driver.c and came up with parts that seem to be just out of date in addition to the ifdef'd sections. A few seem to deal with pll stuff (which I think I saw in an OpenBSD forum somewhere was related to this issue?) so I'm not sure exactly what is just updated and what should actually be changed. I've inlined the diff below -- please take a look and let me know which sections are necessary so I can make changes accordingly. (I've also attached it so you can just edit that if you prefer.) Thanks! Sean *** radeon_driver.c Wed Jul 6 10:03:53 2005 --- /usr/radeon_driver.c Thu May 26 04:06:06 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 } }; *************** *** 5276,5281 **** --- 5282,5295 ---- 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?). *************** *** 5748,5754 **** */ vgaHWSave(pScrn, &hwp->SavedReg, VGA_SR_MODE); /* Save mode only */ #else ! vgaHWSave(pScrn, &hwp->SavedReg, VGA_SR_MODE | VGA_SR_FONTS); /* Save mode * & fonts & cmap */ #endif --- 5762,5768 ---- */ vgaHWSave(pScrn, &hwp->SavedReg, VGA_SR_MODE); /* Save mode only */ #else ! vgaHWSave(pScrn, &hwp->SavedReg, VGA_SR_ALL); /* Save mode * & fonts & cmap */ #endif *************** *** 5818,5824 **** */ vgaHWRestore(pScrn, &hwp->SavedReg, VGA_SR_MODE ); #else ! vgaHWRestore(pScrn, &hwp->SavedReg, VGA_SR_MODE | VGA_SR_FONTS ); #endif vgaHWLock(hwp); } else { --- 5832,5838 ---- */ vgaHWRestore(pScrn, &hwp->SavedReg, VGA_SR_MODE ); #else ! vgaHWRestore(pScrn, &hwp->SavedReg, VGA_SR_ALL ); #endif vgaHWLock(hwp); } else { *************** *** 6727,6736 **** } /* Define PLL registers for requested video mode */ ! static void RADEONInitPLLRegisters(RADEONSavePtr save, RADEONPLLPtr pll, double dot_clock) { unsigned long freq = dot_clock * 100; struct { int divider; --- 6741,6751 ---- } /* Define PLL registers for requested video mode */ ! static void RADEONInitPLLRegisters(RADEONSavePtr save, RADEONInfoPtr info, double dot_clock) { unsigned long freq = dot_clock * 100; + RADEONPLLPtr pll = &info->pll; struct { int divider; *************** *** 6780,6786 **** save->post_div)); save->ppll_ref_div = pll->reference_div; ! save->ppll_div_3 = (save->feedback_div | (post_div->bitvalue << 16)); save->htotal_cntl = 0; } --- 6795,6811 ---- 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 **** return FALSE; dot_clock = (((RADEONMergedDisplayModePtr)mode->Private)->CRT1)->Clock / 1000.0; if (dot_clock) { ! RADEONInitPLLRegisters(save, &info->pll, dot_clock); } else { save->ppll_ref_div = info->SavedReg.ppll_ref_div; save->ppll_div_3 = info->SavedReg.ppll_div_3; --- 6946,6952 ---- return FALSE; dot_clock = (((RADEONMergedDisplayModePtr)mode->Private)->CRT1)->Clock / 1000.0; if (dot_clock) { ! RADEONInitPLLRegisters(save, info, dot_clock); } else { save->ppll_ref_div = info->SavedReg.ppll_ref_div; save->ppll_div_3 = info->SavedReg.ppll_div_3; *************** *** 6942,6948 **** save->htotal_cntl = 0; } else ! RADEONInitPLLRegisters(save, &info->pll, dot_clock); } else { save->ppll_ref_div = info->SavedReg.ppll_ref_div; save->ppll_div_3 = info->SavedReg.ppll_div_3; --- 6967,6973 ---- save->htotal_cntl = 0; } else ! RADEONInitPLLRegisters(save, info, dot_clock); } 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 --- 7184,7190 ---- RADEONDoAdjustFrame(pScrn, x, y, FALSE); } ! /* RADEONSetFBLocation (pScrn); */ #ifdef XF86DRI if (info->CPStarted) DRIUnlock(pScrn->pScreen); #endif --9jxsPFA5p3P2qPhR Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="radeon.diff" *** radeon_driver.c Wed Jul 6 10:03:53 2005 --- /usr/radeon_driver.c Thu May 26 04:06:06 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 } }; *************** *** 5276,5281 **** --- 5282,5295 ---- 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?). *************** *** 5748,5754 **** */ vgaHWSave(pScrn, &hwp->SavedReg, VGA_SR_MODE); /* Save mode only */ #else ! vgaHWSave(pScrn, &hwp->SavedReg, VGA_SR_MODE | VGA_SR_FONTS); /* Save mode * & fonts & cmap */ #endif --- 5762,5768 ---- */ vgaHWSave(pScrn, &hwp->SavedReg, VGA_SR_MODE); /* Save mode only */ #else ! vgaHWSave(pScrn, &hwp->SavedReg, VGA_SR_ALL); /* Save mode * & fonts & cmap */ #endif *************** *** 5818,5824 **** */ vgaHWRestore(pScrn, &hwp->SavedReg, VGA_SR_MODE ); #else ! vgaHWRestore(pScrn, &hwp->SavedReg, VGA_SR_MODE | VGA_SR_FONTS ); #endif vgaHWLock(hwp); } else { --- 5832,5838 ---- */ vgaHWRestore(pScrn, &hwp->SavedReg, VGA_SR_MODE ); #else ! vgaHWRestore(pScrn, &hwp->SavedReg, VGA_SR_ALL ); #endif vgaHWLock(hwp); } else { *************** *** 6727,6736 **** } /* Define PLL registers for requested video mode */ ! static void RADEONInitPLLRegisters(RADEONSavePtr save, RADEONPLLPtr pll, double dot_clock) { unsigned long freq = dot_clock * 100; struct { int divider; --- 6741,6751 ---- } /* Define PLL registers for requested video mode */ ! static void RADEONInitPLLRegisters(RADEONSavePtr save, RADEONInfoPtr info, double dot_clock) { unsigned long freq = dot_clock * 100; + RADEONPLLPtr pll = &info->pll; struct { int divider; *************** *** 6780,6786 **** save->post_div)); save->ppll_ref_div = pll->reference_div; ! save->ppll_div_3 = (save->feedback_div | (post_div->bitvalue << 16)); save->htotal_cntl = 0; } --- 6795,6811 ---- 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 **** return FALSE; dot_clock = (((RADEONMergedDisplayModePtr)mode->Private)->CRT1)->Clock / 1000.0; if (dot_clock) { ! RADEONInitPLLRegisters(save, &info->pll, dot_clock); } else { save->ppll_ref_div = info->SavedReg.ppll_ref_div; save->ppll_div_3 = info->SavedReg.ppll_div_3; --- 6946,6952 ---- return FALSE; dot_clock = (((RADEONMergedDisplayModePtr)mode->Private)->CRT1)->Clock / 1000.0; if (dot_clock) { ! RADEONInitPLLRegisters(save, info, dot_clock); } else { save->ppll_ref_div = info->SavedReg.ppll_ref_div; save->ppll_div_3 = info->SavedReg.ppll_div_3; *************** *** 6942,6948 **** save->htotal_cntl = 0; } else ! RADEONInitPLLRegisters(save, &info->pll, dot_clock); } else { save->ppll_ref_div = info->SavedReg.ppll_ref_div; save->ppll_div_3 = info->SavedReg.ppll_div_3; --- 6967,6973 ---- save->htotal_cntl = 0; } else ! RADEONInitPLLRegisters(save, info, dot_clock); } 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 --- 7184,7190 ---- RADEONDoAdjustFrame(pScrn, x, y, FALSE); } ! /* RADEONSetFBLocation (pScrn); */ #ifdef XF86DRI if (info->CPStarted) DRIUnlock(pScrn->pScreen); #endif --9jxsPFA5p3P2qPhR--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050706153005.GA22632>