aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem_evict.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2013-08-29 19:47:41 -0400
committerDave Airlie <airlied@redhat.com>2013-08-29 19:47:41 -0400
commitefa27f9cec09518c9b574e3ab4a0a41717237429 (patch)
tree28d04d8a8fecb67ba81c8fecd488e584ed121929 /drivers/gpu/drm/i915/i915_gem_evict.c
parent62f2104f3fc11c4cfd1307429cb955bfa48dcb37 (diff)
parentfb1ae911f4e58c2cf28fcd48b59f54d17283da07 (diff)
Merge tag 'drm-intel-next-2013-08-23' of git://people.freedesktop.org/~danvet/drm-intel into drm-next
Need to get my stuff out the door ;-) Highlights: - pc8+ support from Paulo - more vma patches from Ben. - Kconfig option to enable preliminary support by default (Josh Triplett) - Optimized cpu cache flush handling and support for write-through caching of display planes on Iris (Chris) - rc6 tuning from Stéphane Marchesin for more stability - VECS seqno wrap/semaphores fix (Ben) - a pile of smaller cleanups and improvements all over Note that I've ditched Ben's execbuf vma conversion for 3.12 since not yet ready. But there's still other vma conversion stuff in here. * tag 'drm-intel-next-2013-08-23' of git://people.freedesktop.org/~danvet/drm-intel: (62 commits) drm/i915: Print seqnos as unsigned in debugfs drm/i915: Fix context size calculation on SNB/IVB/VLV drm/i915: Use POSTING_READ in lcpll code drm/i915: enable Package C8+ by default drm/i915: add i915.pc8_timeout function drm/i915: add i915_pc8_status debugfs file drm/i915: allow package C8+ states on Haswell (disabled) drm/i915: fix SDEIMR assertion when disabling LCPLL drm/i915: grab force_wake when restoring LCPLL drm/i915: drop WaMbcDriverBootEnable workaround drm/i915: Cleaning up the relocate entry function drm/i915: merge HSW and SNB PM irq handlers drm/i915: fix how we mask PMIMR when adding work to the queue drm/i915: don't queue PM events we won't process drm/i915: don't disable/reenable IVB error interrupts when not needed drm/i915: add dev_priv->pm_irq_mask drm/i915: don't update GEN6_PMIMR when it's not needed drm/i915: wrap GEN6_PMIMR changes drm/i915: wrap GTIMR changes drm/i915: add the FCLK case to intel_ddi_get_cdclk_freq ...
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_evict.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_evict.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_evict.c b/drivers/gpu/drm/i915/i915_gem_evict.c
index 425939b7d343..91b700155850 100644
--- a/drivers/gpu/drm/i915/i915_gem_evict.c
+++ b/drivers/gpu/drm/i915/i915_gem_evict.c
@@ -37,7 +37,7 @@ mark_free(struct i915_vma *vma, struct list_head *unwind)
37 if (vma->obj->pin_count) 37 if (vma->obj->pin_count)
38 return false; 38 return false;
39 39
40 list_add(&vma->obj->exec_list, unwind); 40 list_add(&vma->exec_list, unwind);
41 return drm_mm_scan_add_block(&vma->node); 41 return drm_mm_scan_add_block(&vma->node);
42} 42}
43 43
@@ -49,7 +49,6 @@ i915_gem_evict_something(struct drm_device *dev, struct i915_address_space *vm,
49 drm_i915_private_t *dev_priv = dev->dev_private; 49 drm_i915_private_t *dev_priv = dev->dev_private;
50 struct list_head eviction_list, unwind_list; 50 struct list_head eviction_list, unwind_list;
51 struct i915_vma *vma; 51 struct i915_vma *vma;
52 struct drm_i915_gem_object *obj;
53 int ret = 0; 52 int ret = 0;
54 53
55 trace_i915_gem_evict(dev, min_size, alignment, mappable); 54 trace_i915_gem_evict(dev, min_size, alignment, mappable);
@@ -104,14 +103,13 @@ i915_gem_evict_something(struct drm_device *dev, struct i915_address_space *vm,
104none: 103none:
105 /* Nothing found, clean up and bail out! */ 104 /* Nothing found, clean up and bail out! */
106 while (!list_empty(&unwind_list)) { 105 while (!list_empty(&unwind_list)) {
107 obj = list_first_entry(&unwind_list, 106 vma = list_first_entry(&unwind_list,
108 struct drm_i915_gem_object, 107 struct i915_vma,
109 exec_list); 108 exec_list);
110 vma = i915_gem_obj_to_vma(obj, vm);
111 ret = drm_mm_scan_remove_block(&vma->node); 109 ret = drm_mm_scan_remove_block(&vma->node);
112 BUG_ON(ret); 110 BUG_ON(ret);
113 111
114 list_del_init(&obj->exec_list); 112 list_del_init(&vma->exec_list);
115 } 113 }
116 114
117 /* We expect the caller to unpin, evict all and try again, or give up. 115 /* We expect the caller to unpin, evict all and try again, or give up.
@@ -125,28 +123,30 @@ found:
125 * temporary list. */ 123 * temporary list. */
126 INIT_LIST_HEAD(&eviction_list); 124 INIT_LIST_HEAD(&eviction_list);
127 while (!list_empty(&unwind_list)) { 125 while (!list_empty(&unwind_list)) {
128 obj = list_first_entry(&unwind_list, 126 vma = list_first_entry(&unwind_list,
129 struct drm_i915_gem_object, 127 struct i915_vma,
130 exec_list); 128 exec_list);
131 vma = i915_gem_obj_to_vma(obj, vm);
132 if (drm_mm_scan_remove_block(&vma->node)) { 129 if (drm_mm_scan_remove_block(&vma->node)) {
133 list_move(&obj->exec_list, &eviction_list); 130 list_move(&vma->exec_list, &eviction_list);
134 drm_gem_object_reference(&obj->base); 131 drm_gem_object_reference(&vma->obj->base);
135 continue; 132 continue;
136 } 133 }
137 list_del_init(&obj->exec_list); 134 list_del_init(&vma->exec_list);
138 } 135 }
139 136
140 /* Unbinding will emit any required flushes */ 137 /* Unbinding will emit any required flushes */
141 while (!list_empty(&eviction_list)) { 138 while (!list_empty(&eviction_list)) {
142 obj = list_first_entry(&eviction_list, 139 struct drm_gem_object *obj;
143 struct drm_i915_gem_object, 140 vma = list_first_entry(&eviction_list,
141 struct i915_vma,
144 exec_list); 142 exec_list);
143
144 obj = &vma->obj->base;
145 list_del_init(&vma->exec_list);
145 if (ret == 0) 146 if (ret == 0)
146 ret = i915_vma_unbind(i915_gem_obj_to_vma(obj, vm)); 147 ret = i915_vma_unbind(vma);
147 148
148 list_del_init(&obj->exec_list); 149 drm_gem_object_unreference(obj);
149 drm_gem_object_unreference(&obj->base);
150 } 150 }
151 151
152 return ret; 152 return ret;