From c39caed3b207e058409f5e2b548a4f940b6283c6 Mon Sep 17 00:00:00 2001 From: Ville Syrjälä Date: Sat, 26 Mar 2022 22:07:17 +0200 Subject: tools/intel_vbt_decode: Warn if we lack the full definiton of the BDB block MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Warn in case out BDB block definition is smaller than what the VBT has. That is an indication that we are potentially forgetting to decode some useful new data. We exclude blocks 2,11,22 from this since we don't have a sensible min size for them. We also limit this to modernish VBTs (155+) since some old stuff doesn't really conform (eg. my cst with version 134 has a 9 byte block 1 even though our min size for it is 7 bytes, and all the other oldish machines have block 1 only made up of of 4 or 5 bytes). Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä --- tools/intel_vbt_decode.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c index e45bab4a..5494a34b 100644 --- a/tools/intel_vbt_decode.c +++ b/tools/intel_vbt_decode.c @@ -476,6 +476,15 @@ static struct bdb_block *find_section(const struct context *context, int section size = get_blocksize(data); + /* expect to have the full definition for each block with modern VBTs */ + if (min_size && size > min_size && + section_id != BDB_CHILD_DEVICE_TABLE && + section_id != BDB_SDVO_LVDS_OPTIONS && + section_id != BDB_GENERAL_DEFINITIONS && + context->bdb->version >= 155) + fprintf(stderr, "Block %d min size %zu less than block size %zu\n", + section_id, min_size, size); + block = calloc(1, sizeof(*block) + 3 + max(size, min_size)); if (!block) { free(temp_block); -- cgit v1.2.3