diff --git a/src/rhd_atombios.c b/src/rhd_atombios.c index c30558c..fba8baa 100644 --- a/src/rhd_atombios.c +++ b/src/rhd_atombios.c @@ -2451,6 +2451,41 @@ atomGetDevice(atomBiosHandlePtr handle, enum atomDevice Device) return ATOM_MAX_SUPPORTED_DEVICE; } +void rhdPanelPowerDown(atomBiosHandlePtr handle) { + union { + PIXEL_CLOCK_PARAMETERS pclk; + PIXEL_CLOCK_PARAMETERS_V2 pclk_v2; + PIXEL_CLOCK_PARAMETERS_V3 pclk_v3; + SET_PIXEL_CLOCK_PS_ALLOCATION pclk_a; + } ps; + + CARD8 version; + + ps.pclk_v3.usPixelClock = 0; + ps.pclk_v3.usRefDiv = 0xe; + ps.pclk_v3.usFbDiv = 0x1f9; + ps.pclk_v3.ucPostDiv = 0xb; + ps.pclk_v3.ucPpll = 0; + ps.pclk_v3.ucTransmitterId = 0x1f; + ps.pclk_v3.ucEncoderMode = 1; + ps.pclk_v3.ucMiscInfo = 0x1; + + AtomBiosArgRec data; + data.exec.index = GetIndexIntoMasterTable(COMMAND, SetPixelClock); + if (!rhdAtomGetCommandTableRevisionSize(handle, data.exec.index, &version, NULL, NULL)) + xf86DrvMsg(handle->scrnIndex, X_WARNING, "[DBG] What the... can't get version\n"); + data.exec.dataSpace = NULL; + data.exec.pspace = &ps; + + xf86DrvMsg(handle->scrnIndex, X_WARNING, "[DBG] Calling SetPixelClock\n"); + atomDebugPrintPspace(handle, &data, sizeof(ps)); + if (RHDAtomBiosFunc(handle->scrnIndex, handle, ATOMBIOS_EXEC, &data) == ATOM_SUCCESS) { + xf86DrvMsg(handle->scrnIndex, X_WARNING, "[DBG] SetPixelClock success\n"); + } else { + xf86DrvMsg(handle->scrnIndex, X_WARNING, "[DBG] SetPixelClock fail\n"); + } +} + /* * */ diff --git a/src/rhd_randr.c b/src/rhd_randr.c index 8495c49..1bf73e7 100644 --- a/src/rhd_randr.c +++ b/src/rhd_randr.c @@ -73,6 +73,8 @@ # include "rhd_i2c.h" # include "rhd_audio.h" +void rhdPanelPowerDown(atomBiosHandlePtr handle); + /* * Driver internal */ @@ -322,8 +324,12 @@ rhdRRCrtcDpms(xf86CrtcPtr Crtc, int mode) break; case DPMSModeOff: rhdCrtc->Power(rhdCrtc, RHD_POWER_SHUTDOWN); - if (rhdCrtc->PLL) - rhdCrtc->PLL->Power(rhdCrtc->PLL, RHD_POWER_SHUTDOWN); + if (rhdCrtc->PLL) { + xf86DrvMsg(rhdPtr->scrnIndex, X_WARNING, "[DBG] PANEL hack start\n"); + rhdPanelPowerDown(rhdPtr->atomBIOS); + xf86DrvMsg(rhdPtr->scrnIndex, X_WARNING, "[DBG] PANEL hack end\n"); + /*rhdCrtc->PLL->Power(rhdCrtc->PLL, RHD_POWER_SHUTDOWN);*/ + } rhdCrtc->Active = FALSE; break; default: