[09/12] drm/i915/selftests: Use GT engines in mock_gem_device
diff mbox series

Message ID 20191022094726.3001-10-tvrtko.ursulin@linux.intel.com
State New
Headers show
Series
  • Fewer for_each_engine(.., i915, ..)
Related show

Commit Message

Tvrtko Ursulin Oct. 22, 2019, 9:47 a.m. UTC
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Just freeing up two more call sites from passing in i915 to
for_each_engine.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/selftests/mock_gem_device.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Chris Wilson Oct. 22, 2019, 10:06 a.m. UTC | #1
Quoting Tvrtko Ursulin (2019-10-22 10:47:23)
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> Just freeing up two more call sites from passing in i915 to
> for_each_engine.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Ok, we really should do a gt/mock_gt.c...
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/selftests/mock_gem_device.c b/drivers/gpu/drm/i915/selftests/mock_gem_device.c
index cb8c3a501cc7..13d0380c08b5 100644
--- a/drivers/gpu/drm/i915/selftests/mock_gem_device.c
+++ b/drivers/gpu/drm/i915/selftests/mock_gem_device.c
@@ -40,14 +40,14 @@ 
 
 void mock_device_flush(struct drm_i915_private *i915)
 {
+	struct intel_gt *gt = &i915->gt;
 	struct intel_engine_cs *engine;
 	enum intel_engine_id id;
 
 	do {
-		for_each_engine(engine, i915, id)
+		for_each_engine(engine, gt, id)
 			mock_engine_flush(engine);
-	} while (intel_gt_retire_requests_timeout(&i915->gt,
-						  MAX_SCHEDULE_TIMEOUT));
+	} while (intel_gt_retire_requests_timeout(gt, MAX_SCHEDULE_TIMEOUT));
 }
 
 static void mock_device_release(struct drm_device *dev)
@@ -60,7 +60,7 @@  static void mock_device_release(struct drm_device *dev)
 
 	i915_gem_drain_workqueue(i915);
 
-	for_each_engine(engine, i915, id)
+	for_each_engine(engine, &i915->gt, id)
 		mock_engine_free(engine);
 	i915_gem_driver_release__contexts(i915);