aboutsummaryrefslogtreecommitdiffstats
path: root/monitor-get-edid-using-vbe.c
diff options
context:
space:
mode:
authorGwenolé Beauchesne <gbeauchesne@mandriva.org>2006-08-31 13:48:59 +0000
committerGwenolé Beauchesne <gbeauchesne@mandriva.org>2006-08-31 13:48:59 +0000
commit7eecc68d898db2170894c4170e492fbd59af6de3 (patch)
treea253b42ff1ef517249a87fb90f0b566f5301df8e /monitor-get-edid-using-vbe.c
parent52d81dd07bf58c8e157ed0a7cb6811ec9ccd2425 (diff)
downloadmonitor-edid-7eecc68d898db2170894c4170e492fbd59af6de3.tar
monitor-edid-7eecc68d898db2170894c4170e492fbd59af6de3.tar.gz
monitor-edid-7eecc68d898db2170894c4170e492fbd59af6de3.tar.bz2
monitor-edid-7eecc68d898db2170894c4170e492fbd59af6de3.tar.xz
monitor-edid-7eecc68d898db2170894c4170e492fbd59af6de3.zip
- Merge in newer code. Mostly factorisation for mapped reads
- Ignore VBIOS CRC check failures to be in-line with older LRMI-based code - Use CPU emulator when CRC check fail to be on the safe side - Add new options: --map-bios-vram, --check-bios-crc, --use-cpuemu
Diffstat (limited to 'monitor-get-edid-using-vbe.c')
-rw-r--r--monitor-get-edid-using-vbe.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/monitor-get-edid-using-vbe.c b/monitor-get-edid-using-vbe.c
index 50366f2..1b5a470 100644
--- a/monitor-get-edid-using-vbe.c
+++ b/monitor-get-edid-using-vbe.c
@@ -10,6 +10,7 @@
#include <sys/ioctl.h>
#include <sys/vt.h>
#include "get-edid.h"
+#include "hd.h"
int verbose = 0;
@@ -19,16 +20,30 @@ int main(int argc, char **argv)
int try_in_console = 0;
int i;
- for (i = 1; i < argc; i++)
- if (strcmp(argv[i], "-v") == 0) verbose = 1;
- else if (strcmp(argv[i], "--try-in-console") == 0) try_in_console = 1;
- else if (strcmp(argv[i], "-h") == 0 ||
- strcmp(argv[i], "--help") == 0) {
+ /* Hardware Data defaults */
+ hd_data_t hd_data;
+ hd_data.flags.biosvram = 0; /* don't map video BIOS RAM */
+ hd_data.flags.nobioscrc = 1; /* don't check VBIOS CRC */
+ hd_data.flags.cpuemu = 1; /* use CPU emulator everywhere... */
+#ifdef __i386__
+ hd_data.flags.cpuemu = 0; /* ... but ia32, unless VBIOS CRC is invalid */
+#endif
+
+ for (i = 1; i < argc; i++) {
+ const char *arg = argv[i];
+ if (strcmp(arg, "-v") == 0) verbose = 1;
+ 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");
exit(1);
}
+ }
- int size = get_edid(edid);
+ int size = get_edid(&hd_data, edid);
if (!size && try_in_console) {
int non_X_console = 1;
@@ -41,7 +56,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(edid);
+ size = get_edid(&hd_data, edid);
/* restore */
ioctl(fd, VT_ACTIVATE, current.v_active) == 0 &&