projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0ef34ad
)
drm/i915: Only GGTT vma may be pinned and prevent shrinking
author
Chris Wilson
<
[email protected]
>
Thu, 25 May 2017 07:25:28 +0000
(08:25 +0100)
committer
Chris Wilson
<
[email protected]
>
Thu, 25 May 2017 20:50:08 +0000
(21:50 +0100)
As only GGTT vma may be permanently pinned and are always at the head of
the object's vma list, as soon as we seen a ppGTT vma we can stop
searching for any_vma_pinned().
Signed-off-by: Chris Wilson <
[email protected]
>
Cc: Joonas Lahtinen <
[email protected]
>
Link:
http://patchwork.freedesktop.org/patch/msgid/
[email protected]
Reviewed-by: Joonas Lahtinen <
[email protected]
>
drivers/gpu/drm/i915/i915_gem_shrinker.c
patch
|
blob
|
history
diff --git
a/drivers/gpu/drm/i915/i915_gem_shrinker.c
b/drivers/gpu/drm/i915/i915_gem_shrinker.c
index b409e67c5c72bb4ce70fd6be2008b9a7b886b704..0fd2b58ce47517b0ea82d754d0cbded57a8e98f5 100644
(file)
--- a/
drivers/gpu/drm/i915/i915_gem_shrinker.c
+++ b/
drivers/gpu/drm/i915/i915_gem_shrinker.c
@@
-65,9
+65,17
@@
static bool any_vma_pinned(struct drm_i915_gem_object *obj)
{
struct i915_vma *vma;
- list_for_each_entry(vma, &obj->vma_list, obj_link)
+ list_for_each_entry(vma, &obj->vma_list, obj_link) {
+ /* Only GGTT vma may be permanently pinned, and are always
+ * at the start of the list. We can stop hunting as soon
+ * as we see a ppGTT vma.
+ */
+ if (!i915_vma_is_ggtt(vma))
+ break;
+
if (i915_vma_is_pinned(vma))
return true;
+ }
return false;
}