diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2009-08-17 10:28:39 -0400 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2009-08-19 02:09:53 -0400 |
commit | 5fd9cbad3a4ae82c83c55b9c621d156c326724ef (patch) | |
tree | 1a0868a3bd2751fa861c083aeb3ac27f3f695694 /drivers/gpu/drm/ttm/ttm_bo.c | |
parent | e9840be8c23601285a70520b4898818f28ce8c2b (diff) |
drm/ttm: Memory accounting rework.
Use inclusive zones to simplify accounting and its sysfs representation.
Use DMA32 accounting where applicable.
Add a sysfs interface to make the heuristically determined limits
readable and configurable.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_bo.c')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index c1c407f7cca3..f16909ceec93 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c | |||
@@ -70,7 +70,7 @@ static void ttm_bo_release_list(struct kref *list_kref) | |||
70 | if (bo->destroy) | 70 | if (bo->destroy) |
71 | bo->destroy(bo); | 71 | bo->destroy(bo); |
72 | else { | 72 | else { |
73 | ttm_mem_global_free(bdev->mem_glob, bo->acc_size, false); | 73 | ttm_mem_global_free(bdev->mem_glob, bo->acc_size); |
74 | kfree(bo); | 74 | kfree(bo); |
75 | } | 75 | } |
76 | } | 76 | } |
@@ -1065,14 +1065,14 @@ int ttm_buffer_object_create(struct ttm_bo_device *bdev, | |||
1065 | 1065 | ||
1066 | size_t acc_size = | 1066 | size_t acc_size = |
1067 | ttm_bo_size(bdev, (size + PAGE_SIZE - 1) >> PAGE_SHIFT); | 1067 | ttm_bo_size(bdev, (size + PAGE_SIZE - 1) >> PAGE_SHIFT); |
1068 | ret = ttm_mem_global_alloc(mem_glob, acc_size, false, false, false); | 1068 | ret = ttm_mem_global_alloc(mem_glob, acc_size, false, false); |
1069 | if (unlikely(ret != 0)) | 1069 | if (unlikely(ret != 0)) |
1070 | return ret; | 1070 | return ret; |
1071 | 1071 | ||
1072 | bo = kzalloc(sizeof(*bo), GFP_KERNEL); | 1072 | bo = kzalloc(sizeof(*bo), GFP_KERNEL); |
1073 | 1073 | ||
1074 | if (unlikely(bo == NULL)) { | 1074 | if (unlikely(bo == NULL)) { |
1075 | ttm_mem_global_free(mem_glob, acc_size, false); | 1075 | ttm_mem_global_free(mem_glob, acc_size); |
1076 | return -ENOMEM; | 1076 | return -ENOMEM; |
1077 | } | 1077 | } |
1078 | 1078 | ||