https://git.reactos.org/?p=reactos.git;a=commitdiff;h=08e9000496e4630b8f6c8…
commit 08e9000496e4630b8f6c848df03aebfd4d74c547
Author: Hervé Poussineau <hpoussin(a)reactos.org>
AuthorDate: Sat May 29 21:37:03 2021 +0200
Commit: Hervé Poussineau <hpoussin(a)reactos.org>
CommitDate: Sat Jun 5 23:38:05 2021 +0200
[VBE] Check if DDC is supported before trying to read EDID
Also set Edx to 0 when reading Edid, as per specification.
CORE-16695
---
win32ss/drivers/miniport/vbe/edid.c | 14 +++++++++++++-
win32ss/drivers/videoprt/videoprt.c | 4 ----
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/win32ss/drivers/miniport/vbe/edid.c b/win32ss/drivers/miniport/vbe/edid.c
index a9ebe35dbbf..cde4fc35754 100644
--- a/win32ss/drivers/miniport/vbe/edid.c
+++ b/win32ss/drivers/miniport/vbe/edid.c
@@ -184,6 +184,19 @@ VBEReadEdid(
VideoPortDebugPrint(Trace, "VBEMP: VBEReadEdid() called\n");
+ /*
+ * Check if DDC1/DDC2 is supported
+ */
+ VideoPortZeroMemory(&BiosRegisters, sizeof(BiosRegisters));
+ BiosRegisters.Eax = VBE_DDC;
+ VBEDeviceExtension->Int10Interface.Int10CallBios(
+ VBEDeviceExtension->Int10Interface.Context,
+ &BiosRegisters);
+ if (VBE_GETRETURNCODE(BiosRegisters.Eax) != VBE_SUCCESS)
+ return FALSE;
+ if ((BiosRegisters.Ebx & 3) == 0)
+ return FALSE;
+
/*
* Directly read EDID information
*/
@@ -191,7 +204,6 @@ VBEReadEdid(
BiosRegisters.Eax = VBE_DDC;
BiosRegisters.Ebx = VBE_DDC_READ_EDID;
BiosRegisters.Ecx = ChildIndex;
- BiosRegisters.Edx = 1;
BiosRegisters.Edi = VBEDeviceExtension->TrampolineMemoryOffset;
BiosRegisters.SegEs = VBEDeviceExtension->TrampolineMemorySegment;
VBEDeviceExtension->Int10Interface.Int10CallBios(
diff --git a/win32ss/drivers/videoprt/videoprt.c b/win32ss/drivers/videoprt/videoprt.c
index 5d4c54a3559..b57cff52594 100644
--- a/win32ss/drivers/videoprt/videoprt.c
+++ b/win32ss/drivers/videoprt/videoprt.c
@@ -1233,10 +1233,6 @@ VideoPortEnumerateChildren(
{
/* Mark it invalid */
ChildExtension->EdidValid = FALSE;
- // FIXME: the following break workarounds CORE-16695
- // but prevents graphic cards to return an invalid
- // EDID as first child, and a valid one as second child.
- break;
}
}
}