hv_drv_OsdIndex.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /**
  2. * @file hv_drv_OsdIndex.h
  3. * @brief Osd driver layer index orgnization interface.
  4. * @verbatim
  5. * ==============================================================================
  6. * ##### How to use this driver #####
  7. * ==============================================================================
  8. * (+) Use Hv_Drv_OsdIndex_Init(...) to init index offset.
  9. * (+) Use Hv_Drv_OsdIndex_AllocRegion(...) to alloc index region for window.
  10. * (+) Use Hv_Drv_OsdIndex_NewRow(...) to alloc normal row structure.
  11. * (+) Use Hv_Drv_OsdIndex_NewEndRow(...) to append end row at last.
  12. * (+) Use Hv_Drv_OsdIndex_FillBlankLines(...) to fill row blank space.
  13. * (+) Use Hv_Drv_OsdIndex_FillColumnBlanks(...) to fill column blank space.
  14. * (+) Use Hv_Drv_OsdIndex_SetChangeRange(...) to record index change range.
  15. * (+) Use Hv_Drv_OsdIndex_TransferIndex(...) to transfer index change to OSD SRAM.
  16. * @endverbatim
  17. *
  18. * @author HiView SoC Software Team
  19. * @version 0.0.1
  20. * @date 2022-08-22
  21. */
  22. #ifndef __HV_DRV_OSDINDEX_H
  23. #define __HV_DRV_OSDINDEX_H
  24. #include "hv_drv_Osd.h"
  25. /**
  26. * @brief reset index offset to 0
  27. * @param[in] None
  28. * @return VOID without return
  29. */
  30. VOID Hv_Drv_OsdIndex_ResetOffset(VOID);
  31. /**
  32. * @brief allocate index region for current window
  33. * @param[in] usSize region size need
  34. * @return VOID without return
  35. */
  36. VOID Hv_Drv_OsdIndex_AllocRegion(USHORT16 usSize);
  37. /**
  38. * @brief Get current index DDR address
  39. * @param[in] None
  40. * @return DDR address of index
  41. */
  42. UCHAR8 *Hv_Drv_OsdIndex_GetCurrentAddress(VOID);
  43. /**
  44. * @brief Get index management data for current window
  45. * @param[in] None
  46. * @return data structure for current window
  47. */
  48. OsdIndexInfo *Hv_Drv_OsdIndex_GetCurrentIndexInfo(VOID);
  49. /**
  50. * @brief calculate columns of one row for current window
  51. * @param[in] usWinWidth width of window
  52. * @param[in] ucFixColumns user specified fix columns, 0 if not specified
  53. * @return column number of one row
  54. */
  55. UCHAR8 Hv_Drv_OsdIndex_RowColumnNum(USHORT16 usWinWidth, UCHAR8 ucFixColumns);
  56. /**
  57. * @brief fill blank columns between two components
  58. * @param[in] pstColumn current column
  59. * @param[in] usDiff total blank pixels need to fill
  60. * @param[in] ucWidth width of blank column
  61. * @return column structure after fill
  62. */
  63. OsdIndexColumn *Hv_Drv_OsdIndex_FillColumnBlanks(OsdIndexColumn *pstColumn,
  64. USHORT16 usDiff, UCHAR8 ucWidth);
  65. /**
  66. * @brief allocate a new NORMAL row structure
  67. * @param[in] pstPrevRow previous row structure, NULL for first row
  68. * @return row structure allocated
  69. */
  70. OsdIndexRow* Hv_Drv_OsdIndex_NewRow(OsdIndexRow *pstPrevRow);
  71. /**
  72. * @brief append END row for current window
  73. * @param[in] None
  74. * @return VOID without return
  75. */
  76. VOID Hv_Drv_OsdIndex_NewEndRow(VOID);
  77. /**
  78. * @brief fill blank rows between two NORMAL rows
  79. * @param[in] pstCurRow current row structure
  80. * @param[in] usPixels pixels need to fill between pstCurRow and next row
  81. * @return row structure after blank filled, blank row maybe inserted
  82. */
  83. OsdIndexRow* Hv_Drv_OsdIndex_FillBlankLines(OsdIndexRow *pstCurRow, USHORT16 usPixels);
  84. /**
  85. * @brief Get row structure by row Index
  86. * @param[in] ucRowIndex row index of current window
  87. * @return row structure required
  88. */
  89. OsdIndexRow* Hv_Drv_OsdIndex_GetRow(UCHAR8 ucRowIndex);
  90. /**
  91. * @brief set Index change range
  92. * @param[in] enType index change type OSD_SRAM_CHANGE_NONE: index area clean
  93. * OSD_SRAM_CHANGE_PARTIAL: partial area of index dirty
  94. * OSD_SRAM_CHANGE_FULL: whole area of index dirty
  95. * @param[in] uiChangeStart start position of this change
  96. * @param[in] uiChangeEnd end position of this change
  97. * @return VOID without return
  98. */
  99. VOID Hv_Drv_OsdIndex_SetChangeRange(OsdSRAMChangeType enType, UINT32 uiChangeStart, UINT32 uiChangeEnd);
  100. /**
  101. * @brief transfer index change area to OSD RAM
  102. * @param[in] None
  103. * @return VOID without return
  104. */
  105. VOID Hv_Drv_OsdIndex_TransferIndex(VOID);
  106. /**
  107. * @brief reset index offset to 0
  108. * @param[in] None
  109. * @return VOID without return
  110. */
  111. VOID Hv_Drv_OsdIndex_Init(VOID);
  112. #ifdef HV_SCALER_DEBUG_VERSION
  113. extern USHORT16 g_usMaxIndexSize;
  114. #endif
  115. #endif