diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2010-11-05 15:24:53 -0400 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-11-23 15:14:45 -0500 |
commit | 93a37f20eabeea4039130527b07453038c07f471 (patch) | |
tree | edea203d4753ba92bb07edc796d29a4645105ba0 /drivers/gpu/drm/i915/i915_gem.c | |
parent | f050a8abbda0efcd597c6b1825e3b9ce4d613383 (diff) |
drm/i915: track objects in the gtt
This is required to restore gtt mappings on resume when agp is gone.
The right way to do this would be to make sturct drm_mm_node embeddable
and use the allocation list maintained by the drm memory manager. But
that's a bigger project. Getting rid of the per bo agp_mem will save
more memory than this wastes, anyway.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index b663d2da1db3..07e1b25f4a8a 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -95,6 +95,7 @@ static void i915_gem_info_add_gtt(struct drm_i915_private *dev_priv, | |||
95 | min_t(size_t, obj->gtt_space->size, | 95 | min_t(size_t, obj->gtt_space->size, |
96 | dev_priv->mm.gtt_mappable_end - obj->gtt_offset); | 96 | dev_priv->mm.gtt_mappable_end - obj->gtt_offset); |
97 | } | 97 | } |
98 | list_add_tail(&obj->gtt_list, &dev_priv->mm.gtt_list); | ||
98 | } | 99 | } |
99 | 100 | ||
100 | static void i915_gem_info_remove_gtt(struct drm_i915_private *dev_priv, | 101 | static void i915_gem_info_remove_gtt(struct drm_i915_private *dev_priv, |
@@ -107,6 +108,7 @@ static void i915_gem_info_remove_gtt(struct drm_i915_private *dev_priv, | |||
107 | min_t(size_t, obj->gtt_space->size, | 108 | min_t(size_t, obj->gtt_space->size, |
108 | dev_priv->mm.gtt_mappable_end - obj->gtt_offset); | 109 | dev_priv->mm.gtt_mappable_end - obj->gtt_offset); |
109 | } | 110 | } |
111 | list_del_init(&obj->gtt_list); | ||
110 | } | 112 | } |
111 | 113 | ||
112 | /** | 114 | /** |
@@ -4604,6 +4606,7 @@ struct drm_gem_object * i915_gem_alloc_object(struct drm_device *dev, | |||
4604 | obj->base.driver_private = NULL; | 4606 | obj->base.driver_private = NULL; |
4605 | obj->fence_reg = I915_FENCE_REG_NONE; | 4607 | obj->fence_reg = I915_FENCE_REG_NONE; |
4606 | INIT_LIST_HEAD(&obj->mm_list); | 4608 | INIT_LIST_HEAD(&obj->mm_list); |
4609 | INIT_LIST_HEAD(&obj->gtt_list); | ||
4607 | INIT_LIST_HEAD(&obj->ring_list); | 4610 | INIT_LIST_HEAD(&obj->ring_list); |
4608 | INIT_LIST_HEAD(&obj->gpu_write_list); | 4611 | INIT_LIST_HEAD(&obj->gpu_write_list); |
4609 | obj->madv = I915_MADV_WILLNEED; | 4612 | obj->madv = I915_MADV_WILLNEED; |
@@ -4916,6 +4919,7 @@ i915_gem_load(struct drm_device *dev) | |||
4916 | INIT_LIST_HEAD(&dev_priv->mm.pinned_list); | 4919 | INIT_LIST_HEAD(&dev_priv->mm.pinned_list); |
4917 | INIT_LIST_HEAD(&dev_priv->mm.fence_list); | 4920 | INIT_LIST_HEAD(&dev_priv->mm.fence_list); |
4918 | INIT_LIST_HEAD(&dev_priv->mm.deferred_free_list); | 4921 | INIT_LIST_HEAD(&dev_priv->mm.deferred_free_list); |
4922 | INIT_LIST_HEAD(&dev_priv->mm.gtt_list); | ||
4919 | init_ring_lists(&dev_priv->render_ring); | 4923 | init_ring_lists(&dev_priv->render_ring); |
4920 | init_ring_lists(&dev_priv->bsd_ring); | 4924 | init_ring_lists(&dev_priv->bsd_ring); |
4921 | init_ring_lists(&dev_priv->blt_ring); | 4925 | init_ring_lists(&dev_priv->blt_ring); |