All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Remove redundant check in i915_gem_obj_to_vma
@ 2015-11-12 11:59 Tvrtko Ursulin
  2015-11-12 12:29 ` Chris Wilson
  0 siblings, 1 reply; 4+ messages in thread
From: Tvrtko Ursulin @ 2015-11-12 11:59 UTC (permalink / raw)
  To: Intel-gfx

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

No need to verify VMA belongs to GGTT since:

1. The function must return a normal VMA belonging to passed in VM.
2. There can only be one normal VMA for any VM.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
Maybe now even a candidate for making a static inline?

 drivers/gpu/drm/i915/i915_gem.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index d85c63dc36ac..a913387a89cb 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -4485,10 +4485,8 @@ struct i915_vma *i915_gem_obj_to_vma(struct drm_i915_gem_object *obj,
 {
 	struct i915_vma *vma;
 	list_for_each_entry(vma, &obj->vma_list, vma_link) {
-		if (i915_is_ggtt(vma->vm) &&
-		    vma->ggtt_view.type != I915_GGTT_VIEW_NORMAL)
-			continue;
-		if (vma->vm == vm)
+		if (vma->ggtt_view.type == I915_GGTT_VIEW_NORMAL &&
+		    vma->vm == vm)
 			return vma;
 	}
 	return NULL;
-- 
1.9.1

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

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

* Re: [PATCH] drm/i915: Remove redundant check in i915_gem_obj_to_vma
  2015-11-12 11:59 [PATCH] drm/i915: Remove redundant check in i915_gem_obj_to_vma Tvrtko Ursulin
@ 2015-11-12 12:29 ` Chris Wilson
  2015-11-12 14:19   ` Jani Nikula
  2015-11-13 12:36   ` Tvrtko Ursulin
  0 siblings, 2 replies; 4+ messages in thread
From: Chris Wilson @ 2015-11-12 12:29 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: Intel-gfx

On Thu, Nov 12, 2015 at 11:59:55AM +0000, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> No need to verify VMA belongs to GGTT since:
> 
> 1. The function must return a normal VMA belonging to passed in VM.
> 2. There can only be one normal VMA for any VM.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by Chris Wilson <chris@chris-wilson.co.uk>

> Maybe now even a candidate for making a static inline?

No. After tracking vma, i915_gem_obj_to_vma() is moved off the hotpaths
and mostly used for the first lookup by an execbuffer, context creation,
modesetting and debug code.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915: Remove redundant check in i915_gem_obj_to_vma
  2015-11-12 12:29 ` Chris Wilson
@ 2015-11-12 14:19   ` Jani Nikula
  2015-11-13 12:36   ` Tvrtko Ursulin
  1 sibling, 0 replies; 4+ messages in thread
From: Jani Nikula @ 2015-11-12 14:19 UTC (permalink / raw)
  To: Chris Wilson, Tvrtko Ursulin; +Cc: Intel-gfx

On Thu, 12 Nov 2015, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> On Thu, Nov 12, 2015 at 11:59:55AM +0000, Tvrtko Ursulin wrote:
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> 
>> No need to verify VMA belongs to GGTT since:
>> 
>> 1. The function must return a normal VMA belonging to passed in VM.
>> 2. There can only be one normal VMA for any VM.
>> 
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Reviewed-by Chris Wilson <chris@chris-wilson.co.uk>

Pushed to drm-intel-next-queued, thanks for the patch and review.

BR,
Jani.



>
>> Maybe now even a candidate for making a static inline?
>
> No. After tracking vma, i915_gem_obj_to_vma() is moved off the hotpaths
> and mostly used for the first lookup by an execbuffer, context creation,
> modesetting and debug code.
> -Chris

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915: Remove redundant check in i915_gem_obj_to_vma
  2015-11-12 12:29 ` Chris Wilson
  2015-11-12 14:19   ` Jani Nikula
@ 2015-11-13 12:36   ` Tvrtko Ursulin
  1 sibling, 0 replies; 4+ messages in thread
From: Tvrtko Ursulin @ 2015-11-13 12:36 UTC (permalink / raw)
  To: Chris Wilson, Intel-gfx, Tvrtko Ursulin


On 12/11/15 12:29, Chris Wilson wrote:
> On Thu, Nov 12, 2015 at 11:59:55AM +0000, Tvrtko Ursulin wrote:
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> No need to verify VMA belongs to GGTT since:
>>
>> 1. The function must return a normal VMA belonging to passed in VM.
>> 2. There can only be one normal VMA for any VM.
>>
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Reviewed-by Chris Wilson <chris@chris-wilson.co.uk>

Thanks!

>> Maybe now even a candidate for making a static inline?
>
> No. After tracking vma, i915_gem_obj_to_vma() is moved off the hotpaths
> and mostly used for the first lookup by an execbuffer, context creation,
> modesetting and debug code.

Well I thought I wouldn't harm in the interim, since there are only 
three callers in total, two of which are performance sensitive, and if 
inlined code would now probably quite compact.

How is the rewrite coming along then?

Regards,

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

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

end of thread, other threads:[~2015-11-13 12:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-12 11:59 [PATCH] drm/i915: Remove redundant check in i915_gem_obj_to_vma Tvrtko Ursulin
2015-11-12 12:29 ` Chris Wilson
2015-11-12 14:19   ` Jani Nikula
2015-11-13 12:36   ` Tvrtko Ursulin

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.