drm/i915: Update less state during modeset.
[deliverable/linux.git] / drivers / gpu / drm / i915 / i915_gem_shrinker.c
index f7929e769250705284b31733acb1311084a35028..f6ecbda2c60475297b36b1da6cff0766fb0fe833 100644 (file)
@@ -184,9 +184,12 @@ static int num_vma_bound(struct drm_i915_gem_object *obj)
        struct i915_vma *vma;
        int count = 0;
 
-       list_for_each_entry(vma, &obj->vma_list, vma_link)
+       list_for_each_entry(vma, &obj->vma_list, vma_link) {
                if (drm_mm_node_allocated(&vma->node))
                        count++;
+               if (vma->pin_count)
+                       count++;
+       }
 
        return count;
 }
@@ -210,8 +213,7 @@ i915_gem_shrinker_count(struct shrinker *shrinker, struct shrink_control *sc)
                        count += obj->base.size >> PAGE_SHIFT;
 
        list_for_each_entry(obj, &dev_priv->mm.bound_list, global_list) {
-               if (!i915_gem_obj_is_pinned(obj) &&
-                   obj->pages_pin_count == num_vma_bound(obj))
+               if (obj->pages_pin_count == num_vma_bound(obj))
                        count += obj->base.size >> PAGE_SHIFT;
        }
 
This page took 0.029325 seconds and 5 git commands to generate.