mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-10 03:20:04 +08:00
[vpu_mem_legacy]: buffer group create
1.limit buffer count for create vpu_mem_pool case 2.remove limit buffer print in mpp_buffer_impl Change-Id: I88daa0204d8858e882ac3255ef3a95e0853ae2f2 Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
This commit is contained in:
@@ -246,7 +246,8 @@ MPP_RET mpp_buffer_create(const char *tag, const char *caller,
|
||||
}
|
||||
|
||||
if (group->limit_count && group->buffer_count >= group->limit_count) {
|
||||
mpp_err_f("group %d reach count limit %d\n", group->group_id, group->limit_count);
|
||||
if (group->log_runtime_en)
|
||||
mpp_log_f("group %d reach count limit %d\n", group->group_id, group->limit_count);
|
||||
ret = MPP_NOK;
|
||||
goto RET;
|
||||
}
|
||||
|
@@ -134,11 +134,12 @@ void close_vpu_memory_pool(vpu_display_mem_pool *p)
|
||||
|
||||
int create_vpu_memory_pool_allocator(vpu_display_mem_pool **ipool, int num, int size)
|
||||
{
|
||||
|
||||
vpu_display_mem_pool_impl *p_mempool = mpp_calloc(vpu_display_mem_pool_impl, 1);
|
||||
if (NULL == p_mempool) {
|
||||
return -1;
|
||||
}
|
||||
mpp_buffer_group_get_internal(&p_mempool->group, MPP_BUFFER_TYPE_ION);
|
||||
mpp_buffer_group_limit_config(p_mempool->group, size, num + 4);
|
||||
p_mempool->commit_hdl = commit_memory_handle;
|
||||
p_mempool->get_free = get_free_memory_vpumem;
|
||||
p_mempool->put_used = put_used_memory_handle;
|
||||
@@ -149,8 +150,6 @@ int create_vpu_memory_pool_allocator(vpu_display_mem_pool **ipool, int num, int
|
||||
p_mempool->buff_size = size;
|
||||
p_mempool->size = size;
|
||||
*ipool = (vpu_display_mem_pool*)p_mempool;
|
||||
|
||||
(void)num;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -160,7 +159,13 @@ void release_vpu_memory_pool_allocator(vpu_display_mem_pool *ipool)
|
||||
if (p_mempool == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (p_mempool->group) {
|
||||
mpp_buffer_group_put(p_mempool->group);
|
||||
p_mempool->group = NULL;
|
||||
}
|
||||
mpp_free(p_mempool);
|
||||
p_mempool = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user