[Intel-gfx] [PATCH 2/2] drm/i915/guc: Remove enable_guc_loading parameter.

anushasr anusha.srivatsa at intel.com
Thu Dec 15 18:24:57 UTC 2016


Remove the enable_guc_loading parameter. GuC loads are now
controlled through enable_huc and enable_guc_submission
parameter. If either or both of these parameters are set.
GuC is loaded.

If we need to debug GuC we can do so by removing the firmware from
the rootfs instead of disabling with a parameter. So besides enabling
guc by default this patch also kill the use of the parameter for
loading.

Cc: Jani Nikula <jani.nikula at intel.com>
Cc: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin at linux.intel.com>
Cc: Arek <arkadiusz.hiler at intel.com>
Signed-off-by: Anusha Srivatsa <anusha.srivatsa at intel.com>
---
 drivers/gpu/drm/i915/i915_params.c      |  6 ------
 drivers/gpu/drm/i915/i915_params.h      |  1 -
 drivers/gpu/drm/i915/intel_guc_loader.c | 27 +++++++++------------------
 3 files changed, 9 insertions(+), 25 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
index 1d9c306..55c050f 100644
--- a/drivers/gpu/drm/i915/i915_params.c
+++ b/drivers/gpu/drm/i915/i915_params.c
@@ -57,7 +57,6 @@ struct i915_params i915 __read_mostly = {
 	.nuclear_pageflip = 0,
 	.edp_vswing = 0,
 	.enable_huc = 1,
-	.enable_guc_loading = 0,
 	.enable_guc_submission = 0,
 	.guc_log_level = -1,
 	.enable_dp_mst = true,
@@ -221,11 +220,6 @@ module_param_named(enable_huc, i915.enable_huc, int, 0400);
 MODULE_PARM_DESC(enable_huc,
 		"Enable HuC usage. If enabled,load GuC (1:enabled (default), 0:disabled)");
 
-module_param_named_unsafe(enable_guc_loading, i915.enable_guc_loading, int, 0400);
-MODULE_PARM_DESC(enable_guc_loading,
-		"Enable GuC firmware loading "
-		"(-1=auto, 0=never [default], 1=if available, 2=required)");
-
 module_param_named_unsafe(enable_guc_submission, i915.enable_guc_submission, int, 0400);
 MODULE_PARM_DESC(enable_guc_submission,
 		"Enable GuC submission "
diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
index 7b0523b..3599329 100644
--- a/drivers/gpu/drm/i915/i915_params.h
+++ b/drivers/gpu/drm/i915/i915_params.h
@@ -45,7 +45,6 @@ struct i915_params {
 	int enable_ips;
 	int invert_brightness;
 	int enable_huc;
-	int enable_guc_loading;
 	int enable_guc_submission;
 	int guc_log_level;
 	int use_mmio_flip;
diff --git a/drivers/gpu/drm/i915/intel_guc_loader.c b/drivers/gpu/drm/i915/intel_guc_loader.c
index 85c0a2a..c09fdc8 100644
--- a/drivers/gpu/drm/i915/intel_guc_loader.c
+++ b/drivers/gpu/drm/i915/intel_guc_loader.c
@@ -459,10 +459,9 @@ int intel_guc_setup(struct drm_i915_private *dev_priv)
 		intel_uc_fw_status_repr(guc_fw->fetch_status),
 		intel_uc_fw_status_repr(guc_fw->load_status));
 
-	/* Loading forbidden, or no firmware to load? */
-	if (!i915.enable_guc_loading) {
-		err = 0;
-		goto fail;
+	if (!HAS_GUC(dev_priv)) {
+		/* Platform does not have a GuC */
+		return 0;
 	} else if (fw_path == NULL) {
 		/* Device is known to have no uCode (e.g. no GuC) */
 		err = -ENXIO;
@@ -560,9 +559,7 @@ int intel_guc_setup(struct drm_i915_private *dev_priv)
 	 * nonfatal error (i.e. it doesn't prevent driver load, but
 	 * marks the GPU as wedged until reset).
 	 */
-	if (i915.enable_guc_loading > 1) {
-		ret = -EIO;
-	} else if (i915.enable_guc_submission > 1) {
+	if (i915.enable_guc_submission > 1) {
 		ret = -EIO;
 	} else {
 		ret = 0;
@@ -743,14 +740,11 @@ void intel_guc_init(struct drm_i915_private *dev_priv)
 	const char *fw_path;
 
 	if (!HAS_GUC(dev_priv)) {
-		i915.enable_guc_loading = 0;
-		i915.enable_guc_submission = 0;
-	} else {
-		/* A negative value means "use platform default" */
-		if (i915.enable_guc_loading < 0)
-			i915.enable_guc_loading = HAS_GUC_UCODE(dev_priv);
-		if (i915.enable_guc_submission < 0)
-			i915.enable_guc_submission = HAS_GUC_SCHED(dev_priv);
+		return;
+	} else if ((!i915.enable_huc) && (!i915.enable_guc_submission)) {
+		/* Both enable_huc and enable_guc_submission is disabled */
+		DRM_ERROR("GuC will not be loaded\n");
+		return;
 	}
 
 	if (!HAS_GUC_UCODE(dev_priv)) {
@@ -775,9 +769,6 @@ void intel_guc_init(struct drm_i915_private *dev_priv)
 	guc_fw->fetch_status = INTEL_UC_FIRMWARE_NONE;
 	guc_fw->load_status = INTEL_UC_FIRMWARE_NONE;
 
-	/* Early (and silent) return if GuC loading is disabled */
-	if (!i915.enable_guc_loading)
-		return;
 	if (fw_path == NULL)
 		return;
 	if (*fw_path == '\0')
-- 
2.7.4



More information about the Intel-gfx mailing list