If the driver is wedged, we will not be using the GPU. (Userspace will
be told NO!) As we won't be using the GPU until the wedged status is
cleared and the device restarted, we can skip enabling the guc whilst
the driver is terminally wedged, and so avoid trying to use a truly
wedged device.

Signed-off-by: Chris Wilson <[email protected]>
Cc: Mika Kuoppala <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>
Cc: Oscar Mateo <[email protected]>
Cc: Daniele Ceraolo Spurio <[email protected]>
Cc: Michal Wajdeczko <[email protected]>
Cc: Arkadiusz Hiler <[email protected]>
---
 drivers/gpu/drm/i915/i915_guc_submission.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_guc_submission.c 
b/drivers/gpu/drm/i915/i915_guc_submission.c
index b04b46966780..96235024e62c 100644
--- a/drivers/gpu/drm/i915/i915_guc_submission.c
+++ b/drivers/gpu/drm/i915/i915_guc_submission.c
@@ -1213,6 +1213,13 @@ int i915_guc_submission_enable(struct drm_i915_private 
*dev_priv)
        enum intel_engine_id id;
        int err;
 
+       /* Don't start the guc if the driver is wedged - we won't be using
+        * the gpu anyway until after the wedged status is cleared and we
+        * do a restrt of the device.
+        */
+       if (i915_terminally_wedged(&dev_priv->gpu_error))
+               return -EIO;
+
        if (!client) {
                client = guc_client_alloc(dev_priv,
                                          INTEL_INFO(dev_priv)->ring_mask,
-- 
2.11.0

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

Reply via email to