Compare commits

3 Commits
vic ... bka

Author SHA1 Message Date
rio004
06c2f57a69 mediatek: Add dummy libperfctl_vendor library
Change-Id: Ia28f02499fcb798d5b59d261070d93b947852b0e
Signed-off-by: rio004 <riyon336@gmail.com>
Signed-off-by: Saikrishna1504 <saikrishna26918@gmail.com>
2025-12-09 22:18:32 +05:30
rio004
f02501ff7e interfaces: Initial reverse engineered mtkpower AIDL interface
Change-Id: I214ac76ec5fb787f8dce11878fd8e0c6e822af1a
Signed-off-by: rio004 <riyon336@gmail.com>
Signed-off-by: Saikrishna1504 <saikrishna26918@gmail.com>
2025-12-09 22:18:18 +05:30
rio004
2865516922 vintf: Import/Upstream more FCMs
Change-Id: I52e7c2b17090e882f1bb3854f84ab336a03b4127
Signed-off-by: rio004 <riyon336@gmail.com>
Signed-off-by: Saikrishna1504 <saikrishna26918@gmail.com>
2025-12-09 22:18:07 +05:30
14 changed files with 478 additions and 9 deletions

28
aidl/mtkpower/Android.bp Normal file
View File

@@ -0,0 +1,28 @@
/*
* Copyright (C) 2024 The LineageOS Project
*
* SPDX-License-Identifier: Apache-2.0
*/
aidl_interface {
name: "vendor.mediatek.hardware.mtkpower",
vendor_available: true,
srcs: ["vendor/mediatek/hardware/mtkpower/*.aidl"],
stability: "vintf",
owner: "mediatek",
backend: {
cpp: {
enabled: true,
},
java: {
sdk_version: "module_current",
},
},
versions_with_info: [
{
version: "1",
imports: [],
},
],
}

View File

@@ -0,0 +1 @@
467acd9434d0afec502dd4bb33140f0d98025d29

View File

@@ -0,0 +1,31 @@
/*
* Copyright (C) 2024 The LineageOS Project
*
* SPDX-License-Identifier: Apache-2.0
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.mediatek.hardware.mtkpower;
@VintfStability
interface IMtkPerf {
int perfCusLockHint(in int hint, in int duration);
int perfLockAcquire(in int pl_handle, in int duration, in int[] boostsList, in int reserved);
oneway void perfLockRelease(in int pl_handle, in int reserved);
int perfLockReleaseSync(in int pl_handle, in int reserved);
}

View File

@@ -0,0 +1,31 @@
/*
* Copyright (C) 2024 The LineageOS Project
*
* SPDX-License-Identifier: Apache-2.0
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.mediatek.hardware.mtkpower;
@VintfStability
interface IMtkPowerCallback {
oneway void mtkPowerHint(in int hint, in int duration);
oneway void notifyAppState(in String pack, in String act, in int pid, in int state,
in int uid);
oneway void notifyScnUpdate(in int hint, in int data);
}

View File

@@ -0,0 +1,37 @@
/*
* Copyright (C) 2024 The LineageOS Project
*
* SPDX-License-Identifier: Apache-2.0
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.mediatek.hardware.mtkpower;
import vendor.mediatek.hardware.mtkpower.IMtkPowerCallback;
@VintfStability
interface IMtkPowerService {
oneway void mtkCusPowerHint(in int hint, in int data);
oneway void mtkPowerHint(in int hint, in int data);
oneway void notifyAppState(in String pack, in String act, in int pid, in int state,
in int uid);
int querySysInfo(in int cmd, in int param);
int setMtkPowerCallback(in IMtkPowerCallback callback);
int setMtkScnUpdateCallback(in int hint, in IMtkPowerCallback callback);
int setSysInfo(in int type, in String data);
void setSysInfoAsync(in int type, in String data);
}

View File

@@ -0,0 +1,31 @@
/*
* Copyright (C) 2024 The LineageOS Project
*
* SPDX-License-Identifier: Apache-2.0
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.mediatek.hardware.mtkpower;
@VintfStability
interface IMtkPerf {
int perfCusLockHint(in int hint, in int duration);
int perfLockAcquire(in int pl_handle, in int duration, in int[] boostsList, in int reserved);
oneway void perfLockRelease(in int pl_handle, in int reserved);
int perfLockReleaseSync(in int pl_handle, in int reserved);
}

View File

@@ -0,0 +1,30 @@
/*
* Copyright (C) 2024 The LineageOS Project
*
* SPDX-License-Identifier: Apache-2.0
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.mediatek.hardware.mtkpower;
@VintfStability
interface IMtkPowerCallback {
oneway void mtkPowerHint(in int hint, in int duration);
oneway void notifyAppState(in String pack, in String act, in int pid, in int state, in int uid);
oneway void notifyScnUpdate(in int hint, in int data);
}

View File

@@ -0,0 +1,35 @@
/*
* Copyright (C) 2024 The LineageOS Project
*
* SPDX-License-Identifier: Apache-2.0
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.mediatek.hardware.mtkpower;
@VintfStability
interface IMtkPowerService {
oneway void mtkCusPowerHint(in int hint, in int data);
oneway void mtkPowerHint(in int hint, in int data);
oneway void notifyAppState(in String pack, in String act, in int pid, in int state, in int uid);
int querySysInfo(in int cmd, in int param);
int setMtkPowerCallback(in vendor.mediatek.hardware.mtkpower.IMtkPowerCallback callback);
int setMtkScnUpdateCallback(in int hint, in vendor.mediatek.hardware.mtkpower.IMtkPowerCallback callback);
int setSysInfo(in int type, in String data);
void setSysInfoAsync(in int type, in String data);
}

View File

@@ -0,0 +1,15 @@
/*
* Copyright (C) 2024 The LineageOS Project
*
* SPDX-License-Identifier: Apache-2.0
*/
package vendor.mediatek.hardware.mtkpower;
@VintfStability
interface IMtkPerf {
int perfCusLockHint(in int hint, in int duration);
int perfLockAcquire(in int pl_handle, in int duration, in int[] boostsList, in int reserved);
oneway void perfLockRelease(in int pl_handle, in int reserved);
int perfLockReleaseSync(in int pl_handle, in int reserved);
}

