summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2022-03-26 22:07:17 +0200
committerVille Syrjälä <ville.syrjala@linux.intel.com>2022-06-22 15:39:07 +0300
commitc39caed3b207e058409f5e2b548a4f940b6283c6 (patch)
tree272d76882eb22aaedd1b810ed4d92ceaa2fc8658
parentce4d30196d3cfcd695130be31cf91f4dd6aef2ec (diff)
tools/intel_vbt_decode: Warn if we lack the full definiton of the BDB block
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 <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
-rw-r--r--tools/intel_vbt_decode.c9
1 files changed, 9 insertions, 0 deletions
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);