mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
vidc: Fix EOS handling if video h/w has a frame in transaction
In case of video hardware is encoding a frame and EOS buffer with with zero data length arrived, set the EOS flag to the transaction available in the transaction table which will be passed to the client in frame done callback from the video hardware. Signed-off-by: Praveen Chavan <pchavan@codeaurora.org>
This commit is contained in:
parent
df3901e149
commit
d21217ca8d
2 changed files with 50 additions and 9 deletions
|
@ -398,4 +398,8 @@ u32 vcd_set_num_slices(struct vcd_clnt_ctxt *cctxt);
|
|||
u32 vcd_update_decoder_perf_level(struct vcd_dev_ctxt *dev_ctxt, u32 perf_lvl);
|
||||
|
||||
u32 vcd_set_perf_turbo_level(struct vcd_clnt_ctxt *cctxt);
|
||||
|
||||
struct vcd_transc *vcd_get_first_in_use_trans_for_clnt(
|
||||
struct vcd_clnt_ctxt *cctxt);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1684,7 +1684,7 @@ u32 vcd_process_cmd_sess_start(struct vcd_clnt_ctxt *cctxt)
|
|||
void vcd_send_frame_done_in_eos(struct vcd_clnt_ctxt *cctxt,
|
||||
struct vcd_frame_data *input_frame, u32 valid_opbuf)
|
||||
{
|
||||
VCD_MSG_LOW("vcd_send_frame_done_in_eos:");
|
||||
VCD_MSG_HIGH("vcd_send_frame_done_in_eos:");
|
||||
|
||||
if (!input_frame->virtual && !valid_opbuf) {
|
||||
VCD_MSG_MED("Sending NULL output with EOS");
|
||||
|
@ -1804,12 +1804,41 @@ void vcd_send_frame_done_in_eos_for_enc(
|
|||
}
|
||||
}
|
||||
|
||||
struct vcd_transc *vcd_get_first_in_use_trans_for_clnt(
|
||||
struct vcd_clnt_ctxt *cctxt)
|
||||
{
|
||||
u32 i;
|
||||
struct vcd_dev_ctxt *dev_ctxt;
|
||||
VCD_MSG_HIGH("%s: ", __func__);
|
||||
dev_ctxt = cctxt->dev_ctxt;
|
||||
if (!dev_ctxt->trans_tbl) {
|
||||
VCD_MSG_ERROR("%s: Null trans_tbl", __func__);
|
||||
return NULL;
|
||||
}
|
||||
i = 0;
|
||||
while (i < dev_ctxt->trans_tbl_size) {
|
||||
if ((cctxt == dev_ctxt->trans_tbl[i].cctxt) &&
|
||||
(dev_ctxt->trans_tbl[i].in_use)) {
|
||||
VCD_MSG_MED("%s: found transc = 0x%p",
|
||||
__func__, &dev_ctxt->trans_tbl[i]);
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if (i == dev_ctxt->trans_tbl_size) {
|
||||
VCD_MSG_ERROR("%s: in_use transction not found",
|
||||
__func__);
|
||||
return NULL;
|
||||
} else
|
||||
return &dev_ctxt->trans_tbl[i];
|
||||
}
|
||||
|
||||
u32 vcd_handle_recvd_eos(
|
||||
struct vcd_clnt_ctxt *cctxt,
|
||||
struct vcd_frame_data *input_frame, u32 *pb_eos_handled)
|
||||
{
|
||||
u32 rc;
|
||||
|
||||
struct vcd_transc *transc;
|
||||
VCD_MSG_LOW("vcd_handle_recvd_eos:");
|
||||
|
||||
*pb_eos_handled = false;
|
||||
|
@ -1827,13 +1856,21 @@ u32 vcd_handle_recvd_eos(
|
|||
*pb_eos_handled = true;
|
||||
else if (cctxt->decoding && !input_frame->virtual)
|
||||
cctxt->sched_clnt_hdl->tkns++;
|
||||
else if (!cctxt->decoding) {
|
||||
vcd_send_frame_done_in_eos(cctxt, input_frame, false);
|
||||
if (cctxt->status.mask & VCD_EOS_WAIT_OP_BUF) {
|
||||
vcd_do_client_state_transition(cctxt,
|
||||
VCD_CLIENT_STATE_EOS,
|
||||
CLIENT_STATE_EVENT_NUMBER
|
||||
(encode_frame));
|
||||
else if (!cctxt->decoding && !cctxt->status.frame_delayed) {
|
||||
if (!cctxt->status.frame_submitted) {
|
||||
vcd_send_frame_done_in_eos(cctxt, input_frame, false);
|
||||
if (cctxt->status.mask & VCD_EOS_WAIT_OP_BUF)
|
||||
vcd_do_client_state_transition(cctxt,
|
||||
VCD_CLIENT_STATE_EOS,
|
||||
CLIENT_STATE_EVENT_NUMBER
|
||||
(encode_frame));
|
||||
} else {
|
||||
transc = vcd_get_first_in_use_trans_for_clnt(cctxt);
|
||||
if (transc) {
|
||||
transc->flags |= VCD_FRAME_FLAG_EOS;
|
||||
VCD_MSG_HIGH("%s: Add EOS flag to transc",
|
||||
__func__);
|
||||
}
|
||||
}
|
||||
*pb_eos_handled = true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue