aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/vc4/vc4_gem.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/vc4/vc4_gem.c')
-rw-r--r--drivers/gpu/drm/vc4/vc4_gem.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c
index 6155e8aca1c6..b262c5c26f10 100644
--- a/drivers/gpu/drm/vc4/vc4_gem.c
+++ b/drivers/gpu/drm/vc4/vc4_gem.c
@@ -534,8 +534,8 @@ vc4_cl_lookup_bos(struct drm_device *dev,
534 return -EINVAL; 534 return -EINVAL;
535 } 535 }
536 536
537 exec->bo = kcalloc(exec->bo_count, sizeof(struct drm_gem_cma_object *), 537 exec->bo = drm_calloc_large(exec->bo_count,
538 GFP_KERNEL); 538 sizeof(struct drm_gem_cma_object *));
539 if (!exec->bo) { 539 if (!exec->bo) {
540 DRM_ERROR("Failed to allocate validated BO pointers\n"); 540 DRM_ERROR("Failed to allocate validated BO pointers\n");
541 return -ENOMEM; 541 return -ENOMEM;
@@ -572,8 +572,8 @@ vc4_cl_lookup_bos(struct drm_device *dev,
572 spin_unlock(&file_priv->table_lock); 572 spin_unlock(&file_priv->table_lock);
573 573
574fail: 574fail:
575 kfree(handles); 575 drm_free_large(handles);
576 return 0; 576 return ret;
577} 577}
578 578
579static int 579static int
@@ -608,7 +608,7 @@ vc4_get_bcl(struct drm_device *dev, struct vc4_exec_info *exec)
608 * read the contents back for validation, and I think the 608 * read the contents back for validation, and I think the
609 * bo->vaddr is uncached access. 609 * bo->vaddr is uncached access.
610 */ 610 */
611 temp = kmalloc(temp_size, GFP_KERNEL); 611 temp = drm_malloc_ab(temp_size, 1);
612 if (!temp) { 612 if (!temp) {
613 DRM_ERROR("Failed to allocate storage for copying " 613 DRM_ERROR("Failed to allocate storage for copying "
614 "in bin/render CLs.\n"); 614 "in bin/render CLs.\n");
@@ -675,7 +675,7 @@ vc4_get_bcl(struct drm_device *dev, struct vc4_exec_info *exec)
675 ret = vc4_validate_shader_recs(dev, exec); 675 ret = vc4_validate_shader_recs(dev, exec);
676 676
677fail: 677fail:
678 kfree(temp); 678 drm_free_large(temp);
679 return ret; 679 return ret;
680} 680}
681 681
@@ -688,7 +688,7 @@ vc4_complete_exec(struct drm_device *dev, struct vc4_exec_info *exec)
688 if (exec->bo) { 688 if (exec->bo) {
689 for (i = 0; i < exec->bo_count; i++) 689 for (i = 0; i < exec->bo_count; i++)
690 drm_gem_object_unreference_unlocked(&exec->bo[i]->base); 690 drm_gem_object_unreference_unlocked(&exec->bo[i]->base);
691 kfree(exec->bo); 691 drm_free_large(exec->bo);
692 } 692 }
693 693
694 while (!list_empty(&exec->unref_list)) { 694 while (!list_empty(&exec->unref_list)) {
@@ -942,8 +942,8 @@ vc4_gem_destroy(struct drm_device *dev)
942 vc4->overflow_mem = NULL; 942 vc4->overflow_mem = NULL;
943 } 943 }
944 944
945 vc4_bo_cache_destroy(dev);
946
947 if (vc4->hang_state) 945 if (vc4->hang_state)
948 vc4_free_hang_state(dev, vc4->hang_state); 946 vc4_free_hang_state(dev, vc4->hang_state);
947
948 vc4_bo_cache_destroy(dev);
949} 949}