summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBuddy Liong2016-06-17 10:30:07 -0500
committerBuddy Liong2016-06-17 10:30:07 -0500
commitd0d2e63691f4c6906aa9ae28c16f5b92de8c1bcd (patch)
tree6a874121e0c5846ad00fc291682b0f09b45498c9
parent4e9b02508ac3847df0af5c496a1be7b4ae082ad5 (diff)
downloadhardware-ti-libdce-d0d2e63691f4c6906aa9ae28c16f5b92de8c1bcd.tar.gz
hardware-ti-libdce-d0d2e63691f4c6906aa9ae28c16f5b92de8c1bcd.tar.xz
hardware-ti-libdce-d0d2e63691f4c6906aa9ae28c16f5b92de8c1bcd.zip
get_rproc_info: Introduce new API to query remoteproc
This is the initial implementation of an extensible API that allows the user to query various remote core parameters. Currently, there are three query parameters that are supported: 1. CPU Load 2. Total configured heap size 3. Available heap size The intent of this API is to programmatically call the API and feed it in various other tools that can be developed on top of this (for example: soc performance visualization etc.) NOTE: This will require the implementation on ipumm-fw and/or dspdce-fw. Change-Id: I94c309221dbce24162a4f31166890d3acdb2d049 Signed-off-by: Karthik Ramanan <a0393906@ti.com> Signed-off-by: Buddy Liong <buddy.liong@ti.com>
-rw-r--r--dce_rpc.h3
-rw-r--r--libdce.c38
-rw-r--r--libdce.h15
3 files changed, 55 insertions, 1 deletions
diff --git a/dce_rpc.h b/dce_rpc.h
index dcbeaf7..cba0d3f 100644
--- a/dce_rpc.h
+++ b/dce_rpc.h
@@ -60,7 +60,8 @@ typedef enum dce_rpc_call {
60 DCE_RPC_CODEC_CONTROL, 60 DCE_RPC_CODEC_CONTROL,
61 DCE_RPC_CODEC_GET_VERSION, 61 DCE_RPC_CODEC_GET_VERSION,
62 DCE_RPC_CODEC_PROCESS, 62 DCE_RPC_CODEC_PROCESS,
63 DCE_RPC_CODEC_DELETE 63 DCE_RPC_CODEC_DELETE,
64 DCE_RPC_GET_INFO
64} dce_rpc_call; 65} dce_rpc_call;
65 66
66//Enumeration for dce function callback 67//Enumeration for dce function callback
diff --git a/libdce.c b/libdce.c
index 82eaf46..9c7a605 100644
--- a/libdce.c
+++ b/libdce.c
@@ -565,6 +565,44 @@ EXIT:
565 return; 565 return;
566} 566}
567 567
568 /*===============================================================*/
569/** get_rproc_info : Get Information from the Remote proc.
570 *
571 * @ param engine [in] : Engine Handle obtained in Engine_open() call.
572 * @ param info_type [in] : Information type as defined in the rproc_info_type
573+ */
574int32_t get_rproc_info(Engine_Handle engine, rproc_info_type info_type)
575{
576 MmRpc_FxnCtx fxnCtx;
577 int32_t fxnRet;
578 dce_error_status eError = DCE_EOK;
579 int32_t coreIdx = INVALID_CORE;
580 int tableIdx = -1;
581
582 /*Acquire permission to use IPC*/
583 pthread_mutex_lock(&ipc_mutex);
584
585 _ASSERT(engine != NULL, DCE_EINVALID_INPUT);
586
587 /* Marshall function arguments into the send buffer */
588 Fill_MmRpc_fxnCtx(&fxnCtx, DCE_RPC_GET_INFO, 1, 0, NULL);
589 Fill_MmRpc_fxnCtx_Scalar_Params(&(fxnCtx.params[0]), sizeof(rproc_info_type), (int32_t)info_type);
590
591 coreIdx = getCoreIndexFromEngine(engine, &tableIdx);
592 _ASSERT(coreIdx != INVALID_CORE,DCE_EINVALID_INPUT);
593
594 /* Invoke the Remote function through MmRpc */
595 eError = MmRpc_call(MmRpcHandle[coreIdx], &fxnCtx, &fxnRet);
596 _ASSERT(eError == DCE_EOK, DCE_EIPC_CALL_FAIL);
597
598EXIT:
599 /*Relinquish IPC*/
600 pthread_mutex_unlock(&ipc_mutex);
601
602 return fxnRet;
603}
604
605
568/*===============================================================*/ 606/*===============================================================*/
569/** Functions create(), control(), get_version(), process(), delete() are common codec 607/** Functions create(), control(), get_version(), process(), delete() are common codec
570 * glue function signatures which are same for both encoder and decoder 608 * glue function signatures which are same for both encoder and decoder
diff --git a/libdce.h b/libdce.h
index de16f0d..f17422e 100644
--- a/libdce.h
+++ b/libdce.h
@@ -58,6 +58,13 @@ typedef enum dce_error_status {
58 DCE_EOMAPDRM_FAIL = -7 58 DCE_EOMAPDRM_FAIL = -7
59} dce_error_status; 59} dce_error_status;
60 60
61
62typedef enum rproc_info_type {
63 RPROC_CPU_LOAD = 0,
64 RPROC_TOTAL_HEAP_SIZE = 1,
65 RPROC_AVAILABLE_HEAP_SIZE = 2
66} rproc_info_type;
67
61/***************************** Memory Allocation/Free APIs *****************************/ 68/***************************** Memory Allocation/Free APIs *****************************/
62/*=====================================================================================*/ 69/*=====================================================================================*/
63/** dce_alloc : Allocate the Data structures passed to codec-engine APIs 70/** dce_alloc : Allocate the Data structures passed to codec-engine APIs
@@ -183,5 +190,13 @@ int dce_get_fd();
183void dce_set_fd(int fd); 190void dce_set_fd(int fd);
184 191
185 192
193 /*===============================================================*/
194/** get_rproc_info : Get Information from the Remote proc.
195 *
196 * @ param engine [in] : Engine Handle obtained in Engine_open() call.
197 * @ param info_type [in] : Information type as defined in the rproc_info_type
198+ */
199int32_t get_rproc_info(Engine_Handle engine, rproc_info_type info_type);
200
186#endif /* __LIBDCE_H__ */ 201#endif /* __LIBDCE_H__ */
187 202