From 652a775f284d7f19adf585a963619dea3b8d3d68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Mon, 1 Aug 2022 16:24:07 +0200 Subject: [PATCH] intel_extreme: on gen12 PIPE_DDI_FUNC_CTL_EDP seems unreliable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this is only useful when connecting an external screen, and the laptop actually uses it on boot. should help with #17706 Change-Id: Ia3434f76cf6210b743f17d5559d031c089cbcd85 Reviewed-on: https://review.haiku-os.org/c/haiku/+/5518 Tested-by: Commit checker robot Reviewed-by: Jérôme Duval --- .../accelerants/intel_extreme/Ports.cpp | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/add-ons/accelerants/intel_extreme/Ports.cpp b/src/add-ons/accelerants/intel_extreme/Ports.cpp index bb3245e1d2..3cc5715148 100644 --- a/src/add-ons/accelerants/intel_extreme/Ports.cpp +++ b/src/add-ons/accelerants/intel_extreme/Ports.cpp @@ -759,7 +759,7 @@ Port::_DpAuxTransfer(uint8* transmitBuffer, uint8 transmitSize, for (int i = 0; i < 5; i++) channelData[i] = PCH_DP_AUX_CH_DATA(channel, i); } else { - ERROR("DigitalDisplayInterface::_DpAuxTransfer() unknown register config\n"); + ERROR("Port::_DpAuxTransfer() unknown register config\n"); return B_BUSY; } if (transmitSize > 20 || receiveSize > 20) @@ -2296,14 +2296,18 @@ DigitalDisplayInterface::IsConnected() uint32 pipeState = 0; if ((gInfo->shared_info->device_type.IsMobile() || _IsEDPPort()) && (PortIndex() == INTEL_PORT_A)) { - pipeState = read32(PIPE_DDI_FUNC_CTL_EDP); - TRACE("%s: PIPE_DDI_FUNC_CTL_EDP: 0x%" B_PRIx32 "\n", __func__, pipeState); - if (!(pipeState & PIPE_DDI_FUNC_CTL_ENABLE)) { - TRACE("%s: Laptop, but eDP port down\n", __func__); - return false; + if (gInfo->shared_info->device_type.Generation() < 12) { + // TODO: the pipe state isn't reliable after gen11 + pipeState = read32(PIPE_DDI_FUNC_CTL_EDP); + TRACE("%s: PIPE_DDI_FUNC_CTL_EDP: 0x%" B_PRIx32 "\n", __func__, pipeState); + if (!(pipeState & PIPE_DDI_FUNC_CTL_ENABLE)) { + TRACE("%s: Laptop, but eDP port down\n", __func__); + return false; + } } - - if (gInfo->shared_info->has_vesa_edid_info) { + if (edidDetected) + return true; + else if (gInfo->shared_info->has_vesa_edid_info) { TRACE("%s: Laptop. Using VESA edid info\n", __func__); memcpy(&fEDIDInfo, &gInfo->shared_info->vesa_edid_info, sizeof(edid1_info)); if (fEDIDState != B_OK) {