diff options
author | Christian König <christian.koenig@amd.com> | 2014-05-28 10:24:17 (GMT) |
---|---|---|
committer | Christian König <christian.koenig@amd.com> | 2014-05-30 12:21:54 (GMT) |
commit | 7d95f6cc4ef73572a43d4a0a1907a13ace17a62a (patch) | |
tree | e2e38cde53fa04ccde07ebdb59d71236c060a96b | |
parent | ec65da385d46f63740c1c9230b891a6dcbd64c71 (diff) | |
download | linux-7d95f6cc4ef73572a43d4a0a1907a13ace17a62a.tar.xz |
drm/radeon: only allocate necessary size for vm bo list
No need to always allocate the theoretical maximum here.
Signed-off-by: Christian König <christian.koenig@amd.com>
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_vm.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_vm.c b/drivers/gpu/drm/radeon/radeon_vm.c index d9ab99f..1f42669 100644 --- a/drivers/gpu/drm/radeon/radeon_vm.c +++ b/drivers/gpu/drm/radeon/radeon_vm.c @@ -130,10 +130,10 @@ struct radeon_cs_reloc *radeon_vm_get_bos(struct radeon_device *rdev, struct list_head *head) { struct radeon_cs_reloc *list; - unsigned i, idx, size; + unsigned i, idx; - size = (radeon_vm_num_pdes(rdev) + 1) * sizeof(struct radeon_cs_reloc); - list = kmalloc(size, GFP_KERNEL); + list = kmalloc_array(vm->max_pde_used + 1, + sizeof(struct radeon_cs_reloc), GFP_KERNEL); if (!list) return NULL; |