From: Jason Ekstrand <jason@jlekstrand.net> To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Cc: Daniel Vetter <daniel.vetter@ffwll.ch>, Jason Ekstrand <jason@jlekstrand.net> Subject: [PATCH 1/2] drm/i915: Don't allow setting I915_CONTEXT_PARAM_VM twice Date: Sat, 10 Jul 2021 16:24:46 -0500 [thread overview] Message-ID: <20210710212447.785288-2-jason@jlekstrand.net> (raw) In-Reply-To: <20210710212447.785288-1-jason@jlekstrand.net> 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. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Cc: 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
WARNING: multiple messages have this Message-ID (diff)
From: Jason Ekstrand <jason@jlekstrand.net> To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Subject: [Intel-gfx] [PATCH 1/2] drm/i915: Don't allow setting I915_CONTEXT_PARAM_VM twice Date: Sat, 10 Jul 2021 16:24:46 -0500 [thread overview] Message-ID: <20210710212447.785288-2-jason@jlekstrand.net> (raw) In-Reply-To: <20210710212447.785288-1-jason@jlekstrand.net> 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. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Cc: 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 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2021-07-10 21:26 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-07-10 21:24 [PATCH 0/2] drm/i915: Better document VM and engine set APIs Jason Ekstrand 2021-07-10 21:24 ` [Intel-gfx] " Jason Ekstrand 2021-07-10 21:24 ` Jason Ekstrand [this message] 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 2021-07-12 14:30 ` [Intel-gfx] " Daniel Vetter 2021-07-10 21:24 ` [PATCH 2/2] drm/i915/uapi: Add docs about immutability of engine sets and VMs Jason Ekstrand 2021-07-10 21:24 ` [Intel-gfx] " Jason Ekstrand 2021-07-12 14:34 ` Daniel Vetter 2021-07-12 14:34 ` [Intel-gfx] " 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=20210710212447.785288-2-jason@jlekstrand.net \ --to=jason@jlekstrand.net \ --cc=daniel.vetter@ffwll.ch \ --cc=dri-devel@lists.freedesktop.org \ --cc=intel-gfx@lists.freedesktop.org \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.