Skip to contentSkip to conversation

drm/i915/guc: Consolidate firmware major-minor to one place

PATCH Superseded Tvrtko Ursulin 2 participants 3 messages Jul 4, 2016

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/i915/guc: Consolidate firmware major-minor to one place

From: Tvrtko Ursulin <[email protected]>

Currently to change the firmware one has to update the exported module firmware string and the major-minor versions used for verification after load. Consolidate that to a single place defining correct major and minor versions per platform.

v2: Rebased for KBL.

Cc Dave Gordon <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Cc Peter Antoine <[email protected]>
Cc Michel Thierry <[email protected]>
---
 drivers/gpu/drm/i915/intel_guc_loader.c | 30 +++++++++++++++++++++---------
 1 file changed, 21 insertions(+), 9 deletions(-)
drivers/gpu/drm/i915/intel_guc_loader.c +21 -9
index d80b617ad9af..e5fa3932bf54 100644
@@ -59,13 +59,25 @@
  *
  */
 
-#define I915_SKL_GUC_UCODE "i915/skl_guc_ver6_1.bin"
+#define SKL_FW_MAJOR 6
+#define SKL_FW_MINOR 1
+
+#define BXT_FW_MAJOR 8
+#define BXT_FW_MINOR 7
+
+#define KBL_FW_MAJOR 9
+#define KBL_FW_MINOR 14
+
+#define GUC_FW_PATH(platform, major, minor) \
+       "i915/" __stringify(platform) "_guc_ver" __stringify(major) "_" __stringify(minor) ".bin"
+
+#define I915_SKL_GUC_UCODE GUC_FW_PATH(skl, SKL_FW_MAJOR, SKL_FW_MINOR)
 MODULE_FIRMWARE(I915_SKL_GUC_UCODE);
 
-#define I915_BXT_GUC_UCODE "i915/bxt_guc_ver8_7.bin"
+#define I915_BXT_GUC_UCODE GUC_FW_PATH(bxt, BXT_FW_MAJOR, BXT_FW_MINOR)
 MODULE_FIRMWARE(I915_BXT_GUC_UCODE);
 
-#define I915_KBL_GUC_UCODE "i915/kbl_guc_ver9_14.bin"
+#define I915_KBL_GUC_UCODE GUC_FW_PATH(kbl, KBL_FW_MAJOR, KBL_FW_MINOR)
 MODULE_FIRMWARE(I915_KBL_GUC_UCODE);
 
 /* User-friendly representation of an enum */
@@ -695,16 +707,16 @@ void intel_guc_init(struct drm_device *dev)
 		fw_path = NULL;
 	} else if (IS_SKYLAKE(dev)) {
 		fw_path = I915_SKL_GUC_UCODE;
-		guc_fw->guc_fw_major_wanted = 6;
-		guc_fw->guc_fw_minor_wanted = 1;
+		guc_fw->guc_fw_major_wanted = SKL_FW_MAJOR;
+		guc_fw->guc_fw_minor_wanted = SKL_FW_MINOR;
 	} else if (IS_BROXTON(dev)) {
 		fw_path = I915_BXT_GUC_UCODE;
-		guc_fw->guc_fw_major_wanted = 8;
-		guc_fw->guc_fw_minor_wanted = 7;
+		guc_fw->guc_fw_major_wanted = BXT_FW_MAJOR;
+		guc_fw->guc_fw_minor_wanted = BXT_FW_MINOR;
 	} else if (IS_KABYLAKE(dev)) {
 		fw_path = I915_KBL_GUC_UCODE;
-		guc_fw->guc_fw_major_wanted = 9;
-		guc_fw->guc_fw_minor_wanted = 14;
+		guc_fw->guc_fw_major_wanted = KBL_FW_MAJOR;
+		guc_fw->guc_fw_minor_wanted = KBL_FW_MINOR;
 	} else {
 		fw_path = "";	/* unknown device */
 	}
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH 2/2 drm/i915/guc: Demote some firmware loading messages to debug

From: Tvrtko Ursulin <[email protected]>

These messages are not errors unless GuC loading or submission is in the mandatory mode and even then the final status will be logged as error in intel_guc_setup.

