Merge "video: driver: queue pending buffers at streamon"
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

commit
e61914fe82
@@ -29,7 +29,6 @@ int msm_vdec_init_input_subcr_params(struct msm_vidc_inst *inst);
|
||||
int msm_vdec_input_port_settings_change(struct msm_vidc_inst *inst);
|
||||
int msm_vdec_output_port_settings_change(struct msm_vidc_inst *inst);
|
||||
int msm_vdec_process_cmd(struct msm_vidc_inst *inst, u32 cmd);
|
||||
int msm_vidc_queue_buffer_batch(struct msm_vidc_inst *inst);
|
||||
int msm_vdec_handle_release_buffer(struct msm_vidc_inst *inst,
|
||||
struct msm_vidc_buffer *buf);
|
||||
|
||||
|
@@ -354,7 +354,12 @@ int msm_vidc_get_delayed_unmap(struct msm_vidc_inst *inst,
|
||||
struct msm_vidc_map *map);
|
||||
int msm_vidc_put_delayed_unmap(struct msm_vidc_inst *inst,
|
||||
struct msm_vidc_map *map);
|
||||
int msm_vidc_queue_buffer_single(struct msm_vidc_inst *inst, struct vb2_buffer *vb2);
|
||||
enum msm_vidc_buffer_type v4l2_type_to_driver(u32 type,
|
||||
const char *func);
|
||||
int msm_vidc_queue_buffer_single(struct msm_vidc_inst *inst,
|
||||
struct vb2_buffer *vb2);
|
||||
int msm_vidc_queue_deferred_buffers(struct msm_vidc_inst *inst,
|
||||
enum msm_vidc_buffer_type buf_type);
|
||||
int msm_vidc_destroy_internal_buffer(struct msm_vidc_inst *inst,
|
||||
struct msm_vidc_buffer *buffer);
|
||||
void msm_vidc_destroy_buffers(struct msm_vidc_inst *inst);
|
||||
|
@@ -1779,7 +1779,7 @@ static int msm_vdec_qbuf_batch(struct msm_vidc_inst *inst,
|
||||
cancel_batch_work(inst);
|
||||
}
|
||||
|
||||
rc = msm_vidc_queue_buffer_batch(inst);
|
||||
rc = msm_vidc_queue_deferred_buffers(inst, MSM_VIDC_BUF_OUTPUT);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
|
@@ -2937,18 +2937,18 @@ static int msm_vidc_queue_buffer(struct msm_vidc_inst *inst, struct msm_vidc_buf
|
||||
return 0;
|
||||
}
|
||||
|
||||
int msm_vidc_queue_buffer_batch(struct msm_vidc_inst *inst)
|
||||
int msm_vidc_queue_deferred_buffers(struct msm_vidc_inst *inst, enum msm_vidc_buffer_type buf_type)
|
||||
{
|
||||
struct msm_vidc_buffers *buffers;
|
||||
struct msm_vidc_buffer *buf;
|
||||
int rc = 0;
|
||||
|
||||
if (!inst) {
|
||||
if (!inst || !buf_type) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
buffers = msm_vidc_get_buffers(inst, MSM_VIDC_BUF_OUTPUT, __func__);
|
||||
buffers = msm_vidc_get_buffers(inst, buf_type, __func__);
|
||||
if (!buffers)
|
||||
return -EINVAL;
|
||||
|
||||
@@ -4493,7 +4493,7 @@ void msm_vidc_batch_handler(struct work_struct *work)
|
||||
}
|
||||
|
||||
i_vpr_h(inst, "%s: queue pending batch buffers\n", __func__);
|
||||
rc = msm_vidc_queue_buffer_batch(inst);
|
||||
rc = msm_vidc_queue_deferred_buffers(inst, MSM_VIDC_BUF_OUTPUT);
|
||||
if (rc) {
|
||||
i_vpr_e(inst, "%s: batch qbufs failed\n", __func__);
|
||||
msm_vidc_change_inst_state(inst, MSM_VIDC_ERROR, __func__);
|
||||
|
@@ -151,6 +151,7 @@ int msm_vidc_start_streaming(struct vb2_queue *q, unsigned int count)
|
||||
{
|
||||
int rc = 0;
|
||||
struct msm_vidc_inst *inst;
|
||||
enum msm_vidc_buffer_type buf_type;
|
||||
|
||||
if (!q || !q->drv_priv) {
|
||||
d_vpr_e("%s: invalid input, q = %pK\n", q);
|
||||
@@ -226,6 +227,15 @@ int msm_vidc_start_streaming(struct vb2_queue *q, unsigned int count)
|
||||
/* print final buffer counts & size details */
|
||||
msm_vidc_print_buffer_info(inst);
|
||||
|
||||
buf_type = v4l2_type_to_driver(q->type, __func__);
|
||||
if (!buf_type)
|
||||
goto error;
|
||||
|
||||
/* queue pending buffers */
|
||||
rc = msm_vidc_queue_deferred_buffers(inst, buf_type);
|
||||
if (rc)
|
||||
goto error;
|
||||
|
||||
i_vpr_h(inst, "Streamon: %d successful\n", q->type);
|
||||
|
||||
return rc;
|
||||
|
Reference in New Issue
Block a user