mpi_sys.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /******************************************************************************
  2. Copyright (C), 2016-2018, Hisilicon Tech. Co., Ltd.
  3. ******************************************************************************
  4. File Name : mpi_sys.h
  5. Version : Initial Draft
  6. Author : Hisilicon multimedia software group
  7. Created : 2016/07/15
  8. Last Modified :
  9. Description : MPP Programe Interface for system control moudle
  10. Function List :
  11. ******************************************************************************/
  12. #ifndef __MPI_SYS_H__
  13. #define __MPI_SYS_H__
  14. #include "hi_type.h"
  15. #include "hi_common.h"
  16. #include "hi_comm_sys.h"
  17. #ifdef __cplusplus
  18. #if __cplusplus
  19. extern "C" {
  20. #endif
  21. #endif /* End of #ifdef __cplusplus */
  22. HI_S32 HI_MPI_SYS_Init(HI_VOID);
  23. HI_S32 HI_MPI_SYS_Exit(HI_VOID);
  24. HI_S32 HI_MPI_SYS_SetConfig(const MPP_SYS_CONFIG_S* pstSysConfig);
  25. HI_S32 HI_MPI_SYS_GetConfig(MPP_SYS_CONFIG_S* pstSysConfig);
  26. HI_S32 HI_MPI_SYS_Bind(const MPP_CHN_S* pstSrcChn, const MPP_CHN_S* pstDestChn);
  27. HI_S32 HI_MPI_SYS_UnBind(const MPP_CHN_S* pstSrcChn, const MPP_CHN_S* pstDestChn);
  28. HI_S32 HI_MPI_SYS_GetBindbyDest(const MPP_CHN_S* pstDestChn, MPP_CHN_S* pstSrcChn);
  29. HI_S32 HI_MPI_SYS_GetBindbySrc(const MPP_CHN_S *pstSrcChn, MPP_BIND_DEST_S *pstBindDest);
  30. HI_S32 HI_MPI_SYS_GetVersion(MPP_VERSION_S* pstVersion);
  31. HI_S32 HI_MPI_SYS_GetChipId(HI_U32 *pu32ChipId);
  32. HI_S32 HI_MPI_SYS_GetCustomCode(HI_U32 *pu32CustomCode);
  33. /*
  34. ** u64Base is the global PTS of the system.
  35. ** ADVICE:
  36. ** 1. Better to call HI_MPI_SYS_GetCurPTS on the host board to get u64Base.
  37. ** 2. When os start up, call HI_MPI_SYS_InitPTSBase to set the init PTS.
  38. ** 3. When media bussines is running, synchronize the PTS one time per minute
  39. ** by calling HI_MPI_SYS_SyncPTS.
  40. */
  41. HI_S32 HI_MPI_SYS_GetCurPTS(HI_U64* pu64CurPTS);
  42. HI_S32 HI_MPI_SYS_InitPTSBase(HI_U64 u64PTSBase);
  43. HI_S32 HI_MPI_SYS_SyncPTS(HI_U64 u64PTSBase);
  44. /* alloc mmz memory in user context */
  45. HI_S32 HI_MPI_SYS_MmzAlloc(HI_U64* pu64PhyAddr, HI_VOID** ppVirAddr,
  46. const HI_CHAR* strMmb, const HI_CHAR* strZone, HI_U32 u32Len);
  47. /* alloc mmz memory with cache */
  48. HI_S32 HI_MPI_SYS_MmzAlloc_Cached(HI_U64* pu64PhyAddr, HI_VOID** ppVirAddr,
  49. const HI_CHAR* pstrMmb, const HI_CHAR* pstrZone, HI_U32 u32Len);
  50. /* free mmz memory in user context */
  51. HI_S32 HI_MPI_SYS_MmzFree(HI_U64 u64PhyAddr, HI_VOID* pVirAddr);
  52. /* fulsh cache */
  53. HI_S32 HI_MPI_SYS_MmzFlushCache(HI_U64 u64PhyAddr, HI_VOID* pVirAddr, HI_U32 u32Size);
  54. /*
  55. ** Call the mmap function to map physical address to virtual address
  56. ** The system function mmap is too complicated, so we packge it.
  57. */
  58. HI_VOID* HI_MPI_SYS_Mmap(HI_U64 u64PhyAddr, HI_U32 u32Size);
  59. HI_VOID* HI_MPI_SYS_MmapCache(HI_U64 u64PhyAddr, HI_U32 u32Size);
  60. HI_S32 HI_MPI_SYS_Munmap(HI_VOID* pVirAddr, HI_U32 u32Size);
  61. HI_S32 HI_MPI_SYS_MflushCache(HI_U64 u64PhyAddr, HI_VOID *pVirAddr, HI_U32 u32Size);
  62. HI_S32 HI_MPI_SYS_SetMemConfig(const MPP_CHN_S* pstMppChn, const HI_CHAR* pcMmzName);
  63. HI_S32 HI_MPI_SYS_GetMemConfig(const MPP_CHN_S* pstMppChn, HI_CHAR* pcMmzName);
  64. /* Close all the FD which is used by sys module */
  65. HI_S32 HI_MPI_SYS_CloseFd(HI_VOID);
  66. /* Get virtual meminfo according to virtual addr, should be in one process */
  67. HI_S32 HI_MPI_SYS_GetVirMemInfo(const void* pVirAddr, SYS_VIRMEM_INFO_S* pstMemInfo);
  68. /* Set/get Scale coefficient level for VPSS/VGS*/
  69. HI_S32 HI_MPI_SYS_SetScaleCoefLevel(const SCALE_RANGE_S *pstScaleRange, const SCALE_COEFF_LEVEL_S *pstScaleCoeffLevel);
  70. HI_S32 HI_MPI_SYS_GetScaleCoefLevel(const SCALE_RANGE_S *pstScaleRange, SCALE_COEFF_LEVEL_S *pstScaleCoeffLevel);
  71. /* Set/Get local timezone, range: [-86400, 86400] seconds (that is: [-24, 24] hours) */
  72. HI_S32 HI_MPI_SYS_SetTimeZone(HI_S32 s32TimeZone);
  73. HI_S32 HI_MPI_SYS_GetTimeZone(HI_S32 *ps32TimeZone);
  74. HI_S32 HI_MPI_SYS_SetGPSInfo(const GPS_INFO_S *pstGPSInfo);
  75. HI_S32 HI_MPI_SYS_GetGPSInfo(GPS_INFO_S *pstGPSInfo);
  76. HI_S32 HI_MPI_SYS_SetTuningConnect(HI_S32 s32Connect);
  77. HI_S32 HI_MPI_SYS_GetTuningConnect(HI_S32* ps32Connect);
  78. HI_S32 HI_MPI_SYS_SetVIVPSSMode(const VI_VPSS_MODE_S* pstVIVPSSMode);
  79. HI_S32 HI_MPI_SYS_GetVIVPSSMode(VI_VPSS_MODE_S* pstVIVPSSMode);
  80. HI_S32 HI_MPI_LOG_SetLevelConf(LOG_LEVEL_CONF_S *pstConf);
  81. HI_S32 HI_MPI_LOG_GetLevelConf(LOG_LEVEL_CONF_S *pstConf);
  82. HI_S32 HI_MPI_LOG_SetWaitFlag(HI_BOOL bWait);
  83. HI_S32 HI_MPI_LOG_Read(HI_CHAR *pBuf, HI_U32 u32Size);
  84. HI_VOID HI_MPI_LOG_Close(HI_VOID);
  85. #ifdef __cplusplus
  86. #if __cplusplus
  87. }
  88. #endif
  89. #endif /* End of #ifdef __cplusplus */
  90. #endif /*__MPI_SYS_H__ */