--- xf86-video-nouveau/src/nv_output-old.c 2009-01-05 22:31:49.000000000 +0800 +++ xf86-video-nouveau/src/nv_output.c 2009-01-08 22:03:32.000000000 +0800 @@ -673,6 +673,8 @@ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); int i; + backlightenable(pScrn, mode); + if (mode == DPMSModeOn) { nv_crtc = to_nouveau_crtc(crtc); regp = &pNv->ModeReg.crtc_reg[nv_crtc->head]; --- xf86-video-nouveau/src/nv_bios-old.c 2009-01-05 22:31:30.000000000 +0800 +++ xf86-video-nouveau/src/nv_bios.c 2009-01-08 11:56:22.000000000 +0800 @@ -2754,23 +2754,33 @@ if (script == LVDS_PANEL_OFF) /* off-on delay in ms */ BIOS_USLEEP(le16_to_cpu(*(uint16_t *)&bios->data[bios->fp.xlated_entry + 7])); + +#ifdef __powerpc__ + /* Powerbook specific quirks */ + if (script == LVDS_RESET && ((pNv->Chipset & 0xffff) == 0x0179 || (pNv->Chipset & 0xffff) == 0x0329)) + nv_write_tmds(pNv, dcbent->or, 0, 0x02, 0x72); +#endif + return 0; +} + +void backlightenable(ScrnInfoPtr pScrn, int mode) +{ + NVPtr pNv = NVPTR(pScrn); + #ifdef __powerpc__ /* Powerbook specific quirks */ - if (script == LVDS_RESET && ((pNv->Chipset & 0xffff) == 0x0179 || (pNv->Chipset & 0xffff) == 0x0329)) - nv_write_tmds(pNv, dcbent->or, 0, 0x02, 0x72); if ((pNv->Chipset & 0xffff) == 0x0179 || (pNv->Chipset & 0xffff) == 0x0189 || (pNv->Chipset & 0xffff) == 0x0329) { - if (script == LVDS_PANEL_ON) { + if (mode == DPMSModeOn) { nv32_wr(pScrn, NV_PBUS_DEBUG_DUALHEAD_CTL, nv32_rd(pScrn, NV_PBUS_DEBUG_DUALHEAD_CTL) | (1 << 31)); nv32_wr(pScrn, NV_CRTC_GPIO_EXT, nv32_rd(pScrn, NV_CRTC_GPIO_EXT) | 1); } - if (script == LVDS_PANEL_OFF) { + if (mode == DPMSModeOff) { nv32_wr(pScrn, NV_PBUS_DEBUG_DUALHEAD_CTL, nv32_rd(pScrn, NV_PBUS_DEBUG_DUALHEAD_CTL) & ~(1 << 31)); nv32_wr(pScrn, NV_CRTC_GPIO_EXT, nv32_rd(pScrn, NV_CRTC_GPIO_EXT) & ~3); } } #endif - return 0; } static int run_lvds_table(ScrnInfoPtr pScrn, struct dcb_entry *dcbent, int head, enum LVDS_script script, int pxclk) --- xf86-video-nouveau/src/nv_proto-old.h 2009-01-08 22:07:18.000000000 +0800 +++ xf86-video-nouveau/src/nv_proto.h 2009-01-08 11:57:13.000000000 +0800 @@ -77,6 +77,7 @@ int getMNP_single(ScrnInfoPtr pScrn, struct pll_lims *pll_lim, int clk, int *NM, int *log2P); int getMNP_double(ScrnInfoPtr pScrn, struct pll_lims *pll_lim, int clk, int *NM1, int *NM2, int *log2P); int get_pll_limits(ScrnInfoPtr pScrn, uint32_t limit_match, struct pll_lims *pll_lim); +void backlightenable(ScrnInfoPtr pScrn, int mode); /* nv_crtc.c */ void NVCrtcSetBase(xf86CrtcPtr crtc, int x, int y);