summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/ttm/ttm_bo_util.c
diff options
context:
space:
mode:
authorJerome Glisse <jglisse@redhat.com>2011-11-11 15:42:57 -0500
committerDave Airlie <airlied@redhat.com>2011-12-06 10:40:11 +0000
commit57de4ba959b290f0b8cf36ecd5e7f1b29d4b8a12 (patch)
tree8063f4dfaf1a22bf8cf7a5f0410d4e4929b250ec /drivers/gpu/drm/ttm/ttm_bo_util.c
parent8e7e70522d760c4ccd4cd370ebfa0ba69e006c6e (diff)
downloadop-kernel-dev-57de4ba959b290f0b8cf36ecd5e7f1b29d4b8a12.zip
op-kernel-dev-57de4ba959b290f0b8cf36ecd5e7f1b29d4b8a12.tar.gz
drm/ttm: simplify memory accounting for ttm user v2
Provide helper function to compute the kernel memory size needed for each buffer object. Move all the accounting inside ttm, simplifying driver and avoiding code duplication accross them. v2 fix accounting of ghost object, one would have thought that i would have run into the issue since a longtime but it seems ghost object are rare when you have plenty of vram ;) Signed-off-by: Jerome Glisse <jglisse@redhat.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_bo_util.c')
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo_util.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
index 60f204d..f8187ea 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
@@ -445,6 +445,7 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo,
kref_init(&fbo->list_kref);
kref_init(&fbo->kref);
fbo->destroy = &ttm_transfered_destroy;
+ fbo->acc_size = 0;
*new_obj = fbo;
return 0;
OpenPOWER on IntegriCloud