diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-11-25 14:32:06 -0500 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-11-25 16:19:26 -0500 |
commit | 432e58edc9de1d9c3d6a7b444b3c455b8f209a7d (patch) | |
tree | 8dd0b0edb78ddf1b59e6f8e5cd8939ff6ed961ec /drivers/gpu/drm/i915/i915_gem_evict.c | |
parent | 54cf91dc4e51fd5070a9a2346377493cc38a1ca9 (diff) |
drm/i915: Avoid allocation for execbuffer object list
Besides the minimal improvement in reducing the execbuffer overhead, the
real benefit is clarifying a few routines.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_evict.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_evict.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_evict.c b/drivers/gpu/drm/i915/i915_gem_evict.c index 03e15d37b550..78b8cf90c922 100644 --- a/drivers/gpu/drm/i915/i915_gem_evict.c +++ b/drivers/gpu/drm/i915/i915_gem_evict.c | |||
@@ -34,7 +34,7 @@ | |||
34 | static bool | 34 | static bool |
35 | mark_free(struct drm_i915_gem_object *obj, struct list_head *unwind) | 35 | mark_free(struct drm_i915_gem_object *obj, struct list_head *unwind) |
36 | { | 36 | { |
37 | list_add(&obj->evict_list, unwind); | 37 | list_add(&obj->exec_list, unwind); |
38 | drm_gem_object_reference(&obj->base); | 38 | drm_gem_object_reference(&obj->base); |
39 | return drm_mm_scan_add_block(obj->gtt_space); | 39 | return drm_mm_scan_add_block(obj->gtt_space); |
40 | } | 40 | } |
@@ -127,7 +127,7 @@ i915_gem_evict_something(struct drm_device *dev, int min_size, | |||
127 | } | 127 | } |
128 | 128 | ||
129 | /* Nothing found, clean up and bail out! */ | 129 | /* Nothing found, clean up and bail out! */ |
130 | list_for_each_entry(obj, &unwind_list, evict_list) { | 130 | list_for_each_entry(obj, &unwind_list, exec_list) { |
131 | ret = drm_mm_scan_remove_block(obj->gtt_space); | 131 | ret = drm_mm_scan_remove_block(obj->gtt_space); |
132 | BUG_ON(ret); | 132 | BUG_ON(ret); |
133 | drm_gem_object_unreference(&obj->base); | 133 | drm_gem_object_unreference(&obj->base); |
@@ -146,12 +146,12 @@ found: | |||
146 | while (!list_empty(&unwind_list)) { | 146 | while (!list_empty(&unwind_list)) { |
147 | obj = list_first_entry(&unwind_list, | 147 | obj = list_first_entry(&unwind_list, |
148 | struct drm_i915_gem_object, | 148 | struct drm_i915_gem_object, |
149 | evict_list); | 149 | exec_list); |
150 | if (drm_mm_scan_remove_block(obj->gtt_space)) { | 150 | if (drm_mm_scan_remove_block(obj->gtt_space)) { |
151 | list_move(&obj->evict_list, &eviction_list); | 151 | list_move(&obj->exec_list, &eviction_list); |
152 | continue; | 152 | continue; |
153 | } | 153 | } |
154 | list_del(&obj->evict_list); | 154 | list_del_init(&obj->exec_list); |
155 | drm_gem_object_unreference(&obj->base); | 155 | drm_gem_object_unreference(&obj->base); |
156 | } | 156 | } |
157 | 157 | ||
@@ -159,10 +159,10 @@ found: | |||
159 | while (!list_empty(&eviction_list)) { | 159 | while (!list_empty(&eviction_list)) { |
160 | obj = list_first_entry(&eviction_list, | 160 | obj = list_first_entry(&eviction_list, |
161 | struct drm_i915_gem_object, | 161 | struct drm_i915_gem_object, |
162 | evict_list); | 162 | exec_list); |
163 | if (ret == 0) | 163 | if (ret == 0) |
164 | ret = i915_gem_object_unbind(obj); | 164 | ret = i915_gem_object_unbind(obj); |
165 | list_del(&obj->evict_list); | 165 | list_del_init(&obj->exec_list); |
166 | drm_gem_object_unreference(&obj->base); | 166 | drm_gem_object_unreference(&obj->base); |
167 | } | 167 | } |
168 | 168 | ||