void mali_dev_pause(mali_bool *power_is_on)
{
	mali_bool power_is_on_tmp;

	/* Locking the current power state - so it will not switch from being ON to OFF, but it might remain OFF */
	power_is_on_tmp = _mali_osk_pm_dev_ref_add_no_power_on();
	if (NULL != power_is_on)
	{
		*power_is_on = power_is_on_tmp;
	}

	mali_gp_scheduler_suspend();
	mali_pp_scheduler_suspend();
}
mali_bool mali_pm_domain_lock_state(struct mali_pm_domain *domain)
{
	mali_bool is_powered = MALI_TRUE;

	/* Take a reference without powering on */
	if (NULL != domain) {
		mali_pm_domain_lock(domain);
		++domain->use_count;

		if (MALI_PM_DOMAIN_ON != domain->state) {
			is_powered = MALI_FALSE;
		}
		mali_pm_domain_unlock(domain);
	}

	if(!_mali_osk_pm_dev_ref_add_no_power_on()) {
		is_powered = MALI_FALSE;
	}

	return is_powered;
}
Beispiel #3
0
_mali_osk_errcode_t mali_pmu_power_up(struct mali_pmu_core *pmu, u32 mask)
{
	_mali_osk_errcode_t err;

	MALI_DEBUG_ASSERT_POINTER(pmu);
	MALI_DEBUG_ASSERT(pmu->registered_cores_mask != 0 );

	/* Make sure we have a valid power domain mask */
	if (mask & ~pmu->registered_cores_mask)
	{
		return _MALI_OSK_ERR_INVALID_ARGS;
	}

	mali_pmu_lock(pmu);

	MALI_DEBUG_PRINT(4, ("Mali PMU: Power up (0x%08X)\n", mask));

	pmu->active_cores_mask |= mask;

	_mali_osk_pm_dev_ref_add_no_power_on();
	if (!mali_pm_is_power_on())
	{
		/* Don't touch hardware if all of Mali is powered off. */
		_mali_osk_pm_dev_ref_dec_no_power_on();
		mali_pmu_unlock(pmu);

		MALI_DEBUG_PRINT(4, ("Mali PMU: Skipping power up (0x%08X) since Mali is off\n", mask));

		return _MALI_OSK_ERR_BUSY;
	}

	err = mali_pmu_send_command(pmu, PMU_REG_ADDR_MGMT_POWER_UP, mask);

	_mali_osk_pm_dev_ref_dec_no_power_on();
	mali_pmu_unlock(pmu);

	return err;
}