From: Dave Gordon <david.s.gordon@intel.com>
To: intel-gfx@lists.freedesktop.org,
Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Subject: Re: [PATCH 4/4] drm/i915: Simplify i915_gem_obj_ggtt_bound_view
Date: Fri, 22 Apr 2016 11:54:33 +0100 [thread overview]
Message-ID: <571A02E9.1020108@intel.com> (raw)
In-Reply-To: <1461240286-25968-4-git-send-email-tvrtko.ursulin@linux.intel.com>
On 21/04/16 13:04, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>
> Can use the new vma->is_gtt to simplify the check and
> get rid of the local variables.
>
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
> drivers/gpu/drm/i915/i915_gem.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 135e1e9c40c2..c5ca53d2e35d 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -5275,12 +5275,10 @@ bool i915_gem_obj_bound(struct drm_i915_gem_object *o,
> bool i915_gem_obj_ggtt_bound_view(struct drm_i915_gem_object *o,
> const struct i915_ggtt_view *view)
> {
> - struct drm_i915_private *dev_priv = to_i915(o->base.dev);
> - struct i915_ggtt *ggtt = &dev_priv->ggtt;
> struct i915_vma *vma;
>
> list_for_each_entry(vma, &o->vma_list, obj_link)
> - if (vma->vm == &ggtt->base &&
> + if (vma->is_ggtt &&
> i915_ggtt_view_equal(&vma->ggtt_view, view) &&
> drm_mm_node_allocated(&vma->node))
> return true;
>
For patches 2-4,
Reviewed-by: Dave Gordon <david.s.gordon@intel.com>
As these three all now contain
if (vma->is_ggtt &&
i915_ggtt_view_equal(&vma->ggtt_view, view)
...
and these are the ONLY three uses of i915_ggtt_view_equal(), perhaps
the latter could be deleted from the header file and replaced by a local
(static) inline that encapsulates the is_ggtt test as well?
The Cocci script below found one more candidate for updating:
--- drivers/gpu/drm/i915/i915_gem_gtt.c
+++ cocci-output-24681-2f2e3b-i915_gem_gtt.c
@@ -3255,7 +3255,7 @@ void i915_gem_restore_gtt_mappings(struc
list_for_each_entry(obj, &dev_priv->mm.bound_list, global_list) {
flush = false;
list_for_each_entry(vma, &obj->vma_list, obj_link) {
- if (vma->vm != &ggtt->base)
+ if (!vma->is_ggtt)
continue;
Cocci:
@is_ggtt@
idexpression struct i915_ggtt *GGTT;
idexpression struct i915_vma *VMA;
@@
{
<...
- VMA->vm == &GGTT->base
+ VMA->is_ggtt
...>
}
@not_ggtt@
idexpression struct i915_ggtt *GGTT;
idexpression struct i915_vma *VMA;
@@
{
<...
- VMA->vm != &GGTT->base
+ !VMA->is_ggtt
...>
}
.Dave.
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-04-22 10:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-21 12:04 [PATCH 1/4] drm/i915: Remove i915_gem_obj_size Tvrtko Ursulin
2016-04-21 12:04 ` [PATCH 2/4] drm/i915: Simplify i915_gem_obj_to_ggtt_view Tvrtko Ursulin
2016-04-21 12:04 ` [PATCH 3/4] drm/i915: Simplify i915_gem_obj_ggtt_offset_view Tvrtko Ursulin
2016-04-21 12:04 ` [PATCH 4/4] drm/i915: Simplify i915_gem_obj_ggtt_bound_view Tvrtko Ursulin
2016-04-22 10:54 ` Dave Gordon [this message]
2016-04-21 12:19 ` [PATCH 1/4] drm/i915: Remove i915_gem_obj_size Chris Wilson
2016-04-21 12:46 ` Tvrtko Ursulin
2016-04-23 15:58 ` ✗ Fi.CI.BAT: warning for series starting with [1/4] " Patchwork
2016-04-25 8:29 ` Dave Gordon
2016-04-25 11:37 ` Tvrtko Ursulin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=571A02E9.1020108@intel.com \
--to=david.s.gordon@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=tvrtko.ursulin@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.