From 6c3ac484b049681f9f3e692f9a6238ed122a8191 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 20 May 2008 10:48:36 -0700 Subject: [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. --- shared-core/i915_drv.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'shared-core') 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; -- cgit v1.2.3