From 74a5be42e7044ea7393204e174436d4764fd0b6a Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 8 Jan 2008 18:14:54 +0000 Subject: - 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 --- monitor-get-edid-using-vbe.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'monitor-get-edid-using-vbe.c') diff --git a/monitor-get-edid-using-vbe.c b/monitor-get-edid-using-vbe.c index 1b5a470..822820a 100644 --- a/monitor-get-edid-using-vbe.c +++ b/monitor-get-edid-using-vbe.c @@ -18,6 +18,7 @@ int main(int argc, char **argv) { char edid[256]; int try_in_console = 0; + int port = 0; int i; /* Hardware Data defaults */ @@ -32,18 +33,19 @@ int main(int argc, char **argv) for (i = 1; i < argc; i++) { const char *arg = argv[i]; if (strcmp(arg, "-v") == 0) verbose = 1; + else if (strcmp(arg, "--port") == 0 && i+1 < argc) port = atoi(argv[++i]); else if (strcmp(arg, "--try-in-console") == 0) try_in_console = 1; else if (strcmp(arg, "--map-bios-vram") == 0) hd_data.flags.biosvram = 1; else if (strcmp(arg, "--check-bios-crc") == 0) hd_data.flags.nobioscrc = 0; else if (strcmp(arg, "--use-cpuemu") == 0) hd_data.flags.cpuemu = 1; else if (strcmp(arg, "-h") == 0 || strcmp(arg, "--help") == 0) { - printf("usage: monitor-get-edid [-v]\n"); + printf("usage: monitor-get-edid [-v] [--port <0-3>]\n"); exit(1); } } - int size = get_edid(&hd_data, edid); + int size = get_edid(&hd_data, edid, port); if (!size && try_in_console) { int non_X_console = 1; @@ -56,7 +58,7 @@ int main(int argc, char **argv) ioctl(fd, VT_ACTIVATE, non_X_console) == 0 && ioctl(fd, VT_WAITACTIVE, non_X_console) == 0) { /* retrying */ - size = get_edid(&hd_data, edid); + size = get_edid(&hd_data, edid, port); /* restore */ ioctl(fd, VT_ACTIVATE, current.v_active) == 0 && -- cgit v1.2.1