static u32 ddl_eos_frame_done_callback(struct ddl_context *ddl_context)
{
	struct ddl_client_context *ddl = ddl_context->current_ddl;
	struct ddl_decoder_data *decoder = &(ddl->codec_data.decoder);
	struct vidc_720p_dec_disp_info *dec_disp_info =
		&(decoder->dec_disp_info);

	if (!DDLCLIENT_STATE_IS(ddl, DDL_CLIENT_WAIT_FOR_EOS_DONE)) {
		VIDC_LOGERR_STRING("STATE-CRITICAL-EOSFRMRUN");
		ddl_client_fatal_cb(ddl_context);
		return true;
	}
	VIDC_LOG_STRING("EOS_FRM_RUN_DONE");

	ddl_move_command_state(ddl_context, DDL_CMD_INVALID);

	vidc_720p_decode_display_info(dec_disp_info);

	ddl_decode_dynamic_property(ddl, false);

	if (dec_disp_info->disp_status == VIDC_720P_DISPLAY_ONLY) {
		if (ddl_decoder_output_done_callback(ddl, false)
			!= VCD_S_SUCCESS)
			return true;
	} else
		VIDC_LOG_STRING("STATE-CRITICAL-WRONG-DISP-STATUS");

	ddl_decoder_dpb_transact(decoder, NULL, DDL_DPB_OP_SET_MASK);
	ddl_move_command_state(ddl_context, DDL_CMD_EOS);
	vidc_720p_submit_command(ddl->channel_id,
		VIDC_720P_CMD_FRAMERUN);
	return false;
}
static u32 ddl_eos_frame_done_callback(
	struct ddl_client_context *ddl)
{
	struct ddl_context *ddl_context = ddl->ddl_context;
	struct ddl_decoder_data *decoder = &ddl->codec_data.decoder;
	struct ddl_mask *dpb_mask = &decoder->dpb_mask;
	u32 ret_status = true, rsl_chg;
	enum vidc_1080p_display_status disp_status;

