Commit 0cb9b4ea authored by Radhakrishna Sripada's avatar Radhakrishna Sripada Committed by Jani Nikula

drm/i915: Duplicate opregion vbt memory

In the case of vbt residing in opregion, we simply remap the region
into the kernel and pass the memory reference. Instead duplicate the
memory to handle a saner cleanup in intel_bios_init.

Cc: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarRadhakrishna Sripada <radhakrishna.sripada@intel.com>
Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240228213235.2495611-6-radhakrishna.sripada@intel.com
parent 9d9bb71f
......@@ -3194,8 +3194,10 @@ void intel_bios_init(struct drm_i915_private *i915)
oprom_vbt = firmware_get_vbt(i915, NULL);
vbt = oprom_vbt;
if (!vbt)
vbt = intel_opregion_get_vbt(i915, NULL);
if (!vbt) {
oprom_vbt = intel_opregion_get_vbt(i915, NULL);
vbt = oprom_vbt;
}
/*
* If the OpRegion does not have VBT, look in SPI flash through MMIO or
......
......@@ -1151,7 +1151,7 @@ const void *intel_opregion_get_vbt(struct drm_i915_private *i915, size_t *size)
if (size)
*size = opregion->vbt_size;
return opregion->vbt;
return kmemdup(opregion->vbt, opregion->vbt_size, GFP_KERNEL);
}
bool intel_opregion_headless_sku(struct drm_i915_private *i915)
......
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