aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBuddy Liong2016-06-17 10:30:07 -0500
committerBuddy Liong2016-06-17 10:30:07 -0500
commitd0d2e63691f4c6906aa9ae28c16f5b92de8c1bcd (patch)
tree6a874121e0c5846ad00fc291682b0f09b45498c9 /libdce.c
parent4e9b02508ac3847df0af5c496a1be7b4ae082ad5 (diff)
downloadrepo-libdce-d0d2e63691f4c6906aa9ae28c16f5b92de8c1bcd.tar.gz
repo-libdce-d0d2e63691f4c6906aa9ae28c16f5b92de8c1bcd.tar.xz
repo-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>
Diffstat (limited to 'libdce.c')
-rw-r--r--libdce.c38
1 files changed, 38 insertions, 0 deletions
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