]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/gpu/drm/i915/i915_gem.c
drm/i915: GuC-specific firmware loader
[karo-tx-linux.git] / drivers / gpu / drm / i915 / i915_gem.c
index 407b6b3576ae40c5d5213ca110586c408911d226..1ac57ec803bdc0657f0a0a845121e83f35608165 100644 (file)
@@ -4681,6 +4681,22 @@ i915_gem_init_hw(struct drm_device *dev)
                        goto out;
        }
 
+       /* We can't enable contexts until all firmware is loaded */
+       ret = intel_guc_ucode_load(dev);
+       if (ret) {
+               /*
+                * If we got an error and GuC submission is enabled, map
+                * the error to -EIO so the GPU will be declared wedged.
+                * OTOH, if we didn't intend to use the GuC anyway, just
+                * discard the error and carry on.
+                */
+               DRM_ERROR("Failed to initialize GuC, error %d%s\n", ret,
+                       i915.enable_guc_submission ? "" : " (ignored)");
+               ret = i915.enable_guc_submission ? -EIO : 0;
+               if (ret)
+                       goto out;
+       }
+
        /* Now it is safe to go back round and do everything else: */
        for_each_ring(ring, dev_priv, i) {
                struct drm_i915_gem_request *req;