31 #include <drm/i915_drm.h>
47 bool mappable,
bool nonblocking)
50 struct list_head eviction_list, unwind_list;
54 trace_i915_gem_evict(dev, min_size, alignment, mappable);
79 INIT_LIST_HEAD(&unwind_list);
82 min_size, alignment, cache_level,
83 0, dev_priv->
mm.gtt_mappable_end);
86 min_size, alignment, cache_level);
90 if (mark_free(obj, &unwind_list))
99 if (mark_free(obj, &unwind_list))
105 while (!list_empty(&unwind_list)) {
125 INIT_LIST_HEAD(&eviction_list);
126 while (!list_empty(&unwind_list)) {
131 list_move(&obj->
exec_list, &eviction_list);
132 drm_gem_object_reference(&obj->
base);
139 while (!list_empty(&eviction_list)) {
147 drm_gem_object_unreference(&obj->
base);
161 lists_empty = (list_empty(&dev_priv->
mm.inactive_list) &&
162 list_empty(&dev_priv->
mm.active_list));
166 trace_i915_gem_evict_everything(dev);