From e2051c44730b1a18f58b3be88fdc6ca7fb538e11 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Tue, 15 Dec 2015 13:14:52 +0200 Subject: [PATCH] drm/i915/bios: move debug logging about VBT source to intel_parse_bios() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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: Ville Syrjälä Signed-off-by: Jani Nikula Link: http://patchwork.freedesktop.org/patch/msgid/1450178092-27148-1-git-send-email-jani.nikula@intel.com --- drivers/gpu/drm/i915/intel_bios.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c index 2fc2a994f395..1c86bc2b628f 100644 --- a/drivers/gpu/drm/i915/intel_bios.c +++ b/drivers/gpu/drm/i915/intel_bios.c @@ -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, size_t size, - const void *_vbt, - const char *source) + const void *_vbt) { size_t offset = _vbt - base; const struct vbt_header *vbt = _vbt; @@ -1255,8 +1254,6 @@ static const struct vbt_header *validate_vbt(const void *base, return NULL; } - DRM_DEBUG_KMS("Using VBT from %s: %20s\n", - source, vbt->signature); return vbt; } @@ -1276,7 +1273,7 @@ static const struct vbt_header *find_vbt(void __iomem *bios, size_t size) */ void *_bios = (void __force *) bios; - vbt = validate_vbt(_bios, size, _bios + i, "PCI ROM"); + vbt = validate_vbt(_bios, size, _bios + i); break; } } @@ -1309,8 +1306,10 @@ intel_parse_bios(struct drm_device *dev) /* XXX Should this validation be moved to intel_opregion.c? */ vbt = validate_vbt(dev_priv->opregion.header, OPREGION_SIZE, - dev_priv->opregion.vbt, "OpRegion"); - if (!vbt) { + dev_priv->opregion.vbt); + if (vbt) { + DRM_DEBUG_KMS("Found valid VBT in ACPI OpRegion\n"); + } else { size_t size; bios = pci_map_rom(pdev, &size); @@ -1322,10 +1321,15 @@ intel_parse_bios(struct drm_device *dev) pci_unmap_rom(pdev, bios); return -1; } + + DRM_DEBUG_KMS("Found valid VBT in PCI ROM\n"); } bdb = get_bdb_header(vbt); + DRM_DEBUG_KMS("VBT signature \"%20s\", BDB version %d\n", + vbt->signature, bdb->version); + /* Grab useful general definitions */ parse_general_features(dev_priv, bdb); parse_general_definitions(dev_priv, bdb); -- 2.20.1