diff --git a/Configs/ResourcesConfig.yaml b/Configs/ResourcesConfig.yaml index 8518909..11202b9 100644 --- a/Configs/ResourcesConfig.yaml +++ b/Configs/ResourcesConfig.yaml @@ -107,3 +107,24 @@ ResourceConfigs: Modes: ["display_on", "doze"] Policy: pass_through ApplyType: "global" + + # Reserve "90" for Downstream Resources + - ResType: "0x90" + ResID: "0x0000" + Name: "RES_SCHED_BOOST" + Path: "/proc/sys/walt/sched_boost" + Supported: true + Permissions: third_party + Modes: ["display_on", "doze"] + Policy: pass_through + ApplyType: "global" + + - ResType: "0x90" + ResID: "0x0001" + Name: "RES_CPU_MAX_FREQ" + Path: "/sys/kernel/msm_performance/parameters/cpu_max_freq" + Supported: true + Permissions: third_party + Modes: ["display_on", "doze"] + Policy: higher_is_better + ApplyType: "cluster" diff --git a/Configs/SignalsConfig.yaml b/Configs/SignalsConfig.yaml index a94e7a0..15dc5bf 100644 --- a/Configs/SignalsConfig.yaml +++ b/Configs/SignalsConfig.yaml @@ -21,3 +21,11 @@ SignalConfigs: - {ResCode: "0x00040003", ResInfo: "0x00000000", Values: [1]} - {ResCode: "0x00040004", ResInfo: "0x00000100", Values: [1]} - {ResCode: "0x00040005", ResInfo: "0x00000200", Values: [1]} + + - SigId: "0x0001" + Category: "0x81" + Name: CAM_OPEN + Enable: true + Permissions: ["system", "third_party"] + Resources: + - {ResCode: "0x00030000", Values: [100]} diff --git a/Extensions/Example.cpp b/Extensions/Example.cpp new file mode 100644 index 0000000..fbf6512 --- /dev/null +++ b/Extensions/Example.cpp @@ -0,0 +1,58 @@ +// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. +// SPDX-License-Identifier: BSD-3-Clause-Clear + +#include +#include +#include + +#include +#include + +#include "Helpers.h" + +#define POLICY_DIR_PATH "/sys/devices/system/cpu/cpufreq/" + +static void cpuFreqApplierCallback(void* context) { + /*Resource* res = static_cast(context); + int32_t cluster = res->getClusterValue(); + int64_t value = res->getValueAt(0); + //Get Path + std::string path = "/sys/kernel/msm_performance/parameters/cpu_max_freq"; + + / # cat /sys/kernel/msm_performance/parameters/cpu_max_freq + 0:2147483647 1:2147483647 2:2147483647 3:2147483647 4:2147483647 5:2147483647 6:2147483647 7:2147483647 + / # cat /sys/kernel/msm_performance/parameters/cpu_min_freq + 0:0 1:0 2:0 3:0 4:0 5:0 6:0 7:0 + / # + //Save the value of this Node + //write the requested value + */ + printf("URM-ext: cpuFreqApplierCallback"); + return; +} + +static void cpuFreqTearCallback(void* context) { + // Reset to original if needed, else no_op + printf("URM-ext: cpuFreqTearCallback"); + return; +} + +URM_REGISTER_RES_APPLIER_CB(0x00900001, cpuFreqApplierCallback) +URM_REGISTER_RES_TEAR_CB(0x00900001, cpuFreqTearCallback) + +static void postProcessCallback(void* context) { + if(context == nullptr) { + return; + } + + PostProcessCBData* cbData = static_cast(context); + if(cbData == nullptr) { + return; + } + + // Match to our usecase + cbData->mSigId = CONSTRUCT_SIG_CODE(0x81, 0x0001); + cbData->mSigType = DEFAULT_SIGNAL_TYPE; +} + +URM_REGISTER_POST_PROCESS_CB("gst-launch-1.0", postProcessCallback)