Therefore demote the messages in guc_fw_fetch to DRM_DEBUG_DRIVER.

If more detail about the cause of the fail is required users will be asked to dial up the debug level.

v2: Demote signature error in guc_ucode_xfer_dma as well.

---
 drivers/gpu/drm/i915/intel_guc_loader.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)
drivers/gpu/drm/i915/intel_guc_loader.c +7 -9
index e5fa3932bf54..5a646a1f16e5 100644
@@ -300,7 +300,7 @@ static int guc_ucode_xfer_dma(struct drm_i915_private *dev_priv)
 			I915_READ(DMA_CTRL), status);
 
 	if ((status & GS_BOOTROM_MASK) == GS_BOOTROM_RSA_FAILED) {
-		DRM_ERROR("GuC firmware signature verification failed\n");
+		DRM_DEBUG_DRIVER("GuC firmware signature verification failed\n");
 		ret = -ENOEXEC;
 	}
 
@@ -583,7 +583,7 @@ static void guc_fw_fetch(struct drm_device *dev, struct intel_guc_fw *guc_fw)
 
 	/* Check the size of the blob before examining buffer contents */
 	if (fw->size < sizeof(struct guc_css_header)) {
-		DRM_ERROR("Firmware header is missing\n");
+		DRM_DEBUG_DRIVER("Firmware header is missing\n");
 		goto fail;
 	}
 
@@ -595,7 +595,7 @@ static void guc_fw_fetch(struct drm_device *dev, struct intel_guc_fw *guc_fw)
 		css->key_size_dw - css->exponent_size_dw) * sizeof(u32);
 
 	if (guc_fw->header_size != sizeof(struct guc_css_header)) {
-		DRM_ERROR("CSS header definition mismatch\n");
+		DRM_DEBUG_DRIVER("CSS header definition mismatch\n");
 		goto fail;
 	}
 
@@ -605,7 +605,7 @@ static void guc_fw_fetch(struct drm_device *dev, struct intel_guc_fw *guc_fw)
 
 	/* now RSA */
 	if (css->key_size_dw != UOS_RSA_SCRATCH_MAX_COUNT) {
-		DRM_ERROR("RSA key size is bad\n");
+		DRM_DEBUG_DRIVER("RSA key size is bad\n");
 		goto fail;
 	}
 	guc_fw->rsa_offset = guc_fw->ucode_offset + guc_fw->ucode_size;
@@ -614,14 +614,14 @@ static void guc_fw_fetch(struct drm_device *dev, struct intel_guc_fw *guc_fw)
 	/* At least, it should have header, uCode and RSA. Size of all three. */
 	size = guc_fw->header_size + guc_fw->ucode_size + guc_fw->rsa_size;
 	if (fw->size < size) {
-		DRM_ERROR("Missing firmware components\n");
+		DRM_DEBUG_DRIVER("Missing firmware components\n");
 		goto fail;
 	}
 
 	/* Header and uCode will be loaded to WOPCM. Size of the two. */
 	size = guc_fw->header_size + guc_fw->ucode_size;
 	if (size > guc_wopcm_size(dev->dev_private)) {
-		DRM_ERROR("Firmware is too large to fit in WOPCM\n");
+		DRM_DEBUG_DRIVER("Firmware is too large to fit in WOPCM\n");
 		goto fail;
 	}
 
