diff --git a/headers/private/graphics/intel_extreme/intel_extreme.h b/headers/private/graphics/intel_extreme/intel_extreme.h index c5cb0169b6..e2ef215504 100644 --- a/headers/private/graphics/intel_extreme/intel_extreme.h +++ b/headers/private/graphics/intel_extreme/intel_extreme.h @@ -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 diff --git a/src/add-ons/accelerants/intel_extreme/dpms.cpp b/src/add-ons/accelerants/intel_extreme/dpms.cpp index b45242a6c3..37fee355f6 100644 --- a/src/add-ons/accelerants/intel_extreme/dpms.cpp +++ b/src/add-ons/accelerants/intel_extreme/dpms.cpp @@ -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); } }