Name: %{daemon_name}
Summary: Power Aware System Service
-Version: 2.0.0
+Version: 2.0.1
Release: 1
Group: System/Kernel
License: Apache-2.0
res->config_data.res_name);
}
-/**
- * @brief Deprecated - set pmqos_data for nonstandard h/w resource
- * @param [in] res Instance of h/w resource
- * @return @c 0 on success, otherwise error value
- * @retval -22 Invalid argument (-EINVAL)
- * @retval -1 Operation not permitted (-EPERM)
- * @retval -19 Operation not supported (-ENOTSUP)
- */
-int pass_hal_set_pmqos_data(struct pass_resource *res, void *data)
-{
- if (!res || !data)
- return -EINVAL;
-
- return hal_power_misc_set_pmqos_data(res->config_data.res_type,
- res->config_data.res_name, data);
-}
-
/**
* @brief Save the initial state of DVFS(Dynamic Voltage and Frequency
* Scaling) resource before PASS (Power Aware System Service)
}
/* fall through */
case PASS_RESOURCE_BATTERY_ID:
- case PASS_RESOURCE_NONSTANDARD_ID:
ret = pass_hal_save_battery_initdata(res);
if (ret < 0) {
_E("Failed to save battery initdata for '%s' resource",
}
/* fall through */
case PASS_RESOURCE_BATTERY_ID:
- case PASS_RESOURCE_NONSTANDARD_ID:
ret = pass_hal_restore_battery_initdata(res);
if (ret < 0) {
_E("Failed to restore battery initdata for '%s' resource",
int pass_hal_get_fault_around_bytes(struct pass_resource *res);
int pass_hal_set_fault_around_bytes(struct pass_resource *res,
int fault_around_bytes);
-
-/***
- * Functions for Nonstandard H/W resources
- */
-/*
- * NOTE: It is not propper method. But PASS must need to keep
- * the backwards compatibility, set the PMQoS's data from
- * platform to hal. So, It is not recommended to use it.
- *
- * This function will be removed after finding the proper method.
- */
-int pass_hal_set_pmqos_data(struct pass_resource *res, void *data);
-
#endif /* __PASS_HAL__ */
config_data->res_type = PASS_RESOURCE_DISK_ID;
else if (!strncmp(device_type, PASS_RESOURCE_NETWORK_NAME, strlen(device_type)))
config_data->res_type = PASS_RESOURCE_NETWORK_ID;
- else if (!strncmp(device_type, PASS_RESOURCE_NONSTANDARD_NAME, strlen(device_type)))
- config_data->res_type = PASS_RESOURCE_NONSTANDARD_ID;
else {
_E("Unknown 'device_type' property value (%s)\n", device_type);
return -EINVAL;
limit_min_freq = adjusted_level.limit_min_freq;
/* fall through */
case PASS_RESOURCE_BATTERY_ID:
- case PASS_RESOURCE_NONSTANDARD_ID:
cooling_device_state = adjusted_level.cooling_device_state;
charging_status = adjusted_level.charging_status;
charging_current_uA = adjusted_level.charging_current_uA;
if (!res)
return -EINVAL;
- /*
- * FIXME: PMQoS core sends the raw data to the HAL in order to
- * support the backwards compatibility. This function call will
- * be removed after finding the proper method.
- */
- if (data)
- pass_hal_set_pmqos_data(res, data);
-
rescon_set_scenario_level(res, scenario_level);
return rescon_update(res);
if (!res)
return -EINVAL;
- /*
- * FIXME: PMQoS core sends the raw data to the HAL in order to
- * support the backwards compatibility. This function call will
- * be removed after finding the proper method.
- */
- if (data)
- pass_hal_set_pmqos_data(res, data);
-
rescon_unset_scenario_level(res, scenario_level);
return rescon_update(res);
| PASS_MODULE_RESMON
| PASS_MODULE_PMQOS
| PASS_MODULE_THERMAL,
-
- [PASS_RESOURCE_NONSTANDARD_ID] = PASS_MODULE_PARSER
- | PASS_MODULE_RESCON
- | PASS_MODULE_RESMON
- | PASS_MODULE_PMQOS
- | PASS_MODULE_THERMAL,
};
extern int pass_cpuhp_init(struct pass_resource *res);
* - PASS_RESOURCE_BUS_ID
* - PASS_RESOURCE_GPU_ID
* - PASS_RESOURCE_BATTERY_ID
- * - PASS_RESOURCE_NONSTANDARD_ID
*/
int cooling_device_state;
* The current state of battery charging device
* and this property is used for the following resources:
* - PASS_RESOURCE_BATTERY_ID
- * - PASS_RESOURCE_NONSTANDARD_ID
*/
int charging_status;
int charging_current_uA;
* - 2: PASS_RESOURCE_BUS_ID
* - 3: PASS_RESOURCE_GPU_ID
* - 4: PASS_RESOURCE_MEMORY_ID
- * - 99: PASS_RESOURCE_NONSTANDARD_ID
*/
unsigned int res_type;
/**
* - If res_type of cdata is PASS_RESOURCE_GPU_ID, hal.gpu will be used.
* - If res_type of cdata is PASS_RESOURCE_MEMORY_ID,
* hal.memory will be used.
- * - If res_type of cdata is PASS_RESOURCE_NONSTANDARD_ID,
- * hal.nonstandard will be used.
*/
union {
/** Instance for CPU h/w resource */
struct pass_resource_gpu *gpu;
/** Instance for Memory h/w resource */
struct pass_resource_memory *memory;
- /** Instance for Nonstandard h/w resource */
- struct pass_resource_nonstandard *nonstandard;
} hal;
/** Instance of PASS_MODULE_RESCON module */
}
}
-TEST_F(PowerHaltest, SetPmqosData_HandlesValidInput)
-{
- int ret = 0;
- unsigned int i;
- char applaunch_scenario[] = "AppLaunch";
-
- for (i = 0; i < g_pass.num_resources; i++) {
- struct pass_resource *res = &g_pass.res[i];
-
- ret = pass_hal_set_pmqos_data(res, applaunch_scenario);
- if (haltest_is_failed(res, ret)) {
- ASSERT_EQ(ret, 0) << "SetPmqosData Failed";
- }
- }
-}
-
TEST_F(PowerHaltest, PutResourceConfig_HandlesValidInput)
{
int ret = 0;
EXPECT_NE(ret, 0);
}
-TEST_F(PassHalTest, pass_hal_set_pmqos_data) {
- struct pass_resource res;
- char buf[BUFF_MAX];
- int ret;
-
- EXPECT_CALL(*gHalApiPowerMock, hal_power_misc_set_pmqos_data(_, _, _))
- .WillRepeatedly(Return(0));
-
- ret = pass_hal_set_pmqos_data(&res, (void *)buf);
- EXPECT_EQ(ret, 0);
- ret = pass_hal_set_pmqos_data(NULL, (void *)buf);
- EXPECT_NE(ret, 0);
- ret = pass_hal_set_pmqos_data(NULL, NULL);
- EXPECT_NE(ret, 0);
-}
-
/* Unittest of pass-parser module */
class PassParserTest : public testing::Test {
public:
return gHalApiPowerMock->hal_power_memory_set_fault_around_bytes(
res_type, res_name, fault_around_bytes);
}
-
-/**
- * Miscellaneous Operation for CPU/BUS/GPU H/W
- */
-int hal_power_misc_set_pmqos_data(unsigned int res_type, char *res_name, void *data)
-{
- if (!gHalApiPowerMock)
- return -ENOTSUP;
-
- return gHalApiPowerMock->hal_power_misc_set_pmqos_data(
- res_type, res_name, data);
-}
/* Get and set the /sys/kernel/debug/fault_around_bytes */
virtual int hal_power_memory_get_fault_around_bytes(unsigned int res_type, char *res_name) = 0;
virtual int hal_power_memory_set_fault_around_bytes(unsigned int res_type, char *res_name, int fault_around_bytes) = 0;
-
- /**
- * Miscellaneous Operation for CPU/BUS/GPU H/W
- */
- virtual int hal_power_misc_set_pmqos_data(unsigned int res_type, char *res_name, void *data) = 0;
};
class HalApiPowerMock:HalApiPowerMockInterface {
MOCK_METHOD2(hal_power_memory_get_fault_around_bytes, int (unsigned int res_type, char *res_name));
MOCK_METHOD3(hal_power_memory_set_fault_around_bytes, int (unsigned int res_type, char *res_name, int fault_around_bytes));
-
- MOCK_METHOD3(hal_power_misc_set_pmqos_data, int (unsigned int res_type, char *res_name, void *data));
-
};
extern HalApiPowerMock *gHalApiPowerMock;
EXPECT_NE(ret, 0);
}
-TEST_F(PassHalTest, pass_hal_set_pmqos_data) {
- struct pass_resource res;
- char buf[BUFF_MAX];
- int ret;
-
- EXPECT_CALL(*gHalApiPowerMock, hal_power_misc_set_pmqos_data(_, _, _))
- .WillRepeatedly(Return(0));
-
- ret = pass_hal_set_pmqos_data(&res, (void *)buf);
- EXPECT_EQ(ret, 0);
- ret = pass_hal_set_pmqos_data(NULL, (void *)buf);
- EXPECT_NE(ret, 0);
- ret = pass_hal_set_pmqos_data(NULL, NULL);
- EXPECT_NE(ret, 0);
-}
-
/* Unittest of pass-parser module */
class PassParserTest : public testing::Test {
public:
return gPassHalMock->pass_hal_get_fault_around_bytes(res);
}
-int pass_hal_set_pmqos_data(struct pass_resource *res, void *data)
-{
- if (!gPassHalMock)
- return -ENOTSUP;
-
- return gPassHalMock->pass_hal_set_pmqos_data(res, data);
-}
-
int pass_hal_save_initdata(struct pass_resource *res)
{
if (!gPassHalMock)
/* Get and set the /sys/kernel/debug/fault_around_bytes */
virtual int pass_hal_get_fault_around_bytes(struct pass_resource *res) = 0;
virtual int pass_hal_set_fault_around_bytes(struct pass_resource *res, int fault_around_bytes) = 0;
-
- /***
- * Functions for Nonstandard H/W resources
- */
- /*
- * NOTE: It is not propper method. But PASS must need to keep
- * the backwards compatibility, set the PMQoS's data from
- * platform to hal. So, It is not recommended to use it.
- *
- * This function will be removed after finding the proper method.
- */
- virtual int pass_hal_set_pmqos_data(struct pass_resource *res, void *data) = 0;
};
class PassHalMock:PassHalMockInterface {
/* Get and set the /sys/kernel/debug/fault_around_bytes */
MOCK_METHOD1(pass_hal_get_fault_around_bytes, int (struct pass_resource *res));
MOCK_METHOD2(pass_hal_set_fault_around_bytes, int (struct pass_resource *res, int fault_around_bytes));
-
- /***
- * Functions for Nonstandard H/W resources
- */
- /*
- * NOTE: It is not propper method. But PASS must need to keep
- * the backwards compatibility, set the PMQoS's data from
- * platform to hal. So, It is not recommended to use it.
- *
- * This function will be removed after finding the proper method.
- */
- MOCK_METHOD2(pass_hal_set_pmqos_data, int (struct pass_resource *res, void *data));
-
};
extern PassHalMock *gPassHalMock;
/* Get and set the /sys/kernel/debug/fault_around_bytes */
EXPECT_CALL(*gPassHalMock, pass_hal_get_fault_around_bytes(_)).WillRepeatedly(Return(0));
EXPECT_CALL(*gPassHalMock, pass_hal_set_fault_around_bytes(_, _)).WillRepeatedly(Return(0));
-
- /*
- * NOTE: It is not propper method. But PASS must need to keep
- * the backwards compatibility, set the PMQoS's data from
- * platform to hal. So, It is not recommended to use it.
- *
- * This function will be removed after finding the proper method.
- */
- EXPECT_CALL(*gPassHalMock, pass_hal_set_pmqos_data(_, _)).WillRepeatedly(Return(0));
}
static void exit_pass_hal(void)
return gPassHalMock->pass_hal_get_fault_around_bytes(res);
}
-int pass_hal_set_pmqos_data(struct pass_resource *res, void *data)
-{
- if (!gPassHalMock)
- return -ENOTSUP;
-
- return gPassHalMock->pass_hal_set_pmqos_data(res, data);
-}
-
int pass_hal_save_initdata(struct pass_resource *res)
{
if (!gPassHalMock)
/* Get and set the /sys/kernel/debug/fault_around_bytes */
virtual int pass_hal_get_fault_around_bytes(struct pass_resource *res) = 0;
virtual int pass_hal_set_fault_around_bytes(struct pass_resource *res, int fault_around_bytes) = 0;
-
- /***
- * Functions for Nonstandard H/W resources
- */
- /*
- * NOTE: It is not propper method. But PASS must need to keep
- * the backwards compatibility, set the PMQoS's data from
- * platform to hal. So, It is not recommended to use it.
- *
- * This function will be removed after finding the proper method.
- */
- virtual int pass_hal_set_pmqos_data(struct pass_resource *res, void *data) = 0;
};
class PassHalMock:PassHalMockInterface {
/* Get and set the /sys/kernel/debug/fault_around_bytes */
MOCK_METHOD1(pass_hal_get_fault_around_bytes, int (struct pass_resource *res));
MOCK_METHOD2(pass_hal_set_fault_around_bytes, int (struct pass_resource *res, int fault_around_bytes));
-
- /***
- * Functions for Nonstandard H/W resources
- */
- /*
- * NOTE: It is not propper method. But PASS must need to keep
- * the backwards compatibility, set the PMQoS's data from
- * platform to hal. So, It is not recommended to use it.
- *
- * This function will be removed after finding the proper method.
- */
- MOCK_METHOD2(pass_hal_set_pmqos_data, int (struct pass_resource *res, void *data));
-
};
extern PassHalMock *gPassHalMock;
/* Get and set the /sys/kernel/debug/fault_around_bytes */
EXPECT_CALL(*gPassHalMock, pass_hal_get_fault_around_bytes(_)).WillRepeatedly(Return(0));
EXPECT_CALL(*gPassHalMock, pass_hal_set_fault_around_bytes(_, _)).WillRepeatedly(Return(0));
-
- /*
- * NOTE: It is not propper method. But PASS must need to keep
- * the backwards compatibility, set the PMQoS's data from
- * platform to hal. So, It is not recommended to use it.
- *
- * This function will be removed after finding the proper method.
- */
- EXPECT_CALL(*gPassHalMock, pass_hal_set_pmqos_data(_, _)).WillRepeatedly(Return(0));
}
static void exit_pass_hal(void)