mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-05-24 10:39:52 +00:00
drm/vc4: Use drm_malloc_ab to fix large rendering jobs.
If you exceeded the size that kmalloc would return, you'd get a dmesg warning and a return from the job submit. We can handle much allocations with vmalloc, and drm_malloc_ab makes that decision. Fixes failure in piglit's scissor-many. Signed-off-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
parent
d5fb46e0e3
commit
ece7267dcc
1 changed files with 5 additions and 5 deletions
|
@ -534,8 +534,8 @@ vc4_cl_lookup_bos(struct drm_device *dev,
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
exec->bo = kcalloc(exec->bo_count, sizeof(struct drm_gem_cma_object *),
|
exec->bo = drm_calloc_large(exec->bo_count,
|
||||||
GFP_KERNEL);
|
sizeof(struct drm_gem_cma_object *));
|
||||||
if (!exec->bo) {
|
if (!exec->bo) {
|
||||||
DRM_ERROR("Failed to allocate validated BO pointers\n");
|
DRM_ERROR("Failed to allocate validated BO pointers\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
@ -608,7 +608,7 @@ vc4_get_bcl(struct drm_device *dev, struct vc4_exec_info *exec)
|
||||||
* read the contents back for validation, and I think the
|
* read the contents back for validation, and I think the
|
||||||
* bo->vaddr is uncached access.
|
* bo->vaddr is uncached access.
|
||||||
*/
|
*/
|
||||||
temp = kmalloc(temp_size, GFP_KERNEL);
|
temp = drm_malloc_ab(temp_size, 1);
|
||||||
if (!temp) {
|
if (!temp) {
|
||||||
DRM_ERROR("Failed to allocate storage for copying "
|
DRM_ERROR("Failed to allocate storage for copying "
|
||||||
"in bin/render CLs.\n");
|
"in bin/render CLs.\n");
|
||||||
|
@ -675,7 +675,7 @@ vc4_get_bcl(struct drm_device *dev, struct vc4_exec_info *exec)
|
||||||
ret = vc4_validate_shader_recs(dev, exec);
|
ret = vc4_validate_shader_recs(dev, exec);
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
kfree(temp);
|
drm_free_large(temp);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -688,7 +688,7 @@ vc4_complete_exec(struct drm_device *dev, struct vc4_exec_info *exec)
|
||||||
if (exec->bo) {
|
if (exec->bo) {
|
||||||
for (i = 0; i < exec->bo_count; i++)
|
for (i = 0; i < exec->bo_count; i++)
|
||||||
drm_gem_object_unreference_unlocked(&exec->bo[i]->base);
|
drm_gem_object_unreference_unlocked(&exec->bo[i]->base);
|
||||||
kfree(exec->bo);
|
drm_free_large(exec->bo);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!list_empty(&exec->unref_list)) {
|
while (!list_empty(&exec->unref_list)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue