diff options
author | Eric Anholt <anholt@FreeBSD.org> | 2006-04-15 12:16:46 -0700 |
---|---|---|
committer | Eric Anholt <anholt@FreeBSD.org> | 2006-04-15 12:16:46 -0700 |
commit | 62652127cd12f5a0fc9364285b81d2661372148a (patch) | |
tree | aa33b843f3183446ff0d0c11c3bf83beb4a34d64 /src/i830_bios.c | |
parent | 830fa81792a613fe2127a2b89a3eaa326f56114c (diff) |
Check for LVDS BIOS tables exactly once at startup. While there, dump the BIOS
data to /tmp/xf86-video-intel-VBIOS, for offline debugging.
Diffstat (limited to 'src/i830_bios.c')
-rw-r--r-- | src/i830_bios.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/i830_bios.c b/src/i830_bios.c index 8e575df7..c9ca8819 100644 --- a/src/i830_bios.c +++ b/src/i830_bios.c @@ -47,6 +47,27 @@ /* XXX */ #define INTEL_VBIOS_SIZE (64 * 1024) +static void +i830DumpBIOSToFile(ScrnInfoPtr pScrn) +{ + I830Ptr pI830 = I830PTR(pScrn); + const char *filename = "/tmp/xf86-video-intel-VBIOS"; + FILE *f; + + f = fopen(filename, "w"); + if (f == NULL) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Couldn't open %s\n", filename); + return; + } + if (fwrite(pI830->VBIOS, INTEL_VBIOS_SIZE, 1, f) != 1) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Couldn't write BIOS data\n"); + } + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Wrote BIOS contents to %s\n", + filename); + fclose(f); +} + /** * Loads the Video BIOS and checks that the VBT exists. * @@ -76,6 +97,7 @@ i830GetBIOS(ScrnInfoPtr pScrn) xf86ReadPciBIOS(0, pI830->PciTag, 0, pI830->VBIOS, INTEL_VBIOS_SIZE); } + i830DumpBIOSToFile(pScrn); vbt_off = INTEL_BIOS_16(0x1a); if (vbt_off >= INTEL_VBIOS_SIZE) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Bad VBT offset: 0x%x\n", |