Commit 432e58ed authored by Chris Wilson's avatar Chris Wilson

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: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent 54cf91dc
...@@ -712,8 +712,8 @@ struct drm_i915_gem_object { ...@@ -712,8 +712,8 @@ struct drm_i915_gem_object {
struct list_head mm_list; struct list_head mm_list;
/** This object's place on GPU write list */ /** This object's place on GPU write list */
struct list_head gpu_write_list; struct list_head gpu_write_list;
/** This object's place on eviction list */ /** This object's place in the batchbuffer or on the eviction list */
struct list_head evict_list; struct list_head exec_list;
/** /**
* This is set if the object is on the active or flushing lists * This is set if the object is on the active or flushing lists
...@@ -737,12 +737,6 @@ struct drm_i915_gem_object { ...@@ -737,12 +737,6 @@ struct drm_i915_gem_object {
*/ */
signed int fence_reg : 5; signed int fence_reg : 5;
/**
* Used for checking the object doesn't appear more than once
* in an execbuffer object list.
*/
unsigned int in_execbuffer : 1;
/** /**
* Advice: are the backing pages purgeable? * Advice: are the backing pages purgeable?
*/ */
......
...@@ -3399,6 +3399,7 @@ struct drm_i915_gem_object *i915_gem_alloc_object(struct drm_device *dev, ...@@ -3399,6 +3399,7 @@ struct drm_i915_gem_object *i915_gem_alloc_object(struct drm_device *dev,
INIT_LIST_HEAD(&obj->mm_list); INIT_LIST_HEAD(&obj->mm_list);
INIT_LIST_HEAD(&obj->gtt_list); INIT_LIST_HEAD(&obj->gtt_list);
INIT_LIST_HEAD(&obj->ring_list); INIT_LIST_HEAD(&obj->ring_list);
INIT_LIST_HEAD(&obj->exec_list);
INIT_LIST_HEAD(&obj->gpu_write_list); INIT_LIST_HEAD(&obj->gpu_write_list);
obj->madv = I915_MADV_WILLNEED; obj->madv = I915_MADV_WILLNEED;
/* Avoid an unnecessary call to unbind on the first bind. */ /* Avoid an unnecessary call to unbind on the first bind. */
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
static bool static bool
mark_free(struct drm_i915_gem_object *obj, struct list_head *unwind) mark_free(struct drm_i915_gem_object *obj, struct list_head *unwind)
{ {
list_add(&obj->evict_list, unwind); list_add(&obj->exec_list, unwind);
drm_gem_object_reference(&obj->base); drm_gem_object_reference(&obj->base);
return drm_mm_scan_add_block(obj->gtt_space); return drm_mm_scan_add_block(obj->gtt_space);
} }
...@@ -127,7 +127,7 @@ i915_gem_evict_something(struct drm_device *dev, int min_size, ...@@ -127,7 +127,7 @@ i915_gem_evict_something(struct drm_device *dev, int min_size,
} }
/* Nothing found, clean up and bail out! */ /* Nothing found, clean up and bail out! */
list_for_each_entry(obj, &unwind_list, evict_list) { list_for_each_entry(obj, &unwind_list, exec_list) {
ret = drm_mm_scan_remove_block(obj->gtt_space); ret = drm_mm_scan_remove_block(obj->gtt_space);
BUG_ON(ret); BUG_ON(ret);
drm_gem_object_unreference(&obj->base); drm_gem_object_unreference(&obj->base);
...@@ -146,12 +146,12 @@ i915_gem_evict_something(struct drm_device *dev, int min_size, ...@@ -146,12 +146,12 @@ i915_gem_evict_something(struct drm_device *dev, int min_size,
while (!list_empty(&unwind_list)) { while (!list_empty(&unwind_list)) {
obj = list_first_entry(&unwind_list, obj = list_first_entry(&unwind_list,
struct drm_i915_gem_object, struct drm_i915_gem_object,
evict_list); exec_list);
if (drm_mm_scan_remove_block(obj->gtt_space)) { if (drm_mm_scan_remove_block(obj->gtt_space)) {
list_move(&obj->evict_list, &eviction_list); list_move(&obj->exec_list, &eviction_list);
continue; continue;
} }
list_del(&obj->evict_list); list_del_init(&obj->exec_list);
drm_gem_object_unreference(&obj->base); drm_gem_object_unreference(&obj->base);
} }
...@@ -159,10 +159,10 @@ i915_gem_evict_something(struct drm_device *dev, int min_size, ...@@ -159,10 +159,10 @@ i915_gem_evict_something(struct drm_device *dev, int min_size,
while (!list_empty(&eviction_list)) { while (!list_empty(&eviction_list)) {
obj = list_first_entry(&eviction_list, obj = list_first_entry(&eviction_list,
struct drm_i915_gem_object, struct drm_i915_gem_object,
evict_list); exec_list);
if (ret == 0) if (ret == 0)
ret = i915_gem_object_unbind(obj); ret = i915_gem_object_unbind(obj);
list_del(&obj->evict_list); list_del_init(&obj->exec_list);
drm_gem_object_unreference(&obj->base); drm_gem_object_unreference(&obj->base);
} }
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment