]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/gt: Push the GPU cancellation to the backend
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 21 Feb 2020 23:51:35 +0000 (23:51 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Sat, 22 Feb 2020 10:20:12 +0000 (10:20 +0000)
Upon unregistering the user interface, we mark the GPU as wedged to
ensure we push no new work to the GPU, and to flush all current work
from the GPU. Move this call to the GT backend.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Andi Shyti <andi.shyti@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200221235135.2883006-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gt/intel_gt.c
drivers/gpu/drm/i915/i915_drv.c

index cd64f81a3e604e4cec1ea76d137d3c602668f629..3dea8881e915c16d18bb5c1a58548d327f3dafc6 100644 (file)
@@ -644,6 +644,13 @@ void intel_gt_driver_remove(struct intel_gt *gt)
 void intel_gt_driver_unregister(struct intel_gt *gt)
 {
        intel_rps_driver_unregister(&gt->rps);
+
+       /*
+        * Upon unregistering the device to prevent any new users, cancel
+        * all in-flight requests so that we can quickly unbind the active
+        * resources.
+        */
+       intel_gt_set_wedged(gt);
 }
 
 void intel_gt_driver_release(struct intel_gt *gt)
index 4dd8294b68e1e210b8fc97baecf8dc2e4542c115..6b216fc94b3142fd82f401ffceab47ee6021e325 100644 (file)
@@ -1494,13 +1494,6 @@ void i915_driver_remove(struct drm_i915_private *i915)
 
        i915_driver_unregister(i915);
 
-       /*
-        * After unregistering the device to prevent any new users, cancel
-        * all in-flight requests so that we can quickly unbind the active
-        * resources.
-        */
-       intel_gt_set_wedged(&i915->gt);
-
        /* Flush any external code that still may be under the RCU lock */
        synchronize_rcu();