Exemplo n.º 1
0
static u32 vcd_flush_in_eos(struct vcd_clnt_ctxt *cctxt,
	u32 mode)
{
	u32 rc = VCD_S_SUCCESS;
	VCD_MSG_LOW("vcd_flush_in_eos:");

	if (mode > VCD_FLUSH_ALL || !mode) {
		VCD_MSG_ERROR("Invalid flush mode %d", mode);

		return VCD_ERR_ILLEGAL_PARM;
	}

	VCD_MSG_MED("Flush mode requested %d", mode);
	if (!(cctxt->status.frame_submitted) &&
		(!cctxt->decoding)) {
		rc = vcd_flush_buffers(cctxt, mode);
		if (!VCD_FAILED(rc)) {
			VCD_MSG_HIGH("All buffers are flushed");
			cctxt->status.mask |= (mode & VCD_FLUSH_ALL);
			vcd_send_flush_done(cctxt, VCD_S_SUCCESS);
		}
	} else
		cctxt->status.mask |= (mode & VCD_FLUSH_ALL);

	return rc;
}
Exemplo n.º 2
0
static u32  vcd_flush_inopen(struct vcd_clnt_ctxt *cctxt,
	u32 mode)
{
   VCD_MSG_LOW("vcd_flush_inopen:");
   cctxt->status.mask |= (mode & VCD_FLUSH_ALL);
   vcd_send_flush_done(cctxt, VCD_S_SUCCESS);
   return VCD_S_SUCCESS;
}
Exemplo n.º 3
0
static u32  vcd_flush_inopen(struct vcd_clnt_ctxt_type_t *p_cctxt,
	u32 n_mode)
{
   VCD_MSG_LOW("vcd_flush_inopen:");
   p_cctxt->status.n_flush_mode = n_mode;
   vcd_send_flush_done(p_cctxt, VCD_S_SUCCESS);
   return VCD_S_SUCCESS;
}
Exemplo n.º 4
0
static u32 vcd_flush_in_invalid(struct vcd_clnt_ctxt *cctxt,
	u32 mode)
{
	u32 rc = VCD_S_SUCCESS;
	VCD_MSG_LOW("vcd_flush_in_invalid:");
	if (!(cctxt->status.mask & VCD_CLEANING_UP)) {
		rc = vcd_flush_buffers(cctxt, mode);
		if (!VCD_FAILED(rc)) {
			VCD_MSG_HIGH("All buffers are flushed");
			cctxt->status.mask |= (mode & VCD_FLUSH_ALL);
			vcd_send_flush_done(cctxt, VCD_S_SUCCESS);
		}
	}
	return rc;
}
Exemplo n.º 5
0
static u32 vcd_flush_in_invalid(struct vcd_clnt_ctxt_type_t *p_cctxt,
	u32 mode)
{
	u32 rc = VCD_S_SUCCESS;
	VCD_MSG_LOW("vcd_flush_in_invalid:");
	if (!p_cctxt->status.b_cleaning_up) {
		rc = vcd_flush_buffers(p_cctxt, mode);
		if (!VCD_FAILED(rc)) {
			VCD_MSG_HIGH("All buffers are flushed");
			p_cctxt->status.n_flush_mode = mode;
			vcd_send_flush_done(p_cctxt, VCD_S_SUCCESS);
		}
	}
	return rc;
}
Exemplo n.º 6
0
static u32 vcd_flush_cmn(struct vcd_clnt_ctxt *cctxt, u32 mode)
{
	u32 rc = VCD_S_SUCCESS;

	VCD_MSG_LOW("vcd_flush_cmn in %d:", cctxt->clnt_state.state);

	rc = vcd_flush_buffers(cctxt, mode);

	VCD_FAILED_RETURN(rc, "Failed: vcd_flush_buffers");

	if (cctxt->status.frame_submitted > 0) {
		vcd_do_client_state_transition(cctxt,
					       VCD_CLIENT_STATE_FLUSHING,
					       CLIENT_STATE_EVENT_NUMBER
					       (flush));
	} else {
		VCD_MSG_HIGH("All buffers are flushed");
		cctxt->status.mask |= (mode & VCD_FLUSH_ALL);
		vcd_send_flush_done(cctxt, VCD_S_SUCCESS);
	}

	return rc;
}
Exemplo n.º 7
0
static u32 vcd_flush_cmn(struct vcd_clnt_ctxt_type_t *p_cctxt, u32 n_mode)
{
	u32 rc = VCD_S_SUCCESS;

	VCD_MSG_LOW("vcd_flush_cmn in %d:", p_cctxt->clnt_state.e_state);

	rc = vcd_flush_buffers(p_cctxt, n_mode);

	VCD_FAILED_RETURN(rc, "Failed: vcd_flush_buffers");

	if (p_cctxt->status.n_frame_submitted > 0) {
		vcd_do_client_state_transition(p_cctxt,
					       VCD_CLIENT_STATE_FLUSHING,
					       CLIENT_STATE_EVENT_NUMBER
					       (pf_flush));
	} else {
		VCD_MSG_HIGH("All buffers are flushed");
		p_cctxt->status.n_flush_mode = n_mode;
		vcd_send_flush_done(p_cctxt, VCD_S_SUCCESS);
	}

	return rc;
}
Exemplo n.º 8
0
static void vcd_clnt_cb_in_flushing
    (struct vcd_clnt_ctxt *cctxt,
     u32 event,
     u32 status,
     void *payload, size_t sz, u32 *ddl_handle, void *const client_data) {
	struct vcd_dev_ctxt *dev_ctxt = cctxt->dev_ctxt;
	u32 rc = VCD_S_SUCCESS;
	u32 frm_trans_end = false;

	VCD_MSG_LOW("vcd_clnt_cb_in_flushing:");

	if (cctxt->ddl_handle != ddl_handle) {
		VCD_MSG_ERROR("ddl_handle mismatch");

		return;
	}

	switch (event) {
	case VCD_EVT_RESP_INPUT_DONE:
		{
			rc = vcd_handle_input_done(cctxt,
						   payload,
						   VCD_EVT_RESP_INPUT_FLUSHED,
						   status);

			break;
		}

	case VCD_EVT_RESP_OUTPUT_DONE:
		{

			rc = vcd_handle_frame_done(cctxt,
						   payload,
						   VCD_EVT_RESP_OUTPUT_FLUSHED,
						   status);

			break;
		}
	case VCD_EVT_RESP_OUTPUT_REQ:
		{
			rc = vcd_handle_output_required_in_flushing(cctxt,
				payload);
			break;
		}
	case VCD_EVT_IND_OUTPUT_RECONFIG:
		{
			rc = vcd_handle_ind_output_reconfig(cctxt,
				payload, status);
			if (!VCD_FAILED(rc)) {
				frm_trans_end = true;
				payload = NULL;
			}
			break;
		}
	case VCD_EVT_IND_HWERRFATAL:
		{
			vcd_handle_ind_hw_err_fatal(cctxt,
				VCD_EVT_IND_HWERRFATAL,	status);
			break;
		}
	default:
		{
			VCD_MSG_ERROR
			    ("Unexpected callback event=%d status=%d from DDL",
			     event, status);

			dev_ctxt->command_continue = false;

			break;
		}
	}
	if (!VCD_FAILED(rc) && ((event == VCD_EVT_RESP_INPUT_DONE ||
		event == VCD_EVT_RESP_OUTPUT_DONE ||
		event == VCD_EVT_RESP_OUTPUT_REQ ||
		event == VCD_EVT_IND_OUTPUT_RECONFIG))) {
		if (payload &&
			((struct ddl_frame_data_tag *)\
			payload)->frm_trans_end) {

			vcd_mark_frame_channel(cctxt->dev_ctxt);
			frm_trans_end = true;
		}
		if (frm_trans_end && !cctxt->status.frame_submitted) {
			VCD_MSG_HIGH
			    ("All pending frames recvd from DDL");
			if (cctxt->status.mask & VCD_FLUSH_INPUT)
				vcd_flush_bframe_buffers(cctxt,
							VCD_FLUSH_INPUT);
			if (cctxt->status.mask & VCD_FLUSH_OUTPUT)
				vcd_flush_output_buffers(cctxt);
			vcd_send_flush_done(cctxt, VCD_S_SUCCESS);
			vcd_release_interim_frame_channels(dev_ctxt);
			VCD_MSG_HIGH("Flush complete");
			vcd_do_client_state_transition(cctxt,
				VCD_CLIENT_STATE_RUN,
				CLIENT_STATE_EVENT_NUMBER
				(clnt_cb));
		}
	}
}
Exemplo n.º 9
0
static void vcd_clnt_cb_in_flushing
    (struct vcd_clnt_ctxt_type_t *p_cctxt,
     u32 event,
     u32 status,
     void *p_payload, u32 size, u32 *ddl_handle, void *const p_client_data) {
	struct vcd_dev_ctxt_type *p_dev_ctxt = p_cctxt->p_dev_ctxt;
	u32 rc = VCD_S_SUCCESS;
	u32 b_frm_trans_end = FALSE;

	VCD_MSG_LOW("vcd_clnt_cb_in_flushing:");

	if (p_cctxt->ddl_handle != ddl_handle) {
		VCD_MSG_ERROR("ddl_handle mismatch");

		return;
	}

	switch (event) {
	case VCD_EVT_RESP_INPUT_DONE:
		{
			rc = vcd_handle_input_done(p_cctxt,
						   p_payload,
						   VCD_EVT_RESP_INPUT_FLUSHED,
						   status);

			break;
		}

	case VCD_EVT_RESP_OUTPUT_DONE:
		{

			rc = vcd_handle_frame_done(p_cctxt,
						   p_payload,
						   VCD_EVT_RESP_OUTPUT_FLUSHED,
						   status);

			break;
		}
	case VCD_EVT_RESP_OUTPUT_REQ:
		{
			rc = vcd_handle_output_required_in_flushing(p_cctxt,
				p_payload);
			break;
		}
	case VCD_EVT_IND_OUTPUT_RECONFIG:
		{
			(void) vcd_handle_ind_output_reconfig(p_cctxt,
				p_payload, status);

			b_frm_trans_end = TRUE;
			p_payload = NULL;

			break;
		}
	case VCD_EVT_IND_HWERRFATAL:
		{
			vcd_handle_ind_hw_err_fatal(p_cctxt,
				VCD_EVT_IND_HWERRFATAL,	status);
			break;
		}
	default:
		{
			VCD_MSG_ERROR
			    ("Unexpected callback event=%d status=%d from DDL",
			     event, status);

			p_dev_ctxt->b_continue = FALSE;

			break;
		}
	}
	if (!VCD_FAILED(rc) && ((event == VCD_EVT_RESP_INPUT_DONE ||
		event == VCD_EVT_RESP_OUTPUT_DONE ||
		event == VCD_EVT_RESP_OUTPUT_REQ ||
		event == VCD_EVT_IND_OUTPUT_RECONFIG))) {
		if (p_payload &&
			((struct ddl_frame_data_type_tag *)\
			p_payload)->b_frm_trans_end) {

			vcd_mark_frame_channel(p_cctxt->p_dev_ctxt);
			b_frm_trans_end = TRUE;
		}
		if (b_frm_trans_end && !p_cctxt->status.n_frame_submitted) {

			VCD_MSG_HIGH
			    ("All pending frames recvd from DDL");

			if (p_cctxt->status.
			    n_flush_mode & VCD_FLUSH_OUTPUT) {
				vcd_flush_output_buffers(p_cctxt);

				vcd_release_all_clnt_frm_transc
				    (p_cctxt);

			}

			vcd_send_flush_done(p_cctxt, VCD_S_SUCCESS);
			vcd_release_interim_frame_channels(p_dev_ctxt);
			VCD_MSG_HIGH("Flush complete");
			vcd_release_all_clnt_def_frm_transc(p_cctxt);
			vcd_do_client_state_transition(p_cctxt,
				VCD_CLIENT_STATE_RUN,
				CLIENT_STATE_EVENT_NUMBER
				(pf_clnt_cb));
		}
	}
}