All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Tidy aliasing_gtt_bind_vma()
@ 2015-11-20 10:27 Chris Wilson
  2015-11-24 13:05 ` Daniel Vetter
  2016-03-24  7:13 ` ✗ Fi.CI.BAT: failure for " Patchwork
  0 siblings, 2 replies; 3+ messages in thread
From: Chris Wilson @ 2015-11-20 10:27 UTC (permalink / raw)
  To: intel-gfx; +Cc: Daniel Vetter

In commit 0a878716265e9af9f697264dc2e858fcc060d833
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Thu Oct 15 14:23:01 2015 +0200

    drm/i915: restore ggtt double-bind avoidance

we wrote the ggtt_bind_vma() observing a number of cleanups we could do
over the template of aliasing_gtt_bind_vma(). Now let's apply the
cleanups we made there back to the original. The essence is to avoid
redundant variables and assignements, and by doing so make the code
easier to read.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 21667ad3c685..a09f8f0510d5 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -2561,32 +2561,31 @@ static int aliasing_gtt_bind_vma(struct i915_vma *vma,
 				 enum i915_cache_level cache_level,
 				 u32 flags)
 {
-	struct drm_device *dev = vma->vm->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
-	struct drm_i915_gem_object *obj = vma->obj;
-	struct sg_table *pages = obj->pages;
-	u32 pte_flags = 0;
+	u32 pte_flags;
 	int ret;
 
 	ret = i915_get_ggtt_vma_pages(vma);
 	if (ret)
 		return ret;
-	pages = vma->ggtt_view.pages;
 
 	/* Currently applicable only to VLV */
-	if (obj->gt_ro)
+	pte_flags = 0;
+	if (vma->obj->gt_ro)
 		pte_flags |= PTE_READ_ONLY;
 
 
 	if (flags & GLOBAL_BIND) {
-		vma->vm->insert_entries(vma->vm, pages,
+		vma->vm->insert_entries(vma->vm,
+					vma->ggtt_view.pages,
 					vma->node.start,
 					cache_level, pte_flags);
 	}
 
 	if (flags & LOCAL_BIND) {
-		struct i915_hw_ppgtt *appgtt = dev_priv->mm.aliasing_ppgtt;
-		appgtt->base.insert_entries(&appgtt->base, pages,
+		struct i915_hw_ppgtt *appgtt =
+			to_i915(vma->vm->dev)->mm.aliasing_ppgtt;
+		appgtt->base.insert_entries(&appgtt->base,
+					    vma->ggtt_view.pages,
 					    vma->node.start,
 					    cache_level, pte_flags);
 	}
-- 
2.6.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/i915: Tidy aliasing_gtt_bind_vma()
  2015-11-20 10:27 [PATCH] drm/i915: Tidy aliasing_gtt_bind_vma() Chris Wilson
@ 2015-11-24 13:05 ` Daniel Vetter
  2016-03-24  7:13 ` ✗ Fi.CI.BAT: failure for " Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2015-11-24 13:05 UTC (permalink / raw)
  To: Chris Wilson; +Cc: Daniel Vetter, intel-gfx

On Fri, Nov 20, 2015 at 10:27:18AM +0000, Chris Wilson wrote:
> In commit 0a878716265e9af9f697264dc2e858fcc060d833
> Author: Daniel Vetter <daniel.vetter@ffwll.ch>
> Date:   Thu Oct 15 14:23:01 2015 +0200
> 
>     drm/i915: restore ggtt double-bind avoidance
> 
> we wrote the ggtt_bind_vma() observing a number of cleanups we could do
> over the template of aliasing_gtt_bind_vma(). Now let's apply the
> cleanups we made there back to the original. The essence is to avoid
> redundant variables and assignements, and by doing so make the code
> easier to read.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  drivers/gpu/drm/i915/i915_gem_gtt.c | 19 +++++++++----------
>  1 file changed, 9 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index 21667ad3c685..a09f8f0510d5 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -2561,32 +2561,31 @@ static int aliasing_gtt_bind_vma(struct i915_vma *vma,
>  				 enum i915_cache_level cache_level,
>  				 u32 flags)
>  {
> -	struct drm_device *dev = vma->vm->dev;
> -	struct drm_i915_private *dev_priv = dev->dev_private;
> -	struct drm_i915_gem_object *obj = vma->obj;
> -	struct sg_table *pages = obj->pages;
> -	u32 pte_flags = 0;
> +	u32 pte_flags;
>  	int ret;
>  
>  	ret = i915_get_ggtt_vma_pages(vma);
>  	if (ret)
>  		return ret;
> -	pages = vma->ggtt_view.pages;
>  
>  	/* Currently applicable only to VLV */
> -	if (obj->gt_ro)
> +	pte_flags = 0;
> +	if (vma->obj->gt_ro)
>  		pte_flags |= PTE_READ_ONLY;
>  
>  
>  	if (flags & GLOBAL_BIND) {
> -		vma->vm->insert_entries(vma->vm, pages,
> +		vma->vm->insert_entries(vma->vm,
> +					vma->ggtt_view.pages,
>  					vma->node.start,
>  					cache_level, pte_flags);
>  	}
>  
>  	if (flags & LOCAL_BIND) {
> -		struct i915_hw_ppgtt *appgtt = dev_priv->mm.aliasing_ppgtt;
> -		appgtt->base.insert_entries(&appgtt->base, pages,
> +		struct i915_hw_ppgtt *appgtt =
> +			to_i915(vma->vm->dev)->mm.aliasing_ppgtt;
> +		appgtt->base.insert_entries(&appgtt->base,
> +					    vma->ggtt_view.pages,
>  					    vma->node.start,
>  					    cache_level, pte_flags);
>  	}
> -- 
> 2.6.2
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

* ✗ Fi.CI.BAT: failure for drm/i915: Tidy aliasing_gtt_bind_vma()
  2015-11-20 10:27 [PATCH] drm/i915: Tidy aliasing_gtt_bind_vma() Chris Wilson
  2015-11-24 13:05 ` Daniel Vetter
@ 2016-03-24  7:13 ` Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2016-03-24  7:13 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Tidy aliasing_gtt_bind_vma()
URL   : https://patchwork.freedesktop.org/series/990/
State : failure

== Summary ==

Series 990v1 drm/i915: Tidy aliasing_gtt_bind_vma()
2016-03-23T16:40:39.102374 http://patchwork.freedesktop.org/api/1.0/series/990/revisions/1/mbox/
Applying: drm/i915: Tidy aliasing_gtt_bind_vma()
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 drm/i915: Tidy aliasing_gtt_bind_vma()

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-24  7:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-20 10:27 [PATCH] drm/i915: Tidy aliasing_gtt_bind_vma() Chris Wilson
2015-11-24 13:05 ` Daniel Vetter
2016-03-24  7:13 ` ✗ Fi.CI.BAT: failure for " Patchwork

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.