Attempt at panel control for SandyBridge, still disabled though as it doesn't

work yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42856 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2011-10-15 11:20:40 +00:00
parent cf1d1fb4ff
commit 16cc59778b
2 changed files with 15 additions and 7 deletions

View File

@ -247,6 +247,10 @@ struct intel_free_graphics_memory {
#define PCH_DISPLAY_A_PLL_DIVISOR_1 0xc6044 // INTEL_DISPLAY_A_PLL_DIVISOR_1
#define PCH_DISPLAY_B_PLL_DIVISOR_0 0xc6048 // INTEL_DISPLAY_B_PLL_DIVISOR_0
#define PCH_DISPLAY_B_PLL_DIVISOR_1 0xc604c // INTEL_DISPLAY_B_PLL_DIVISOR_1
#define PCH_PANEL_CONTROL 0xc7200 // INTEL_PANEL_CONTROL
#define PCH_PANEL_STATUS 0xc7204 // INTEL_PANEL_STATUS
#define PANEL_REGISTER_UNLOCK (0xabcd << 16)
// South Display Engine (SDE) Transcoder and Port Controls
#define PCH_DISPLAY_A_ANALOG_PORT 0xe1100 // INTEL_DISPLAY_A_ANALOG_PORT

View File

@ -74,26 +74,30 @@ enable_display_pipe(bool enable)
static void
enable_lvds_panel(bool enable)
{
uint32 control = read32(INTEL_PANEL_CONTROL);
bool isSNB = gInfo->shared_info->device_type.InGroup(INTEL_TYPE_SNB);
int controlRegister = isSNB ? PCH_PANEL_CONTROL : INTEL_PANEL_CONTROL;
int statusRegister = isSNB ? PCH_PANEL_STATUS : INTEL_PANEL_STATUS;
uint32 control = read32(controlRegister);
uint32 panelStatus;
if (enable) {
if ((control & PANEL_CONTROL_POWER_TARGET_ON) == 0) {
write32(INTEL_PANEL_CONTROL, control
| PANEL_CONTROL_POWER_TARGET_ON);
write32(controlRegister, control | PANEL_CONTROL_POWER_TARGET_ON
| (isSNB ? PANEL_REGISTER_UNLOCK : 0));
}
do {
panelStatus = read32(INTEL_PANEL_STATUS);
panelStatus = read32(statusRegister);
} while ((panelStatus & PANEL_STATUS_POWER_ON) == 0);
} else {
if ((control & PANEL_CONTROL_POWER_TARGET_ON) != 0) {
write32(INTEL_PANEL_CONTROL, control
& ~PANEL_CONTROL_POWER_TARGET_ON);
write32(controlRegister, (control & ~PANEL_CONTROL_POWER_TARGET_ON)
| (isSNB ? PANEL_REGISTER_UNLOCK : 0));
}
do {
panelStatus = read32(INTEL_PANEL_STATUS);
panelStatus = read32(statusRegister);
} while ((panelStatus & PANEL_STATUS_POWER_ON) != 0);
}
}