diff mbox series

[v4,14/17] drm/i915/vm_bind: Expose i915_request_await_bind()

Message ID 20221018071630.3831-15-niranjana.vishwanathapura@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/vm_bind: Add VM_BIND functionality | expand

Commit Message

Niranjana Vishwanathapura Oct. 18, 2022, 7:16 a.m. UTC
Rename __i915_request_await_bind() as i915_request_await_bind()
and make it non-static as it will be used in execbuf3 ioctl path.

Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
---
 drivers/gpu/drm/i915/i915_vma.c | 8 +-------
 drivers/gpu/drm/i915/i915_vma.h | 6 ++++++
 2 files changed, 7 insertions(+), 7 deletions(-)

Comments

Matthew Auld Oct. 19, 2022, 4:09 p.m. UTC | #1
On 18/10/2022 08:16, Niranjana Vishwanathapura wrote:
> Rename __i915_request_await_bind() as i915_request_await_bind()
> and make it non-static as it will be used in execbuf3 ioctl path.
> 
> Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
> Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
> ---
>   drivers/gpu/drm/i915/i915_vma.c | 8 +-------
>   drivers/gpu/drm/i915/i915_vma.h | 6 ++++++
>   2 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
> index 4975fc662c86..ab89e907f2eb 100644
> --- a/drivers/gpu/drm/i915/i915_vma.c
> +++ b/drivers/gpu/drm/i915/i915_vma.c
> @@ -1884,18 +1884,12 @@ void i915_vma_revoke_mmap(struct i915_vma *vma)
>   		list_del(&vma->obj->userfault_link);
>   }
>   
> -static int
> -__i915_request_await_bind(struct i915_request *rq, struct i915_vma *vma)
> -{
> -	return __i915_request_await_exclusive(rq, &vma->active);
> -}
> -
>   static int __i915_vma_move_to_active(struct i915_vma *vma, struct i915_request *rq)
>   {
>   	int err;
>   
>   	/* Wait for the vma to be bound before we start! */
> -	err = __i915_request_await_bind(rq, vma);
> +	err = i915_request_await_bind(rq, vma);
>   	if (err)
>   		return err;
>   
> diff --git a/drivers/gpu/drm/i915/i915_vma.h b/drivers/gpu/drm/i915/i915_vma.h
> index 04770f8ba815..19e57e12b956 100644
> --- a/drivers/gpu/drm/i915/i915_vma.h
> +++ b/drivers/gpu/drm/i915/i915_vma.h
> @@ -54,6 +54,12 @@ void i915_vma_unpin_and_release(struct i915_vma **p_vma, unsigned int flags);
>   /* do not reserve memory to prevent deadlocks */
>   #define __EXEC_OBJECT_NO_RESERVE BIT(31)
>   
> +static inline int
> +i915_request_await_bind(struct i915_request *rq, struct i915_vma *vma)

Some kernel doc might be good?

Reviewed-by: Matthew Auld <matthew.auld@intel.com>

> +{
> +	return __i915_request_await_exclusive(rq, &vma->active);
> +}
> +
>   int __must_check _i915_vma_move_to_active(struct i915_vma *vma,
>   					  struct i915_request *rq,
>   					  struct dma_fence *fence,
Niranjana Vishwanathapura Oct. 19, 2022, 6:04 p.m. UTC | #2
On Wed, Oct 19, 2022 at 05:09:32PM +0100, Matthew Auld wrote:
>On 18/10/2022 08:16, Niranjana Vishwanathapura wrote:
>>Rename __i915_request_await_bind() as i915_request_await_bind()
>>and make it non-static as it will be used in execbuf3 ioctl path.
>>
>>Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
>>Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
>>---
>>  drivers/gpu/drm/i915/i915_vma.c | 8 +-------
>>  drivers/gpu/drm/i915/i915_vma.h | 6 ++++++
>>  2 files changed, 7 insertions(+), 7 deletions(-)
>>
>>diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
>>index 4975fc662c86..ab89e907f2eb 100644
>>--- a/drivers/gpu/drm/i915/i915_vma.c
>>+++ b/drivers/gpu/drm/i915/i915_vma.c
>>@@ -1884,18 +1884,12 @@ void i915_vma_revoke_mmap(struct i915_vma *vma)
>>  		list_del(&vma->obj->userfault_link);
>>  }
>>-static int
>>-__i915_request_await_bind(struct i915_request *rq, struct i915_vma *vma)
>>-{
>>-	return __i915_request_await_exclusive(rq, &vma->active);
>>-}
>>-
>>  static int __i915_vma_move_to_active(struct i915_vma *vma, struct i915_request *rq)
>>  {
>>  	int err;
>>  	/* Wait for the vma to be bound before we start! */
>>-	err = __i915_request_await_bind(rq, vma);
>>+	err = i915_request_await_bind(rq, vma);
>>  	if (err)
>>  		return err;
>>diff --git a/drivers/gpu/drm/i915/i915_vma.h b/drivers/gpu/drm/i915/i915_vma.h
>>index 04770f8ba815..19e57e12b956 100644
>>--- a/drivers/gpu/drm/i915/i915_vma.h
>>+++ b/drivers/gpu/drm/i915/i915_vma.h
>>@@ -54,6 +54,12 @@ void i915_vma_unpin_and_release(struct i915_vma **p_vma, unsigned int flags);
>>  /* do not reserve memory to prevent deadlocks */
>>  #define __EXEC_OBJECT_NO_RESERVE BIT(31)
>>+static inline int
>>+i915_request_await_bind(struct i915_request *rq, struct i915_vma *vma)
>
>Some kernel doc might be good?
>
>Reviewed-by: Matthew Auld <matthew.auld@intel.com>
>

Ok, will add.

Thanks,
Niranjana

>>+{
>>+	return __i915_request_await_exclusive(rq, &vma->active);
>>+}
>>+
>>  int __must_check _i915_vma_move_to_active(struct i915_vma *vma,
>>  					  struct i915_request *rq,
>>  					  struct dma_fence *fence,
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index 4975fc662c86..ab89e907f2eb 100644
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -1884,18 +1884,12 @@  void i915_vma_revoke_mmap(struct i915_vma *vma)
 		list_del(&vma->obj->userfault_link);
 }
 
-static int
-__i915_request_await_bind(struct i915_request *rq, struct i915_vma *vma)
-{
-	return __i915_request_await_exclusive(rq, &vma->active);
-}
-
 static int __i915_vma_move_to_active(struct i915_vma *vma, struct i915_request *rq)
 {
 	int err;
 
 	/* Wait for the vma to be bound before we start! */
-	err = __i915_request_await_bind(rq, vma);
+	err = i915_request_await_bind(rq, vma);
 	if (err)
 		return err;
 
diff --git a/drivers/gpu/drm/i915/i915_vma.h b/drivers/gpu/drm/i915/i915_vma.h
index 04770f8ba815..19e57e12b956 100644
--- a/drivers/gpu/drm/i915/i915_vma.h
+++ b/drivers/gpu/drm/i915/i915_vma.h
@@ -54,6 +54,12 @@  void i915_vma_unpin_and_release(struct i915_vma **p_vma, unsigned int flags);
 /* do not reserve memory to prevent deadlocks */
 #define __EXEC_OBJECT_NO_RESERVE BIT(31)
 
+static inline int
+i915_request_await_bind(struct i915_request *rq, struct i915_vma *vma)
+{
+	return __i915_request_await_exclusive(rq, &vma->active);
+}
+
 int __must_check _i915_vma_move_to_active(struct i915_vma *vma,
 					  struct i915_request *rq,
 					  struct dma_fence *fence,