mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-03 04:13:31 +00:00
[FREELDR]
Add VESA DDC detection and EDID read code. Work in progress. svn path=/trunk/; revision=73587
This commit is contained in:
@@ -1678,6 +1678,18 @@ DetectDisplayController(PCONFIGURATION_COMPONENT_DATA BusKey)
|
||||
TRACE("Created key: DisplayController\\0\n");
|
||||
|
||||
/* FIXME: Add display peripheral (monitor) data */
|
||||
if (VesaVersion != 0)
|
||||
{
|
||||
if (BiosIsVesaDdcSupported())
|
||||
{
|
||||
TRACE("VESA/DDC supported!\n");
|
||||
if (BiosVesaReadEdid())
|
||||
{
|
||||
TRACE("EDID data read successfully!\n");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
DBG_DEFAULT_CHANNEL(UI);
|
||||
DBG_DEFAULT_CHANNEL(HWDETECT);
|
||||
|
||||
#include <pshpack2.h>
|
||||
typedef struct
|
||||
@@ -237,3 +237,64 @@ USHORT BiosIsVesaSupported(VOID)
|
||||
|
||||
return SvgaInfo->VesaVersion;
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN
|
||||
BiosIsVesaDdcSupported(VOID)
|
||||
{
|
||||
REGS Regs;
|
||||
|
||||
TRACE("BiosIsVesaDdcSupported()\n");
|
||||
|
||||
Regs.w.ax = 0x4F15;
|
||||
Regs.b.bl = 0;
|
||||
Regs.w.cx = 0;
|
||||
Regs.w.es = 0;
|
||||
Regs.w.di = 0;
|
||||
Int386(0x10, &Regs, &Regs);
|
||||
|
||||
TRACE("AL = 0x%x\n", Regs.b.al);
|
||||
TRACE("AH = 0x%x\n", Regs.b.ah);
|
||||
|
||||
TRACE("BL = 0x%x\n", Regs.b.bl);
|
||||
|
||||
if (Regs.w.ax != 0x004F)
|
||||
{
|
||||
ERR("VESA/DDC installation check failed\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return (Regs.b.ah == 0);
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN
|
||||
BiosVesaReadEdid(VOID)
|
||||
{
|
||||
REGS Regs;
|
||||
|
||||
TRACE("BiosVesaReadEdid()\n");
|
||||
|
||||
RtlZeroMemory((PVOID)BIOSCALLBUFFER, 128);
|
||||
|
||||
Regs.w.ax = 0x4F15;
|
||||
Regs.b.bl = 1;
|
||||
Regs.w.cx = 0;
|
||||
Regs.w.dx = 0;
|
||||
Regs.w.es = BIOSCALLBUFSEGMENT;
|
||||
Regs.w.di = BIOSCALLBUFOFFSET;
|
||||
Int386(0x10, &Regs, &Regs);
|
||||
|
||||
TRACE("AL = 0x%x\n", Regs.b.al);
|
||||
TRACE("AH = 0x%x\n", Regs.b.ah);
|
||||
|
||||
if (Regs.w.ax != 0x004F)
|
||||
{
|
||||
ERR("Read EDID function not supported!\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return (Regs.b.ah == 0);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
||||
@@ -30,9 +30,11 @@ typedef struct
|
||||
|
||||
extern PVOID VideoOffScreenBuffer;
|
||||
|
||||
USHORT BiosIsVesaSupported(VOID); // Implemented in i386vid.c, returns the VESA version
|
||||
USHORT BiosIsVesaSupported(VOID); // Implemented in i386vid.c, returns the VESA version
|
||||
BOOLEAN BiosIsVesaDdcSupported(VOID);
|
||||
BOOLEAN BiosVesaReadEdid(VOID);
|
||||
|
||||
PVOID VideoAllocateOffScreenBuffer(VOID); // Returns a pointer to an off-screen buffer sufficient for the current video mode
|
||||
PVOID VideoAllocateOffScreenBuffer(VOID); // Returns a pointer to an off-screen buffer sufficient for the current video mode
|
||||
|
||||
VOID VideoCopyOffScreenBufferToVRAM(VOID);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user