mirror of
				https://github.com/tiagovignatti/intel-gpu-tools.git
				synced 2025-11-03 19:47:15 +00:00 
			
		
		
		
	intel_bios_reader: Read the child device size from VBT
New stuff has been added to the end of the child device block at various times, so using a hardcoded size for the block is a bad idea. Fortunately the size of the block is listed in the VBT just before the blocks themselves, so grab it from there. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
This commit is contained in:
		
							parent
							
								
									c137ac7158
								
							
						
					
					
						commit
						b1e756451c
					
				@ -269,7 +269,7 @@ struct bdb_general_definitions {
 | 
				
			|||||||
	 * TV and LVDS are missing, so be careful when interpreting
 | 
						 * TV and LVDS are missing, so be careful when interpreting
 | 
				
			||||||
	 * [4] and [5].
 | 
						 * [4] and [5].
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	struct child_device_config devices[0];
 | 
						uint8_t devices[0];
 | 
				
			||||||
	/* may be another device block here on some platforms */
 | 
						/* may be another device block here on some platforms */
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __attribute__ ((packed));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -341,7 +341,6 @@ static void dump_child_device(struct child_device_config *child)
 | 
				
			|||||||
static void dump_general_definitions(const struct bdb_block *block)
 | 
					static void dump_general_definitions(const struct bdb_block *block)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct bdb_general_definitions *defs = block->data;
 | 
						struct bdb_general_definitions *defs = block->data;
 | 
				
			||||||
	struct child_device_config *child;
 | 
					 | 
				
			||||||
	int i;
 | 
						int i;
 | 
				
			||||||
	int child_device_num;
 | 
						int child_device_num;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -354,9 +353,11 @@ static void dump_general_definitions(const struct bdb_block *block)
 | 
				
			|||||||
	printf("\tBoot display type: 0x%02x%02x\n", defs->boot_display[1],
 | 
						printf("\tBoot display type: 0x%02x%02x\n", defs->boot_display[1],
 | 
				
			||||||
	       defs->boot_display[0]);
 | 
						       defs->boot_display[0]);
 | 
				
			||||||
	printf("\tTV data block present: %s\n", YESNO(tv_present));
 | 
						printf("\tTV data block present: %s\n", YESNO(tv_present));
 | 
				
			||||||
	child_device_num = (block->size - sizeof(*defs)) / sizeof(*child);
 | 
						printf("\tChild device size: %d\n", defs->child_dev_size);
 | 
				
			||||||
 | 
						child_device_num = (block->size - sizeof(*defs)) /
 | 
				
			||||||
 | 
							defs->child_dev_size;
 | 
				
			||||||
	for (i = 0; i < child_device_num; i++)
 | 
						for (i = 0; i < child_device_num; i++)
 | 
				
			||||||
		dump_child_device(&defs->devices[i]);
 | 
							dump_child_device((void*)&defs->devices[i * defs->child_dev_size]);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void dump_child_devices(const struct bdb_block *block)
 | 
					static void dump_child_devices(const struct bdb_block *block)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user