summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhao Yakui <yakui.zhao@intel.com>2009-07-24 10:44:20 +0800
committerZhenyu Wang <zhenyuw@linux.intel.com>2009-08-04 11:32:26 +0800
commitaf45482a52999b52bf41468c458808e30c100e35 (patch)
treeadbd9570f7ed671bcecbecda8b6498f8d6ddcdf2
parent50e2a6734de43a135aa91cd6e6fb5147e15ce315 (diff)
Calculate the DVO relative offset in LVDS data entry to get the DVO timing
Now the DVO timing in LVDS data entry is obtained by using the following step: a. get the entry size for every LVDS panel data b. Get the LVDS fp entry for the preferred panel type c. get the DVO timing by using entry->dvo_timing In our driver the entry->dvo_timing is related with the size of lvds_fp_timing. For example: the size is 46. But it seems that the size of lvds_fp_timing varies on the differnt platform. In such case we will get the incorrect DVO timing because of the incorrect DVO offset in LVDS panel data entry. Calculate the DVO timing offset in LVDS data entry to get the DVO timing a. get the DVO timing offset in the LVDS fp data entry by using the pointer definition in LVDS data ptr b. get the LVDS data entry c. get the DVO timing by adding the DVO timing offset to data entry https://bugs.freedesktop.org/show_bug.cgi?id=22787 Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
-rw-r--r--src/bios_reader/bios_reader.c20
-rw-r--r--src/i830_bios.c6
2 files changed, 21 insertions, 5 deletions
diff --git a/src/bios_reader/bios_reader.c b/src/bios_reader/bios_reader.c
index cdc20453..35b144cb 100644
--- a/src/bios_reader/bios_reader.c
+++ b/src/bios_reader/bios_reader.c
@@ -313,11 +313,23 @@ static void dump_lvds_data(void)
313{ 313{
314 struct bdb_block *block; 314 struct bdb_block *block;
315 struct bdb_lvds_lfp_data *lvds_data; 315 struct bdb_lvds_lfp_data *lvds_data;
316 struct bdb_lvds_lfp_data_ptrs *ptrs;
316 int num_entries; 317 int num_entries;
317 int i; 318 int i;
318 int hdisplay, hsyncstart, hsyncend, htotal; 319 int hdisplay, hsyncstart, hsyncend, htotal;
319 int vdisplay, vsyncstart, vsyncend, vtotal; 320 int vdisplay, vsyncstart, vsyncend, vtotal;
320 float clock; 321 float clock;
322 int lfp_data_size, dvo_offset;
323
324 block = find_section(BDB_LVDS_LFP_DATA_PTRS);
325 if (!block) {
326 printf("No LVDS ptr block\n");
327 return;
328 }
329 ptrs = block->data;
330 lfp_data_size = ptrs->ptr[1].fp_timing_offset - ptrs->ptr[0].fp_timing_offset;
331 dvo_offset = ptrs->ptr[0].dvo_timing_offset - ptrs->ptr[0].fp_timing_offset;
332 free(block);
321 333
322 block = find_section(BDB_LVDS_LFP_DATA); 334 block = find_section(BDB_LVDS_LFP_DATA);
323 if (!block) { 335 if (!block) {
@@ -326,14 +338,16 @@ static void dump_lvds_data(void)
326 } 338 }
327 339
328 lvds_data = block->data; 340 lvds_data = block->data;
329 num_entries = block->size / sizeof(struct bdb_lvds_lfp_data_entry); 341 num_entries = block->size / lfp_data_size;
330 342
331 printf("LVDS panel data block (preferred block marked with '*'):\n"); 343 printf("LVDS panel data block (preferred block marked with '*'):\n");
332 printf(" Number of entries: %d\n", num_entries); 344 printf(" Number of entries: %d\n", num_entries);
333 345
334 for (i = 0; i < num_entries; i++) { 346 for (i = 0; i < num_entries; i++) {
335 struct bdb_lvds_lfp_data_entry *lfp_data = &lvds_data->data[i]; 347 uint8_t *lfp_data_ptr = (uint8_t *)lvds_data->data + lfp_data_size * i;
336 uint8_t *timing_data = (uint8_t *)&lfp_data->dvo_timing; 348 uint8_t *timing_data = lfp_data_ptr + dvo_offset;
349 struct bdb_lvds_lfp_data_entry *lfp_data =
350 (struct bdb_lvds_flp_data_entry *)lfp_data_ptr;
337 char marker; 351 char marker;
338 352
339 if (i == panel_type) 353 if (i == panel_type)
diff --git a/src/i830_bios.c b/src/i830_bios.c
index 60c307c2..f4a20053 100644
--- a/src/i830_bios.c
+++ b/src/i830_bios.c
@@ -123,6 +123,7 @@ parse_integrated_panel_data(I830Ptr pI830, struct bdb_header *bdb)
123 DisplayModePtr fixed_mode; 123 DisplayModePtr fixed_mode;
124 unsigned char *timing_ptr; 124 unsigned char *timing_ptr;
125 int lfp_data_size; 125 int lfp_data_size;
126 int dvo_offset;
126 127
127 /* Defaults if we can't find VBT info */ 128 /* Defaults if we can't find VBT info */
128 pI830->lvds_dither = 0; 129 pI830->lvds_dither = 0;
@@ -146,10 +147,11 @@ parse_integrated_panel_data(I830Ptr pI830, struct bdb_header *bdb)
146 147
147 lfp_data_size = lvds_lfp_data_ptrs->ptr[1].dvo_timing_offset - 148 lfp_data_size = lvds_lfp_data_ptrs->ptr[1].dvo_timing_offset -
148 lvds_lfp_data_ptrs->ptr[0].dvo_timing_offset; 149 lvds_lfp_data_ptrs->ptr[0].dvo_timing_offset;
150 dvo_offset = lvds_lfp_data_ptrs->ptr[0].dvo_timing_offset -
151 lvds_lfp_data_ptrs->ptr[0].fp_timing_offset;
149 entry = (struct bdb_lvds_lfp_data_entry *)((uint8_t *)lvds_data->data + 152 entry = (struct bdb_lvds_lfp_data_entry *)((uint8_t *)lvds_data->data +
150 (lfp_data_size * lvds_options->panel_type)); 153 (lfp_data_size * lvds_options->panel_type));
151 timing_ptr = (unsigned char *)&entry->dvo_timing; 154 timing_ptr = (unsigned char *)entry + dvo_offset;
152
153 if (pI830->skip_panel_detect) 155 if (pI830->skip_panel_detect)
154 return; 156 return;
155 157