diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-01-08 18:14:54 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-01-08 18:14:54 +0000 |
commit | 74a5be42e7044ea7393204e174436d4764fd0b6a (patch) | |
tree | f0c129a1f55c86c1026c2cc3deff5882fea9ab5f /monitor-get-edid-using-vbe.c | |
parent | 957050b286bc1784110a881c93b0fe7e24e7dc18 (diff) | |
download | monitor-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 'monitor-get-edid-using-vbe.c')
-rw-r--r-- | monitor-get-edid-using-vbe.c | 8 |
1 files changed, 5 insertions, 3 deletions
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 && |