intel_extreme: Improve LVDS panel detection robustness
* If older generation, check for mobile. If mobile GPU is found, make an assumption that a LVDS panel exists and attempt to leverage the vbios or VESA EDID.
This commit is contained in:
@@ -68,9 +68,9 @@ wait_for_clear(addr_t address, uint32 mask, uint32 timeout)
|
|||||||
Port::Port(port_index index, const char* baseName)
|
Port::Port(port_index index, const char* baseName)
|
||||||
:
|
:
|
||||||
fPipe(NULL),
|
fPipe(NULL),
|
||||||
|
fEDIDState(B_NO_INIT),
|
||||||
fPortIndex(index),
|
fPortIndex(index),
|
||||||
fPortName(NULL),
|
fPortName(NULL)
|
||||||
fEDIDState(B_NO_INIT)
|
|
||||||
{
|
{
|
||||||
char portID[2];
|
char portID[2];
|
||||||
portID[0] = 'A' + index - INTEL_PORT_A;
|
portID[0] = 'A' + index - INTEL_PORT_A;
|
||||||
@@ -360,22 +360,41 @@ LVDSPort::IsConnected()
|
|||||||
TRACE("%s: %s PortRegister: 0x%" B_PRIxADDR "\n", __func__, PortName(),
|
TRACE("%s: %s PortRegister: 0x%" B_PRIxADDR "\n", __func__, PortName(),
|
||||||
_PortRegister());
|
_PortRegister());
|
||||||
|
|
||||||
// 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(_PortRegister());
|
|
||||||
if (gInfo->shared_info->device_type.HasPlatformControlHub()) {
|
if (gInfo->shared_info->device_type.HasPlatformControlHub()) {
|
||||||
|
uint32 registerValue = read32(_PortRegister());
|
||||||
// there's a detection bit we can use
|
// 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");
|
TRACE("LVDS: Not detected\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// TODO: Skip if eDP support
|
// TODO: Skip if eDP support
|
||||||
|
} else if (gInfo->shared_info->device_type.Generation() <= 4) {
|
||||||
|
// Older generations don't have LVDS detection. If not mobile skip.
|
||||||
|
if (!gInfo->shared_info->device_type.IsMobile()) {
|
||||||
|
TRACE("LVDS: Skipping LVDS detection due to gen and not mobile\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// If mobile, try to grab EDID
|
||||||
|
// Linux seems to look at lid status for LVDS port detection
|
||||||
|
// If we don't get EDID, we can use vbios native mode or vesa?
|
||||||
|
if (!HasEDID()) {
|
||||||
|
#if 0
|
||||||
|
if (gInfo->shared_info->got_vbt) {
|
||||||
|
// TODO: Fake EDID from vbios native mode?
|
||||||
|
// I feel like this would be more accurate
|
||||||
|
} else if...
|
||||||
|
#endif
|
||||||
|
if (gInfo->shared_info->has_vesa_edid_info) {
|
||||||
|
TRACE("LVDS: Using VESA edid info\n");
|
||||||
|
memcpy(&fEDIDInfo, &gInfo->shared_info->vesa_edid_info,
|
||||||
|
sizeof(edid1_info));
|
||||||
|
fEDIDState = B_OK;
|
||||||
|
// HasEDID now true
|
||||||
|
} else {
|
||||||
|
TRACE("LVDS: Couldn't find any valid EDID!\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try getting EDID, as the LVDS port doesn't overlap with anything else,
|
// Try getting EDID, as the LVDS port doesn't overlap with anything else,
|
||||||
|
|||||||
@@ -85,15 +85,15 @@ static status_t _SetI2CSignals(void* cookie, int clock,
|
|||||||
display_mode fCurrentMode;
|
display_mode fCurrentMode;
|
||||||
Pipe* fPipe;
|
Pipe* fPipe;
|
||||||
|
|
||||||
|
status_t fEDIDState;
|
||||||
|
edid1_info fEDIDInfo;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual addr_t _DDCRegister() = 0;
|
virtual addr_t _DDCRegister() = 0;
|
||||||
virtual addr_t _PortRegister() = 0;
|
virtual addr_t _PortRegister() = 0;
|
||||||
|
|
||||||
port_index fPortIndex;
|
port_index fPortIndex;
|
||||||
char* fPortName;
|
char* fPortName;
|
||||||
|
|
||||||
status_t fEDIDState;
|
|
||||||
edid1_info fEDIDInfo;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user