clear-pkgs-linux-iot-lts2018/0604-drm-i915-gvt-add-param...

70 lines
1.9 KiB
Diff

From 4b64b593cb29fde6340e02d75bc1c98fd3aaacd7 Mon Sep 17 00:00:00 2001
From: Fei Jiang <fei.jiang@intel.com>
Date: Fri, 29 Dec 2017 18:48:22 +0800
Subject: [PATCH 604/743] drm/i915/gvt: add param disable_gvt_fw_loading to
disable gvt fw loading
when gvt fw doesn't exist, try to load fw from initrd will cost about 1 minute,
add disable_gvt_fw_loading to speed up sos boot up time.
Change-Id: I07aca795057fec09ff9ee729a65a5f96006c5ef8
Signed-off-by: Fei Jiang <fei.jiang@intel.com>
Reviewed-on:
Reviewed-by: Dong, Eddie <eddie.dong@intel.com>
Tested-by: Dong, Eddie <eddie.dong@intel.com>
---
drivers/gpu/drm/i915/gvt/firmware.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/i915/gvt/firmware.c b/drivers/gpu/drm/i915/gvt/firmware.c
index 4ac18b447247..f0d30237c988 100644
--- a/drivers/gpu/drm/i915/gvt/firmware.c
+++ b/drivers/gpu/drm/i915/gvt/firmware.c
@@ -199,6 +199,7 @@ static int verify_firmware(struct intel_gvt *gvt,
#define GVT_FIRMWARE_PATH "i915/gvt"
+bool disable_gvt_fw_loading=true;
/**
* intel_gvt_load_firmware - load GVT firmware
* @gvt: intel gvt device
@@ -216,27 +217,27 @@ int intel_gvt_load_firmware(struct intel_gvt *gvt)
void *mem;
int ret;
- path = kmalloc(PATH_MAX, GFP_KERNEL);
- if (!path)
- return -ENOMEM;
-
mem = kmalloc(info->cfg_space_size, GFP_KERNEL);
- if (!mem) {
- kfree(path);
+ if (!mem)
return -ENOMEM;
- }
firmware->cfg_space = mem;
mem = kmalloc(info->mmio_size, GFP_KERNEL);
if (!mem) {
- kfree(path);
kfree(firmware->cfg_space);
return -ENOMEM;
}
firmware->mmio = mem;
+ if (disable_gvt_fw_loading)
+ goto expose_firmware;
+
+ path = kmalloc(PATH_MAX, GFP_KERNEL);
+ if (!path)
+ return -ENOMEM;
+
sprintf(path, "%s/vid_0x%04x_did_0x%04x_rid_0x%02x.golden_hw_state",
GVT_FIRMWARE_PATH, pdev->vendor, pdev->device,
pdev->revision);
--
2.19.2