aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-06-17 16:52:49 -0400
committerEric Anholt <eric@anholt.net>2009-06-17 18:26:24 -0400
commitd78b47b9a527bf46cb6081555847facd6efd5f81 (patch)
treedee4127eda7743ee2370057394418e6a2d742a2d /drivers/gpu
parent76cff81ad1cfa3bd8b52b5e4510702ce2ed28335 (diff)
drm/i915: detach/attach get/put pages symmetry
After performing an operation over the page list for a buffer retrieved by i915_gem_object_get_pages() the pages need to be returned with i915_gem_object_put_pages(). This was not being observed for the phys objects which were thus leaking references to their backing pages. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> CC: Dave Airlie <airlied@gmail.com> Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c4
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 c0ae6bbbd9b5..a5f95ad3c072 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -4312,6 +4312,8 @@ void i915_gem_detach_phys_object(struct drm_device *dev,
4312 } 4312 }
4313 drm_clflush_pages(obj_priv->pages, page_count); 4313 drm_clflush_pages(obj_priv->pages, page_count);
4314 drm_agp_chipset_flush(dev); 4314 drm_agp_chipset_flush(dev);
4315
4316 i915_gem_object_put_pages(obj);
4315out: 4317out:
4316 obj_priv->phys_obj->cur_obj = NULL; 4318 obj_priv->phys_obj->cur_obj = NULL;
4317 obj_priv->phys_obj = NULL; 4319 obj_priv->phys_obj = NULL;
@@ -4369,6 +4371,8 @@ i915_gem_attach_phys_object(struct drm_device *dev,
4369 kunmap_atomic(src, KM_USER0); 4371 kunmap_atomic(src, KM_USER0);
4370 } 4372 }
4371 4373
4374 i915_gem_object_put_pages(obj);
4375
4372 return 0; 4376 return 0;
4373out: 4377out:
4374 return ret; 4378 return ret;