drm/i915: Pass size to oprom_get_vbt
authorRadhakrishna Sripada <radhakrishna.sripada@intel.com>
Wed, 28 Feb 2024 21:32:30 +0000 (13:32 -0800)
committerJani Nikula <jani.nikula@intel.com>
Mon, 11 Mar 2024 10:37:13 +0000 (12:37 +0200)
oprom_get_vbt will later be used to show the contents of vbt for which
the size of vbt is needed.

v2: Avoid overuse of *size and remove dummy size variable in
    intel_bios_init(Jani)

Cc: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Radhakrishna Sripada <radhakrishna.sripada@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240228213235.2495611-2-radhakrishna.sripada@intel.com
drivers/gpu/drm/i915/display/intel_bios.c

index 373291d10af9fc3de92a6eb5fa210f33e729f7df..71b80ff88c38eaa3af826b4f8842a3f1c9296b98 100644 (file)
@@ -3058,7 +3058,8 @@ err_not_found:
        return NULL;
 }
 
-static struct vbt_header *oprom_get_vbt(struct drm_i915_private *i915)
+static struct vbt_header *oprom_get_vbt(struct drm_i915_private *i915,
+                                       size_t *sizep)
 {
        struct pci_dev *pdev = to_pci_dev(i915->drm.dev);
        void __iomem *p = NULL, *oprom;
@@ -3107,6 +3108,9 @@ static struct vbt_header *oprom_get_vbt(struct drm_i915_private *i915)
 
        pci_unmap_rom(pdev, oprom);
 
+       if (sizep)
+               *sizep = vbt_size;
+
        drm_dbg_kms(&i915->drm, "Found valid VBT in PCI ROM\n");
 
        return vbt;
@@ -3156,7 +3160,7 @@ void intel_bios_init(struct drm_i915_private *i915)
        }
 
        if (!vbt) {
-               oprom_vbt = oprom_get_vbt(i915);
+               oprom_vbt = oprom_get_vbt(i915, NULL);
                vbt = oprom_vbt;
        }