]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Allow parsing of variable size child device entries from VBT
authorDavid Weinehall <david.weinehall@linux.intel.com>
Fri, 21 Aug 2015 13:52:01 +0000 (16:52 +0300)
committerJani Nikula <jani.nikula@intel.com>
Mon, 24 Aug 2015 07:34:09 +0000 (10:34 +0300)
commitfde69b1419d502552c79075d6b9b779b1f73643e
treed534b7ff4a5b0881a93fc709391edeedc06929d3
parentf179b51d2e8a55dd3f49a4651e3c7a844a5b67d9
drm/i915: Allow parsing of variable size child device entries from VBT

VBT version 196 increased the size of common_child_dev_config. The
parser code assumed that the size of this structure would not change.

The modified code now copies the amount needed based on the VBT version,
and emits a debug message if the VBT version is unknown (too new); since
the struct config block won't shrink in newer versions it should be
harmless to copy the maximum known size in such cases, so that's what we
do, but emitting the warning is probably sensible anyway.

In the longer run it might make sense to modify the parser code to use a
version/feature mapping, rather than hardcoding things like this, but
for now the variants are fairly manageable.

This fixes a regression introduced in

commit 06bdb7f1073de13d732772c931d0c8f595382416
Author: Antti Koskipaa <antti.koskipaa@linux.intel.com>
Date:   Fri Jul 10 14:10:55 2015 +0300

    drm/i915: Per-DDI I_boost override

since that commit changed the child device config size without updating
the checks and memcpy.

v2: Stricter size checks

v3 by Jani:
- Keep the checks strict, and warnigns verbose, but keep going anyway.
- Take care to copy the max amount of child device config we can.
- Fix the messages.

Signed-off-by: David Weinehall <david.weinehall@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/intel_bios.c
drivers/gpu/drm/i915/intel_bios.h