power: Add support for ADPF implementation.
ADPF provided the API for power/performance tuning. Add API support in power HAL. Change-Id: Ie00f97650b209a890da222e5911371a270efb131
This commit is contained in:
22
Power.cpp
22
Power.cpp
@@ -25,11 +25,16 @@
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Changes from Qualcomm Innovation Center are provided under the following license:
|
||||
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||
*/
|
||||
|
||||
#define LOG_TAG "QTI PowerHAL"
|
||||
|
||||
#include "Power.h"
|
||||
#include "PowerHintSession.h"
|
||||
|
||||
#include <android-base/logging.h>
|
||||
|
||||
@@ -125,15 +130,22 @@ ndk::ScopedAStatus Power::isBoostSupported(Boost type, bool* _aidl_return) {
|
||||
*_aidl_return = false;
|
||||
return ndk::ScopedAStatus::ok();
|
||||
}
|
||||
ndk::ScopedAStatus Power::createHintSession(int32_t, int32_t, const std::vector<int32_t>&, int64_t,
|
||||
ndk::ScopedAStatus Power::createHintSession(int32_t tgid, int32_t uid, const std::vector<int32_t>& threadIds, int64_t durationNanos,
|
||||
std::shared_ptr<IPowerHintSession>* _aidl_return) {
|
||||
*_aidl_return = nullptr;
|
||||
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
|
||||
LOG(INFO) << "Power createHintSession";
|
||||
if (threadIds.size() == 0) {
|
||||
LOG(ERROR) << "Error: threadIds.size() shouldn't be " << threadIds.size();
|
||||
*_aidl_return = nullptr;
|
||||
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
|
||||
}
|
||||
*_aidl_return = setPowerHintSession();
|
||||
return ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
ndk::ScopedAStatus Power::getHintSessionPreferredRate(int64_t* outNanoseconds) {
|
||||
*outNanoseconds = -1;
|
||||
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
|
||||
LOG(INFO) << "Power getHintSessionPreferredRate";
|
||||
*outNanoseconds = getSessionPreferredRate();
|
||||
return ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
} // namespace impl
|
||||
|
||||
Reference in New Issue
Block a user