xf86-video-intel: Branch 'modesetting' - src/i830_bios.c src/i830_display.c src/i830_driver.c
Eric Anholt
anholt at kemper.freedesktop.org
Sat Apr 15 22:16:55 EEST 2006
src/i830_bios.c | 22 ++++++++++++++++++++++
src/i830_display.c | 3 +--
src/i830_driver.c | 11 +++++++++--
3 files changed, 32 insertions(+), 4 deletions(-)
New commits:
diff-tree 62652127cd12f5a0fc9364285b81d2661372148a (from 830fa81792a613fe2127a2b89a3eaa326f56114c)
Author: Eric Anholt <anholt at FreeBSD.org>
Date: Sat Apr 15 12:16:46 2006 -0700
Check for LVDS BIOS tables exactly once at startup. While there, dump the BIOS
data to /tmp/xf86-video-intel-VBIOS, for offline debugging.
diff --git a/src/i830_bios.c b/src/i830_bios.c
index 8e575df..c9ca881 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",
diff --git a/src/i830_display.c b/src/i830_display.c
index c55609d..4cdc2b1 100644
--- a/src/i830_display.c
+++ b/src/i830_display.c
@@ -368,8 +368,7 @@ i830PipeSetMode(ScrnInfoPtr pScrn, Displ
pipesrc = ((pMode->HDisplay - 1) << 16) | (pMode->VDisplay - 1);
dspsize = ((pMode->VDisplay - 1) << 16) | (pMode->HDisplay - 1);
pixel_clock = pMode->Clock;
- if (outputs & PIPE_LCD_ACTIVE && i830GetLVDSInfoFromBIOS(pScrn) &&
- pI830->panel_fixed_hactive != 0)
+ if (outputs & PIPE_LCD_ACTIVE && pI830->panel_fixed_hactive != 0)
{
/* To enable panel fitting, we need to set the pipe timings to that of
* the screen at its full resolution. So, drop the timings from the
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 4d29907..8930db0 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -2139,6 +2139,13 @@ I830BIOSPreInit(ScrnInfoPtr pScrn, int f
pI830->MonType2 = PIPE_NONE;
pI830->specifiedMonitor = FALSE;
+ /* Always check for LVDS info once at startup. We hook in the BIOS data
+ * dumping here (this should be cleaner) and we get to rely on having the
+ * LVDS info later on.
+ */
+ if (!i830GetLVDSInfoFromBIOS(pScrn))
+ has_lvds = FALSE;
+
if ((s = xf86GetOptValString(pI830->Options, OPTION_MONITOR_LAYOUT)) &&
I830IsPrimary(pScrn)) {
char *Mon1;
@@ -2227,7 +2234,7 @@ I830BIOSPreInit(ScrnInfoPtr pScrn, int f
pI830->specifiedMonitor = TRUE;
} else if (I830IsPrimary(pScrn)) {
/* Choose a default set of outputs to use based on what we've detected. */
- if (i830GetLVDSInfoFromBIOS(pScrn) && has_lvds) {
+ if (has_lvds) {
pI830->MonType2 |= PIPE_LFP;
}
@@ -2743,7 +2750,7 @@ I830BIOSPreInit(ScrnInfoPtr pScrn, int f
* rely on the scaler so that we can display any mode smaller than or the
* same size as the panel.
*/
- if (!i830GetLVDSInfoFromBIOS(pScrn)) {
+ if (!has_lvds) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Unable to locate panel information in BIOS VBT tables\n");
PreInitCleanup(pScrn);
More information about the xorg-commit
mailing list