diff options
author | Anssi Hannula <anssi@mandriva.org> | 2010-01-03 08:50:08 +0000 |
---|---|---|
committer | Anssi Hannula <anssi@mandriva.org> | 2010-01-03 08:50:08 +0000 |
commit | 854c3e5023035951184375b7bb83525878b9a7fb (patch) | |
tree | 3a63cc31efee60a39fbe0447141cca91c9eec15f /vbe.c | |
parent | b6a1b2905b8e404fa7e794bbe38fb20c81d6fc56 (diff) | |
download | monitor-edid-854c3e5023035951184375b7bb83525878b9a7fb.tar monitor-edid-854c3e5023035951184375b7bb83525878b9a7fb.tar.gz monitor-edid-854c3e5023035951184375b7bb83525878b9a7fb.tar.bz2 monitor-edid-854c3e5023035951184375b7bb83525878b9a7fb.tar.xz monitor-edid-854c3e5023035951184375b7bb83525878b9a7fb.zip |
monitor-get-edid-using-vbe:
- add --skip-vbe-check for skipping call for VBE info; useful if
calling the program multiple times for different ports
- on failure, return exit status 2 if no successful VBE calls were made
Diffstat (limited to 'vbe.c')
-rw-r--r-- | vbe.c | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -260,20 +260,23 @@ static int vbe_get_edid_info(char *edid, int port, int block) return 1; } -int get_edid(char *edid, int port) +int get_edid(char *edid, int port, int skip_vbe_check) { int i, extensions; int ok = 0; if (getuid() != 0) { fprintf(stderr, "you must be root to run this program\n"); - return 0; + return -1; } - ok = - (box_is_xbox() || (vbe_check_vbe_info() && - vbe_check_ddc_capabilities(port))) && - vbe_get_edid_info(edid, port, 0); + if (!box_is_xbox() && !skip_vbe_check) { + if (!vbe_check_vbe_info()) + return -1; + } + + ok = vbe_check_ddc_capabilities(port) && + vbe_get_edid_info(edid, port, 0); if (!ok) return 0; |