diff options
author | Eric Anholt <eric@anholt.net> | 2008-05-20 10:48:36 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2008-05-20 10:52:39 -0700 |
commit | 6c3ac484b049681f9f3e692f9a6238ed122a8191 (patch) | |
tree | 5cbe0ca9b9bc234ef7a0fa503d312ff5d0d6fad6 /shared-core | |
parent | 7dced2f33a952ad12aafb7a3e34747156020a3ae (diff) |
[gem] Clean up active/inactive list handling using helper functions.
Additionally, a boolean active field is added to indicate which list an
object is on, rather than smashing last_rendering_cookie to 0 to show
inactive. This will help with flush-reduction later on, and makes the code
clearer.
Diffstat (limited to 'shared-core')
-rw-r--r-- | shared-core/i915_drv.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/shared-core/i915_drv.h b/shared-core/i915_drv.h index 296e1823..870726c5 100644 --- a/shared-core/i915_drv.h +++ b/shared-core/i915_drv.h @@ -247,9 +247,18 @@ typedef struct drm_i915_private { /** * List of objects currently involved in rendering from the * ringbuffer. + * + * A reference is held on the buffer while on this list. */ struct list_head active_list; - /** LRU List of non-executing objects still in the GTT. */ + /** + * LRU List of non-executing objects still in the GTT. + * There may still be dirty cachelines that need to be flushed + * before unbind. + * A reference is not held on the buffer while on this list, + * as merely being GTT-bound shouldn't prevent its being + * freed, and we'll pull it off the list in the free path. + */ struct list_head inactive_list; } mm; } drm_i915_private_t; @@ -271,6 +280,13 @@ struct drm_i915_gem_object { /** This object's place on the active or inactive lists */ struct list_head list; + /** + * This is set if the object is on the active list + * (has pending rendering), and is not set if it's on inactive (ready + * to be unbound). + */ + int active; + /** AGP memory structure for our GTT binding. */ DRM_AGP_MEM *agp_mem; |