[Intel-gfx] [PATCH 2/2] drm/i915: Return -ENOENT for unknown contexts

Daniel Vetter daniel at ffwll.ch
Fri Mar 14 16:38:47 CET 2014


On Fri, Mar 14, 2014 at 04:22:11PM +0200, Mika Kuoppala wrote:
> If hw_contexts are disabled, we always return the per file
> descriptor default context stats. Make sure that the context
> is correctly given and fail accordingly if not.
> 
> Signed-off-by: Mika Kuoppala <mika.kuoppala at intel.com>

Hm, does this fix a testcase somewhere? If sou can you specify which one?
Of there's no such thing I guess we should try to add a new testcase for
this for pre-gen6 ...
-Daniel

> ---
>  drivers/gpu/drm/i915/i915_gem_context.c |    6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
> index b5a5837..a8e625d 100644
> --- a/drivers/gpu/drm/i915/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/i915_gem_context.c
> @@ -573,8 +573,12 @@ i915_gem_context_get(struct drm_i915_file_private *file_priv, u32 id)
>  {
>  	struct i915_hw_context *ctx;
>  
> -	if (!HAS_HW_CONTEXTS(file_priv->dev_priv->dev))
> +	if (!HAS_HW_CONTEXTS(file_priv->dev_priv->dev)) {
> +		if (id != DEFAULT_CONTEXT_ID)
> +			return ERR_PTR(-ENOENT);
> +
>  		return file_priv->private_default_ctx;
> +	}
>  
>  	ctx = (struct i915_hw_context *)idr_find(&file_priv->context_idr, id);
>  	if (!ctx)
> -- 
> 1.7.9.5
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch



More information about the Intel-gfx mailing list