static u32 vcd_fill_output_buffer_cmn (struct vcd_clnt_ctxt *cctxt, struct vcd_frame_data *buffer) { u32 rc = VCD_S_SUCCESS; struct vcd_buffer_entry *buf_entry; u32 result = true; u32 handled = true; if (!cctxt || !buffer) { VCD_MSG_ERROR("%s(): Inavlid params cctxt %p buffer %p", __func__, cctxt, buffer); return VCD_ERR_BAD_POINTER; } VCD_MSG_LOW("vcd_fill_output_buffer_cmn in %d:", cctxt->clnt_state.state); if (cctxt->status.mask & VCD_IN_RECONFIG) { buffer->time_stamp = 0; buffer->data_len = 0; VCD_MSG_LOW("In reconfig: Return output buffer"); cctxt->callback(VCD_EVT_RESP_OUTPUT_DONE, VCD_S_SUCCESS, buffer, sizeof(struct vcd_frame_data), cctxt, cctxt->client_data); return rc; } buf_entry = vcd_check_fill_output_buffer(cctxt, buffer); if (!buf_entry) return VCD_ERR_BAD_POINTER; if (!(cctxt->status.mask & VCD_FIRST_OP_RCVD)) { rc = vcd_handle_first_fill_output_buffer(cctxt, buffer, &handled); VCD_FAILED_RETURN(rc, "Failed: vcd_handle_first_fill_output_buffer"); if (handled) return rc ; } result = vcd_buffer_pool_entry_en_q(&cctxt->out_buf_pool, buf_entry); if (!result && !cctxt->decoding) { VCD_MSG_ERROR("Failed: vcd_buffer_pool_entry_en_q"); return VCD_ERR_FAIL; } buf_entry->frame = *buffer; rc = vcd_return_op_buffer_to_hw(cctxt, buf_entry); if (!VCD_FAILED(rc) && cctxt->sched_clnt_hdl) { cctxt->sched_clnt_hdl->tkns++; vcd_try_submit_frame(cctxt->dev_ctxt); } return rc; }
static u32 vcd_fill_output_buffer_cmn (struct vcd_clnt_ctxt_type_t *p_cctxt, struct vcd_frame_data_type *p_buffer) { u32 rc = VCD_S_SUCCESS; u32 b_handled = FALSE; rc = vcd_return_op_buffer_to_hw(p_cctxt, p_buffer, &b_handled); if (!b_handled && !VCD_FAILED(rc) && p_cctxt->b_sched_clnt_valid) vcd_try_submit_frame(p_cctxt->p_dev_ctxt); return rc; }
static u32 vcd_fill_output_buffer_cmn (struct vcd_clnt_ctxt_type_t *p_cctxt, struct vcd_frame_data_type *p_buffer) { u32 rc = VCD_S_SUCCESS; struct vcd_buffer_entry_type *p_buf_entry; u32 b_q_result = TRUE; u32 b_handled = TRUE; VCD_MSG_LOW("vcd_fill_output_buffer_cmn in %d:", p_cctxt->clnt_state.e_state); p_buf_entry = vcd_check_fill_output_buffer(p_cctxt, p_buffer); if (!p_buf_entry) return VCD_ERR_BAD_POINTER; if (!p_cctxt->status.b_first_op_frame_recvd) { rc = vcd_handle_first_fill_output_buffer(p_cctxt, p_buffer, &b_handled); VCD_FAILED_RETURN(rc, "Failed: VCD_HandleFirstFillOutputBuffer"); p_cctxt->status.b_first_op_frame_recvd = TRUE; if (b_handled) return rc ; } b_q_result = vcd_buffer_pool_entry_en_q(&p_cctxt->out_buf_pool, p_buf_entry); if (!b_q_result && !p_cctxt->b_decoding) { VCD_MSG_ERROR("Failed: vcd_buffer_pool_entry_en_q"); return VCD_ERR_FAIL; } p_buf_entry->frame = *p_buffer; rc = vcd_return_op_buffer_to_hw(p_cctxt, p_buf_entry); if (!VCD_FAILED(rc) && p_cctxt->sched_clnt_hdl) { vcd_try_submit_frame(p_cctxt->p_dev_ctxt); p_cctxt->sched_clnt_hdl->n_o_tkns++; } return rc; }
static u32 vcd_fill_output_buffer_cmn (struct vcd_clnt_ctxt *cctxt, struct vcd_frame_data *buffer) { u32 rc = VCD_S_SUCCESS; struct vcd_buffer_entry *buf_entry; u32 result = true; u32 handled = true; VCD_MSG_LOW("vcd_fill_output_buffer_cmn in %d:", cctxt->clnt_state.state); buf_entry = vcd_check_fill_output_buffer(cctxt, buffer); if (!buf_entry) return VCD_ERR_BAD_POINTER; if (!(cctxt->status.mask & VCD_FIRST_OP_RCVD)) { rc = vcd_handle_first_fill_output_buffer(cctxt, buffer, &handled); VCD_FAILED_RETURN(rc, "Failed: vcd_handle_first_fill_output_buffer"); if (handled) return rc ; } result = vcd_buffer_pool_entry_en_q(&cctxt->out_buf_pool, buf_entry); if (!result && !cctxt->decoding) { VCD_MSG_ERROR("Failed: vcd_buffer_pool_entry_en_q"); return VCD_ERR_FAIL; } buf_entry->frame = *buffer; rc = vcd_return_op_buffer_to_hw(cctxt, buf_entry); if (!VCD_FAILED(rc) && cctxt->sched_clnt_hdl) { cctxt->sched_clnt_hdl->tkns++; vcd_try_submit_frame(cctxt->dev_ctxt); } return rc; }
static u32 vcd_resume_in_paused(struct vcd_clnt_ctxt_type_t *p_cctxt) { struct vcd_dev_ctxt_type *p_dev_ctxt = p_cctxt->p_dev_ctxt; u32 rc = VCD_S_SUCCESS; VCD_MSG_LOW("vcd_resume_in_paused:"); if (p_cctxt->b_sched_clnt_valid) { rc = vcd_power_event(p_cctxt->p_dev_ctxt, p_cctxt, VCD_EVT_PWR_CLNT_RESUME); if (VCD_FAILED(rc)) { VCD_MSG_ERROR("VCD_EVT_PWR_CLNT_RESUME failed"); } else { rc = vcd_map_sched_status(sched_suspend_resume_client (p_cctxt->p_dev_ctxt-> sched_hdl, p_cctxt->sched_clnt_hdl, TRUE)); if (VCD_FAILED(rc)) { VCD_MSG_ERROR ("rc = 0x%x. Failed: " "sched_suspend_resume_client", rc); } } if (!VCD_FAILED(rc)) vcd_try_submit_frame(p_dev_ctxt); } if (!VCD_FAILED(rc)) { vcd_do_client_state_transition(p_cctxt, VCD_CLIENT_STATE_RUN, CLIENT_STATE_EVENT_NUMBER (pf_resume)); } return rc; }
static u32 vcd_resume_in_paused(struct vcd_clnt_ctxt *cctxt) { struct vcd_dev_ctxt *dev_ctxt = cctxt->dev_ctxt; u32 rc = VCD_S_SUCCESS; VCD_MSG_LOW("vcd_resume_in_paused:"); if (cctxt->sched_clnt_hdl) { rc = vcd_power_event(cctxt->dev_ctxt, cctxt, VCD_EVT_PWR_CLNT_RESUME); if (VCD_FAILED(rc)) { VCD_MSG_ERROR("VCD_EVT_PWR_CLNT_RESUME failed"); } else { rc = vcd_sched_suspend_resume_clnt(cctxt, true); if (VCD_FAILED(rc)) { VCD_MSG_ERROR ("rc = 0x%x. Failed: " "vcd_sched_suspend_resume_clnt", rc); } } if (!VCD_FAILED(rc)) { vcd_do_client_state_transition(cctxt, VCD_CLIENT_STATE_RUN, CLIENT_STATE_EVENT_NUMBER (resume)); vcd_try_submit_frame(dev_ctxt); } } else { vcd_do_client_state_transition(cctxt, VCD_CLIENT_STATE_RUN, CLIENT_STATE_EVENT_NUMBER (resume)); } return rc; }