static int
_tdm_exynos_pp_make_new_tasks(tdm_exynos_pp_data *pp_data)
{
- tdm_exynos_pp_buffer *main_buffer = NULL, *b = NULL, *bb = NULL;
+ tdm_exynos_pp_buffer *b = NULL, *bb = NULL;
tdm_exynos_pp_task *new_task = NULL;
int i;
if (LIST_IS_EMPTY(&pp_data->pending_buffer_list)) {
return 0;
}
LIST_FOR_EACH_ENTRY_SAFE(b, bb, &pp_data->pending_buffer_list, link) {
- main_buffer = b;
if ((new_task = calloc(1, sizeof(tdm_exynos_pp_task))) == NULL) {
TDM_BACKEND_ERR("Out of memory");
return -1;
new_task->current_step = 0;
new_task->done_func = pp_data->done_func;
new_task->done_user_data = pp_data->done_user_data;
- tbm_surface_internal_ref(main_buffer->src);
- new_task->buffers[0].src = main_buffer->src;
- tbm_surface_internal_ref(main_buffer->dst);
- new_task->buffers[new_task->max_step-1].dst = main_buffer->dst;
+ tbm_surface_internal_ref(b->src);
+ new_task->buffers[0].src = b->src;
+ tbm_surface_internal_ref(b->dst);
+ new_task->buffers[new_task->max_step-1].dst = b->dst;
#if 0
if (new_task->max_step > 1) {
tbm_surface_info_s src_buf_info;
tbm_surface_info_s dst_buf_info;
- tbm_surface_get_info(main_buffer->src, &src_buf_info);
- tbm_surface_get_info(main_buffer->dst, &dst_buf_info);
+ tbm_surface_get_info(b->src, &src_buf_info);
+ tbm_surface_get_info(b->dst, &dst_buf_info);
unsigned int max_width = (src_buf_info.width > dst_buf_info.width) ? src_buf_info.width : dst_buf_info.width;
unsigned int max_height = (src_buf_info.height > dst_buf_info.height) ? src_buf_info.height : dst_buf_info.height;
tbm_format temp_buf_fmt = dst_buf_info.format;
new_task->buffers[i].src = new_task->buffers[i-1].dst;
}
LIST_ADDTAIL(&new_task->link, &pp_data->pending_tasks_list);
- TDM_BACKEND_DBG("pp %p(%d). Add new src %p dst %p buffer", pp_data, pp_data->stamp, main_buffer->src, main_buffer->dst);
+ TDM_BACKEND_DBG("pp %p(%d). Add new src %p dst %p buffer", pp_data, pp_data->stamp, b->src, b->dst);
TDM_BACKEND_DBG("To New task %p(%d)", new_task, new_task->stamp);
- free(main_buffer);
- main_buffer = NULL;
+ free(b);
}
return 1;
}