]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/i915/bios: move debug logging about VBT source to intel_parse_bios()
authorJani Nikula <jani.nikula@intel.com>
Tue, 15 Dec 2015 11:14:52 +0000 (13:14 +0200)
committerJani Nikula <jani.nikula@intel.com>
Wed, 16 Dec 2015 09:22:06 +0000 (11:22 +0200)
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ä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1450178092-27148-1-git-send-email-jani.nikula@intel.com
drivers/gpu/drm/i915/intel_bios.c

index 2fc2a994f395074c7d3a0d7760931f8a44e7d775..1c86bc2b628f78ddc41b05b9ef8c9c26f8af9743 100644 (file)
@@ -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);