Example #1
0
u32 ddl_reset_hw(u32 mode)
{
	struct ddl_context *ddl_context;
	struct ddl_client_context *ddl;
	u32 i;

	DDL_MSG_HIGH("ddl_reset_hw");
	DDL_MSG_LOW("ddl_reset_hw:called");
	ddl_context = ddl_get_context();
	ddl_context->cmd_state = DDL_CMD_INVALID;
	DDL_BUSY(ddl_context);
	if (ddl_context->core_virtual_base_addr) {
		vidc_1080p_do_sw_reset(VIDC_1080P_RESET_IN_SEQ_FIRST_STAGE);
		msleep(DDL_SW_RESET_SLEEP);
		vidc_1080p_do_sw_reset(VIDC_1080P_RESET_IN_SEQ_SECOND_STAGE);
		msleep(DDL_SW_RESET_SLEEP);
		ddl_context->core_virtual_base_addr = NULL;
	}
	ddl_context->device_state = DDL_DEVICE_NOTINIT;
	for (i = 0; i < VCD_MAX_NO_CLIENT; i++) {
		ddl = ddl_context->ddl_clients[i];
		ddl_context->ddl_clients[i] = NULL;
		if (ddl) {
			ddl_release_client_internal_buffers(ddl);
			ddl_client_transact(DDL_FREE_CLIENT, &ddl);
		}
	}
	ddl_release_context_buffers(ddl_context);
	memset(ddl_context, 0, sizeof(struct ddl_context));
	return true;
}
Example #2
0
u32 ddl_reset_hw(u32 mode)
{
	struct ddl_context *ddl_context;
	struct ddl_client_context *ddl;
	int i_client_num;

	VIDC_LOG_STRING("ddl_reset_hw:called");
	ddl_context = ddl_get_context();
	ddl_move_command_state(ddl_context, DDL_CMD_INVALID);
	DDL_BUSY(ddl_context);

	if (ddl_context->core_virtual_base_addr)
		vidc_720p_do_sw_reset();

	ddl_context->device_state = DDL_DEVICE_NOTINIT;
	for (i_client_num = 0; i_client_num < VCD_MAX_NO_CLIENT;
			++i_client_num) {
		ddl = ddl_context->ddl_clients[i_client_num];
		ddl_context->ddl_clients[i_client_num] = NULL;
		if (ddl) {
			ddl_release_client_internal_buffers(ddl);
			ddl_client_transact(DDL_FREE_CLIENT, &ddl);
		}
	}

	ddl_release_context_buffers(ddl_context);
	DDL_MEMSET(ddl_context, 0, sizeof(struct ddl_context));

	return true;
}
static void ddl_channel_end_callback(struct ddl_context *ddl_context)
{
	struct ddl_client_context *ddl;

	DDL_MSG_MED("ddl_channel_end_callback");
	ddl = ddl_get_current_ddl_client_for_command(ddl_context,
			DDL_CMD_CHANNEL_END);
	if (ddl) {
		ddl->cmd_state = DDL_CMD_INVALID;
		if (!DDLCLIENT_STATE_IS(ddl, DDL_CLIENT_WAIT_FOR_CHEND)) {
			DDL_MSG_LOW("STATE-CRITICAL-CHEND");
		} else {
			DDL_MSG_LOW("CH_END_DONE");
			ddl_release_client_internal_buffers(ddl);
			ddl_context->ddl_callback(VCD_EVT_RESP_STOP,
				VCD_S_SUCCESS, NULL, 0, (u32 *)ddl,
				ddl->client_data);
			DDL_MSG_LOW("ddl_state_transition: %s ~~>"
				"DDL_CLIENT_OPEN",
				ddl_get_state_string(ddl->client_state));
			ddl->client_state = DDL_CLIENT_OPEN;
		}
		ddl_release_command_channel(ddl_context,
			ddl->command_channel);
	}
}
Example #4
0
u32 ddl_reset_hw(u32 n_mode)
{
    struct ddl_context_type *p_ddl_context;
    struct ddl_client_context_type *p_ddl;
    int i_client_num;

    VIDC_LOG_STRING("ddl_reset_hw:called");
    p_ddl_context = ddl_get_context();
    ddl_move_command_state(p_ddl_context, DDL_CMD_INVALID);
    DDL_BUSY(p_ddl_context);

    if (NULL != p_ddl_context->p_core_virtual_base_addr)
        vidc_720p_do_sw_reset();

    p_ddl_context->n_device_state = DDL_DEVICE_NOTINIT;
    for (i_client_num = 0; i_client_num < VCD_MAX_NO_CLIENT;
            ++i_client_num) {
        p_ddl = p_ddl_context->a_ddl_clients[i_client_num];
        p_ddl_context->a_ddl_clients[i_client_num] = NULL;
        if (p_ddl) {
            ddl_release_client_internal_buffers(p_ddl);
            ddl_client_transact(DDL_FREE_CLIENT, &p_ddl);
        }
    }

    ddl_release_context_buffers(p_ddl_context);
    DDL_MEMSET(p_ddl_context, 0, sizeof(struct ddl_context_type));

    VIDC_LOG_BUFFER_INIT;
    return TRUE;
}
static void ddl_channel_end_callback(struct ddl_context *ddl_context)
{
	struct ddl_client_context *ddl;

	ddl_move_command_state(ddl_context, DDL_CMD_INVALID);
	VIDC_LOG_STRING("CH_END_DONE");

	ddl = ddl_context->current_ddl;
	if (!ddl ||
		!DDLCLIENT_STATE_IS(ddl, DDL_CLIENT_WAIT_FOR_CHEND)
		) {
		VIDC_LOG_STRING("STATE-CRITICAL-CHEND");
		DDL_IDLE(ddl_context);
		return;
	}

	ddl_release_client_internal_buffers(ddl);
	ddl_context->ddl_callback(VCD_EVT_RESP_STOP, VCD_S_SUCCESS,
		NULL, 0, (u32 *) ddl,	ddl_context->client_data);
	ddl_move_client_state(ddl, DDL_CLIENT_OPEN);
	DDL_IDLE(ddl_context);
}