drm/i915: Use ww pinning for intel_context_create_request()
We want to get rid of intel_context_pin(), convert intel_context_create_request() first. :) Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Thomas Hellström <thomas.hellstrom@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200819140904.1708856-21-maarten.lankhorst@linux.intel.com Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
This commit is contained in:
parent
052e04f170
commit
8a929c9eb1
|
@ -449,15 +449,25 @@ int intel_context_prepare_remote_request(struct intel_context *ce,
|
||||||
|
|
||||||
struct i915_request *intel_context_create_request(struct intel_context *ce)
|
struct i915_request *intel_context_create_request(struct intel_context *ce)
|
||||||
{
|
{
|
||||||
|
struct i915_gem_ww_ctx ww;
|
||||||
struct i915_request *rq;
|
struct i915_request *rq;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
err = intel_context_pin(ce);
|
i915_gem_ww_ctx_init(&ww, true);
|
||||||
if (unlikely(err))
|
retry:
|
||||||
return ERR_PTR(err);
|
err = intel_context_pin_ww(ce, &ww);
|
||||||
|
if (!err) {
|
||||||
|
rq = i915_request_create(ce);
|
||||||
|
intel_context_unpin(ce);
|
||||||
|
} else if (err == -EDEADLK) {
|
||||||
|
err = i915_gem_ww_ctx_backoff(&ww);
|
||||||
|
if (!err)
|
||||||
|
goto retry;
|
||||||
|
} else {
|
||||||
|
rq = ERR_PTR(err);
|
||||||
|
}
|
||||||
|
|
||||||
rq = i915_request_create(ce);
|
i915_gem_ww_ctx_fini(&ww);
|
||||||
intel_context_unpin(ce);
|
|
||||||
|
|
||||||
if (IS_ERR(rq))
|
if (IS_ERR(rq))
|
||||||
return rq;
|
return rq;
|
||||||
|
|
Loading…
Reference in New Issue