drm/i915: always pin hw_id for GVT context
diff mbox series

Message ID 20190311023747.1426-1-zhenyuw@linux.intel.com
State New
Headers show
Series
  • drm/i915: always pin hw_id for GVT context
Related show

Commit Message

Zhenyu Wang March 11, 2019, 2:37 a.m. UTC
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>
---
 drivers/gpu/drm/i915/i915_gem_context.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Li, Weinan Z March 11, 2019, 1:49 p.m. UTC | #1
> -----Original Message-----
> From: Intel-gfx [mailto:intel-gfx-bounces@lists.freedesktop.org] On Behalf Of
> Zhenyu Wang
> Sent: Monday, March 11, 2019 10:38 AM
> To: intel-gfx@lists.freedesktop.org
> Cc: intel-gvt-dev@lists.freedesktop.org
> Subject: [Intel-gfx] [PATCH] 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>
> ---
>  drivers/gpu/drm/i915/i915_gem_context.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_context.c
> b/drivers/gpu/drm/i915/i915_gem_context.c
> index b9f321947982..f33917ebabe6 100644
> --- a/drivers/gpu/drm/i915/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/i915_gem_context.c
> @@ -506,6 +506,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 = NULL;
> +		goto out;
> +	}
> +
Do you mean the BUG check of " i915_gem_context_is_closed"?
GVT-g tag the gvt context flag as "closed" in "i915_gem_context_create_gvt", it seems not very appropriate.


>  	ctx->file_priv = ERR_PTR(-EBADF);
>  	i915_gem_context_set_closed(ctx); /* not user accessible */
>  	i915_gem_context_clear_bannable(ctx);
> --
> 2.20.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Chris Wilson March 24, 2019, 11:25 a.m. UTC | #2
Quoting Zhenyu Wang (2019-03-11 02:37:47)
> 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>
-Chris

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index b9f321947982..f33917ebabe6 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -506,6 +506,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 = NULL;
+		goto out;
+	}
+
 	ctx->file_priv = ERR_PTR(-EBADF);
 	i915_gem_context_set_closed(ctx); /* not user accessible */
 	i915_gem_context_clear_bannable(ctx);