View File

@@ -0,0 +1,15 @@
/*
* Copyright (C) 2024 The LineageOS Project
*
* SPDX-License-Identifier: Apache-2.0
*/
package vendor.mediatek.hardware.mtkpower;
@VintfStability
interface IMtkPowerCallback {
oneway void mtkPowerHint(in int hint, in int duration);
oneway void notifyAppState(in String pack, in String act, in int pid, in int state,
in int uid);
oneway void notifyScnUpdate(in int hint, in int data);
}

View File

@@ -0,0 +1,22 @@
/*
* Copyright (C) 2024 The LineageOS Project
*
* SPDX-License-Identifier: Apache-2.0
*/
package vendor.mediatek.hardware.mtkpower;
import vendor.mediatek.hardware.mtkpower.IMtkPowerCallback;
@VintfStability
interface IMtkPowerService {
oneway void mtkCusPowerHint(in int hint, in int data);
oneway void mtkPowerHint(in int hint, in int data);
oneway void notifyAppState(in String pack, in String act, in int pid, in int state,
in int uid);
int querySysInfo(in int cmd, in int param);
int setMtkPowerCallback(in IMtkPowerCallback callback);
int setMtkScnUpdateCallback(in int hint, in IMtkPowerCallback callback);
int setSysInfo(in int type, in String data);
void setSysInfoAsync(in int type, in String data);
}

View File

@@ -40,3 +40,10 @@ cc_library_shared {
defaults: ["libpowerhalwrap_defaults"],
vendor: true,
}
cc_library_shared {
name: "libperfctl_vendor",
vendor: true,
srcs: ["perfctl_vendor.c"],
shared_libs: ["liblog"],
}

View File

