mirror of
https://github.com/reactos/reactos.git
synced 2025-05-08 11:24:14 +00:00
- Support more than one child
- vbemp shouldn't parse the EDID, so return it to videoprt svn path=/trunk/; revision=22304
This commit is contained in:
parent
259db9be47
commit
ab794adf1d
2 changed files with 66 additions and 20 deletions
|
@ -37,7 +37,8 @@ VBEWriteClockLine(
|
||||||
VideoPortZeroMemory(&BiosRegisters, sizeof(BiosRegisters));
|
VideoPortZeroMemory(&BiosRegisters, sizeof(BiosRegisters));
|
||||||
BiosRegisters.Eax = VBE_DDC;
|
BiosRegisters.Eax = VBE_DDC;
|
||||||
BiosRegisters.Ebx = VBE_DDC_WRITE_SCL_CLOCK_LINE;
|
BiosRegisters.Ebx = VBE_DDC_WRITE_SCL_CLOCK_LINE;
|
||||||
BiosRegisters.Ecx = data;
|
BiosRegisters.Ecx = VBEDeviceExtension->CurrentChildIndex;
|
||||||
|
BiosRegisters.Edx = data;
|
||||||
VBEDeviceExtension->Int10Interface.Int10CallBios(
|
VBEDeviceExtension->Int10Interface.Int10CallBios(
|
||||||
VBEDeviceExtension->Int10Interface.Context,
|
VBEDeviceExtension->Int10Interface.Context,
|
||||||
&BiosRegisters);
|
&BiosRegisters);
|
||||||
|
@ -55,7 +56,8 @@ VBEWriteDataLine(
|
||||||
VideoPortZeroMemory(&BiosRegisters, sizeof(BiosRegisters));
|
VideoPortZeroMemory(&BiosRegisters, sizeof(BiosRegisters));
|
||||||
BiosRegisters.Eax = VBE_DDC;
|
BiosRegisters.Eax = VBE_DDC;
|
||||||
BiosRegisters.Ebx = VBE_DDC_WRITE_SDA_DATA_LINE;
|
BiosRegisters.Ebx = VBE_DDC_WRITE_SDA_DATA_LINE;
|
||||||
BiosRegisters.Ecx = data;
|
BiosRegisters.Ecx = VBEDeviceExtension->CurrentChildIndex;
|
||||||
|
BiosRegisters.Edx = data;
|
||||||
VBEDeviceExtension->Int10Interface.Int10CallBios(
|
VBEDeviceExtension->Int10Interface.Int10CallBios(
|
||||||
VBEDeviceExtension->Int10Interface.Context,
|
VBEDeviceExtension->Int10Interface.Context,
|
||||||
&BiosRegisters);
|
&BiosRegisters);
|
||||||
|
@ -72,6 +74,7 @@ VBEReadClockLine(
|
||||||
VideoPortZeroMemory(&BiosRegisters, sizeof(BiosRegisters));
|
VideoPortZeroMemory(&BiosRegisters, sizeof(BiosRegisters));
|
||||||
BiosRegisters.Eax = VBE_DDC;
|
BiosRegisters.Eax = VBE_DDC;
|
||||||
BiosRegisters.Ebx = VBE_DDC_READ_SCL_CLOCK_LINE;
|
BiosRegisters.Ebx = VBE_DDC_READ_SCL_CLOCK_LINE;
|
||||||
|
BiosRegisters.Ecx = VBEDeviceExtension->CurrentChildIndex;
|
||||||
VBEDeviceExtension->Int10Interface.Int10CallBios(
|
VBEDeviceExtension->Int10Interface.Int10CallBios(
|
||||||
VBEDeviceExtension->Int10Interface.Context,
|
VBEDeviceExtension->Int10Interface.Context,
|
||||||
&BiosRegisters);
|
&BiosRegisters);
|
||||||
|
@ -90,6 +93,7 @@ VBEReadDataLine(
|
||||||
VideoPortZeroMemory(&BiosRegisters, sizeof(BiosRegisters));
|
VideoPortZeroMemory(&BiosRegisters, sizeof(BiosRegisters));
|
||||||
BiosRegisters.Eax = VBE_DDC;
|
BiosRegisters.Eax = VBE_DDC;
|
||||||
BiosRegisters.Ebx = VBE_DDC_READ_SDA_DATA_LINE;
|
BiosRegisters.Ebx = VBE_DDC_READ_SDA_DATA_LINE;
|
||||||
|
BiosRegisters.Ecx = VBEDeviceExtension->CurrentChildIndex;
|
||||||
VBEDeviceExtension->Int10Interface.Int10CallBios(
|
VBEDeviceExtension->Int10Interface.Int10CallBios(
|
||||||
VBEDeviceExtension->Int10Interface.Context,
|
VBEDeviceExtension->Int10Interface.Context,
|
||||||
&BiosRegisters);
|
&BiosRegisters);
|
||||||
|
@ -99,8 +103,9 @@ VBEReadDataLine(
|
||||||
|
|
||||||
static BOOLEAN
|
static BOOLEAN
|
||||||
VBEReadEdidUsingSCI(
|
VBEReadEdidUsingSCI(
|
||||||
PVOID HwDeviceExtension,
|
IN PVOID HwDeviceExtension,
|
||||||
PVBE_EDID Edid)
|
IN ULONG ChildIndex,
|
||||||
|
OUT PVOID Edid)
|
||||||
{
|
{
|
||||||
INT10_BIOS_ARGUMENTS BiosRegisters;
|
INT10_BIOS_ARGUMENTS BiosRegisters;
|
||||||
PVBE_DEVICE_EXTENSION VBEDeviceExtension =
|
PVBE_DEVICE_EXTENSION VBEDeviceExtension =
|
||||||
|
@ -116,6 +121,7 @@ VBEReadEdidUsingSCI(
|
||||||
VideoPortZeroMemory(&BiosRegisters, sizeof(BiosRegisters));
|
VideoPortZeroMemory(&BiosRegisters, sizeof(BiosRegisters));
|
||||||
BiosRegisters.Eax = VBE_DDC;
|
BiosRegisters.Eax = VBE_DDC;
|
||||||
BiosRegisters.Ebx = VBE_DDC_REPORT_CAPABILITIES;
|
BiosRegisters.Ebx = VBE_DDC_REPORT_CAPABILITIES;
|
||||||
|
BiosRegisters.Ecx = VBEDeviceExtension->CurrentChildIndex;
|
||||||
VBEDeviceExtension->Int10Interface.Int10CallBios(
|
VBEDeviceExtension->Int10Interface.Int10CallBios(
|
||||||
VBEDeviceExtension->Int10Interface.Context,
|
VBEDeviceExtension->Int10Interface.Context,
|
||||||
&BiosRegisters);
|
&BiosRegisters);
|
||||||
|
@ -131,6 +137,7 @@ VBEReadEdidUsingSCI(
|
||||||
VideoPortZeroMemory(&BiosRegisters, sizeof(BiosRegisters));
|
VideoPortZeroMemory(&BiosRegisters, sizeof(BiosRegisters));
|
||||||
BiosRegisters.Eax = VBE_DDC;
|
BiosRegisters.Eax = VBE_DDC;
|
||||||
BiosRegisters.Ebx = VBE_DDC_BEGIN_SCL_SDA_CONTROL;
|
BiosRegisters.Ebx = VBE_DDC_BEGIN_SCL_SDA_CONTROL;
|
||||||
|
BiosRegisters.Ecx = VBEDeviceExtension->CurrentChildIndex;
|
||||||
VBEDeviceExtension->Int10Interface.Int10CallBios(
|
VBEDeviceExtension->Int10Interface.Int10CallBios(
|
||||||
VBEDeviceExtension->Int10Interface.Context,
|
VBEDeviceExtension->Int10Interface.Context,
|
||||||
&BiosRegisters);
|
&BiosRegisters);
|
||||||
|
@ -140,6 +147,7 @@ VBEReadEdidUsingSCI(
|
||||||
/*
|
/*
|
||||||
* Read EDID information
|
* Read EDID information
|
||||||
*/
|
*/
|
||||||
|
VBEDeviceExtension->CurrentChildIndex = ChildIndex;
|
||||||
DDCControl.Size = sizeof(DDC_CONTROL);
|
DDCControl.Size = sizeof(DDC_CONTROL);
|
||||||
DDCControl.I2CCallbacks.WriteClockLine = VBEWriteClockLine;
|
DDCControl.I2CCallbacks.WriteClockLine = VBEWriteClockLine;
|
||||||
DDCControl.I2CCallbacks.WriteDataLine = VBEWriteDataLine;
|
DDCControl.I2CCallbacks.WriteDataLine = VBEWriteDataLine;
|
||||||
|
@ -150,7 +158,7 @@ VBEReadEdidUsingSCI(
|
||||||
HwDeviceExtension,
|
HwDeviceExtension,
|
||||||
&DDCControl,
|
&DDCControl,
|
||||||
(PUCHAR)&Edid,
|
(PUCHAR)&Edid,
|
||||||
sizeof(VBE_EDID));
|
MAX_SIZE_OF_EDID);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Disable I²C interface
|
* Disable I²C interface
|
||||||
|
@ -168,8 +176,9 @@ VBEReadEdidUsingSCI(
|
||||||
|
|
||||||
static BOOLEAN
|
static BOOLEAN
|
||||||
VBEReadEdid(
|
VBEReadEdid(
|
||||||
PVBE_DEVICE_EXTENSION VBEDeviceExtension,
|
IN PVBE_DEVICE_EXTENSION VBEDeviceExtension,
|
||||||
PVBE_EDID Edid)
|
IN ULONG ChildIndex,
|
||||||
|
OUT PVOID Edid)
|
||||||
{
|
{
|
||||||
INT10_BIOS_ARGUMENTS BiosRegisters;
|
INT10_BIOS_ARGUMENTS BiosRegisters;
|
||||||
|
|
||||||
|
@ -181,6 +190,7 @@ VBEReadEdid(
|
||||||
VideoPortZeroMemory(&BiosRegisters, sizeof(BiosRegisters));
|
VideoPortZeroMemory(&BiosRegisters, sizeof(BiosRegisters));
|
||||||
BiosRegisters.Eax = VBE_DDC;
|
BiosRegisters.Eax = VBE_DDC;
|
||||||
BiosRegisters.Ebx = VBE_DDC_READ_EDID;
|
BiosRegisters.Ebx = VBE_DDC_READ_EDID;
|
||||||
|
BiosRegisters.Ecx = ChildIndex;
|
||||||
BiosRegisters.Edx = 1;
|
BiosRegisters.Edx = 1;
|
||||||
BiosRegisters.Edi = VBEDeviceExtension->TrampolineMemoryOffset;
|
BiosRegisters.Edi = VBEDeviceExtension->TrampolineMemoryOffset;
|
||||||
BiosRegisters.SegEs = VBEDeviceExtension->TrampolineMemorySegment;
|
BiosRegisters.SegEs = VBEDeviceExtension->TrampolineMemorySegment;
|
||||||
|
@ -199,7 +209,7 @@ VBEReadEdid(
|
||||||
VBEDeviceExtension->TrampolineMemorySegment,
|
VBEDeviceExtension->TrampolineMemorySegment,
|
||||||
VBEDeviceExtension->TrampolineMemoryOffset,
|
VBEDeviceExtension->TrampolineMemoryOffset,
|
||||||
Edid,
|
Edid,
|
||||||
sizeof(VBE_EDID));
|
MAX_SIZE_OF_EDID);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -215,24 +225,51 @@ VBEGetVideoChildDescriptor(
|
||||||
{
|
{
|
||||||
PVBE_DEVICE_EXTENSION VBEDeviceExtension =
|
PVBE_DEVICE_EXTENSION VBEDeviceExtension =
|
||||||
(PVBE_DEVICE_EXTENSION)HwDeviceExtension;
|
(PVBE_DEVICE_EXTENSION)HwDeviceExtension;
|
||||||
VBE_EDID Edid;
|
ULONG ChildIndex;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We are called very early in device initialization, even before
|
* We are called very early in device initialization, even before
|
||||||
* VBEInitialize is called. So, our Int10 interface is not set.
|
* VBEInitialize is called. So, our Int10 interface is not set.
|
||||||
* Ignore this call, we will trigger it ourselves later.
|
* Ignore this call, we will trigger another one later.
|
||||||
*/
|
*/
|
||||||
if (VBEDeviceExtension->Int10Interface.Size == 0)
|
if (VBEDeviceExtension->Int10Interface.Size == 0)
|
||||||
return VIDEO_ENUM_NO_MORE_DEVICES;
|
return VIDEO_ENUM_NO_MORE_DEVICES;
|
||||||
|
|
||||||
|
if (ChildEnumInfo->Size != sizeof(VIDEO_CHILD_ENUM_INFO))
|
||||||
|
{
|
||||||
|
VideoPortDebugPrint(Error, "VBEMP: Wrong VIDEO_CHILD_ENUM_INFO structure size\n");
|
||||||
|
return VIDEO_ENUM_NO_MORE_DEVICES;
|
||||||
|
}
|
||||||
|
else if (ChildEnumInfo->ChildDescriptorSize < MAX_SIZE_OF_EDID)
|
||||||
|
{
|
||||||
|
VideoPortDebugPrint(Warn, "VBEMP: Too small buffer for EDID\n");
|
||||||
|
return VIDEO_ENUM_NO_MORE_DEVICES;
|
||||||
|
}
|
||||||
|
else if (ChildEnumInfo->ChildIndex == DISPLAY_ADAPTER_HW_ID)
|
||||||
|
{
|
||||||
|
*VideoChildType = VideoChip;
|
||||||
|
*UId = 0;
|
||||||
|
return VIDEO_ENUM_MORE_DEVICES; /* FIXME: not sure... */
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get Child ID
|
||||||
|
*/
|
||||||
|
if (ChildEnumInfo->ChildIndex != 0)
|
||||||
|
ChildIndex = ChildEnumInfo->ChildIndex;
|
||||||
|
else
|
||||||
|
ChildIndex = ChildEnumInfo->ACPIHwId;
|
||||||
|
VideoPortDebugPrint(Info, "VBEMP: ChildEnumInfo->ChildIndex %lu, ChildEnumInfo->ACPIHwId %lu => %lu\n",
|
||||||
|
ChildEnumInfo->ChildIndex, ChildEnumInfo->ACPIHwId, ChildIndex);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Try to read EDID information using 2 different methods.
|
* Try to read EDID information using 2 different methods.
|
||||||
*/
|
*/
|
||||||
if (VBEReadEdid(HwDeviceExtension, &Edid))
|
if (VBEReadEdid(HwDeviceExtension, ChildIndex, pChildDescriptor))
|
||||||
{
|
{
|
||||||
VideoPortDebugPrint(Info, "VBEMP: EDID information read directly\n");
|
VideoPortDebugPrint(Info, "VBEMP: EDID information read directly\n");
|
||||||
}
|
}
|
||||||
else if (VBEReadEdidUsingSCI(HwDeviceExtension, &Edid))
|
else if (VBEReadEdidUsingSCI(HwDeviceExtension, ChildIndex, pChildDescriptor))
|
||||||
{
|
{
|
||||||
VideoPortDebugPrint(Info, "VBEMP: EDID information read using I²C\n");
|
VideoPortDebugPrint(Info, "VBEMP: EDID information read using I²C\n");
|
||||||
}
|
}
|
||||||
|
@ -243,9 +280,18 @@ VBEGetVideoChildDescriptor(
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Process the EDID data.
|
* Fill return data
|
||||||
*/
|
*/
|
||||||
/* FIXME */
|
*VideoChildType = Monitor;
|
||||||
VideoPortDebugPrint(Error, "VBEMP: Need to parse EDID information\n");
|
if (ChildIndex == 0)
|
||||||
return VIDEO_ENUM_NO_MORE_DEVICES;
|
{
|
||||||
|
/*
|
||||||
|
* This is the actual display adapter
|
||||||
|
*/
|
||||||
|
*UId = DISPLAY_ADAPTER_HW_ID;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
*UId = ChildIndex;
|
||||||
|
*pUnused = 0;
|
||||||
|
return VIDEO_ENUM_MORE_DEVICES;
|
||||||
}
|
}
|
||||||
|
|
|
@ -189,10 +189,7 @@ typedef struct
|
||||||
CHAR Reserved4[189];
|
CHAR Reserved4[189];
|
||||||
} VBE_MODEINFO, *PVBE_MODEINFO;
|
} VBE_MODEINFO, *PVBE_MODEINFO;
|
||||||
|
|
||||||
typedef struct
|
#define MAX_SIZE_OF_EDID 256
|
||||||
{
|
|
||||||
UCHAR Reserved[128];
|
|
||||||
} VBE_EDID, *PVBE_EDID;
|
|
||||||
|
|
||||||
#include <poppack.h>
|
#include <poppack.h>
|
||||||
|
|
||||||
|
@ -213,6 +210,9 @@ typedef struct
|
||||||
USHORT *ModeNumbers;
|
USHORT *ModeNumbers;
|
||||||
PVBE_MODEINFO ModeInfo;
|
PVBE_MODEINFO ModeInfo;
|
||||||
USHORT CurrentMode;
|
USHORT CurrentMode;
|
||||||
|
|
||||||
|
/* Current child been enumerated */
|
||||||
|
ULONG CurrentChildIndex;
|
||||||
} VBE_DEVICE_EXTENSION, *PVBE_DEVICE_EXTENSION;
|
} VBE_DEVICE_EXTENSION, *PVBE_DEVICE_EXTENSION;
|
||||||
|
|
||||||
/* edid.c */
|
/* edid.c */
|
||||||
|
|
Loading…
Reference in a new issue