hi_comm_vb.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /******************************************************************************
  2. Copyright (C), 2016, Hisilicon Tech. Co., Ltd.
  3. ******************************************************************************
  4. File Name : hi_comm_vb.h
  5. Version : Initial Draft
  6. Author : Hisilicon multimedia software group
  7. Created : 2016/07/15
  8. Last Modified :
  9. Description : The common data type defination for VB module.
  10. Function List :
  11. ******************************************************************************/
  12. #ifndef __HI_COMM_VB_H__
  13. #define __HI_COMM_VB_H__
  14. #include "hi_type.h"
  15. #include "hi_errno.h"
  16. #include "hi_debug.h"
  17. #ifdef __cplusplus
  18. #if __cplusplus
  19. extern "C"{
  20. #endif
  21. #endif /* End of #ifdef __cplusplus */
  22. #define VB_INVALID_POOLID (-1U)
  23. #define VB_INVALID_HANDLE (-1U)
  24. #define VB_MAX_COMM_POOLS 16
  25. #define VB_MAX_MOD_COMM_POOLS 16
  26. /* user ID for VB */
  27. #define VB_MAX_USER VB_UID_BUTT
  28. typedef enum hiVB_UID_E
  29. {
  30. VB_UID_VI = 0,
  31. VB_UID_VO = 1,
  32. VB_UID_VGS = 2,
  33. VB_UID_VENC = 3,
  34. VB_UID_VDEC = 4,
  35. VB_UID_H265E = 5,
  36. VB_UID_H264E = 6,
  37. VB_UID_JPEGE = 7,
  38. VB_UID_H264D = 8,
  39. VB_UID_JPEGD = 9,
  40. VB_UID_VPSS = 10,
  41. VB_UID_DIS = 11,
  42. VB_UID_USER = 12,
  43. VB_UID_PCIV = 13,
  44. VB_UID_AI = 14,
  45. VB_UID_AENC = 15,
  46. VB_UID_RC = 16,
  47. VB_UID_VFMW = 17,
  48. VB_UID_GDC = 18,
  49. VB_UID_AVS = 19,
  50. VB_UID_DPU_RECT = 20,
  51. VB_UID_DPU_MATCH = 21,
  52. VB_UID_BUTT = 22,
  53. } VB_UID_E;
  54. /* Generall common pool use this owner id, module common pool use VB_UID as owner id */
  55. #define POOL_OWNER_COMMON -1
  56. /* Private pool use this owner id */
  57. #define POOL_OWNER_PRIVATE -2
  58. typedef HI_U32 VB_POOL;
  59. typedef HI_U32 VB_BLK;
  60. #define RESERVE_MMZ_NAME "window"
  61. typedef enum hiVB_REMAP_MODE_E
  62. {
  63. VB_REMAP_MODE_NONE = 0, /* no remap */
  64. VB_REMAP_MODE_NOCACHE = 1, /* no cache remap */
  65. VB_REMAP_MODE_CACHED = 2, /* cache remap, if you use this mode, you should flush cache by yourself */
  66. VB_REMAP_MODE_BUTT
  67. } VB_REMAP_MODE_E;
  68. typedef struct hiVB_POOL_CONFIG_S
  69. {
  70. HI_U64 u64BlkSize;
  71. HI_U32 u32BlkCnt;
  72. VB_REMAP_MODE_E enRemapMode;
  73. HI_CHAR acMmzName[MAX_MMZ_NAME_LEN];
  74. }VB_POOL_CONFIG_S;
  75. typedef struct hiVB_CONFIG_S
  76. {
  77. HI_U32 u32MaxPoolCnt;
  78. VB_POOL_CONFIG_S astCommPool[VB_MAX_COMM_POOLS];
  79. } VB_CONFIG_S;
  80. typedef struct hiVB_POOL_STATUS_S
  81. {
  82. HI_U32 bIsCommPool;
  83. HI_U32 u32BlkCnt;
  84. HI_U32 u32FreeBlkCnt;
  85. }VB_POOL_STATUS_S;
  86. #define VB_SUPPLEMENT_JPEG_MASK 0x1
  87. #define VB_SUPPLEMENT_ISPINFO_MASK 0x2
  88. #define VB_SUPPLEMENT_MOTION_DATA_MASK 0x4
  89. #define VB_SUPPLEMENT_DNG_MASK 0x8
  90. typedef struct hiVB_SUPPLEMENT_CONFIG_S
  91. {
  92. HI_U32 u32SupplementConfig;
  93. }VB_SUPPLEMENT_CONFIG_S;
  94. #define HI_ERR_VB_NULL_PTR HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR)
  95. #define HI_ERR_VB_NOMEM HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM)
  96. #define HI_ERR_VB_NOBUF HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF)
  97. #define HI_ERR_VB_UNEXIST HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST)
  98. #define HI_ERR_VB_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM)
  99. #define HI_ERR_VB_NOTREADY HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY)
  100. #define HI_ERR_VB_BUSY HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY)
  101. #define HI_ERR_VB_NOT_PERM HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM)
  102. #define HI_ERR_VB_SIZE_NOT_ENOUGH HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_SIZE_NOT_ENOUGH)
  103. #define HI_ERR_VB_2MPOOLS HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_BUTT + 1)
  104. #define HI_TRACE_VB(level, fmt,...)\
  105. do{ \
  106. HI_TRACE(level, HI_ID_VB,"[Func]:%s [Line]:%d [Info]:"fmt,__FUNCTION__, __LINE__,##__VA_ARGS__);\
  107. }while(0)
  108. #ifdef __cplusplus
  109. #if __cplusplus
  110. }
  111. #endif
  112. #endif /* __cplusplus */
  113. #endif /* __HI_COMM_VB_H_ */