video: driver: queue pending buffers at streamon
qbuf will be deferred on all ports before streamon, So explicitly queue pending buffers at the time of streamon. Change-Id: I673a14f0d43563184aac887f5f23b63ed13d59df Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
This commit is contained in:
@@ -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_input_port_settings_change(struct msm_vidc_inst *inst);
|
||||||
int msm_vdec_output_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_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,
|
int msm_vdec_handle_release_buffer(struct msm_vidc_inst *inst,
|
||||||
struct msm_vidc_buffer *buf);
|
struct msm_vidc_buffer *buf);
|
||||||
|
|
||||||
|
@@ -348,7 +348,12 @@ int msm_vidc_get_delayed_unmap(struct msm_vidc_inst *inst,
|
|||||||
struct msm_vidc_map *map);
|
struct msm_vidc_map *map);
|
||||||
int msm_vidc_put_delayed_unmap(struct msm_vidc_inst *inst,
|
int msm_vidc_put_delayed_unmap(struct msm_vidc_inst *inst,
|
||||||
struct msm_vidc_map *map);
|
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,
|
int msm_vidc_destroy_internal_buffer(struct msm_vidc_inst *inst,
|
||||||
struct msm_vidc_buffer *buffer);
|
struct msm_vidc_buffer *buffer);
|
||||||
void msm_vidc_destroy_buffers(struct msm_vidc_inst *inst);
|
void msm_vidc_destroy_buffers(struct msm_vidc_inst *inst);
|
||||||
|
@@ -1783,7 +1783,7 @@ static int msm_vdec_qbuf_batch(struct msm_vidc_inst *inst,
|
|||||||
cancel_batch_work(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)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
@@ -2938,18 +2938,18 @@ static int msm_vidc_queue_buffer(struct msm_vidc_inst *inst, struct msm_vidc_buf
|
|||||||
return 0;
|
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_buffers *buffers;
|
||||||
struct msm_vidc_buffer *buf;
|
struct msm_vidc_buffer *buf;
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
if (!inst) {
|
if (!inst || !buf_type) {
|
||||||
d_vpr_e("%s: invalid params\n", __func__);
|
d_vpr_e("%s: invalid params\n", __func__);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
buffers = msm_vidc_get_buffers(inst, MSM_VIDC_BUF_OUTPUT, __func__);
|
buffers = msm_vidc_get_buffers(inst, buf_type, __func__);
|
||||||
if (!buffers)
|
if (!buffers)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
@@ -4488,7 +4488,7 @@ void msm_vidc_batch_handler(struct work_struct *work)
|
|||||||
}
|
}
|
||||||
|
|
||||||
i_vpr_h(inst, "%s: queue pending batch buffers\n", __func__);
|
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) {
|
if (rc) {
|
||||||
i_vpr_e(inst, "%s: batch qbufs failed\n", __func__);
|
i_vpr_e(inst, "%s: batch qbufs failed\n", __func__);
|
||||||
msm_vidc_change_inst_state(inst, MSM_VIDC_ERROR, __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;
|
int rc = 0;
|
||||||
struct msm_vidc_inst *inst;
|
struct msm_vidc_inst *inst;
|
||||||
|
enum msm_vidc_buffer_type buf_type;
|
||||||
|
|
||||||
if (!q || !q->drv_priv) {
|
if (!q || !q->drv_priv) {
|
||||||
d_vpr_e("%s: invalid input, q = %pK\n", q);
|
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 */
|
/* print final buffer counts & size details */
|
||||||
msm_vidc_print_buffer_info(inst);
|
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);
|
i_vpr_h(inst, "Streamon: %d successful\n", q->type);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
Reference in New Issue
Block a user