pass: thermal: Add overridable property 59/265559/3
authorDongwoo Lee <dwlee08@gmail.com>
Wed, 20 Oct 2021 03:54:46 +0000 (20:54 -0700)
committerDongwoo Lee <dwoo08.lee@samsung.com>
Wed, 27 Oct 2021 01:19:50 +0000 (10:19 +0900)
To represent scenario overridable which means that the resource is
allowed or disallowed to be changed by other modules such as PMQoS.

Change-Id: I8871b013ff93882c8cb0656f94e1e450e864e4ac
Signed-off-by: Dongwoo Lee <dwlee08@gmail.com>
src/pass/pass-parser.c
src/pass/pass.h

index 357ab1d..1dacf07 100644 (file)
@@ -113,11 +113,13 @@ static int parse_scenario(struct pass_resource *res, json_object *obj,
        int temp_end;
        int threshold;
        int timer_interval_ms;
+       int overridable;
 
        /* Get property values */
        name = get_string_from_object(obj, "name");
        support = get_boolean_from_object(obj, "support");
        target_level= get_int_from_object(obj, "target_level");
+       overridable = get_boolean_from_object(obj, "overridable");
 
        /* - property for only pmqos module */
        cpuhp_min_level = get_int_from_object(obj, "cpuhp_min_level");
@@ -169,6 +171,7 @@ static int parse_scenario(struct pass_resource *res, json_object *obj,
        scenario->thermal.temp_end = temp_end;
        scenario->thermal.threshold = threshold;
        scenario->thermal.timer_interval = timer_interval_ms;
+       scenario->thermal.overridable = (overridable < 0) ? 1 : overridable;
 
        return 0;
 }
index 6afb875..e50aa9a 100644 (file)
@@ -270,6 +270,8 @@ struct pass_scenario {
                int threshold;
                /** Interval of timer-based monitor (unit: millisecond) */
                int timer_interval;
+               /** Represents this scenario can be overridden */
+               int overridable;
        } thermal;
 };