driver: video: handle drain command
handle decoder and encoder drain command. send hfi drain command to firmware. Change-Id: I94835ce0b2a8b06e7a9ad64f7cc8642913987659 Signed-off-by: Darshana Patil <darshana@codeaurora.org>
This commit is contained in:
@@ -1117,7 +1117,7 @@ int msm_vdec_input_port_settings_change(struct msm_vidc_inst *inst)
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
event.type = V4L2_EVENT_SRC_CH_RESOLUTION;//todo
|
||||
event.type = V4L2_EVENT_SOURCE_CHANGE;
|
||||
event.u.src_change.changes = V4L2_EVENT_SRC_CH_RESOLUTION;
|
||||
v4l2_event_queue_fh(&inst->event_handler, &event);
|
||||
|
||||
@@ -1313,6 +1313,32 @@ int msm_vdec_qbuf(struct msm_vidc_inst *inst, struct vb2_buffer *vb2)
|
||||
return rc;
|
||||
}
|
||||
|
||||
int msm_vdec_process_cmd(struct msm_vidc_inst *inst, u32 cmd)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (cmd == V4L2_DEC_CMD_STOP) {
|
||||
rc = venus_hfi_session_command(inst,
|
||||
HFI_CMD_DRAIN,
|
||||
INPUT_PORT,
|
||||
HFI_PAYLOAD_NONE,
|
||||
NULL,
|
||||
0);
|
||||
if (rc)
|
||||
return rc;
|
||||
} else {
|
||||
d_vpr_e("%s: unknown cmd %d\n", __func__, cmd);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int msm_vdec_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
|
||||
{
|
||||
int rc = 0;
|
||||
|
@@ -613,6 +613,31 @@ error:
|
||||
return rc;
|
||||
}
|
||||
|
||||
int msm_venc_process_cmd(struct msm_vidc_inst *inst, u32 cmd)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (cmd == V4L2_ENC_CMD_STOP) {
|
||||
rc = venus_hfi_session_command(inst,
|
||||
HFI_CMD_DRAIN,
|
||||
INPUT_PORT,
|
||||
HFI_PAYLOAD_NONE,
|
||||
NULL,
|
||||
0);
|
||||
if (rc)
|
||||
return rc;
|
||||
} else {
|
||||
d_vpr_e("%s: unknown cmd %d\n", __func__, cmd);
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int msm_venc_stop_output(struct msm_vidc_inst *inst)
|
||||
{
|
||||
int rc = 0;
|
||||
|
@@ -610,6 +610,19 @@ EXPORT_SYMBOL(msm_vidc_streamoff);
|
||||
|
||||
int msm_vidc_cmd(void *instance, union msm_v4l2_cmd *cmd)
|
||||
{
|
||||
int rc = 0;
|
||||
struct msm_vidc_inst *inst = instance;
|
||||
struct v4l2_decoder_cmd *dec = NULL;
|
||||
struct v4l2_encoder_cmd *enc = NULL;
|
||||
|
||||
if (is_decode_session(inst)) {
|
||||
dec = (struct v4l2_decoder_cmd *)cmd;
|
||||
rc = msm_vdec_process_cmd(inst, dec->cmd);
|
||||
} else if (is_encode_session(inst)) {
|
||||
enc = (struct v4l2_encoder_cmd *)cmd;
|
||||
rc = msm_venc_process_cmd(inst, enc->cmd);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(msm_vidc_cmd);
|
||||
|
@@ -140,8 +140,7 @@ u32 msm_vidc_output_extra_count(struct msm_vidc_inst *inst)
|
||||
|
||||
u32 msm_vidc_decoder_input_size(struct msm_vidc_inst *inst)
|
||||
{
|
||||
u32 size = ALIGN(15 * 1024 * 1024, SZ_4K);
|
||||
size = 4; // TODO
|
||||
u32 size = ALIGN(1 * 1024 * 1024, SZ_4K);
|
||||
return size;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user