interfaces: Introduce vendor.qti.hardware.perf interfaces

* Based on observing libqti-perfd-client expectations

Co-authored-by: Alexander Martinz <amartinz@shiftphones.com>
Co-authored-by: Arian <arian.kulmer@web.de>
Change-Id: Ibfc31f377b8d09a73e51da4dd28235fe3e408204
diff --git a/Android.bp b/Android.bp
index 6d420f1..aec7338 100644
--- a/Android.bp
+++ b/Android.bp
@@ -23,6 +23,11 @@
 }
 
 hidl_package_root {
+    name: "vendor.qti.hardware.perf",
+    path: "vendor/qcom/opensource/interfaces/perf",
+}
+
+hidl_package_root {
     name: "vendor.qti.hardware.wifi",
     path: "vendor/qcom/opensource/interfaces/wifi",
 }
diff --git a/perf/1.0/Android.bp b/perf/1.0/Android.bp
new file mode 100644
index 0000000..15cd335
--- /dev/null
+++ b/perf/1.0/Android.bp
@@ -0,0 +1,14 @@
+// This file is autogenerated by hidl-gen -Landroidbp.
+
+hidl_interface {
+    name: "vendor.qti.hardware.perf@1.0",
+    root: "vendor.qti.hardware.perf",
+    system_ext_specific: true,
+    srcs: [
+        "IPerf.hal",
+    ],
+    interfaces: [
+        "android.hidl.base@1.0",
+    ],
+    gen_java: true,
+}
diff --git a/perf/1.0/IPerf.hal b/perf/1.0/IPerf.hal
new file mode 100644
index 0000000..0e7b530
--- /dev/null
+++ b/perf/1.0/IPerf.hal
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2021 The LineageOS Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package vendor.qti.hardware.perf@1.0;
+
+interface IPerf {
+    perfLockAcquire(int32_t pl_handle, uint32_t duration, vec<int32_t> boostsList, int32_t reserved) generates (int32_t ret);
+    perfLockRelease(int32_t pl_handle, int32_t reserved);
+    perfHint(uint32_t hint, string userDataStr, int32_t userData1, int32_t userData2, int32_t reserved) generates (int32_t ret);
+    perfProfile(int32_t pl_handle, int32_t profile, int32_t reserved) generates (int32_t ret);
+    perfLockCmd(int32_t cmd, int32_t reserved);
+};
diff --git a/perf/2.0/Android.bp b/perf/2.0/Android.bp
new file mode 100644
index 0000000..6c1bab3
--- /dev/null
+++ b/perf/2.0/Android.bp
@@ -0,0 +1,14 @@
+// This file is autogenerated by hidl-gen -Landroidbp.
+
+hidl_interface {
+    name: "vendor.qti.hardware.perf@2.0",
+    root: "vendor.qti.hardware.perf",
+    system_ext_specific: true,
+    srcs: [
+        "IPerf.hal",
+    ],
+    interfaces: [
+        "android.hidl.base@1.0",
+    ],
+    gen_java: true,
+}
diff --git a/perf/2.0/IPerf.hal b/perf/2.0/IPerf.hal
new file mode 100644
index 0000000..1faf0cd
--- /dev/null
+++ b/perf/2.0/IPerf.hal
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2021 The LineageOS Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package vendor.qti.hardware.perf@2.0;
+
+interface IPerf {
+    perfLockAcquire(int32_t pl_handle, uint32_t duration, vec<int32_t> boostsList, vec<int32_t> reserved) generates (int32_t ret);
+    perfLockRelease(int32_t pl_handle, vec<int32_t> reserved);
+    perfHint(uint32_t hint, string userDataStr, int32_t userData1, int32_t userData2, vec<int32_t> reserved) generates (int32_t ret);
+    perfProfile(int32_t pl_handle, int32_t profile, int32_t reserved) generates (int32_t ret);
+    perfLockCmd(int32_t cmd, int32_t reserved);
+    perfGetProp(string propName, string defaultVal) generates (string ret);
+    perfSetProp(string propName, string value) generates (int32_t ret);
+    perfAsyncRequest(int32_t cmd, string userDataStr, vec<int32_t> params) generates (int32_t ret);
+    perfSyncRequest(int32_t cmd, string userDataStr, vec<int32_t> params) generates (string ret);
+};
diff --git a/perf/2.1/Android.bp b/perf/2.1/Android.bp
new file mode 100644
index 0000000..e3de373
--- /dev/null
+++ b/perf/2.1/Android.bp
@@ -0,0 +1,16 @@
+// This file is autogenerated by hidl-gen -Landroidbp.
+
+hidl_interface {
+    name: "vendor.qti.hardware.perf@2.1",
+    root: "vendor.qti.hardware.perf",
+    system_ext_specific: true,
+    srcs: [
+        "IPerf.hal",
+        "IPerfCallback.hal",
+    ],
+    interfaces: [
+        "android.hidl.base@1.0",
+        "vendor.qti.hardware.perf@2.0",
+    ],
+    gen_java: true,
+}
diff --git a/perf/2.1/IPerf.hal b/perf/2.1/IPerf.hal
new file mode 100644
index 0000000..7275334
--- /dev/null
+++ b/perf/2.1/IPerf.hal
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2021 The LineageOS Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package vendor.qti.hardware.perf@2.1;
+
+import @2.0::IPerf;
+import IPerfCallback;
+
+interface IPerf extends @2.0::IPerf {
+    perfCallbackRegister(IPerfCallback callback, int32_t clientId) generates (int32_t ret);
+    perfCallbackDeregister(IPerfCallback callback, int32_t clientId) generates (int32_t ret);
+};
diff --git a/perf/2.1/IPerfCallback.hal b/perf/2.1/IPerfCallback.hal
new file mode 100644
index 0000000..e7bf260
--- /dev/null
+++ b/perf/2.1/IPerfCallback.hal
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2021 The LineageOS Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package vendor.qti.hardware.perf@2.1;
+
+interface IPerfCallback {
+    oneway notifyCallback (uint32_t hint, string userDataStr, int32_t userData1, int32_t userData2, vec<int32_t> reserved);
+};
diff --git a/perf/2.2/Android.bp b/perf/2.2/Android.bp
new file mode 100644
index 0000000..8174e35
--- /dev/null
+++ b/perf/2.2/Android.bp
@@ -0,0 +1,16 @@
+// This file is autogenerated by hidl-gen -Landroidbp.
+
+hidl_interface {
+    name: "vendor.qti.hardware.perf@2.2",
+    root: "vendor.qti.hardware.perf",
+    system_ext_specific: true,
+    srcs: [
+        "IPerf.hal",
+    ],
+    interfaces: [
+        "android.hidl.base@1.0",
+        "vendor.qti.hardware.perf@2.0",
+        "vendor.qti.hardware.perf@2.1",
+    ],
+    gen_java: true,
+}
diff --git a/perf/2.2/IPerf.hal b/perf/2.2/IPerf.hal
new file mode 100644
index 0000000..bd648ff
--- /dev/null
+++ b/perf/2.2/IPerf.hal
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2021 The LineageOS Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package vendor.qti.hardware.perf@2.2;
+
+import @2.1::IPerf;
+
+interface IPerf extends @2.1::IPerf {
+    perfLockAcqAndRelease(int32_t pl_handle, uint32_t duration, vec<int32_t> boostsList, vec<int32_t> reserved) generates (int32_t ret);
+    oneway perfEvent(uint32_t eventId, string userDataStr, vec<int32_t> reserved);
+    perfGetFeedback(uint32_t featureId, string userDataStr, vec<int32_t> reserved) generates (int32_t ret);
+};
diff --git a/perf/2.3/Android.bp b/perf/2.3/Android.bp
new file mode 100644
index 0000000..fe41cd8
--- /dev/null
+++ b/perf/2.3/Android.bp
@@ -0,0 +1,17 @@
+// This file is autogenerated by hidl-gen -Landroidbp.
+
+hidl_interface {
+    name: "vendor.qti.hardware.perf@2.3",
+    root: "vendor.qti.hardware.perf",
+    system_ext_specific: true,
+    srcs: [
+        "IPerf.hal",
+    ],
+    interfaces: [
+        "android.hidl.base@1.0",
+        "vendor.qti.hardware.perf@2.0",
+        "vendor.qti.hardware.perf@2.1",
+        "vendor.qti.hardware.perf@2.2",
+    ],
+    gen_java: true,
+}
diff --git a/perf/2.3/IPerf.hal b/perf/2.3/IPerf.hal
new file mode 100644
index 0000000..51f4191
--- /dev/null
+++ b/perf/2.3/IPerf.hal
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2022 The LineageOS Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package vendor.qti.hardware.perf@2.3;
+
+import @2.2::IPerf;
+
+interface IPerf extends @2.2::IPerf {
+    perfHintAcqRel(int32_t pl_handle, uint32_t hint, string pkg_name, int32_t duration, int32_t hint_type, vec<int32_t> reserved) generates (int32_t ret);
+    perfHintRenew(int32_t pl_handle, uint32_t hint, string pkg_name, int32_t duration, int32_t hint_type, vec<int32_t> reserved) generates (int32_t ret);
+};
diff --git a/perf/current.txt b/perf/current.txt
new file mode 100644
index 0000000..f924c22
--- /dev/null
+++ b/perf/current.txt
@@ -0,0 +1,6 @@
+3b62e5f205de632f6c1d6b46d01a2945b5a855ec4a98247515ce8d14b51a4fa3 vendor.qti.hardware.perf@1.0::IPerf
+517008020b188864935535fa5c9ab30c686d01a4e7559659658d61b78fcd7cd1 vendor.qti.hardware.perf@2.0::IPerf
+429bbf6c78faecc882e6d39ea05329be9519b3ae547448ec3cc5c2393b918740 vendor.qti.hardware.perf@2.1::IPerf
+d5308ed1c730c17c0ae57de676255eb68f48846b5e976fccc1b046755e015a2e vendor.qti.hardware.perf@2.1::IPerfCallback
+dd76694de5ef346703b450dc96e6c96e274caacb52fba60ad52cb69352467040 vendor.qti.hardware.perf@2.2::IPerf
+ca3830177c6813da7219ffa8fd4bf2ffc161f9d10bcbb08b334a93838974f852 vendor.qti.hardware.perf@2.3::IPerf