[Intel-gfx] [PATCH] work around broken [hv]blank values from VBT

Jesse Barnes jbarnes at virtuousgeek.org
Wed Jan 14 00:22:06 CET 2009


Either our calculation in i830_bios.c is wrong (i.e. the [hv]blank fields
contain [hv]blank width values and are therefore relative to [hv]syncend) or
there are quite a few broken VBTs out there.  This patch seems to work around
the problem on the affected machines (see bug 17292 for a list, includes many
Sony Vaio machines and some Dell N series Studio machines).  Only some panels
seem to be sensitive enough to trigger a problem with these problematic mode
lines, which may explain why we haven't seen the problem sooner.

I haven't actually see a problem with the vtotal values yet, but added the
same workaround for those fields for symmetry.

Comments?

Thanks,
-- 
Jesse Barnes, Intel Open Source Technology Center


diff --git a/src/i830_bios.c b/src/i830_bios.c
index 72408f0..c10051a 100644
--- a/src/i830_bios.c
+++ b/src/i830_bios.c
@@ -124,14 +124,20 @@ parse_panel_data(I830Ptr pI830, struct bdb_header *bdb)
 	_H_SYNC_OFF(timing_ptr);
     fixed_mode->HSyncEnd   = fixed_mode->HSyncStart +
 	_H_SYNC_WIDTH(timing_ptr);
-    fixed_mode->HTotal     = fixed_mode->HDisplay +
-	_H_BLANK(timing_ptr);
+    if ((fixed_mode->HDisplay + _H_BLANK(timing_ptr)) < fixed_mode->HSyncEnd)
+	fixed_mode->HTotal = fixed_mode->HDisplay + _H_BLANK(timing_ptr);
+    else
+	fixed_mode->HTotal = fixed_mode->HSyncEnd + _H_BLANK(timing_ptr);
+
     fixed_mode->VSyncStart = fixed_mode->VDisplay +
 	_V_SYNC_OFF(timing_ptr);
     fixed_mode->VSyncEnd   = fixed_mode->VSyncStart +
 	_V_SYNC_WIDTH(timing_ptr);
-    fixed_mode->VTotal     = fixed_mode->VDisplay +
-	_V_BLANK(timing_ptr);
+    if ((fixed_mode->VDisplay + _V_BLANK(timing_ptr)) < fixed_mode->VSyncEnd)
+	fixed_mode->VTotal = fixed_mode->VDisplay + _V_BLANK(timing_ptr);
+    else
+	fixed_mode->VTotal = fixed_mode->VSyncEnd + _V_BLANK(timing_ptr);
+
     fixed_mode->Clock      = _PIXEL_CLOCK(timing_ptr) / 1000;
     fixed_mode->type       = M_T_PREFERRED;
 



More information about the Intel-gfx mailing list