stf_isp_yhist_rdma.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. /**
  2. ******************************************************************************
  3. * @file stf_isp_yhist_rdma.h
  4. * @author StarFive Isp Team
  5. * @version V1.0
  6. * @date 12/14/2019
  7. * @brief
  8. ******************************************************************************
  9. * @copy
  10. *
  11. * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  12. * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  13. * TIME. AS A RESULT, STARFIVE SHALL NOT BE HELD LIABLE FOR ANY
  14. * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  15. * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  16. * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  17. *
  18. * Copyright (C) 2019 - 2022 StarFive Technology Co., Ltd.
  19. */
  20. #ifndef __STF_ISP_YHIST_RDMA_H__
  21. #define __STF_ISP_YHIST_RDMA_H__
  22. #include "registers/stf_isp_rdma.h"
  23. /* add y histogram registers structure */
  24. #define USE_YHIST_REG_READ_ACC
  25. #define Y_HIST_ITEM_SIZE (64)
  26. #define Y_HIST_WAITING_COUNT (10000)
  27. typedef struct _ST_YHIST_DUMP_STATUS {
  28. STF_U8 u8IspIdx;
  29. STF_BOOL8 bDumpStatus;
  30. } ST_YHIST_DUMP_STATUS, *PST_YHIST_DUMP_STATUS;
  31. typedef struct _ST_YHIST_ACC_VALID_STATUS {
  32. STF_U8 u8IspIdx;
  33. STF_BOOL8 bAccValidStatus;
  34. } ST_YHIST_ACC_VALID_STATUS, *PST_YHIST_ACC_VALID_STATUS;
  35. typedef struct _ST_YHIST_RESULT {
  36. STF_U32 u32Accumulate[Y_HIST_ITEM_SIZE];
  37. } ST_YHIST_RESULT, *PST_YHIST_RESULT;
  38. typedef struct _ST_ISP_YHIST_RESULT_PARAM {
  39. STF_U8 u8IspIdx;
  40. ST_YHIST_RESULT stYHistResult;
  41. } ST_ISP_YHIST_RESULT_PARAM, *PST_ISP_YHIST_RESULT_PARAM;
  42. typedef struct _ST_YHIST_REG {
  43. REG_YHIST_CFG_0 YHistCfg0; // 0x0CC8, Y Histogram Start Location Register.
  44. REG_YHIST_CFG_1 YHistCfg1; // 0x0CCC, Y Histogram Size Register.
  45. REG_YHIST_CFG_2 YHistCfg2; // 0x0CD0, Y Histogram Decimation Register.
  46. REG_YHIST_CFG_3 YHistCfg3; // 0x0CD4, Y Histogram mux sel register, only one select 0: before y curve.
  47. #if defined(V4L2_DRIVER)
  48. #else
  49. REG_YHIST_CFG_4 YHistCfg4; // 0x0CD8, Y Histogram dumping base address.
  50. #endif //#if defined(V4L2_DRIVER)
  51. } ST_YHIST_REG, *PST_YHIST_REG;
  52. typedef struct _ST_YHIST_ACC_REG {
  53. REG_YHIST_ACC_0 YHistAcc[Y_HIST_ITEM_SIZE]; // 0x0D00- 0x0DFF, Y Histogram result register 0, Read only.
  54. } ST_YHIST_ACC_REG, *PST_YHIST_ACC_REG;
  55. #define ST_YHIST_REG_SIZE (sizeof(ST_YHIST_REG))
  56. #define ST_YHIST_REG_LEN (ST_YHIST_REG_SIZE / sizeof(STF_U32))
  57. #pragma pack(push, 8)
  58. typedef struct _ST_YHIST_RDMA {
  59. #if defined(SUPPORT_RDMA_FEATURE)
  60. ST_RDMA_CMD stRdmaStartCmd __attribute__ ((aligned (8)));
  61. #endif //SUPPORT_RDMA_FEATURE
  62. ST_YHIST_REG stYHistReg __attribute__ ((aligned (8)));
  63. #if defined(SUPPORT_RDMA_FEATURE)
  64. ST_RDMA_CMD stRdmaEndCmd __attribute__ ((aligned (8)));
  65. #endif //SUPPORT_RDMA_FEATURE
  66. } ST_YHIST_RDMA, *PST_YHIST_RDMA;
  67. #define ST_YHIST_RDMA_SIZE (sizeof(ST_YHIST_RDMA))
  68. #define ST_YHIST_RDMA_LEN (ST_YHIST_RDMA_SIZE / (sizeof(STF_U32) * 2))
  69. typedef struct _ST_ISP_YHIST_RDMA {
  70. STF_U8 u8IspIdx;
  71. ST_YHIST_RDMA stYHistRdma __attribute__ ((aligned (8)));
  72. } ST_ISP_YHIST_RDMA, *PST_ISP_YHIST_RDMA;
  73. #pragma pack(pop)
  74. ///* y histogram registers interface */
  75. ////-----------------------------------------------------------------------------
  76. //extern
  77. //STF_VOID STFHAL_ISP_YHIST_SetReg(
  78. // STF_U8 u8IspIdx,
  79. // ST_YHIST_RDMA *pstYHistRdma
  80. // );
  81. ////-----------------------------------------------------------------------------
  82. //extern
  83. //STF_VOID STFHAL_ISP_YHIST_SetStartLocation(
  84. // STF_U8 u8IspIdx,
  85. // ST_YHIST_RDMA *pstYHistRdma
  86. // );
  87. //extern
  88. //STF_VOID STFHAL_ISP_YHIST_SetWindowSize(
  89. // STF_U8 u8IspIdx,
  90. // ST_YHIST_RDMA *pstYHistRdma
  91. // );
  92. //extern
  93. //STF_VOID STFHAL_ISP_YHIST_SetDecimation(
  94. // STF_U8 u8IspIdx,
  95. // ST_YHIST_RDMA *pstYHistRdma
  96. // );
  97. //extern
  98. //STF_VOID STFHAL_ISP_YHIST_SetMuxSel(
  99. // STF_U8 u8IspIdx,
  100. // ST_YHIST_RDMA *pstYHistRdma
  101. // );
  102. //extern
  103. //STF_VOID STFHAL_ISP_YHIST_SetDumpBufAddr(
  104. // STF_U8 u8IspIdx,
  105. // ST_YHIST_RDMA *pstYHistRdma
  106. // );
  107. //extern
  108. //STF_BOOL8 STFHAL_ISP_YHIST_GetDumpStatus(
  109. // STF_U8 u8IspIdx
  110. // );
  111. //extern
  112. //STF_BOOL8 STFHAL_ISP_YHIST_GetAccValidStatus(
  113. // STF_U8 u8IspIdx
  114. // );
  115. //extern
  116. //STF_VOID STFHAL_ISP_YHIST_GetAccResult(
  117. // STF_U8 u8IspIdx,
  118. // ST_YHIST_RESULT *pstYHistResult
  119. // );
  120. ////-----------------------------------------------------------------------------
  121. //
  122. //
  123. #endif //__STF_ISP_YHIST_RDMA_H__