aboutsummaryrefslogtreecommitdiffstats
path: root/vbe.c
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-01-08 18:14:54 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-01-08 18:14:54 +0000
commit74a5be42e7044ea7393204e174436d4764fd0b6a (patch)
treef0c129a1f55c86c1026c2cc3deff5882fea9ab5f /vbe.c
parent957050b286bc1784110a881c93b0fe7e24e7dc18 (diff)
downloadmonitor-edid-74a5be42e7044ea7393204e174436d4764fd0b6a.tar
monitor-edid-74a5be42e7044ea7393204e174436d4764fd0b6a.tar.gz
monitor-edid-74a5be42e7044ea7393204e174436d4764fd0b6a.tar.bz2
monitor-edid-74a5be42e7044ea7393204e174436d4764fd0b6a.tar.xz
monitor-edid-74a5be42e7044ea7393204e174436d4764fd0b6a.zip
- monitor-get-edid:
o minimal support for getting EDID from different DDC port (experimental, need testing before using it in monitor-edid) this is inspired from SuSE's hwinfo. note: - we may need to not redo vbe_check_vbe_info() for each vbe_get_edid_info() if we want to get many ports. It would need a little re-architecturing (since returning list in C is not great fun) - hwinfo is probing ports 0,1 by default, (hwinfo says: some BIOSes crash when you try more) and 0,1,2 on Dell and nvidia-based laptops
Diffstat (limited to 'vbe.c')
-rw-r--r--vbe.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/vbe.c b/vbe.c
index 413ae2a..534dd0e 100644
--- a/vbe.c
+++ b/vbe.c
@@ -136,7 +136,7 @@ static int vbe_check_vbe_info(hd_data_t *hd_data)
}
/* Get EDID info. */
-int vbe_get_edid_info(hd_data_t *hd_data, char *edid)
+int vbe_get_edid_info(hd_data_t *hd_data, char *edid, int port)
{
int i;
int ax, bx, cx;
@@ -144,7 +144,7 @@ int vbe_get_edid_info(hd_data_t *hd_data, char *edid)
/* Setup registers for the interrupt call */
ax = 0x4f15;
bx = 1;
- cx = 0;
+ cx = port;
/* Get EDID block */
i = CallInt10(&ax, &bx, &cx, edid, 256, hd_data->flags.cpuemu) & 0xffff;
@@ -211,7 +211,7 @@ static int vbe_check_vbe_info__old(void)
return 1;
}
-static int vbe_get_edid_info__old(char *edid)
+static int vbe_get_edid_info__old(char *edid, int port)
{
int i;
unsigned char *mem;
@@ -236,6 +236,7 @@ static int vbe_get_edid_info__old(char *edid)
memset(&regs, 0, sizeof(regs));
regs.eax = 0x4f15;
regs.ebx = 0x0001;
+ regs.ecx = port;
regs.es = ((u_int32_t)mem) >> 4;
regs.edi = ((u_int32_t)mem) & 0x0f;
@@ -261,7 +262,7 @@ static int vbe_get_edid_info__old(char *edid)
return 1;
}
-int get_edid__old(char *edid)
+int get_edid__old(char *edid, int port)
{
int ok;
/* try with older lrmi interface, we can assume a failure for
@@ -269,12 +270,12 @@ int get_edid__old(char *edid)
log_err("Retrying with old LRMI interface\n");
ok =
(box_is_xbox() || vbe_check_vbe_info__old()) &&
- vbe_get_edid_info__old(edid);
+ vbe_get_edid_info__old(edid, port);
return ok;
}
#endif
-int get_edid(hd_data_t *hd_data, char *edid)
+int get_edid(hd_data_t *hd_data, char *edid, int port)
{
int ok = 0;
@@ -286,14 +287,14 @@ int get_edid(hd_data_t *hd_data, char *edid)
if (!box_is_xbox()) {
if (InitInt10(hd_data) == 0) {
ok = vbe_check_vbe_info(hd_data)
- && vbe_get_edid_info(hd_data, edid);
+ && vbe_get_edid_info(hd_data, edid, port);
FreeInt10();
}
}
#ifdef LRMI
if (!ok)
- ok = get_edid__old(edid);
+ ok = get_edid__old(edid, port);
#endif
return ok ? 128 : 0;