	if (!DDLCLIENT_STATE_IS(ddl, DDL_CLIENT_WAIT_FOR_EOS_DONE)) {
		DDL_MSG_ERROR("STATE-CRITICAL-EOSFRMRUN");
		ddl_client_fatal_cb(ddl);
	} else {
		DDL_MSG_LOW("EOS_FRM_RUN_DONE");
		ddl->cmd_state = DDL_CMD_INVALID;
		get_dec_status(&ddl->codec_data.decoder.dec_disp_info,
			ddl->codec_data.decoder.output_order,
			&disp_status, &rsl_chg);
		ddl_vidc_decode_dynamic_property(ddl, false);
		if (disp_status ==
			VIDC_1080P_DISPLAY_STATUS_DPB_EMPTY) {
			ddl_decoder_eos_done_callback(ddl);
		} else {
			struct vidc_1080p_dec_frame_start_param dec_param;
			ret_status = false;
			if (disp_status ==
				VIDC_1080P_DISPLAY_STATUS_DISPLAY_ONLY) {
				if (ddl_decoder_output_done_callback(
					ddl, false))
					ret_status = true;
			} else if (disp_status !=
				VIDC_1080P_DISPLAY_STATUS_NOOP)
				DDL_MSG_ERROR("EOS-STATE-CRITICAL-"
					"WRONG-DISP-STATUS");
			if (!ret_status) {
				ddl_decoder_dpb_transact(decoder, NULL,
					DDL_DPB_OP_SET_MASK);
				ddl->cmd_state = DDL_CMD_EOS;

				memset(&dec_param, 0, sizeof(dec_param));

				dec_param.cmd_seq_num =
					++ddl_context->cmd_seq_num;
				dec_param.inst_id = ddl->instance_id;
				dec_param.shared_mem_addr_offset =
					DDL_ADDR_OFFSET(
					ddl_context->dram_base_a,
					ddl->shared_mem[ddl->command_channel]);
				dec_param.release_dpb_bit_mask =
					dpb_mask->hw_mask;
				dec_param.decode =
					VIDC_1080P_DEC_TYPE_LAST_FRAME_DATA;

				ddl_context->vidc_decode_frame_start[ddl->\
					command_channel](&dec_param);
			}
		}
	}
	return ret_status;
}
static u32 ddl_decoder_frame_run_callback(struct ddl_context
					   *ddl_context)
{
	struct ddl_client_context *ddl = ddl_context->current_ddl;
	struct vidc_720p_dec_disp_info *dec_disp_info =
	    &(ddl->codec_data.decoder.dec_disp_info);
	u32 callback_end = false;
	u32 status = true, eos_present = false;;

	if (!DDLCLIENT_STATE_IS(ddl, DDL_CLIENT_WAIT_FOR_FRAME_DONE)) {
		VIDC_LOG_STRING("STATE-CRITICAL-DECFRMRUN");
		ddl_client_fatal_cb(ddl_context);
		return true;
	}

	VIDC_LOG_STRING("DEC_FRM_RUN_DONE");

	ddl_move_command_state(ddl_context, DDL_CMD_INVALID);

	vidc_720p_decode_display_info(dec_disp_info);

	ddl_decode_dynamic_property(ddl, false);

	if (dec_disp_info->resl_change) {
		VIDC_LOG_STRING
			("DEC_FRM_RUN_DONE: RECONFIG");
		ddl_move_client_state(ddl, DDL_CLIENT_WAIT_FOR_EOS_DONE);
		ddl_move_command_state(ddl_context, DDL_CMD_EOS);
		vidc_720p_submit_command(ddl->channel_id,
			VIDC_720P_CMD_FRAMERUN_REALLOCATE);
		return false;
	}

	if ((VCD_FRAME_FLAG_EOS & ddl->input_frame.vcd_frm.flags)) {
		callback_end = false;
		eos_present = true;
	}


	if (dec_disp_info->disp_status == VIDC_720P_DECODE_ONLY ||
		dec_disp_info->disp_status
			== VIDC_720P_DECODE_AND_DISPLAY) {
		if (!eos_present)
			callback_end = (dec_disp_info->disp_status
					== VIDC_720P_DECODE_ONLY);

	  ddl_decoder_input_done_callback(ddl, callback_end);
	}

	if (dec_disp_info->disp_status == VIDC_720P_DECODE_AND_DISPLAY
		|| dec_disp_info->disp_status == VIDC_720P_DISPLAY_ONLY) {
		if (!eos_present)
			callback_end =
			(dec_disp_info->disp_status
				== VIDC_720P_DECODE_AND_DISPLAY);

		if (ddl_decoder_output_done_callback(ddl, callback_end)
			!= VCD_S_SUCCESS)
			return true;
	}

	if (dec_disp_info->disp_status ==  VIDC_720P_DISPLAY_ONLY ||
		dec_disp_info->disp_status ==  VIDC_720P_EMPTY_BUFFER) {
		/* send the same input once again for decoding */
		ddl_decode_frame_run(ddl);
		/* client need to ignore the interrupt */
		status = false;
	} else if (eos_present) {
		/* send EOS command to HW */
		ddl_decode_eos_run(ddl);
		/* client need to ignore the interrupt */
		status = false;
	} else {
		ddl_move_client_state(ddl, DDL_CLIENT_WAIT_FOR_FRAME);
		/* move to Idle */
		DDL_IDLE(ddl_context);
	}
	return status;
}
static u32 ddl_decoder_frame_run_callback(struct ddl_client_context *ddl)
{
	struct ddl_context *ddl_context = ddl->ddl_context;
	struct ddl_decoder_data *decoder = &ddl->codec_data.decoder;
	u32 callback_end = false, ret_status = false;
	u32 eos_present = false, rsl_chg;
	u32 more_field_needed, extended_rsl_chg;
	enum vidc_1080p_display_status disp_status;
	DDL_MSG_MED("ddl_decoder_frame_run_callback");
	if (!DDLCLIENT_STATE_IS(ddl, DDL_CLIENT_WAIT_FOR_FRAME_DONE)) {
		DDL_MSG_ERROR("STATE-CRITICAL-DECFRMRUN");
		ddl_client_fatal_cb(ddl);
		ret_status = true;
	} else {
		DDL_MSG_LOW("DEC_FRM_RUN_DONE");
		ddl->cmd_state = DDL_CMD_INVALID;
		get_dec_status(ddl, &ddl->codec_data.decoder.dec_disp_info,
			ddl->codec_data.decoder.output_order,
			&disp_status, &rsl_chg);

		vidc_sm_get_extended_decode_status(
			&ddl->shared_mem[ddl->command_channel],
			&more_field_needed,
			&extended_rsl_chg);
		decoder->field_needed_for_prev_ip =
			more_field_needed;
		decoder->prev_ip_frm_tag =
			ddl->input_frame.vcd_frm.ip_frm_tag;

		ddl_vidc_decode_dynamic_property(ddl, false);
		if (rsl_chg != DDL_RESL_CHANGE_NO_CHANGE) {
			ddl_handle_reconfig(rsl_chg, ddl);
			ret_status = false;
		} else {
			if ((VCD_FRAME_FLAG_EOS &
				ddl->input_frame.vcd_frm.flags)) {
				callback_end = false;
				eos_present = true;
			}
			if (disp_status ==
				VIDC_1080P_DISPLAY_STATUS_DECODE_ONLY ||
				disp_status ==
				VIDC_1080P_DISPLAY_STATUS_DECODE_AND_DISPLAY) {
				if (!eos_present)
					callback_end =
					(disp_status ==
					VIDC_1080P_DISPLAY_STATUS_DECODE_ONLY);
				ddl_decoder_input_done_callback(ddl,
					callback_end);
			}
			if (disp_status ==
				VIDC_1080P_DISPLAY_STATUS_DECODE_AND_DISPLAY ||
				disp_status ==
				VIDC_1080P_DISPLAY_STATUS_DISPLAY_ONLY) {
				if (!eos_present)
					callback_end = (disp_status ==
				VIDC_1080P_DISPLAY_STATUS_DECODE_AND_DISPLAY);
				if (ddl_decoder_output_done_callback(
					ddl, callback_end))
					ret_status = true;
			}
			if (!ret_status) {
				if (disp_status ==
					VIDC_1080P_DISPLAY_STATUS_DISPLAY_ONLY
					|| disp_status ==
					VIDC_1080P_DISPLAY_STATUS_DPB_EMPTY ||
					disp_status ==
					VIDC_1080P_DISPLAY_STATUS_NOOP) {
					ddl_vidc_decode_frame_run(ddl);
				} else if (eos_present)
					ddl_vidc_decode_eos_run(ddl);
				else {
					ddl->client_state =
						DDL_CLIENT_WAIT_FOR_FRAME;
					ddl_release_command_channel(ddl_context,
						ddl->command_channel);
					ret_status = true;
				}
			}
		}
	}
	return ret_status;
}
static u32 ddl_decoder_frame_run_callback(struct ddl_client_context *ddl)
{
	struct ddl_context *ddl_context = ddl->ddl_context;
	u32 callback_end = false, ret_status = false;
	u32 eos_present = false, rsl_chg;
	enum vidc_1080p_display_status disp_status;
	DDL_MSG_MED("ddl_decoder_frame_run_callback");
	if (!DDLCLIENT_STATE_IS(ddl, DDL_CLIENT_WAIT_FOR_FRAME_DONE)) {
		DDL_MSG_ERROR("STATE-CRITICAL-DECFRMRUN");
		ddl_client_fatal_cb(ddl);
		ret_status = true;
	} else {
		DDL_MSG_LOW("DEC_FRM_RUN_DONE");
		ddl->cmd_state = DDL_CMD_INVALID;
		get_dec_status(&ddl->codec_data.decoder.dec_disp_info,
			ddl->codec_data.decoder.output_order,
			&disp_status, &rsl_chg);
		ddl_vidc_decode_dynamic_property(ddl, false);
		if (rsl_chg) {
			DDL_MSG_ERROR("DEC_RECONFIG_NOT_SUPPORTED");
			ddl_client_fatal_cb(ddl);
#if (1) //PANTECH Qualcomm SBA Àû¿ë: Case No.517406
			ret_status = true;  
#endif
		} else {
			if ((VCD_FRAME_FLAG_EOS &
				ddl->input_frame.vcd_frm.flags)) {
				callback_end = false;
				eos_present = true;
			}
			if (disp_status ==
				VIDC_1080P_DISPLAY_STATUS_DECODE_ONLY ||
				disp_status ==
				VIDC_1080P_DISPLAY_STATUS_DECODE_AND_DISPLAY) {
				if (!eos_present)
					callback_end =
					(disp_status ==
					VIDC_1080P_DISPLAY_STATUS_DECODE_ONLY);
				ddl_decoder_input_done_callback(ddl,
					callback_end);
			}
			if (disp_status ==
				VIDC_1080P_DISPLAY_STATUS_DECODE_AND_DISPLAY ||
				disp_status ==
				VIDC_1080P_DISPLAY_STATUS_DISPLAY_ONLY) {
				if (!eos_present)
					callback_end = (disp_status ==
				VIDC_1080P_DISPLAY_STATUS_DECODE_AND_DISPLAY);
				if (ddl_decoder_output_done_callback(
					ddl, callback_end))
					ret_status = true;
			}
			if (!ret_status) {
				if (disp_status ==
					VIDC_1080P_DISPLAY_STATUS_DISPLAY_ONLY
					|| disp_status ==
					VIDC_1080P_DISPLAY_STATUS_DPB_EMPTY ||
					disp_status ==
					VIDC_1080P_DISPLAY_STATUS_NOOP) {
					ddl_vidc_decode_frame_run(ddl);
				} else if (eos_present)
					ddl_vidc_decode_eos_run(ddl);
				else {
					ddl->client_state =
						DDL_CLIENT_WAIT_FOR_FRAME;
					ddl_release_command_channel(ddl_context,
						ddl->command_channel);
					ret_status = true;
				}
			}
		}
	}
	return ret_status;
}
Exemple #6
0
static u32 ddl_decoder_frame_run_callback(struct ddl_context_type
					   *p_ddl_context)
{
	struct ddl_client_context_type *p_ddl = p_ddl_context->p_current_ddl;
	struct vidc_720p_dec_disp_info_type *p_dec_disp_info =
	    &(p_ddl->codec_data.decoder.dec_disp_info);
	u32 b_callback_end = FALSE;
	u32 status = TRUE, eos_present = FALSE;;

	if (!DDLCLIENT_STATE_IS(p_ddl, DDL_CLIENT_WAIT_FOR_FRAME_DONE)) {
		VIDC_LOG_STRING("STATE-CRITICAL-DECFRMRUN");
		ddl_client_fatal_cb(p_ddl_context);
		return TRUE;
	}

	VIDC_LOG_STRING("DEC_FRM_RUN_DONE");

	ddl_move_command_state(p_ddl_context, DDL_CMD_INVALID);

	vidc_720p_decode_display_info(p_dec_disp_info);

	ddl_decode_dynamic_property(p_ddl, FALSE);

	if (p_dec_disp_info->n_resl_change) {
		VIDC_LOGERR_STRING
			("ddl_dec_frm_done:Dec_reconfig_not_supported");
		ddl_client_fatal_cb(p_ddl_context);
		return TRUE;
	}

	if ((VCD_FRAME_FLAG_EOS & p_ddl->input_frame.vcd_frm.n_flags)) {
		b_callback_end = FALSE;
		eos_present = TRUE;
	}


	if (p_dec_disp_info->e_disp_status == VIDC_720P_DECODE_ONLY ||
		p_dec_disp_info->e_disp_status
			== VIDC_720P_DECODE_AND_DISPLAY) {
		if (!eos_present)
			b_callback_end = (p_dec_disp_info->e_disp_status
					== VIDC_720P_DECODE_ONLY);

	  ddl_decoder_input_done_callback(p_ddl, b_callback_end);
	}

	if (p_dec_disp_info->e_disp_status == VIDC_720P_DECODE_AND_DISPLAY
		|| p_dec_disp_info->e_disp_status == VIDC_720P_DISPLAY_ONLY) {
		if (!eos_present)
			b_callback_end =
			(p_dec_disp_info->e_disp_status
				== VIDC_720P_DECODE_AND_DISPLAY);

		if (ddl_decoder_output_done_callback(p_ddl, b_callback_end)
			!= VCD_S_SUCCESS)
			return TRUE;
	}

	if (p_dec_disp_info->e_disp_status ==  VIDC_720P_DISPLAY_ONLY) {
		
		ddl_decode_frame_run(p_ddl);
		
		status = FALSE;
	} else if (eos_present) {
		
		ddl_decode_eos_run(p_ddl);
		
		status = FALSE;
	} else {
		ddl_move_client_state(p_ddl, DDL_CLIENT_WAIT_FOR_FRAME);
		
		DDL_IDLE(p_ddl_context);
	}
	return status;
}