Added EDID version 1 retrieval from VESA; doesn't do anything yet besides dumping the

info to the serial line - not tested yet (as Qemu doesn't support DDC/EDID).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19580 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2006-12-20 21:44:03 +00:00
parent 3277df6e04
commit 5d7d960fac
2 changed files with 64 additions and 4 deletions
@@ -3,6 +3,7 @@ SubDir HAIKU_TOP src system boot platform bios_ia32 ;
SubDirHdrs $(HAIKU_TOP) headers private kernel boot platform $(TARGET_BOOT_PLATFORM) ;
UsePrivateHeaders [ FDirName kernel disk_device_manager ] ;
UsePrivateHeaders [ FDirName graphics common ] ;
UsePrivateHeaders [ FDirName graphics vesa ] ;
UsePrivateHeaders [ FDirName storage ] ;
@@ -14,6 +15,8 @@ UsePrivateHeaders [ FDirName storage ] ;
SubDirC++Flags $(defines) -Wall -Wno-multichar -fno-rtti ;
}
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons accelerants common ] ;
KernelMergeObject boot_platform_bios_ia32.o :
shell.S
start.c
@@ -34,6 +37,11 @@ KernelMergeObject boot_platform_bios_ia32.o :
# generic
text_menu.cpp
# VESA/DDC EDID
decode_edid.c
dump_edid.c
: -fno-pic
;
+56 -4
View File
@@ -11,6 +11,8 @@
#include "mmu.h"
#include "images.h"
#include <edid.h>
#include <arch/cpu.h>
#include <boot/stage2.h>
#include <boot/platform.h>
@@ -102,15 +104,17 @@ find_video_mode(int32 width, int32 height, int32 depth)
}
static void
static bool
get_mode_from_settings(void)
{
if (sSettingsLoaded)
return;
return true;
void *handle = load_driver_settings("vesa");
if (handle == NULL)
return;
return false;
bool found = false;
const driver_settings *settings = get_driver_settings(handle);
if (settings == NULL)
@@ -130,13 +134,16 @@ get_mode_from_settings(void)
// search mode that fits
video_mode *mode = find_video_mode(width, height, depth);
if (mode != NULL)
if (mode != NULL) {
found = true;
sMode = mode;
}
}
}
out:
unload_driver_settings(handle);
return found;
}
@@ -176,6 +183,48 @@ vga_enable_bright_background_colors(void)
// VESA functions
static status_t
vesa_get_edid(edid1_info *info)
{
struct bios_regs regs;
regs.eax = 0x4f15;
regs.ebx = 0;
// report DDC service
regs.ecx = 0;
regs.es = 0;
regs.edi = 0;
call_bios(0x10, &regs);
// %ah contains the error code
if ((regs.eax & 0xff00) != 0)
return B_NOT_SUPPORTED;
// test if EDID v1 is supported by the monitor
if (((regs.ebx >> 8) & 1) == 0)
return B_NOT_SUPPORTED;
edid1_raw edidRaw;
regs.eax = 0x4f15;
regs.ebx = 1;
// read EDID
regs.ecx = 0;
regs.edx = 0;
regs.es = ADDRESS_SEGMENT(&edidRaw);
regs.edi = ADDRESS_OFFSET(&edidRaw);
call_bios(0x10, &regs);
if ((regs.eax & 0xff00) != 0)
return B_NOT_SUPPORTED;
// retrieved EDID - now parse it
dprintf("Got EDID!\n");
edid_decode(info, &edidRaw);
edid_dump(info);
return B_OK;
}
static status_t
vesa_get_mode_info(uint16 mode, struct vbe_mode_info *modeInfo)
{
@@ -743,6 +792,9 @@ platform_init_video(void)
TRACE(("VESA compatible graphics!\n"));
edid1_info info;
vesa_get_edid(&info);
return B_OK;
}