Commit e2051c44 authored by Jani Nikula's avatar Jani Nikula

drm/i915/bios: move debug logging about VBT source to intel_parse_bios()

The decision about which source will be used for VBT is done in
intel_parse_bios(), not in the VBT validation function. Make the VBT
validation function strictly about validation, and move the debug
logging to where it logically belongs.

Also split the logging about where the valid VBT was found and what the
signature is. This will make even more sense in the future when the
validation for ACPI OpRegion based VBT takes place at OpRegion setup
time.

v2: Split logging about VBT signature and BDB version.
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1450178092-27148-1-git-send-email-jani.nikula@intel.com
parent caf37fa4
...@@ -1223,8 +1223,7 @@ static const struct bdb_header *get_bdb_header(const struct vbt_header *vbt) ...@@ -1223,8 +1223,7 @@ static const struct bdb_header *get_bdb_header(const struct vbt_header *vbt)
static const struct vbt_header *validate_vbt(const void *base, static const struct vbt_header *validate_vbt(const void *base,
size_t size, size_t size,
const void *_vbt, const void *_vbt)
const char *source)
{ {
size_t offset = _vbt - base; size_t offset = _vbt - base;
const struct vbt_header *vbt = _vbt; const struct vbt_header *vbt = _vbt;
...@@ -1255,8 +1254,6 @@ static const struct vbt_header *validate_vbt(const void *base, ...@@ -1255,8 +1254,6 @@ static const struct vbt_header *validate_vbt(const void *base,
return NULL; return NULL;
} }
DRM_DEBUG_KMS("Using VBT from %s: %20s\n",
source, vbt->signature);
return vbt; return vbt;
} }
...@@ -1276,7 +1273,7 @@ static const struct vbt_header *find_vbt(void __iomem *bios, size_t size) ...@@ -1276,7 +1273,7 @@ static const struct vbt_header *find_vbt(void __iomem *bios, size_t size)
*/ */
void *_bios = (void __force *) bios; void *_bios = (void __force *) bios;
vbt = validate_vbt(_bios, size, _bios + i, "PCI ROM"); vbt = validate_vbt(_bios, size, _bios + i);
break; break;
} }
} }
...@@ -1309,8 +1306,10 @@ intel_parse_bios(struct drm_device *dev) ...@@ -1309,8 +1306,10 @@ intel_parse_bios(struct drm_device *dev)
/* XXX Should this validation be moved to intel_opregion.c? */ /* XXX Should this validation be moved to intel_opregion.c? */
vbt = validate_vbt(dev_priv->opregion.header, OPREGION_SIZE, vbt = validate_vbt(dev_priv->opregion.header, OPREGION_SIZE,
dev_priv->opregion.vbt, "OpRegion"); dev_priv->opregion.vbt);
if (!vbt) { if (vbt) {
DRM_DEBUG_KMS("Found valid VBT in ACPI OpRegion\n");
} else {
size_t size; size_t size;
bios = pci_map_rom(pdev, &size); bios = pci_map_rom(pdev, &size);
...@@ -1322,10 +1321,15 @@ intel_parse_bios(struct drm_device *dev) ...@@ -1322,10 +1321,15 @@ intel_parse_bios(struct drm_device *dev)
pci_unmap_rom(pdev, bios); pci_unmap_rom(pdev, bios);
return -1; return -1;
} }
DRM_DEBUG_KMS("Found valid VBT in PCI ROM\n");
} }
bdb = get_bdb_header(vbt); bdb = get_bdb_header(vbt);
DRM_DEBUG_KMS("VBT signature \"%20s\", BDB version %d\n",
vbt->signature, bdb->version);
/* Grab useful general definitions */ /* Grab useful general definitions */
parse_general_features(dev_priv, bdb); parse_general_features(dev_priv, bdb);
parse_general_definitions(dev_priv, bdb); parse_general_definitions(dev_priv, bdb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment