summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2021-01-01 09:30:01 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2021-02-11 11:24:12 +0000
commit496f3dd1be30fe683f6101165cc9f195b9e32320 (patch)
tree790502846f1a47fcbe47b90b35967ada706d360d
parentba9ee06ee099c6a19444efda7cf8d8dc8c6a760e (diff)
vma-create-for-pages
-rw-r--r--drivers/gpu/drm/i915/i915_perf.c29
1 files changed, 6 insertions, 23 deletions
diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
index 4e448e19eede..d59b73815852 100644
--- a/drivers/gpu/drm/i915/i915_perf.c
+++ b/drivers/gpu/drm/i915/i915_perf.c
@@ -1892,14 +1892,13 @@ alloc_oa_config_buffer(struct i915_perf_stream *stream,
i915_mm_pages_flush_map(pages);
__i915_mm_pages_release_map(pages);
- i915_mm_pages_put(pages);
- oa_bo->vma = i915_vma_instance(obj,
- &stream->engine->gt->ggtt->vm,
- NULL);
+ oa_bo->vma = i915_vma_create_for_pages(pages,
+ &stream->engine->gt->ggtt->vm);
+ i915_gem_object_put(obj);
if (IS_ERR(oa_bo->vma)) {
err = PTR_ERR(oa_bo->vma);
- goto err_oa_bo;
+ goto err_free;
}
oa_bo->oa_config = i915_oa_config_get(oa_config);
@@ -1947,20 +1946,13 @@ emit_oa_config(struct i915_perf_stream *stream,
{
struct i915_request *rq;
struct i915_vma *vma;
- struct i915_gem_ww_ctx ww;
int err;
vma = get_oa_vma(stream, oa_config);
if (IS_ERR(vma))
return PTR_ERR(vma);
- i915_gem_ww_ctx_init(&ww, true);
-retry:
- err = i915_gem_object_lock(vma->obj, &ww);
- if (err)
- goto err;
-
- err = i915_vma_pin_ww(vma, &ww, 0, 0, PIN_GLOBAL | PIN_HIGH);
+ err = i915_vma_pin_ww(vma, NULL, 0, 0, PIN_GLOBAL | PIN_HIGH);
if (err)
goto err;
@@ -1984,9 +1976,7 @@ retry:
goto err_add_request;
}
- err = i915_request_await_object(rq, vma->obj, 0);
- if (!err)
- err = i915_vma_move_to_active(vma, rq, 0);
+ err = i915_vma_move_to_active(vma, rq, 0);
if (err)
goto err_add_request;
@@ -2001,13 +1991,6 @@ err_add_request:
err_vma_unpin:
i915_vma_unpin(vma);
err:
- if (err == -EDEADLK) {
- err = i915_gem_ww_ctx_backoff(&ww);
- if (!err)
- goto retry;
- }
-
- i915_gem_ww_ctx_fini(&ww);
i915_vma_put(vma);
return err;
}