[11/12] drm/i915/selftests: Use GT engines in i915_gem_mman selftest
diff mbox series

Message ID 20191022094726.3001-12-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>

One more for_each_engine call site changed to work on GT engines.

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

Comments

Chris Wilson Oct. 22, 2019, 10:11 a.m. UTC | #1
Quoting Tvrtko Ursulin (2019-10-22 10:47:25)
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> One more for_each_engine call site changed to work on GT engines.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>  drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c
> index 65d4dbf91999..45fc152ebf5c 100644
> --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c
> +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c
> @@ -514,12 +514,13 @@ static int igt_smoke_tiling(void *arg)
>  static int make_obj_busy(struct drm_i915_gem_object *obj)
>  {
>         struct drm_i915_private *i915 = to_i915(obj->base.dev);
> +       struct intel_gt *gt = &i915->gt;
>         struct intel_engine_cs *engine;
>         enum intel_engine_id id;
>         struct i915_vma *vma;
>         int err;
>  
> -       vma = i915_vma_instance(obj, &i915->ggtt.vm, NULL);
> +       vma = i915_vma_instance(obj, &gt->ggtt->vm, NULL);
>         if (IS_ERR(vma))
>                 return PTR_ERR(vma);
>  
> @@ -527,7 +528,7 @@ static int make_obj_busy(struct drm_i915_gem_object *obj)
>         if (err)
>                 return err;
>  
> -       for_each_engine(engine, i915, id) {
> +       for_each_engine(engine, gt, id) {

I was thinking for_each_uabi_engine() -- but I was trying to answer to
myself why exactly.

Ok, I have an idea, let me float a patch.
-Chris

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c
index 65d4dbf91999..45fc152ebf5c 100644
--- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c
+++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c
@@ -514,12 +514,13 @@  static int igt_smoke_tiling(void *arg)
 static int make_obj_busy(struct drm_i915_gem_object *obj)
 {
 	struct drm_i915_private *i915 = to_i915(obj->base.dev);
+	struct intel_gt *gt = &i915->gt;
 	struct intel_engine_cs *engine;
 	enum intel_engine_id id;
 	struct i915_vma *vma;
 	int err;
 
-	vma = i915_vma_instance(obj, &i915->ggtt.vm, NULL);
+	vma = i915_vma_instance(obj, &gt->ggtt->vm, NULL);
 	if (IS_ERR(vma))
 		return PTR_ERR(vma);
 
@@ -527,7 +528,7 @@  static int make_obj_busy(struct drm_i915_gem_object *obj)
 	if (err)
 		return err;
 
-	for_each_engine(engine, i915, id) {
+	for_each_engine(engine, gt, id) {
 		struct i915_request *rq;
 
 		rq = i915_request_create(engine->kernel_context);