diff mbox series

[1/2] drm/i915: Early return for no-op i915_vma_pin_fence()

Message ID 20200108153550.3803446-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show
Series [1/2] drm/i915: Early return for no-op i915_vma_pin_fence() | expand

Commit Message

Chris Wilson Jan. 8, 2020, 3:35 p.m. UTC
If we have no fence and desire no fence on the vma, return before we try
and take the vm->mutex.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_gem_fence_reg.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Mika Kuoppala Jan. 9, 2020, 8:08 a.m. UTC | #1
Chris Wilson <chris@chris-wilson.co.uk> writes:

> If we have no fence and desire no fence on the vma, return before we try
> and take the vm->mutex.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>

Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/i915_gem_fence_reg.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_fence_reg.c b/drivers/gpu/drm/i915/i915_gem_fence_reg.c
> index 71efccfde122..d9c34a23cd67 100644
> --- a/drivers/gpu/drm/i915/i915_gem_fence_reg.c
> +++ b/drivers/gpu/drm/i915/i915_gem_fence_reg.c
> @@ -412,6 +412,9 @@ int i915_vma_pin_fence(struct i915_vma *vma)
>  {
>  	int err;
>  
> +	if (!vma->fence && !i915_gem_object_is_tiled(vma->obj))
> +		return 0;
> +
>  	/*
>  	 * Note that we revoke fences on runtime suspend. Therefore the user
>  	 * must keep the device awake whilst using the fence.
> -- 
> 2.25.0.rc1
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem_fence_reg.c b/drivers/gpu/drm/i915/i915_gem_fence_reg.c
index 71efccfde122..d9c34a23cd67 100644
--- a/drivers/gpu/drm/i915/i915_gem_fence_reg.c
+++ b/drivers/gpu/drm/i915/i915_gem_fence_reg.c
@@ -412,6 +412,9 @@  int i915_vma_pin_fence(struct i915_vma *vma)
 {
 	int err;
 
+	if (!vma->fence && !i915_gem_object_is_tiled(vma->obj))
+		return 0;
+
 	/*
 	 * Note that we revoke fences on runtime suspend. Therefore the user
 	 * must keep the device awake whilst using the fence.