diff options
author | Zhenyu Wang <zhenyuw@linux.intel.com> | 2019-03-11 10:37:47 +0800 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2019-03-24 11:28:09 +0000 |
commit | ddad5babb05e92e655cae137c1f8a3ed2c43a685 (patch) | |
tree | e29e5a86d86bd943d3844b19598140232f2ccbed /drivers/gpu/drm/i915/i915_gem_context.c | |
parent | 4b225248daddfe6a48529963a45184a15be83781 (diff) | |
download | linux-ddad5babb05e92e655cae137c1f8a3ed2c43a685.tar.bz2 |
drm/i915: always pin hw_id for GVT context
Initially found issue with closed context debug check when pin
hw_id for GVT context, looks we should always pin hw_id for that
as GVT context is fixed for each vGPU life cycle, and we'd also
like to get pinned hw_id e.g for perf reason, etc.
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20190311023747.1426-1-zhenyuw@linux.intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_context.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_context.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c index 39ca3cb6af66..e6f594668245 100644 --- a/drivers/gpu/drm/i915/i915_gem_context.c +++ b/drivers/gpu/drm/i915/i915_gem_context.c @@ -482,6 +482,13 @@ i915_gem_context_create_gvt(struct drm_device *dev) if (IS_ERR(ctx)) goto out; + ret = i915_gem_context_pin_hw_id(ctx); + if (ret) { + context_close(ctx); + ctx = ERR_PTR(ret); + goto out; + } + ctx->file_priv = ERR_PTR(-EBADF); i915_gem_context_set_closed(ctx); /* not user accessible */ i915_gem_context_clear_bannable(ctx); |