diff options
author | Stew Benedict <stewb@mandriva.org> | 2005-03-07 21:56:02 +0000 |
---|---|---|
committer | Stew Benedict <stewb@mandriva.org> | 2005-03-07 21:56:02 +0000 |
commit | 2c527c297d7ef43456f6729dee9654e3e4fb4813 (patch) | |
tree | 650a9b9e9109277d93039a9ea1b46bedb5688d91 /vbe.c | |
parent | ec250dd654d3e22f695078447b4270136463932c (diff) | |
download | monitor-edid-2c527c297d7ef43456f6729dee9654e3e4fb4813.tar monitor-edid-2c527c297d7ef43456f6729dee9654e3e4fb4813.tar.gz monitor-edid-2c527c297d7ef43456f6729dee9654e3e4fb4813.tar.bz2 monitor-edid-2c527c297d7ef43456f6729dee9654e3e4fb4813.tar.xz monitor-edid-2c527c297d7ef43456f6729dee9654e3e4fb4813.zip |
XBox support
Diffstat (limited to 'vbe.c')
-rw-r--r-- | vbe.c | 29 |
1 files changed, 26 insertions, 3 deletions
@@ -158,11 +158,11 @@ int get_edid(char *edid) int ok; /* Initialize Int10 */ - ok = InitInt10(pci_config_type) == 0; - + ok = box_is_xbox() || InitInt10(pci_config_type) == 0; + if (ok) { ok = - vbe_check_vbe_info() && + (box_is_xbox() || vbe_check_vbe_info()) && vbe_get_edid_info(edid); FreeInt10(); @@ -171,3 +171,26 @@ int get_edid(char *edid) return ok ? 128 : 0; } + +int box_is_xbox() { + int is_xbox = 0; + int result = -1; + int fd; + size_t rd; + char *xbox_id = "0000\t10de02a5"; + char id[13]; + + if (!(fd = open("/proc/bus/pci/devices", O_RDONLY))) { + printf("Unable to open /proc/bus/pci/devices\n"); + } + if (!(rd = read(fd, id, sizeof(id)))) { + printf("Unable to read /proc/bus/pci/devices\n"); + } + + if (fd > 0) + close(fd); + result = strncmp(id, xbox_id, 13); + if (result == 0) + is_xbox = 1; + return is_xbox; +} |