@@ -0,0 +1,66 @@
/*
* Copyright (C) 2024 The LineageOS Project
*
* SPDX-License-Identifier: Apache-2.0
*/
#define LOG_TAG "libperfctl_vendor"
#include <log/log.h>
uint64_t earaNotifyCVJobBegin(uint64_t jobId, uint64_t jobPriority, uint64_t* result) {
ALOGD("[%s]: jobId: %llu, jobPriority: %llu, result: %p", __func__, jobId, jobPriority, result);
return 0;
}
uint64_t earaNotifyCVJobEnd(uint64_t jobId, uint64_t timestamp, uint32_t* status) {
ALOGD("[%s]: jobId: %llu, timestamp: %llu, status: %p", __func__, jobId, timestamp, status);
return 0;
}
void earaGetUsage(uint32_t param1, uint32_t* usage, uint32_t* status) {
ALOGD("[%s]: param1: %u, usage: %p, status: %p", __func__, param1, usage, status);
}
void earaNotifyJobBegin(uint32_t jobId, uint64_t jobData, int64_t* param3, int64_t* param4) {
ALOGD("[%s]: jobId: %u, jobData: %llu, param3: %p, param4: %p", __func__, jobId, jobData,
param3, param4);
}
uint64_t earaNotifyJobEnd(uint32_t jobId, uint64_t timestamp, uint32_t* status, uint32_t flags,
int64_t* inputData, int64_t* outputData, uint64_t context,
int64_t* result) {
ALOGD("[%s]: jobId: %u, timestamp: %llu, status: %p, flags: %u, inputData: "
"%p, outputData: %p, context: %llu, result: %p",
__func__, jobId, timestamp, status, flags, inputData, outputData, context, result);
return 0;
}
void fbcNotifyTouch(int touchEvent) {
ALOGD("[%s]: touchEvent: %d", __func__, touchEvent);
}
void xgfGetCamApkPid(uint32_t pid, uint32_t apkId, uint32_t flag) {
ALOGD("[%s]: pid: %u, apkId: %u, flag: %u", __func__, pid, apkId, flag);
}
void xgfGetCamServerPid(void) {
ALOGD("[%s]: Get camera server PID", __func__);
}
void xgfGetFPS(int32_t* currentFPS, int32_t* averageFPS) {
ALOGD("[%s]: currentFPS: %p, averageFPS: %p", __func__, currentFPS, averageFPS);
}
void xgfGetFstbActive(uint64_t status) {
ALOGD("[%s]: status: %llu", __func__, status);
}
void xgfWaitFstbActive(void) {
ALOGD("%s called", __func__);
}
uint32_t xgfGetCmd(uint64_t* param) {
ALOGD("[%s]: param: %p", __func__, param);
return 0;
}

View File

