diff mbox

[v2,1/2] drm/i915: Rotated view does not need a fence

Message ID 1477413635-3876-1-git-send-email-tvrtko.ursulin@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Tvrtko Ursulin Oct. 25, 2016, 4:40 p.m. UTC
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

We do not need to set up a fence for the rotated view.

Display does not need it and no one can access it.

v2: Move code to __i915_vma_set_map_and_fenceable. (Chris Wilson)

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Fixes: 05a20d098db1 ("drm/i915: Move map-and-fenceable tracking to the VMA")
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Chris Wilson Oct. 25, 2016, 7:55 p.m. UTC | #1
On Tue, Oct 25, 2016 at 05:40:35PM +0100, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> We do not need to set up a fence for the rotated view.
> 
> Display does not need it and no one can access it.
> 
> v2: Move code to __i915_vma_set_map_and_fenceable. (Chris Wilson)
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Fixes: 05a20d098db1 ("drm/i915: Move map-and-fenceable tracking to the VMA")
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_gem.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 9361c7b54a7f..eb524bdf0c35 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -3790,7 +3790,12 @@ void __i915_vma_set_map_and_fenceable(struct i915_vma *vma)
>  	mappable = (vma->node.start + fence_size <=
>  		    dev_priv->ggtt.mappable_end);
>  
> -	if (mappable && fenceable)
> +	/*
> +	 * Explicitly disable for rotated VMA since the display does not
> +	 * need the fence and the VMA is not accessible to other users.
> +	 */
> +	if (mappable && fenceable &&
> +	    vma->ggtt_view.type != I915_GGTT_VIEW_ROTATED)
>  		vma->flags |= I915_VMA_CAN_FENCE;
>  	else
>  		vma->flags &= ~I915_VMA_CAN_FENCE;

Penciled i915_vma_is_rotated() onto the todo list.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 9361c7b54a7f..eb524bdf0c35 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3790,7 +3790,12 @@  void __i915_vma_set_map_and_fenceable(struct i915_vma *vma)
 	mappable = (vma->node.start + fence_size <=
 		    dev_priv->ggtt.mappable_end);
 
-	if (mappable && fenceable)
+	/*
+	 * Explicitly disable for rotated VMA since the display does not
+	 * need the fence and the VMA is not accessible to other users.
+	 */
+	if (mappable && fenceable &&
+	    vma->ggtt_view.type != I915_GGTT_VIEW_ROTATED)
 		vma->flags |= I915_VMA_CAN_FENCE;
 	else
 		vma->flags &= ~I915_VMA_CAN_FENCE;