Make some more SandyBridge specifics into Platform Control Hub (PCH) specifics.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42868 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz
2011-10-16 19:36:02 +00:00
parent 3aaf71a600
commit 9e2e0d8dac
4 changed files with 21 additions and 16 deletions
@@ -119,6 +119,11 @@ struct DeviceType {
{ {
return (type & INTEL_TYPE_MODEL_MASK) == model; return (type & INTEL_TYPE_MODEL_MASK) == model;
} }
bool HasPlatformControlHub() const
{
return InGroup(INTEL_TYPE_SNB);
}
}; };
// info about PLL on graphics card // info about PLL on graphics card
@@ -209,9 +209,9 @@ intel_init_accelerant(int device)
// assume it is the valid panel size.. // assume it is the valid panel size..
// Later we query for proper EDID info if it exists, or figure something // Later we query for proper EDID info if it exists, or figure something
// else out. (Default modes, etc.) // else out. (Default modes, etc.)
bool isSNB = gInfo->shared_info->device_type.InGroup(INTEL_TYPE_SNB); bool hasPCH = gInfo->shared_info->device_type.HasPlatformControlHub();
if ((isSNB && (lvds & PCH_LVDS_DETECTED) != 0) if ((hasPCH && (lvds & PCH_LVDS_DETECTED) != 0)
|| (!isSNB && (lvds & DISPLAY_PIPE_ENABLED) != 0)) { || (!hasPCH && (lvds & DISPLAY_PIPE_ENABLED) != 0)) {
save_lvds_mode(); save_lvds_mode();
gInfo->head_mode |= HEAD_MODE_LVDS_PANEL; gInfo->head_mode |= HEAD_MODE_LVDS_PANEL;
} }
@@ -95,14 +95,14 @@ enable_display_pipe(bool enable)
static void static void
enable_lvds_panel(bool enable) enable_lvds_panel(bool enable)
{ {
bool isSNB = gInfo->shared_info->device_type.InGroup(INTEL_TYPE_SNB); bool hasPCH = gInfo->shared_info->device_type.HasPlatformControlHub();
if (isSNB) { if (hasPCH) {
// TODO: fix for SNB // TODO: fix for PCH
return; return;
} }
int controlRegister = isSNB ? PCH_PANEL_CONTROL : INTEL_PANEL_CONTROL; int controlRegister = hasPCH ? PCH_PANEL_CONTROL : INTEL_PANEL_CONTROL;
int statusRegister = isSNB ? PCH_PANEL_STATUS : INTEL_PANEL_STATUS; int statusRegister = hasPCH ? PCH_PANEL_STATUS : INTEL_PANEL_STATUS;
uint32 control = read32(controlRegister); uint32 control = read32(controlRegister);
uint32 panelStatus; uint32 panelStatus;
@@ -110,7 +110,7 @@ enable_lvds_panel(bool enable)
if (enable) { if (enable) {
if ((control & PANEL_CONTROL_POWER_TARGET_ON) == 0) { if ((control & PANEL_CONTROL_POWER_TARGET_ON) == 0) {
write32(controlRegister, control | PANEL_CONTROL_POWER_TARGET_ON write32(controlRegister, control | PANEL_CONTROL_POWER_TARGET_ON
| (isSNB ? PANEL_REGISTER_UNLOCK : 0)); | (hasPCH ? PANEL_REGISTER_UNLOCK : 0));
} }
do { do {
@@ -119,7 +119,7 @@ enable_lvds_panel(bool enable)
} else { } else {
if ((control & PANEL_CONTROL_POWER_TARGET_ON) != 0) { if ((control & PANEL_CONTROL_POWER_TARGET_ON) != 0) {
write32(controlRegister, (control & ~PANEL_CONTROL_POWER_TARGET_ON) write32(controlRegister, (control & ~PANEL_CONTROL_POWER_TARGET_ON)
| (isSNB ? PANEL_REGISTER_UNLOCK : 0)); | (hasPCH ? PANEL_REGISTER_UNLOCK : 0));
} }
do { do {
@@ -83,8 +83,8 @@ intel_interrupt_handler(void* data)
int32 handled = B_HANDLED_INTERRUPT; int32 handled = B_HANDLED_INTERRUPT;
// TODO: verify that these aren't actually the same // TODO: verify that these aren't actually the same
bool isSNB = info.device_type.InGroup(INTEL_TYPE_SNB); bool hasPCH = info.device_type.HasPlatformControlHub();
uint16 mask = isSNB ? PCH_INTERRUPT_VBLANK_PIPEA : INTERRUPT_VBLANK_PIPEA; uint16 mask = hasPCH ? PCH_INTERRUPT_VBLANK_PIPEA : INTERRUPT_VBLANK_PIPEA;
if ((identity & mask) != 0) { if ((identity & mask) != 0) {
handled = release_vblank_sem(info); handled = release_vblank_sem(info);
@@ -93,7 +93,7 @@ intel_interrupt_handler(void* data)
DISPLAY_PIPE_VBLANK_STATUS | DISPLAY_PIPE_VBLANK_ENABLED); DISPLAY_PIPE_VBLANK_STATUS | DISPLAY_PIPE_VBLANK_ENABLED);
} }
mask = isSNB ? PCH_INTERRUPT_VBLANK_PIPEB : INTERRUPT_VBLANK_PIPEB; mask = hasPCH ? PCH_INTERRUPT_VBLANK_PIPEB : INTERRUPT_VBLANK_PIPEB;
if ((identity & mask) != 0) { if ((identity & mask) != 0) {
handled = release_vblank_sem(info); handled = release_vblank_sem(info);
@@ -145,8 +145,8 @@ init_interrupt_handler(intel_info &info)
write16(info, INTEL_INTERRUPT_IDENTITY, ~0); write16(info, INTEL_INTERRUPT_IDENTITY, ~0);
// enable interrupts - we only want VBLANK interrupts // enable interrupts - we only want VBLANK interrupts
bool isSNB = info.device_type.InGroup(INTEL_TYPE_SNB); bool hasPCH = info.device_type.HasPlatformControlHub();
uint16 enable = isSNB uint16 enable = hasPCH
? (PCH_INTERRUPT_VBLANK_PIPEA | PCH_INTERRUPT_VBLANK_PIPEB) ? (PCH_INTERRUPT_VBLANK_PIPEA | PCH_INTERRUPT_VBLANK_PIPEB)
: (INTERRUPT_VBLANK_PIPEA | INTERRUPT_VBLANK_PIPEB); : (INTERRUPT_VBLANK_PIPEA | INTERRUPT_VBLANK_PIPEB);
@@ -248,7 +248,7 @@ intel_extreme_init(intel_info &info)
blocks[REGISTER_BLOCK(REGS_FLAT)] = 0; blocks[REGISTER_BLOCK(REGS_FLAT)] = 0;
// setup the register blocks for the different architectures // setup the register blocks for the different architectures
if (info.device_type.InGroup(INTEL_TYPE_SNB)) { if (info.device_type.HasPlatformControlHub()) {
// PCH based platforms (IronLake and up) // PCH based platforms (IronLake and up)
blocks[REGISTER_BLOCK(REGS_INTERRUPT)] blocks[REGISTER_BLOCK(REGS_INTERRUPT)]
= PCH_DE_INTERRUPT_REGISTER_BASE; = PCH_DE_INTERRUPT_REGISTER_BASE;