@@ -636,7 +636,7 @@ static void guc_fw_fetch(struct drm_device *dev, struct intel_guc_fw *guc_fw)
 
 	if (guc_fw->guc_fw_major_found != guc_fw->guc_fw_major_wanted ||
 	    guc_fw->guc_fw_minor_found < guc_fw->guc_fw_minor_wanted) {
-		DRM_ERROR("GuC firmware version %d.%d, required %d.%d\n",
+		DRM_DEBUG_DRIVER("GuC firmware version %d.%d, required %d.%d\n",
 			guc_fw->guc_fw_major_found, guc_fw->guc_fw_minor_found,
 			guc_fw->guc_fw_major_wanted, guc_fw->guc_fw_minor_wanted);
 		err = -ENOEXEC;
@@ -668,8 +668,6 @@ static void guc_fw_fetch(struct drm_device *dev, struct intel_guc_fw *guc_fw)
 fail:
 	DRM_DEBUG_DRIVER("GuC fw fetch status FAIL; err %d, fw %p, obj %p\n",
 		err, fw, guc_fw->guc_fw_obj);
-	DRM_ERROR("Failed to fetch GuC firmware from %s (error %d)\n",
-		  guc_fw->guc_fw_path, err);
 
 	mutex_lock(&dev->struct_mutex);
 	obj = guc_fw->guc_fw_obj;
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

✗ Ro.CI.BAT: failure for series starting with [1/2] drm/i915/guc: Consolidate firmware major-minor to one place

In reply to Tvrtko Ursulin
== Series Details ==

== Series Details ==

Series: series starting with [1/2] drm/i915/guc: Consolidate firmware major-minor to one place
URL : https://patchwork.freedesktop.org/series/9457/
State : failure

== Summary ==

Series 9457v1 Series without cover letter
http://patchwork.freedesktop.org/api/1.0/series/9457/revisions/1/mbox

Test gem_exec_flush:

        Subgroup basic-batch-kernel-default-cmd:
                pass       -> FAIL       (ro-byt-n2820)
        Subgroup basic-batch-kernel-default-uc:
                pass       -> DMESG-FAIL (fi-skl-i7-6700k)
        Subgroup basic-batch-kernel-default-wb:
                pass       -> DMESG-FAIL (ro-bdw-i7-5557U)
        Subgroup basic-wb-pro-default:
                pass       -> DMESG-WARN (ro-ivb-i7-3770)
Test kms_pipe_crc_basic:
        Subgroup read-crc-pipe-a-frame-sequence:
                fail       -> PASS       (ro-snb-i7-2620M)
        Subgroup suspend-read-crc-pipe-a:
                dmesg-warn -> SKIP       (ro-bdw-i7-5557U)
fi-kbl-qkkr      total:231  pass:91   dwarn:21  dfail:3   fail:59  skip:57 
fi-skl-i5-6260u  total:231  pass:203  dwarn:0   dfail:1   fail:2   skip:25 
fi-skl-i7-6700k  total:231  pass:189  dwarn:0   dfail:1   fail:2   skip:39 
fi-snb-i7-2600   total:231  pass:176  dwarn:0   dfail:0   fail:2   skip:53 
ro-bdw-i5-5250u  total:229  pass:204  dwarn:1   dfail:1   fail:0   skip:23 
ro-bdw-i7-5557U  total:229  pass:203  dwarn:1   dfail:2   fail:0   skip:23 
ro-bdw-i7-5600u  total:229  pass:190  dwarn:0   dfail:1   fail:0   skip:38 
ro-bsw-n3050     total:229  pass:176  dwarn:0   dfail:1   fail:2   skip:50 
ro-byt-n2820     total:229  pass:180  dwarn:0   dfail:1   fail:3   skip:45 
ro-hsw-i3-4010u  total:229  pass:197  dwarn:0   dfail:1   fail:0   skip:31 
ro-hsw-i7-4770r  total:229  pass:197  dwarn:0   dfail:1   fail:0   skip:31 
ro-ilk-i7-620lm  total:229  pass:157  dwarn:0   dfail:1   fail:1   skip:70 
ro-ilk1-i5-650   total:224  pass:157  dwarn:0   dfail:1   fail:1   skip:65 
ro-ivb-i7-3770   total:229  pass:187  dwarn:1   dfail:1   fail:0   skip:40 
ro-skl3-i5-6260u total:229  pass:112  dwarn:3   dfail:2   fail:74  skip:38 
ro-snb-i7-2620M  total:229  pass:179  dwarn:0   dfail:1   fail:1   skip:48 

Results at /archive/results/CI_IGT_test/RO_Patchwork_1396/

79fa348 drm-intel-nightly: 2016y-07m-04d-10h-22m-11s UTC integration manifest ae1a1d3 drm/i915/guc: Demote some firmware loading messages to debug d4b44fb drm/i915/guc: Consolidate firmware major-minor to one place

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx