Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > 28424981d3099dcac047cea5424ec3f7 > files > 6

x11-driver-video-intel-2.4.2-7.6mdv2009.0.src.rpm

From 50336b12302e32e17e183565afc534b9841845cb Mon Sep 17 00:00:00 2001
From: Colin Guthrie <development@colin.guthr.ie>
Date: Tue, 30 Sep 2008 20:53:17 +0100
Subject: [PATCH] Fix bug relating to PLL settings on 855GM. Patch from Jesse Barnes on FDO bug #17310

---
 src/bios_reader/bios_reader.c |   15 +++++++++++++++
 src/i830_bios.c               |   13 +++++++------
 2 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/src/bios_reader/bios_reader.c b/src/bios_reader/bios_reader.c
index dbcd150..d43d8f9 100644
--- a/src/bios_reader/bios_reader.c
+++ b/src/bios_reader/bios_reader.c
@@ -180,6 +180,19 @@ static void dump_lvds_options(void *data)
     printf("\tPFIT mode: %d\n", options->pfit_mode);
 }
 
+static void dump_lvds_ptr_data(void *data, unsigned char *base)
+{
+    struct bdb_lvds_lfp_data_ptrs *ptrs = data;
+
+    struct lvds_fp_timing *fp_timing =
+	(struct lvds_fp_timing *)(base + ptrs->ptr[panel_type].fp_timing_offset);
+
+    printf("LVDS timing pointer data:\n");
+
+    printf("\tpanel type %02i: %dx%d\n", panel_type, fp_timing->x_res,
+	   fp_timing->y_res);
+}
+
 static void dump_lvds_data(void *data, unsigned char *base)
 {
     struct bdb_lvds_lfp_data *lvds_data = data;
@@ -274,6 +287,8 @@ int main(int argc, char **argv)
     dump_general_definitions(find_section(bdb, BDB_GENERAL_DEFINITIONS));
     dump_lvds_options(find_section(bdb, BDB_LVDS_OPTIONS));
     dump_lvds_data(find_section(bdb, BDB_LVDS_LFP_DATA), bdb);
+    dump_lvds_ptr_data(find_section(bdb, BDB_LVDS_LFP_DATA_PTRS),
+		       (unsigned char *)bdb);
 
     return 0;
 }
diff --git a/src/i830_bios.c b/src/i830_bios.c
index fe55d23..97bf4fa 100644
--- a/src/i830_bios.c
+++ b/src/i830_bios.c
@@ -88,8 +88,8 @@ static void
 parse_panel_data(I830Ptr pI830, struct bdb_header *bdb)
 {
     struct bdb_lvds_options *lvds_options;
-    struct bdb_lvds_lfp_data *lvds_lfp_data;
-    struct bdb_lvds_lfp_data_entry *entry;
+    struct bdb_lvds_lfp_data_ptrs *lvds_lfp_data_ptrs;
+    int timing_offset;
     DisplayModePtr fixed_mode;
     unsigned char *timing_ptr;
 
@@ -104,12 +104,13 @@ parse_panel_data(I830Ptr pI830, struct bdb_header *bdb)
     if (lvds_options->panel_type == 0xff)
 	return;
 
-    lvds_lfp_data = find_section(bdb, BDB_LVDS_LFP_DATA);
-    if (!lvds_lfp_data)
+    lvds_lfp_data_ptrs = find_section(bdb, BDB_LVDS_LFP_DATA_PTRS);
+    if (!lvds_lfp_data_ptrs)
 	return;
 
-    entry = &lvds_lfp_data->data[lvds_options->panel_type];
-    timing_ptr = (unsigned char *)&entry->dvo_timing;
+    timing_offset =
+	lvds_lfp_data_ptrs->ptr[lvds_options->panel_type].dvo_timing_offset;
+    timing_ptr = (unsigned char *)bdb + timing_offset;
 
     fixed_mode = xnfalloc(sizeof(DisplayModeRec));
     memset(fixed_mode, 0, sizeof(*fixed_mode));
-- 
1.6.0.2