pass: Add new PASS_GOV_BASIC type and adjust the unique number of governor 83/116583/2
authorChanwoo Choi <cw00.choi@samsung.com>
Fri, 17 Feb 2017 06:25:43 +0000 (15:25 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Mon, 27 Feb 2017 06:05:05 +0000 (15:05 +0900)
This patch adds new PASS_GOV_BASIC type which uses the 'HAL interface'
and 'Resource controller'. For example, the bus/gpu resources use
this governor type in order to control the min/max frequency
when pass recevies the pmqos debus message with scenario name.

* Detailed description according to each governor type:
---------------------------------------------------------------------------
| Governor name    | HAL       | Resource   | Hotplug   | Runtime         |
|                  | interface | controller | interface | governor        |
 --------------------------------------------------------------------------
| GOV_DUMMY        | Used      | Un-used    | Un-used   | Un-used         |
| GOV_BASIC        | Used      | Used       | Un-used   | Un-used         |
| GOV_HOTPLUG_ONLY | Used      | Used       | Used      | Un-used         |
| GOV_RADIATION    | Used      | Used       | Used      | Used (Radiation)|
| GOV_STEP         | Used      | Used       | Used      | Used (Step)     |
---------------------------------------------------------------------------

* Detailed description according to PASS's feature:
- HAL interface      : Call the HAL implementation such as pass-hal-(board).rpm
- Resource controller: Control the h/w resource such as CPU/BUS/GPU resource.
- Hotplug interface  : Turn on/off the CPU h/w resource.
- Runtime governor   : Monitor the system status and then decide the proper
                       level. After deciding the level, it control the h/w
       resource by using both 'Resource controller' and
       'Hotplug interface'.

Change-Id: I3b7d7a8f5142baa409cbbfe221afad8decfb2149
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
src/pass/pass-gov.c
src/pass/pass.h

index 3f1528a..5e94a9b 100644 (file)
@@ -191,10 +191,13 @@ struct pass_hotplug* pass_get_hotplug(struct pass_policy *policy,
 
        switch (type) {
        case PASS_GOV_DUMMY:
+       case PASS_GOV_BASIC:
+               /* Don't use Hotplug interface */
                return NULL;
        case PASS_GOV_HOTPLUG_ONLY:
        case PASS_GOV_STEP:
        case PASS_GOV_RADIATION:
+               /* Use Hotplug interface */
                hotplug = calloc(1, sizeof(struct pass_hotplug));
                if (!hotplug) {
                        _E("cannot allocate the memory of struct pass_hotplug");
@@ -687,11 +690,16 @@ struct pass_governor* pass_get_governor(struct pass_policy *policy,
 {
        switch (type) {
        case PASS_GOV_DUMMY:
+               return NULL;
+       case PASS_GOV_BASIC:
        case PASS_GOV_HOTPLUG_ONLY:
+               /* Use the Resource controller only */
                return &pass_gov_dummy;
        case PASS_GOV_STEP:
+               /* Use the Resource controller and Step governor. */
                return &pass_gov_step;
        case PASS_GOV_RADIATION:
+               /* Use the Resource controller and Radiation governor. */
                return &pass_gov_radiation;
        default:
                _E("Unknown governor type");
index 000a39c..6271799 100644 (file)
@@ -50,12 +50,24 @@ enum pass_state {
 
 /*
  * PASS Governor type
+ *
+ * ---------------------------------------------------------------------------
+ * | Governor name    | HAL       | Resource   | Hotplug   | Runtime         |
+ * |                  | interface | controller | interface | governor        |
+ * ---------------------------------------------------------------------------
+ * | GOV_DUMMY        | Used      | Un-used    | Un-used   | Un-used         |
+ * | GOV_BASIC        | Used      | Used       | Un-used   | Un-used         |
+ * | GOV_HOTPLUG_ONLY | Used      | Used       | Used      | Un-used         |
+ * | GOV_RADIATION    | Used      | Used       | Used      | Used (Radiation)|
+ * | GOV_STEP         | Used      | Used       | Used      | Used (Step)     |
+ * ---------------------------------------------------------------------------
  */
 enum pass_gov_type {
        PASS_GOV_DUMMY = -1,
-       PASS_GOV_HOTPLUG_ONLY = 0,
-       PASS_GOV_STEP = 1,
-       PASS_GOV_RADIATION = 2,
+       PASS_GOV_BASIC = 0,
+       PASS_GOV_HOTPLUG_ONLY = 1,
+       PASS_GOV_STEP = 2,
+       PASS_GOV_RADIATION = 3,
 
        PASS_GOV_END,
 };