drm/i915/guc: fix GuC loading/submission check
authorDave Gordon <david.s.gordon@intel.com>
Tue, 7 Jun 2016 08:14:49 +0000 (09:14 +0100)
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>
Tue, 7 Jun 2016 13:21:58 +0000 (14:21 +0100)
The last stage of the GuC loader also sanitises the GuC submission
settings, so should be called unconditionally (even on platforms
without a GuC) to ensure consistent settings; in particular, this
prevents any attempt to use GuC submission on GuCless platforms!

Also fix error path handling and clarify DRM_INFO fallback message.

Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/intel_guc_loader.c

index 1bfc260c59adb3776c155cca51c655f38d9cb1f5..eae8d7a89d09e9f69665035d88724b1776369c91 100644 (file)
@@ -4930,11 +4930,9 @@ i915_gem_init_hw(struct drm_device *dev)
        intel_mocs_init_l3cc_table(dev);
 
        /* We can't enable contexts until all firmware is loaded */
-       if (HAS_GUC(dev)) {
-               ret = intel_guc_setup(dev);
-               if (ret)
-                       goto out;
-       }
+       ret = intel_guc_setup(dev);
+       if (ret)
+               goto out;
 
        /*
         * Increment the next seqno by 0x100 so we have a visible break
index f2b88c7209cb6f44f6a1f73c0041bb14603f598c..4e34c2ea4bf4d275c8669aedd0bf9895a9d888f9 100644 (file)
@@ -425,9 +425,13 @@ int intel_guc_setup(struct drm_device *dev)
        if (!i915.enable_guc_loading) {
                err = 0;
                goto fail;
-       } else if (fw_path == NULL || *fw_path == '\0') {
-               if (*fw_path == '\0')
-                       DRM_INFO("No GuC firmware known for this platform\n");
+       } else if (fw_path == NULL) {
+               /* Device is known to have no uCode (e.g. no GuC) */
+               err = -ENXIO;
+               goto fail;
+       } else if (*fw_path == '\0') {
+               /* Device has a GuC but we don't know what f/w to load? */
+               DRM_INFO("No GuC firmware known for this platform\n");
                err = -ENODEV;
                goto fail;
        }
@@ -535,7 +539,7 @@ fail:
                if (fw_path == NULL)
                        DRM_INFO("GuC submission without firmware not supported\n");
                if (ret == 0)
-                       DRM_INFO("Falling back to execlist mode\n");
+                       DRM_INFO("Falling back from GuC submission to execlist mode\n");
                else
                        DRM_ERROR("GuC init failed: %d\n", ret);
        }