diff mbox series

[RFC,v3,09/17] drm/i915: Do not support vm_bind mode in execbuf2

Message ID 20220827194403.6495-10-andi.shyti@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/vm_bind: Add VM_BIND functionality | expand

Commit Message

Andi Shyti Aug. 27, 2022, 7:43 p.m. UTC
From: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>

Do not support the vm in vm_bind_mode in execbuf2 ioctl.

Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Niranjana Vishwanathapura Aug. 31, 2022, 5:45 a.m. UTC | #1
On Sat, Aug 27, 2022 at 09:43:55PM +0200, Andi Shyti wrote:
>From: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
>
>Do not support the vm in vm_bind_mode in execbuf2 ioctl.
>
>Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
>Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
>Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
>---
> drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
>diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
>index cd75b0ca2555f..f85f10cf9c34b 100644
>--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
>+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
>@@ -781,6 +781,11 @@ static int eb_select_context(struct i915_execbuffer *eb)
> 	if (unlikely(IS_ERR(ctx)))
> 		return PTR_ERR(ctx);
>
>+	if (ctx->vm->vm_bind_mode) {
>+		i915_gem_context_put(ctx);
>+		return -EOPNOTSUPP;
>+	}
>+
> 	eb->gem_context = ctx;
> 	if (i915_gem_context_has_full_ppgtt(ctx))
> 		eb->invalid_flags |= EXEC_OBJECT_NEEDS_GTT;

This should probably be merged with patch #2 that introduces vm_bind_mode uapi.

Niranjana

>-- 
>2.34.1
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index cd75b0ca2555f..f85f10cf9c34b 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -781,6 +781,11 @@  static int eb_select_context(struct i915_execbuffer *eb)
 	if (unlikely(IS_ERR(ctx)))
 		return PTR_ERR(ctx);
 
+	if (ctx->vm->vm_bind_mode) {
+		i915_gem_context_put(ctx);
+		return -EOPNOTSUPP;
+	}
+
 	eb->gem_context = ctx;
 	if (i915_gem_context_has_full_ppgtt(ctx))
 		eb->invalid_flags |= EXEC_OBJECT_NEEDS_GTT;