intel_extreme: LVDS cleanup and fixes for later gens

This commit is contained in:
Alexander von Gluck IV 2015-11-02 18:01:18 -06:00
parent 4b6d5b8427
commit c86f3dba23
3 changed files with 23 additions and 11 deletions

View File

@ -613,16 +613,16 @@ struct intel_free_graphics_memory {
#define VGA_DISPLAY_DISABLED (1UL << 31)
// LVDS panel
#define INTEL_PANEL_STATUS 0x61200
#define INTEL_PANEL_STATUS (0x1200 | REGS_NORTH_PIPE_AND_PORT)
#define PANEL_STATUS_POWER_ON (1UL << 31)
#define INTEL_PANEL_CONTROL 0x61204
#define INTEL_PANEL_CONTROL (0x1204 | REGS_NORTH_PIPE_AND_PORT)
#define PANEL_CONTROL_POWER_TARGET_ON (1UL << 0)
#define INTEL_PANEL_FIT_CONTROL 0x61230
#define INTEL_PANEL_FIT_RATIOS 0x61234
#define INTEL_PANEL_FIT_CONTROL (0x1230 | REGS_NORTH_PIPE_AND_PORT)
#define INTEL_PANEL_FIT_RATIOS (0x1234 | REGS_NORTH_PIPE_AND_PORT)
// LVDS on IronLake and up
#define PCH_PANEL_CONTROL 0xc7200
#define PCH_PANEL_STATUS 0xc7204
#define PCH_PANEL_CONTROL (0x7200 | REGS_SOUTH_SHARED)
#define PCH_PANEL_STATUS (0x7204 | REGS_SOUTH_SHARED)
#define PANEL_REGISTER_UNLOCK (0xabcd << 16)
#define PCH_LVDS_DETECTED (1 << 1)

View File

@ -330,17 +330,33 @@ LVDSPort::LVDSPort()
:
Port(INTEL_PORT_C, "LVDS")
{
// Always unlock LVDS port as soon as we start messing with it.
if (gInfo->shared_info->device_type.HasPlatformControlHub()) {
write32(PCH_PANEL_CONTROL,
read32(PCH_PANEL_CONTROL) | PANEL_REGISTER_UNLOCK);
}
}
bool
LVDSPort::IsConnected()
{
// Older generations don't have LVDS detection. If not mobile skip.
if (gInfo->shared_info->device_type.Generation() <= 4) {
if (!gInfo->shared_info->device_type.IsMobile()) {
TRACE("LVDS: Skipping LVDS detection due to gen and not mobile\n");
return false;
}
}
uint32 registerValue = read32(INTEL_DIGITAL_LVDS_PORT);
if (gInfo->shared_info->device_type.HasPlatformControlHub()) {
// there's a detection bit we can use
if ((registerValue & PCH_LVDS_DETECTED) == 0)
if ((registerValue & PCH_LVDS_DETECTED) == 0) {
TRACE("LVDS: Not detected\n");
return false;
}
// TODO: Skip if eDP support
}
// Try getting EDID, as the LVDS port doesn't overlap with anything else,

View File

@ -99,10 +99,6 @@ static void
enable_lvds_panel(bool enable)
{
bool hasPCH = gInfo->shared_info->device_type.HasPlatformControlHub();
if (hasPCH) {
// TODO: fix for PCH
return;
}
int controlRegister = hasPCH ? PCH_PANEL_CONTROL : INTEL_PANEL_CONTROL;
int statusRegister = hasPCH ? PCH_PANEL_STATUS : INTEL_PANEL_STATUS;