@@ -48,7 +48,7 @@
</hal>
<hal format="aidl" optional="true">
<name>android.hardware.radio.modem</name>
<version>1</version>
<version>1-2</version>
<interface>
<name>IRadioModem</name>
<instance>slot4</instance>
@@ -64,7 +64,7 @@
</hal>
<hal format="aidl" optional="true">
<name>android.hardware.radio.network</name>
<version>1</version>
<version>1-2</version>
<interface>
<name>IRadioNetwork</name>
<instance>slot4</instance>
@@ -76,7 +76,7 @@
</hal>
<hal format="aidl" optional="true">
<name>android.hardware.radio.sim</name>
<version>1</version>
<version>1-2</version>
<interface>
<name>IRadioSim</name>
<instance>slot4</instance>
@@ -92,7 +92,7 @@
</hal>
<hal format="aidl" optional="true">
<name>android.hardware.radio.voice</name>
<version>1</version>
<version>1-2</version>
<interface>
<name>IRadioVoice</name>
<instance>slot4</instance>
@@ -102,6 +102,14 @@
<instance>imsSlot4</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>arm.mali.platform</name>
<version>1-2</version>
<interface>
<name>ICompression</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.mediatek.hardware.aee</name>
<transport>hwbinder</transport>
@@ -134,7 +142,7 @@
</hal>
<hal format="aidl" optional="true">
<name>vendor.mediatek.hardware.apuware.apusys</name>
<version>1</version>
<version>1-2</version>
<interface>
<name>INeuronApusys</name>
<instance>default</instance>
@@ -159,6 +167,14 @@
<instance>default</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>vendor.mediatek.hardware.apuware.utils</name>
<version>1</version>
<interface>
<name>IApuwareUtils</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.mediatek.hardware.apuware.xrp</name>
<transport>hwbinder</transport>
@@ -178,6 +194,14 @@
<instance>default</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>vendor.mediatek.hardware.audio</name>
<version>1</version>
<interface>
<name>IMtkAudio</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.mediatek.hardware.bluetooth.audio</name>
<transport>hwbinder</transport>
@@ -213,6 +237,14 @@
<instance>default</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>vendor.mediatek.hardware.camera.atms</name>
<version>1</version>
<interface>
<name>IATMs</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.mediatek.hardware.camera.bgservice</name>
<transport>hwbinder</transport>
@@ -222,6 +254,14 @@
<instance>internal/0</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>vendor.mediatek.hardware.camera.bgservice</name>
<version>1</version>
<interface>
<name>IBGService</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.mediatek.hardware.camera.ccap</name>
<transport>hwbinder</transport>
@@ -240,6 +280,14 @@
<instance>internal/0</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>vendor.mediatek.hardware.camera.isphal</name>
<version>1</version>
<interface>
<name>IISPModule</name>
<instance>internal/1</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.mediatek.hardware.camera.postproc</name>
<transport>hwbinder</transport>
@@ -267,6 +315,14 @@
<instance>default</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>vendor.mediatek.hardware.composer_ext</name>
<version>1</version>
<interface>
<name>IComposerExt</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.mediatek.hardware.dfps</name>
<transport>hwbinder</transport>
@@ -311,6 +367,14 @@
<instance>default</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>vendor.mediatek.hardware.gnss</name>
<version>1</version>
<interface>
<name>IMtkGnss</name>
<instance>default</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>vendor.mediatek.hardware.gnss.batching</name>
<version>1</version>
@@ -452,6 +516,22 @@
<instance>LoggerHidlServer</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>vendor.mediatek.hardware.mbrain</name>
<version>1</version>
<interface>
<name>IMBrain</name>
<instance>default</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>vendor.mediatek.hardware.mbrainj</name>
<version>1</version>
<interface>
<name>IMBrainJava</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.mediatek.hardware.mdmonitor</name>
<transport>hwbinder</transport>
@@ -470,9 +550,17 @@
<instance>default</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>vendor.mediatek.hardware.mmagent</name>
<version>1</version>
<interface>
<name>IMMAgent</name>
<instance>default</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>vendor.mediatek.hardware.mmlpq</name>
<version>2</version>
<version>2-3</version>
<interface>
<name>IMmlpq</name>
<instance>default</instance>
@@ -509,6 +597,14 @@
<instance>default</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>vendor.mediatek.hardware.mtkpower</name>
<interface>
<version>1</version>
<name>IMtkPowerService</name>
<instance>default</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>vendor.mediatek.hardware.mtkpower_applist</name>
<version>1</version>
@@ -603,7 +699,7 @@
</hal>
<hal format="aidl" optional="true">
<name>vendor.mediatek.hardware.mtkradioex.data</name>
<version>1</version>
<version>1-2</version>
<interface>
<name>IMtkRadioExData</name>
<instance>slot1</instance>
@@ -636,7 +732,7 @@
</hal>
<hal format="aidl" optional="true">
<name>vendor.mediatek.hardware.mtkradioex.modem</name>
<version>1</version>
<version>1-2</version>
<interface>
<name>IMtkRadioExModem</name>
<instance>slot1</instance>
@@ -698,6 +794,14 @@
<instance>default</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>vendor.mediatek.hardware.netdagent</name>
<version>1</version>
<interface>
<name>INetdagents</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.mediatek.hardware.neuropilot.agent</name>
<transport>hwbinder</transport>
@@ -716,6 +820,14 @@
<instance>default</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>vendor.mediatek.hardware.nvram</name>
<version>1</version>
<interface>
<name>INvram</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.mediatek.hardware.nwk_opt</name>
<transport>hwbinder</transport>
@@ -754,7 +866,7 @@
</hal>
<hal format="aidl" optional="true">
<name>vendor.mediatek.hardware.pq_aidl</name>
<version>1</version>
<version>1-7</version>
<interface>
<name>IPictureQuality_AIDL</name>
<instance>default</instance>
@@ -822,6 +934,14 @@
<instance>default</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>vendor.mediatek.hardware.videotelephony</name>
<version>1</version>
<interface>
<name>IVideoTelephony</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.mediatek.hardware.vpu</name>
<transport>hwbinder</transport>