aboutsummaryrefslogtreecommitdiffstats
path: root/vbe.c
diff options
context:
space:
mode:
authorAnssi Hannula <anssi@mandriva.org>2010-01-03 08:50:08 +0000
committerAnssi Hannula <anssi@mandriva.org>2010-01-03 08:50:08 +0000
commit854c3e5023035951184375b7bb83525878b9a7fb (patch)
tree3a63cc31efee60a39fbe0447141cca91c9eec15f /vbe.c
parentb6a1b2905b8e404fa7e794bbe38fb20c81d6fc56 (diff)
downloadmonitor-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.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/vbe.c b/vbe.c
index 56882d3..57c9ac9 100644
--- a/vbe.c
+++ b/vbe.c
@@ -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;