public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Jason Ekstrand <jason@jlekstrand.net>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 1/2] drm/i915: Don't allow setting I915_CONTEXT_PARAM_VM twice
Date: Mon, 12 Jul 2021 16:30:04 +0200	[thread overview]
Message-ID: <YOxR7Dzlxzs8jCBa@phenom.ffwll.local> (raw)
In-Reply-To: <20210710212447.785288-2-jason@jlekstrand.net>

On Sat, Jul 10, 2021 at 04:24:46PM -0500, Jason Ekstrand wrote:
> Allowing setting it multiple times brings no real utility to the API, no
> userspace relies on it, and it does make i915 a tiny bit more
> complicated.  Let's disallow it for now unless someone comes up with a
> compelling reason to support it.

Maybe mention this is for symmetry with other proto ctx set_param
operations, like set_engines.

> 
> Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  drivers/gpu/drm/i915/gem/i915_gem_context.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c b/drivers/gpu/drm/i915/gem/i915_gem_context.c
> index 7d6f52d8a8012..5853737cc79f3 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c
> @@ -319,7 +319,6 @@ static int set_proto_ctx_vm(struct drm_i915_file_private *fpriv,
>  			    const struct drm_i915_gem_context_param *args)
>  {
>  	struct drm_i915_private *i915 = fpriv->dev_priv;
> -	struct i915_address_space *vm;
>  
>  	if (args->size)
>  		return -EINVAL;
> @@ -327,17 +326,16 @@ static int set_proto_ctx_vm(struct drm_i915_file_private *fpriv,
>  	if (!HAS_FULL_PPGTT(i915))
>  		return -ENODEV;
>  
> +	if (pc->vm)
> +		return -EINVAL;
> +
>  	if (upper_32_bits(args->value))
>  		return -ENOENT;
>  
> -	vm = i915_gem_vm_lookup(fpriv, args->value);
> -	if (!vm)
> +	pc->vm = i915_gem_vm_lookup(fpriv, args->value);
> +	if (!pc->vm)
>  		return -ENOENT;
>  
> -	if (pc->vm)
> -		i915_vm_put(pc->vm);
> -	pc->vm = vm;
> -
>  	return 0;
>  }
>  
> -- 
> 2.31.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2021-07-12 14:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-10 21:24 [Intel-gfx] [PATCH 0/2] drm/i915: Better document VM and engine set APIs Jason Ekstrand
2021-07-10 21:24 ` [Intel-gfx] [PATCH 1/2] drm/i915: Don't allow setting I915_CONTEXT_PARAM_VM twice Jason Ekstrand
2021-07-12 14:30   ` Daniel Vetter [this message]
2021-07-10 21:24 ` [Intel-gfx] [PATCH 2/2] drm/i915/uapi: Add docs about immutability of engine sets and VMs Jason Ekstrand
2021-07-12 14:34   ` Daniel Vetter
2021-07-10 22:05 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Better document VM and engine set APIs Patchwork
2021-07-10 22:32 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-07-11  0:10 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YOxR7Dzlxzs8jCBa@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jason@jlekstrand.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox