Commit 1eb04b2e authored by Stanimir Varbanov's avatar Stanimir Varbanov Committed by Mauro Carvalho Chehab

media: venus: helpers: extend set_num_bufs helper with one more argument

Extend venus_helper_set_num_bufs() helper function with one more
argument to set number of output buffers for the secondary decoder
output.
Signed-off-by: default avatarStanimir Varbanov <stanimir.varbanov@linaro.org>
Reviewed-by: default avatarTomasz Figa <tfiga@chromium.org>
Reviewed-by: default avatarAlexandre Courbot <acourbot@chromium.org>
Tested-by: default avatarAlexandre Courbot <acourbot@chromium.org>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 01165b84
...@@ -515,7 +515,8 @@ int venus_helper_set_core_usage(struct venus_inst *inst, u32 usage) ...@@ -515,7 +515,8 @@ int venus_helper_set_core_usage(struct venus_inst *inst, u32 usage)
EXPORT_SYMBOL_GPL(venus_helper_set_core_usage); EXPORT_SYMBOL_GPL(venus_helper_set_core_usage);
int venus_helper_set_num_bufs(struct venus_inst *inst, unsigned int input_bufs, int venus_helper_set_num_bufs(struct venus_inst *inst, unsigned int input_bufs,
unsigned int output_bufs) unsigned int output_bufs,
unsigned int output2_bufs)
{ {
u32 ptype = HFI_PROPERTY_PARAM_BUFFER_COUNT_ACTUAL; u32 ptype = HFI_PROPERTY_PARAM_BUFFER_COUNT_ACTUAL;
struct hfi_buffer_count_actual buf_count; struct hfi_buffer_count_actual buf_count;
...@@ -531,7 +532,18 @@ int venus_helper_set_num_bufs(struct venus_inst *inst, unsigned int input_bufs, ...@@ -531,7 +532,18 @@ int venus_helper_set_num_bufs(struct venus_inst *inst, unsigned int input_bufs,
buf_count.type = HFI_BUFFER_OUTPUT; buf_count.type = HFI_BUFFER_OUTPUT;
buf_count.count_actual = output_bufs; buf_count.count_actual = output_bufs;
return hfi_session_set_property(inst, ptype, &buf_count); ret = hfi_session_set_property(inst, ptype, &buf_count);
if (ret)
return ret;
if (output2_bufs) {
buf_count.type = HFI_BUFFER_OUTPUT2;
buf_count.count_actual = output2_bufs;
ret = hfi_session_set_property(inst, ptype, &buf_count);
}
return ret;
} }
EXPORT_SYMBOL_GPL(venus_helper_set_num_bufs); EXPORT_SYMBOL_GPL(venus_helper_set_num_bufs);
......
...@@ -41,7 +41,8 @@ int venus_helper_set_output_resolution(struct venus_inst *inst, ...@@ -41,7 +41,8 @@ int venus_helper_set_output_resolution(struct venus_inst *inst,
int venus_helper_set_work_mode(struct venus_inst *inst, u32 mode); int venus_helper_set_work_mode(struct venus_inst *inst, u32 mode);
int venus_helper_set_core_usage(struct venus_inst *inst, u32 usage); int venus_helper_set_core_usage(struct venus_inst *inst, u32 usage);
int venus_helper_set_num_bufs(struct venus_inst *inst, unsigned int input_bufs, int venus_helper_set_num_bufs(struct venus_inst *inst, unsigned int input_bufs,
unsigned int output_bufs); unsigned int output_bufs,
unsigned int output2_bufs);
int venus_helper_set_raw_format(struct venus_inst *inst, u32 hfi_format, int venus_helper_set_raw_format(struct venus_inst *inst, u32 hfi_format,
u32 buftype); u32 buftype);
int venus_helper_set_color_format(struct venus_inst *inst, u32 fmt); int venus_helper_set_color_format(struct venus_inst *inst, u32 fmt);
......
...@@ -756,7 +756,7 @@ static int vdec_start_streaming(struct vb2_queue *q, unsigned int count) ...@@ -756,7 +756,7 @@ static int vdec_start_streaming(struct vb2_queue *q, unsigned int count)
goto deinit_sess; goto deinit_sess;
ret = venus_helper_set_num_bufs(inst, inst->num_input_bufs, ret = venus_helper_set_num_bufs(inst, inst->num_input_bufs,
VB2_MAX_FRAME); VB2_MAX_FRAME, VB2_MAX_FRAME);
if (ret) if (ret)
goto deinit_sess; goto deinit_sess;
......
...@@ -961,7 +961,7 @@ static int venc_start_streaming(struct vb2_queue *q, unsigned int count) ...@@ -961,7 +961,7 @@ static int venc_start_streaming(struct vb2_queue *q, unsigned int count)
goto deinit_sess; goto deinit_sess;
ret = venus_helper_set_num_bufs(inst, inst->num_input_bufs, ret = venus_helper_set_num_bufs(inst, inst->num_input_bufs,
inst->num_output_bufs); inst->num_output_bufs, 0);
if (ret) if (ret)
goto deinit_sess; goto deinit_sess;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment