[RFC 14/15] drm/i915: Kill reduntant vbt_firmware from intel_vbt

Radhakrishna Sripada radhakrishna.sripada at intel.com
Mon Jan 8 23:05:16 UTC 2024


vbt_firmware was used to cache the vbt read from firmware. With
introduction of intel_vbt, vbt field is used to cache the firmware read
from different sources making vbt_firmware field redundant. Kill this
field to simplify intel_vbt structure.

Signed-off-by: Radhakrishna Sripada <radhakrishna.sripada at intel.com>
---
 drivers/gpu/drm/i915/display/intel_bios.c         | 9 +++------
 drivers/gpu/drm/i915/display/intel_display_core.h | 1 -
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
index 1b5cc3416d77..135a2d5d50b8 100644
--- a/drivers/gpu/drm/i915/display/intel_bios.c
+++ b/drivers/gpu/drm/i915/display/intel_bios.c
@@ -2968,11 +2968,10 @@ static int intel_load_vbt_firmware(struct drm_i915_private *dev_priv,
 	}
 
 	if (intel_bios_is_valid_vbt(fw->data, fw->size)) {
-		vbt->vbt_firmware = kmemdup(fw->data, fw->size, GFP_KERNEL);
-		if (vbt->vbt_firmware) {
+		vbt->vbt = kmemdup(fw->data, fw->size, GFP_KERNEL);
+		if (vbt->vbt) {
 			drm_dbg_kms(&dev_priv->drm,
 				    "Found valid VBT firmware \"%s\"\n", name);
-			vbt->vbt = vbt->vbt_firmware;
 			vbt->vbt_size = fw->size;
 			vbt->type = I915_VBT_FIRMWARE;
 			ret = 0;
@@ -3273,12 +3272,10 @@ void intel_bios_driver_remove(struct drm_i915_private *i915)
 	switch (vbt->type) {
 	case I915_VBT_SPI:
 	case I915_VBT_OPROM:
+	case I915_VBT_FIRMWARE:
 		kfree(vbt->vbt);
 		vbt->type = I915_VBT_NONE;
 		break;
-	case I915_VBT_FIRMWARE:
-		kfree(vbt->vbt_firmware);
-		fallthrough;
 	case I915_VBT_OPREGION:
 		vbt->vbt = NULL;
 		vbt->type = I915_VBT_NONE;
diff --git a/drivers/gpu/drm/i915/display/intel_display_core.h b/drivers/gpu/drm/i915/display/intel_display_core.h
index 4807edc88f81..cdc6e30ba6a6 100644
--- a/drivers/gpu/drm/i915/display/intel_display_core.h
+++ b/drivers/gpu/drm/i915/display/intel_display_core.h
@@ -233,7 +233,6 @@ struct intel_vbt_data {
 };
 
 struct intel_vbt {
-	void *vbt_firmware;
 	const void *vbt;
 	u32 vbt_size;
 	enum {
-- 
2.34.1



More information about the Intel-gfx mailing list