de_leopard.h 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  1. /*
  2. * Copyright (c) 2020 Actions Technology Co., Ltd
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #ifndef ZEPHYR_DRIVERS_DISPLAY_ENGINE_DE_LEOPARD_H_
  7. #define ZEPHYR_DRIVERS_DISPLAY_ENGINE_DE_LEOPARD_H_
  8. #include <zephyr/types.h>
  9. #include <sys/util.h>
  10. /* Reg DE_CTL */
  11. #define DE_CTL_OUT_FORMAT_SEL(x) ((uint32_t)(x) << 2)
  12. #define DE_CTL_OUT_FORMAT_RGB565 DE_CTL_OUT_FORMAT_SEL(0)
  13. #define DE_CTL_OUT_FORMAT_RGB666 DE_CTL_OUT_FORMAT_SEL(1)
  14. #define DE_CTL_OUT_FORMAT_RGB888 DE_CTL_OUT_FORMAT_SEL(2)
  15. #define DE_CTL_OUT_FORMAT_RGB888_WB_ARGB8888 DE_CTL_OUT_FORMAT_SEL(3)
  16. #define DE_CTL_OUT_FORMAT_RGB888_WB_XRGB8888 (DE_CTL_OUT_FORMAT_SEL(3) | BIT(13))
  17. #define DE_CTL_OUT_COLOR_FILL_EN (0x1 << 5)
  18. #define DE_CTL_OUT_DISPLY_YFLIP_EN(en) ((uint32_t)(en) << 6)
  19. #define DE_CTL_OUT_WB_YFLIP_EN(en) ((uint32_t)(en) << 7)
  20. #define DE_CTL_OUT_MODE_SEL(x) ((uint32_t)(x) << 8)
  21. #define DE_CTL_OUT_MODE_MASK DE_CTL_OUT_MODE_SEL(3)
  22. #define DE_CTL_OUT_MODE_DISPLAY DE_CTL_OUT_MODE_SEL(0)
  23. #define DE_CTL_OUT_MODE_DISPLAY_WB DE_CTL_OUT_MODE_SEL(1)
  24. #define DE_CTL_OUT_MODE_WB DE_CTL_OUT_MODE_SEL(2)
  25. #define DE_CTL_TRANSFER_MODE_SEL(x) ((uint32_t)(x) << 12)
  26. #define DE_CTL_TRANSFER_MODE_MASK DE_CTL_TRANSFER_MODE_SEL(1)
  27. #define DE_CTL_TRANSFER_MODE_TRIGGER DE_CTL_TRANSFER_MODE_SEL(0)
  28. #define DE_CTL_TRANSFER_MODE_CONTINUE DE_CTL_TRANSFER_MODE_SEL(1)
  29. #define DE_CTL_WB_NO_STRIDE_EN(en) ((uint32_t)(en) << 29)
  30. #define DE_FORMAT_RGB565 (0)
  31. #define DE_FORMAT_RGB666 (1)
  32. #define DE_FORMAT_RGB888 (2)
  33. #define DE_FORMAT_ARGB (3)
  34. #define DE_FORMAT_BGRA (4)
  35. #define DE_FORMAT_AX (5)
  36. #define DE_FORMAT_ARGB8565 (6)
  37. #define DE_FORMAT_ABMP_INDEX (7)
  38. /* L0 layer */
  39. #define DE_L0_EN BIT(20)
  40. #define DE_L0_COLOR_FILL_EN(en) (0)
  41. #define DE_L0_NO_STRIDE_EN(en) ((uint32_t)(en) << 31)
  42. #define DE_L0_FORMAT(de_fmt, rb_swap, byte_swap, is_6666, alpha_off) \
  43. ((de_fmt << 15) | (rb_swap << 18) | (!byte_swap << 14) | (is_6666 << 19) | (alpha_off << 10))
  44. #define DE_L0_FORMAT_ARGB_1555 DE_L0_FORMAT(DE_FORMAT_RGB565, 0, 0, 1, 0)
  45. #define DE_L0_FORMAT_RGB_565 DE_L0_FORMAT(DE_FORMAT_RGB565, 0, 0, 0, 0)
  46. #define DE_L0_FORMAT_BGR_565 DE_L0_FORMAT(DE_FORMAT_RGB565, 1, 0, 0, 0)
  47. #define DE_L0_FORMAT_RGB_565_SWAP DE_L0_FORMAT(DE_FORMAT_RGB565, 0, 1, 0, 0)
  48. #define DE_L0_FORMAT_BGR_565_SWAP DE_L0_FORMAT(DE_FORMAT_RGB565, 1, 1, 0, 0)
  49. #define DE_L0_FORMAT_RGB_666 DE_L0_FORMAT(DE_FORMAT_RGB666, 0, 0, 0, 0)
  50. #define DE_L0_FORMAT_BGR_666 DE_L0_FORMAT(DE_FORMAT_RGB666, 1, 0, 0, 0)
  51. #define DE_L0_FORMAT_RGB_888 DE_L0_FORMAT(DE_FORMAT_RGB888, 0, 0, 0, 0)
  52. #define DE_L0_FORMAT_BGR_888 DE_L0_FORMAT(DE_FORMAT_RGB888, 1, 0, 0, 0)
  53. #define DE_L0_FORMAT_ARGB_8888 DE_L0_FORMAT(DE_FORMAT_ARGB, 0, 0, 0, 0)
  54. #define DE_L0_FORMAT_ABGR_8888 DE_L0_FORMAT(DE_FORMAT_ARGB, 1, 0, 0, 0)
  55. #define DE_L0_FORMAT_BGRA_8888 DE_L0_FORMAT(DE_FORMAT_BGRA, 0, 0, 0, 0)
  56. #define DE_L0_FORMAT_RGBA_8888 DE_L0_FORMAT(DE_FORMAT_BGRA, 1, 0, 0, 0)
  57. #define DE_L0_FORMAT_XRGB_8888 DE_L0_FORMAT(DE_FORMAT_ARGB, 0, 0, 0, 1)
  58. #define DE_L0_FORMAT_XBGR_8888 DE_L0_FORMAT(DE_FORMAT_ARGB, 1, 0, 0, 1)
  59. #define DE_L0_FORMAT_BGRX_8888 DE_L0_FORMAT(DE_FORMAT_BGRA, 0, 0, 0, 1)
  60. #define DE_L0_FORMAT_RGBX_8888 DE_L0_FORMAT(DE_FORMAT_BGRA, 1, 0, 0, 1)
  61. #define DE_L0_FORMAT_ARGB_6666 DE_L0_FORMAT(DE_FORMAT_ARGB, 0, 0, 1, 0)
  62. #define DE_L0_FORMAT_ABGR_6666 DE_L0_FORMAT(DE_FORMAT_ARGB, 1, 0, 1, 0)
  63. #define DE_L0_FORMAT_BGRA_6666 DE_L0_FORMAT(DE_FORMAT_BGRA, 0, 0, 1, 0)
  64. #define DE_L0_FORMAT_RGBA_6666 DE_L0_FORMAT(DE_FORMAT_BGRA, 1, 0, 1, 0)
  65. #define DE_L0_FORMAT_XRGB_6666 DE_L0_FORMAT(DE_FORMAT_ARGB, 0, 0, 1, 1)
  66. #define DE_L0_FORMAT_XBGR_6666 DE_L0_FORMAT(DE_FORMAT_ARGB, 1, 0, 1, 1)
  67. #define DE_L0_FORMAT_BGRX_6666 DE_L0_FORMAT(DE_FORMAT_BGRA, 0, 0, 1, 1)
  68. #define DE_L0_FORMAT_RGBX_6666 DE_L0_FORMAT(DE_FORMAT_BGRA, 1, 0, 1, 1)
  69. #define DE_L0_FORMAT_ARGB_8565 DE_L0_FORMAT(DE_FORMAT_ARGB8565, 0, 0, 0, 0)
  70. #define DE_L0_FORMAT_ABGR_8565 DE_L0_FORMAT(DE_FORMAT_ARGB8565, 1, 0, 0, 0)
  71. #define DE_L0_FORMAT_XRGB_8565 DE_L0_FORMAT(DE_FORMAT_ARGB8565, 0, 0, 0, 1)
  72. #define DE_L0_FORMAT_XBGR_8565 DE_L0_FORMAT(DE_FORMAT_ARGB8565, 1, 0, 0, 1)
  73. #define DE_L0_FORMAT_AX DE_L0_FORMAT(DE_FORMAT_AX, 0, 0, 0, 0)
  74. #define DE_L0_FORMAT_ABMP_INDEX DE_L0_FORMAT(DE_FORMAT_ABMP_INDEX, 0, 0, 0, 0)
  75. /* L1 layer */
  76. #define DE_L1_EN BIT(26)
  77. #define DE_L1_SC_EN (0x1)
  78. #define DE_L1_RT_EN (0x2)
  79. #define DE_L1_COLOR_FILL_EN(en) ((uint32_t)(en) << 28)
  80. #define DE_L1_NO_STRIDE_EN(en) ((uint32_t)(en) << 30)
  81. #define DE_L1_FORMAT(de_fmt, rb_swap, byte_swap, is_6666, alpha_off) \
  82. ((de_fmt << 21) | (rb_swap << 24) | (!byte_swap << 27) | (is_6666 << 25) | (alpha_off << 11))
  83. #define DE_L1_FORMAT_ARGB_1555 DE_L1_FORMAT(DE_FORMAT_RGB565, 0, 0, 1, 0)
  84. #define DE_L1_FORMAT_RGB_565 DE_L1_FORMAT(DE_FORMAT_RGB565, 0, 0, 0, 0)
  85. #define DE_L1_FORMAT_BGR_565 DE_L1_FORMAT(DE_FORMAT_RGB565, 1, 0, 0, 0)
  86. #define DE_L1_FORMAT_RGB_565_SWAP DE_L1_FORMAT(DE_FORMAT_RGB565, 0, 1, 0, 0)
  87. #define DE_L1_FORMAT_BGR_565_SWAP DE_L1_FORMAT(DE_FORMAT_RGB565, 1, 1, 0, 0)
  88. #define DE_L1_FORMAT_RGB_666 DE_L1_FORMAT(DE_FORMAT_RGB666, 0, 0, 0, 0)
  89. #define DE_L1_FORMAT_BGR_666 DE_L1_FORMAT(DE_FORMAT_RGB666, 1, 0, 0, 0)
  90. #define DE_L1_FORMAT_RGB_888 DE_L1_FORMAT(DE_FORMAT_RGB888, 0, 0, 0, 0)
  91. #define DE_L1_FORMAT_BGR_888 DE_L1_FORMAT(DE_FORMAT_RGB888, 1, 0, 0, 0)
  92. #define DE_L1_FORMAT_ARGB_8888 DE_L1_FORMAT(DE_FORMAT_ARGB, 0, 0, 0, 0)
  93. #define DE_L1_FORMAT_ABGR_8888 DE_L1_FORMAT(DE_FORMAT_ARGB, 1, 0, 0, 0)
  94. #define DE_L1_FORMAT_BGRA_8888 DE_L1_FORMAT(DE_FORMAT_BGRA, 0, 0, 0, 0)
  95. #define DE_L1_FORMAT_RGBA_8888 DE_L1_FORMAT(DE_FORMAT_BGRA, 1, 0, 0, 0)
  96. #define DE_L1_FORMAT_XRGB_8888 DE_L1_FORMAT(DE_FORMAT_ARGB, 0, 0, 0, 1)
  97. #define DE_L1_FORMAT_XBGR_8888 DE_L1_FORMAT(DE_FORMAT_ARGB, 1, 0, 0, 1)
  98. #define DE_L1_FORMAT_BGRX_8888 DE_L1_FORMAT(DE_FORMAT_BGRA, 0, 0, 0, 1)
  99. #define DE_L1_FORMAT_RGBX_8888 DE_L1_FORMAT(DE_FORMAT_BGRA, 1, 0, 0, 1)
  100. #define DE_L1_FORMAT_ARGB_6666 DE_L1_FORMAT(DE_FORMAT_ARGB, 0, 0, 1, 0)
  101. #define DE_L1_FORMAT_ABGR_6666 DE_L1_FORMAT(DE_FORMAT_ARGB, 1, 0, 1, 0)
  102. #define DE_L1_FORMAT_BGRA_6666 DE_L1_FORMAT(DE_FORMAT_BGRA, 0, 0, 1, 0)
  103. #define DE_L1_FORMAT_RGBA_6666 DE_L1_FORMAT(DE_FORMAT_BGRA, 1, 0, 1, 0)
  104. #define DE_L1_FORMAT_XRGB_6666 DE_L1_FORMAT(DE_FORMAT_ARGB, 0, 0, 1, 1)
  105. #define DE_L1_FORMAT_XBGR_6666 DE_L1_FORMAT(DE_FORMAT_ARGB, 1, 0, 1, 1)
  106. #define DE_L1_FORMAT_BGRX_6666 DE_L1_FORMAT(DE_FORMAT_BGRA, 0, 0, 1, 1)
  107. #define DE_L1_FORMAT_RGBX_6666 DE_L1_FORMAT(DE_FORMAT_BGRA, 1, 0, 1, 1)
  108. #define DE_L1_FORMAT_ARGB_8565 DE_L1_FORMAT(DE_FORMAT_ARGB8565, 0, 0, 0, 0)
  109. #define DE_L1_FORMAT_ABGR_8565 DE_L1_FORMAT(DE_FORMAT_ARGB8565, 1, 0, 0, 0)
  110. #define DE_L1_FORMAT_XRGB_8565 DE_L1_FORMAT(DE_FORMAT_ARGB8565, 0, 0, 0, 1)
  111. #define DE_L1_FORMAT_XBGR_8565 DE_L1_FORMAT(DE_FORMAT_ARGB8565, 1, 0, 0, 1)
  112. #define DE_L1_FORMAT_AX DE_L1_FORMAT(DE_FORMAT_AX, 0, 0, 0, 0)
  113. #define DE_L1_FORMAT_ABMP_INDEX DE_L1_FORMAT(DE_FORMAT_ABMP_INDEX, 0, 0, 0, 0)
  114. /* Reg DE_CTL1 */
  115. /* L2 layer */
  116. #define DE_L2_EN BIT(26)
  117. #define DE_L2_SC_EN (0x1)
  118. #define DE_L2_RT_EN (0x2)
  119. #define DE_L2_COLOR_FILL_EN(en) ((uint32_t)(en) << 28)
  120. #define DE_L2_NO_STRIDE_EN(en) ((uint32_t)(en) << 30)
  121. #define DE_L2_FORMAT(de_fmt, rb_swap, byte_swap, is_6666, alpha_off) \
  122. ((de_fmt << 21) | (rb_swap << 24) | (!byte_swap << 27) | (is_6666 << 25) | (alpha_off << 11))
  123. #define DE_L2_FORMAT_ARGB_1555 DE_L1_FORMAT(DE_FORMAT_RGB565, 0, 0, 1, 0)
  124. #define DE_L2_FORMAT_RGB_565 DE_L2_FORMAT(DE_FORMAT_RGB565, 0, 0, 0, 0)
  125. #define DE_L2_FORMAT_BGR_565 DE_L2_FORMAT(DE_FORMAT_RGB565, 1, 0, 0, 0)
  126. #define DE_L2_FORMAT_RGB_565_SWAP DE_L2_FORMAT(DE_FORMAT_RGB565, 0, 1, 0, 0)
  127. #define DE_L2_FORMAT_BGR_565_SWAP DE_L2_FORMAT(DE_FORMAT_RGB565, 1, 1, 0, 0)
  128. #define DE_L2_FORMAT_RGB_666 DE_L2_FORMAT(DE_FORMAT_RGB666, 0, 0, 0, 0)
  129. #define DE_L2_FORMAT_BGR_666 DE_L2_FORMAT(DE_FORMAT_RGB666, 1, 0, 0, 0)
  130. #define DE_L2_FORMAT_RGB_888 DE_L2_FORMAT(DE_FORMAT_RGB888, 0, 0, 0, 0)
  131. #define DE_L2_FORMAT_BGR_888 DE_L2_FORMAT(DE_FORMAT_RGB888, 1, 0, 0, 0)
  132. #define DE_L2_FORMAT_ARGB_8888 DE_L2_FORMAT(DE_FORMAT_ARGB, 0, 0, 0, 0)
  133. #define DE_L2_FORMAT_ABGR_8888 DE_L2_FORMAT(DE_FORMAT_ARGB, 1, 0, 0, 0)
  134. #define DE_L2_FORMAT_BGRA_8888 DE_L2_FORMAT(DE_FORMAT_BGRA, 0, 0, 0, 0)
  135. #define DE_L2_FORMAT_RGBA_8888 DE_L2_FORMAT(DE_FORMAT_BGRA, 1, 0, 0, 0)
  136. #define DE_L2_FORMAT_XRGB_8888 DE_L2_FORMAT(DE_FORMAT_ARGB, 0, 0, 0, 1)
  137. #define DE_L2_FORMAT_XBGR_8888 DE_L2_FORMAT(DE_FORMAT_ARGB, 1, 0, 0, 1)
  138. #define DE_L2_FORMAT_BGRX_8888 DE_L2_FORMAT(DE_FORMAT_BGRA, 0, 0, 0, 1)
  139. #define DE_L2_FORMAT_RGBX_8888 DE_L2_FORMAT(DE_FORMAT_BGRA, 1, 0, 0, 1)
  140. #define DE_L2_FORMAT_ARGB_6666 DE_L2_FORMAT(DE_FORMAT_ARGB, 0, 0, 1, 0)
  141. #define DE_L2_FORMAT_ABGR_6666 DE_L2_FORMAT(DE_FORMAT_ARGB, 1, 0, 1, 0)
  142. #define DE_L2_FORMAT_BGRA_6666 DE_L2_FORMAT(DE_FORMAT_BGRA, 0, 0, 1, 0)
  143. #define DE_L2_FORMAT_RGBA_6666 DE_L2_FORMAT(DE_FORMAT_BGRA, 1, 0, 1, 0)
  144. #define DE_L2_FORMAT_XRGB_6666 DE_L2_FORMAT(DE_FORMAT_ARGB, 0, 0, 1, 1)
  145. #define DE_L2_FORMAT_XBGR_6666 DE_L2_FORMAT(DE_FORMAT_ARGB, 1, 0, 1, 1)
  146. #define DE_L2_FORMAT_BGRX_6666 DE_L2_FORMAT(DE_FORMAT_BGRA, 0, 0, 1, 1)
  147. #define DE_L2_FORMAT_RGBX_6666 DE_L2_FORMAT(DE_FORMAT_BGRA, 1, 0, 1, 1)
  148. #define DE_L2_FORMAT_ARGB_8565 DE_L2_FORMAT(DE_FORMAT_ARGB8565, 0, 0, 0, 0)
  149. #define DE_L2_FORMAT_ABGR_8565 DE_L2_FORMAT(DE_FORMAT_ARGB8565, 1, 0, 0, 0)
  150. #define DE_L2_FORMAT_XRGB_8565 DE_L2_FORMAT(DE_FORMAT_ARGB8565, 0, 0, 0, 1)
  151. #define DE_L2_FORMAT_XBGR_8565 DE_L2_FORMAT(DE_FORMAT_ARGB8565, 1, 0, 0, 1)
  152. #define DE_L2_FORMAT_AX DE_L2_FORMAT(DE_FORMAT_AX, 0, 0, 0, 0)
  153. #define DE_L2_FORMAT_ABMP_INDEX DE_L2_FORMAT(DE_FORMAT_ABMP_INDEX, 0, 0, 0, 0)
  154. /* Reg DE_CTL2 */
  155. #define DE_CTL2_START BIT(0)
  156. #define DE_CTL2_OUT_FIFO_RESET BIT(1)
  157. #define DE_CTL2_WB_FIFO_RESET BIT(2)
  158. #define DE_CTL2_L0_FIFO_RESET BIT(3)
  159. #define DE_CTL2_L1_FIFO_RESET BIT(4)
  160. #define DE_CTL2_L2_FIFO_RESET BIT(5)
  161. #define DE_CTL2_RGB_CVT_SEL(x) ((uint32_t)(x) << 8)
  162. #define DE_CTL2_RGB_CVT_MASK DE_CTL2_RGB_CVT_SEL(3)
  163. #define DE_CTL2_RGB_CVT_LOW DE_CTL2_RGB_CVT_SEL(0) /* Low bits compensation */
  164. #define DE_CTL2_RGB_CVT_ZERO DE_CTL2_RGB_CVT_SEL(1) /* Zero bits compensation */
  165. #define DE_CTL2_RGB_CVT_HIGH DE_CTL2_RGB_CVT_SEL(2) /* High bits compensation */
  166. #define DE_CTL2_RGB_CVT_CUT DE_CTL2_RGB_CVT_SEL(3) /* Cut to the same bits, then zero compensation */
  167. /* Reg DE_GAT_CTL */
  168. #define DE_LX_GAT_EN BIT(0)
  169. #define DE_OUT_GAT_EN BIT(1)
  170. #define DE_PATH_GAT_EN BIT(3)
  171. #define DE_OVERLAY_GAT_EN (DE_LX_GAT_EN | DE_OUT_GAT_EN | DE_PATH_GAT_EN)
  172. #define DE_ROTATE_GAT_EN BIT(4)
  173. /* Reg DE_MEM_OPT */
  174. #define DE_MEM_BURST_LEN_SEL(x) ((uint32_t)(x) << 8)
  175. #define DE_MEM_BURST_LEN_MASK DE_MEM_BURST_LEN_SEL(3)
  176. #define DE_MEM_BURST_8 DE_MEM_BURST_LEN_SEL(0)
  177. #define DE_MEM_BURST_16 DE_MEM_BURST_LEN_SEL(1)
  178. #define DE_MEM_BURST_32 DE_MEM_BURST_LEN_SEL(2)
  179. #define DE_MEM_SWITCH_EN BIT(6)
  180. #define DE_MEM_CMD_NUM_SEL(x) (((uint32_t)(x) & 0x3f) << 0)
  181. #define DE_MEM_CMD_NUM_MASK DE_MEM_CMD_NUM_SEL(0x3f)
  182. #define DE_SW_FRAME_RST_LEN(x) (((uint32_t)(x) & 0x3f) << 10)
  183. #define DE_SW_FRAME_RST_MASK DE_MEM_CMD_NUM_SEL(0x3f)
  184. /* Reg DE_IRQ_CTL */
  185. #define DE_IRQ_PRELINE BIT(0)
  186. #define DE_IRQ_L0_FIFO_UDF BIT(1) /* under flow*/
  187. #define DE_IRQ_L0_FIFO_OVF BIT(2) /* over flow*/
  188. #define DE_IRQ_L1_FIFO_UDF BIT(3)
  189. #define DE_IRQ_L1_FIFO_OVF BIT(4)
  190. #define DE_IRQ_L0_FTC BIT(5) /* frame transfer complete */
  191. #define DE_IRQ_L1_FTC BIT(6)
  192. #define DE_IRQ_L2_FTC BIT(6)
  193. #define DE_IRQ_WB_FIFO_UDF BIT(8)
  194. #define DE_IRQ_WB_FIFO_OVF BIT(9)
  195. #define DE_IRQ_DEV_FIFO_UDF BIT(10)
  196. #define DE_IRQ_DEV_FIFO_OVF BIT(11)
  197. #define DE_IRQ_L2_FIFO_UDF BIT(12)
  198. #define DE_IRQ_L2_FIFO_OVF BIT(13)
  199. #define DE_IRQ_VSYNC BIT(16)
  200. #define DE_IRQ_DEV_FIFO_HF BIT(29) /* half full */
  201. #define DE_IRQ_WB_FTC BIT(30)
  202. #define DE_IRQ_DEV_FTC BIT(31)
  203. /* Reg DE_STA */
  204. #define DE_STAT_L0_MEM_ERR BIT(0)
  205. #define DE_STAT_L1_MEM_ERR BIT(1)
  206. #define DE_STAT_L2_MEM_ERR BIT(2)
  207. #define DE_STAT_L0_FIFO_EMPTY BIT(7)
  208. #define DE_STAT_L0_FIFO_FULL BIT(8)
  209. #define DE_STAT_L0_FIFO_UDF BIT(9)
  210. #define DE_STAT_L0_FIFO_OVF BIT(10)
  211. #define DE_STAT_L0_FTC BIT(11)
  212. #define DE_STAT_WB_FIFO_UDF BIT(12)
  213. #define DE_STAT_WB_FIFO_OVF BIT(13)
  214. #define DE_STAT_DEV_FIFO_UDF BIT(14)
  215. #define DE_STAT_DEV_FIFO_OVF BIT(15)
  216. #define DE_STAT_DEV_VSYNC BIT(16)
  217. #define DE_STAT_L2_FIFO_EMPTY BIT(17)
  218. #define DE_STAT_L2_FIFO_FULL BIT(18)
  219. #define DE_STAT_L2_FIFO_UDF BIT(19)
  220. #define DE_STAT_L2_FIFO_OVF BIT(20)
  221. #define DE_STAT_L2_FTC BIT(21)
  222. #define DE_STAT_L1_FIFO_EMPTY BIT(23)
  223. #define DE_STAT_L1_FIFO_FULL BIT(24)
  224. #define DE_STAT_L1_FIFO_UDF BIT(25)
  225. #define DE_STAT_L1_FIFO_OVF BIT(26)
  226. #define DE_STAT_L1_FTC BIT(27)
  227. #define DE_STAT_PRELINE BIT(28)
  228. #define DE_STAT_DEV_FIFO_HF BIT(29)
  229. #define DE_STAT_WB_FTC BIT(30)
  230. #define DE_STAT_DEV_FTC BIT(31)
  231. /* Reg DE_BG_SIZE */
  232. #define DE_BG_SIZE(w, h) ((((uint32_t)(h) - 1) << 16) | ((w) - 1))
  233. /* Reg DE_BG_COLOR */
  234. #define DE_BG_COLOR(r, g, b) (((uint32_t)(r) << 16) | ((uint32_t)(g) << 8) | (b))
  235. /* Reg DE_LX_POS */
  236. #define DE_LX_POS(x, y) (((uint32_t)(y) << 16) | (x))
  237. /* Reg DE_LX_SIZE */
  238. #define DE_LX_SIZE(w, h) ((((uint32_t)(h) - 1) << 16) | ((w) - 1))
  239. /* Reg DE_LX_DEF_COLOR */
  240. #define DE_LX_DEF_COLOR(a, r, g, b) \
  241. (((uint32_t)(a) << 24) | ((uint32_t)(r) << 16) | ((uint32_t)(g) << 8) | (b))
  242. /* Reg DE_LX_RT_SRC_SIZE */
  243. #define DE_LX_RT_SRC_SIZE(w, h) ((((uint32_t)(h) - 1) << 16) | ((w) - 1))
  244. /* Reg DE_LX_RT_SW_X_XY & DE_LX_RT_SW_Y_XY */
  245. #define DE_LX_RT_DELTA_XY(dx, dy) (((uint32_t)(dy)) << 16) | (((uint32_t)(dx) & 0xFFFF))
  246. /* Reg DE_ALPHA_CTL */
  247. #define DE_ALPHA_EN BIT(31)
  248. #define DE_ALPHA_COVERAGE (0x0 << 10)
  249. #define DE_ALPHA_PREMULTIPLIED (0x1 << 10)
  250. #define DE_ALPHA_FCV_EN BIT(8)
  251. #define DE_ALPHA_PLANE_ALPHA(x) ((x) & 0xff)
  252. /* Reg DE_ALPHA_POS */
  253. #define DE_ALPHA_POS(x, y) (((uint32_t)(y) << 16) | (x))
  254. /* Reg DE_ALPHA_SIZE */
  255. #define DE_ALPHA_SIZE(w, h) ((((uint32_t)(h) - 1) << 16) | ((w) - 1))
  256. /* Reg DE_FILL_COLOR */
  257. #define DE_FILL_COLOR(a, r, g, b) \
  258. (((uint32_t)(a) << 24) | ((uint32_t)(r) << 16) | ((uint32_t)(g) << 8) | (b))
  259. /* Reg DE_COLOR_FILL_POS */
  260. #define DE_COLOR_FILL_POS(x, y) (((uint32_t)(y) << 16) | (x))
  261. /* Reg DE_COLOR_FILL_SIZE */
  262. #define DE_COLOR_FILL_SIZE(w, h) ((((uint32_t)(h) - 1) << 16) | ((w) - 1))
  263. /* Reg DE_AX_COLOR */
  264. #define DE_AX_TYPE_SEL(x) ((uint32_t)(x) << 24)
  265. #define DE_AX_8 DE_AX_TYPE_SEL(0)
  266. #define DE_AX_4 DE_AX_TYPE_SEL(1)
  267. #define DE_AX_1 DE_AX_TYPE_SEL(2)
  268. #define DE_AX_COLOR(r, g, b) (((uint32_t)(r) << 16) | ((uint32_t)(g) << 8) | (b))
  269. /* Reg DE_AX_CTL */
  270. #define DE_A14_FONT(size, stride, total) \
  271. (((uint32_t)((size) - 1) << 20) | ((uint32_t)((stride) - 1) << 10) | ((total) - 1))
  272. /* Reg DE_CLUT_CTL */
  273. #define DE_CLUT_TAB_SEL(x) ((uint32_t)(x) << 8)
  274. #define DE_CLUT_TAB_IDX(x) ((uint32_t)(x))
  275. /* Reg DE_CLUT_DATA */
  276. #define DE_CLUT_COLOR(a, r, g, b) \
  277. (((uint32_t)(a) << 24) | ((uint32_t)(r) << 16) | ((uint32_t)(g) << 8) | (b))
  278. /* Reg DE_LX_ABMP_CTL */
  279. #define DE_L0_ABMP_BITOFS(bits) (((uint32_t)(bits)) << 4) /* for 1/2/4 bpp */
  280. #define DE_L0_ALPHA_AA_EN (1 << 7)
  281. #define DE_L0_ABMP(type, big_endian, indexed) ((type << 0) | (big_endian << 2) | (indexed << 3))
  282. #define DE_L0_ALPHA_8 DE_L0_ABMP(0, 0, 0)
  283. #define DE_L0_ALPHA_4 DE_L0_ABMP(1, 1, 0)
  284. #define DE_L0_ALPHA_2 (DE_L0_ABMP(3, 1, 0) | DE_L0_ALPHA_AA_EN)
  285. #define DE_L0_ALPHA_1 (DE_L0_ABMP(2, 1, 0) | DE_L0_ALPHA_AA_EN)
  286. #define DE_L0_ALPHA_8_LE DE_L0_ABMP(0, 0, 0)
  287. #define DE_L0_ALPHA_4_LE DE_L0_ABMP(1, 0, 0)
  288. #define DE_L0_ALPHA_2_LE (DE_L0_ABMP(3, 0, 0) | DE_L0_ALPHA_AA_EN)
  289. #define DE_L0_ALPHA_1_LE (DE_L0_ABMP(2, 0, 0) | DE_L0_ALPHA_AA_EN)
  290. #define DE_L0_INDEX_8 DE_L0_ABMP(0, 0, 1)
  291. #define DE_L0_INDEX_4 DE_L0_ABMP(1, 1, 1)
  292. #define DE_L0_INDEX_2 DE_L0_ABMP(3, 1, 1)
  293. #define DE_L0_INDEX_1 DE_L0_ABMP(2, 1, 1)
  294. #define DE_L0_INDEX_8_LE DE_L0_ABMP(0, 0, 1)
  295. #define DE_L0_INDEX_4_LE DE_L0_ABMP(1, 0, 1)
  296. #define DE_L0_INDEX_2_LE DE_L0_ABMP(3, 0, 1)
  297. #define DE_L0_INDEX_1_LE DE_L0_ABMP(2, 0, 1)
  298. #define DE_L1_ABMP_BITOFS(bits) (((uint32_t)(bits)) << 12) /* for 1/2/4 bpp */
  299. #define DE_L1_ALPHA_AA_EN (1 << 15)
  300. #define DE_L1_ABMP(type, big_endian, indexed) ((type << 8) | (big_endian << 10) | (indexed << 11))
  301. #define DE_L1_ALPHA_8 DE_L1_ABMP(0, 0, 0)
  302. #define DE_L1_ALPHA_4 DE_L1_ABMP(1, 1, 0)
  303. #define DE_L1_ALPHA_2 (DE_L1_ABMP(3, 1, 0) | DE_L1_ALPHA_AA_EN)
  304. #define DE_L1_ALPHA_1 (DE_L1_ABMP(2, 1, 0) | DE_L1_ALPHA_AA_EN)
  305. #define DE_L1_ALPHA_8_LE DE_L1_ABMP(0, 0, 0)
  306. #define DE_L1_ALPHA_4_LE DE_L1_ABMP(1, 0, 0)
  307. #define DE_L1_ALPHA_2_LE (DE_L1_ABMP(3, 0, 0) | DE_L1_ALPHA_AA_EN)
  308. #define DE_L1_ALPHA_1_LE (DE_L1_ABMP(2, 0, 0) | DE_L1_ALPHA_AA_EN)
  309. #define DE_L1_INDEX_8 DE_L1_ABMP(0, 0, 1)
  310. #define DE_L1_INDEX_4 DE_L1_ABMP(1, 1, 1)
  311. #define DE_L1_INDEX_2 DE_L1_ABMP(3, 1, 1)
  312. #define DE_L1_INDEX_1 DE_L1_ABMP(2, 1, 1)
  313. #define DE_L1_INDEX_8_LE DE_L1_ABMP(0, 0, 1)
  314. #define DE_L1_INDEX_4_LE DE_L1_ABMP(1, 0, 1)
  315. #define DE_L1_INDEX_2_LE DE_L1_ABMP(3, 0, 1)
  316. #define DE_L1_INDEX_1_LE DE_L1_ABMP(2, 0, 1)
  317. #define DE_L2_ABMP_BITOFS(bits) (((uint32_t)(bits)) << 20) /* for 1/2/4 bpp */
  318. #define DE_L2_ALPHA_AA_EN (1 << 23)
  319. #define DE_L2_ABMP(type, big_endian, indexed) ((type << 16) | (big_endian << 18) | (indexed << 19))
  320. #define DE_L2_ALPHA_8 DE_L2_ABMP(0, 0, 0)
  321. #define DE_L2_ALPHA_4 DE_L2_ABMP(1, 1, 0)
  322. #define DE_L2_ALPHA_2 (DE_L2_ABMP(3, 1, 0) | DE_L2_ALPHA_AA_EN)
  323. #define DE_L2_ALPHA_1 (DE_L2_ABMP(2, 1, 0) | DE_L2_ALPHA_AA_EN)
  324. #define DE_L2_ALPHA_8_LE DE_L2_ABMP(0, 0, 0)
  325. #define DE_L2_ALPHA_4_LE DE_L2_ABMP(1, 0, 0)
  326. #define DE_L2_ALPHA_2_LE (DE_L2_ABMP(3, 0, 0) | DE_L2_ALPHA_AA_EN)
  327. #define DE_L2_ALPHA_1_LE (DE_L2_ABMP(2, 0, 0) | DE_L2_ALPHA_AA_EN)
  328. #define DE_L2_INDEX_8 DE_L2_ABMP(0, 0, 1)
  329. #define DE_L2_INDEX_4 DE_L2_ABMP(1, 1, 1)
  330. #define DE_L2_INDEX_2 DE_L2_ABMP(3, 1, 1)
  331. #define DE_L2_INDEX_1 DE_L2_ABMP(2, 1, 1)
  332. #define DE_L2_INDEX_8_LE DE_L2_ABMP(0, 0, 1)
  333. #define DE_L2_INDEX_4_LE DE_L2_ABMP(1, 0, 1)
  334. #define DE_L2_INDEX_2_LE DE_L2_ABMP(3, 0, 1)
  335. #define DE_L2_INDEX_1_LE DE_L2_ABMP(2, 0, 1)
  336. #define DE_LX_AA_P0_COFF_1_2 (0)
  337. #define DE_LX_AA_P0_COFF_3_4 BIT(24)
  338. /* Reg RT_CTL */
  339. #define RT_MODE_SEL(x) (x)
  340. #define RT_MODE_CIRCLE RT_MODE_SEL(0)
  341. #define RT_MODE_RECT RT_MODE_SEL(1)
  342. #define RT_AUTOLOAD_EN BIT(1)
  343. #define RT_COLOR_FILL_EN BIT(2)
  344. #define RT_IRQ_EN BIT(4)
  345. #define RT_STAT_COMPLETE BIT(7)
  346. #define RT_FILTER_SEL(x) ((uint32_t)(x) << 8)
  347. #define RT_FILTER_LINEAR RT_FILTER_SEL(0)
  348. #define RT_FILTER_BILINEAR RT_FILTER_SEL(1)
  349. #define RT_COLOR_FILL_START BIT(16) /* used for RGB-565 fast clear */
  350. #define RT_COLOR_FILL_BURST_LEN(x) ((uint32_t)(x) << 17)
  351. #define RT_COLOR_FILL_BURST_8 RT_COLOR_FILL_BURST_LEN(0)
  352. #define RT_COLOR_FILL_BURST_16 RT_COLOR_FILL_BURST_LEN(1)
  353. #define RT_FORMAT_SEL(x) ((uint32_t)(x) << 28)
  354. #define RT_FORMAT_RGB565_SWAP RT_FORMAT_SEL(0)
  355. #define RT_FORMAT_RGB565 RT_FORMAT_SEL(1)
  356. #define RT_FORMAT_ARGB8888 RT_FORMAT_SEL(2)
  357. #define RT_EN BIT(31)
  358. /* Reg RT_IMG_SIZE */
  359. #define RT_END_HEIGHT(x) ((uint32_t)(x) << 16)
  360. #define RT_IMG_WIDTH(x) ((x) & 0x1ff)
  361. /* Reg RT_IMG_START_HEIGHT */
  362. #define RT_START_HEIGHT(x) ((x) & 0x1ff)
  363. /* Reg RT_SW_X_XY & RT_SW_Y_XY */
  364. #define RT_SW_DELTA_XY(dx, dy) (((uint32_t)(dy)) << 16) | (((uint32_t)(dx) & 0xFFFF))
  365. /* Reg RT_FILL_COLOR */
  366. #define RT_COLOR_ARGB_8888(a, r, g, b) \
  367. (((uint32_t)(a) << 24) | ((uint32_t)(r) << 16) | ((uint32_t)(g) << 8) | (b))
  368. #define RT_COLOR_RGB_565(r, g, b) \
  369. ((((uint32_t)(r) >> 3) << 11) | (((uint32_t)(g) >> 2) << 5) | ((b) >> 3))
  370. /* Reg RT_SRC_IMG_SIZE */
  371. #define RT_SRC_IMG_SIZE(w, h) ((((uint32_t)(h)) << 16) | (w))
  372. /* Reg SC_LX_SRC_IMG_SIZE */
  373. #define SC_LX_SRC_IMG_SIZE(w, h) ((((uint32_t)(h) - 1) << 16) | ((w) - 1))
  374. /* Reg SC_LX_RATE */
  375. #define SC_LX_RATE(hor, ver) ((((uint32_t)(ver)) << 16) | (hor))
  376. #define SC_LX_RATE_SAME SC_RATE(4096, 4096)
  377. /* Reg SC_LX_POS */
  378. #define SC_LX_POS(x, y) ((((uint32_t)(y)) << 16) | (x))
  379. /**
  380. * @brief DE Module (DE)
  381. */
  382. typedef struct {
  383. volatile uint32_t POS; /*!< (@ 0x00000000) Layer Start Position Register */
  384. volatile uint32_t SIZE; /*!< (@ 0x00000004) Layer Size Register */
  385. volatile uint32_t ADDR; /*!< (@ 0x00000008) Layer Mem Start Address Register */
  386. volatile uint32_t STRIDE; /*!< (@ 0x0000000C) Layer Mem Stride Register */
  387. volatile uint32_t LENGTH; /*!< (@ 0x00000010) Layer Mem Transfer Length Register */
  388. const volatile uint32_t RESERVED1[2];
  389. volatile uint32_t DEF_COLOR; /*!< (@ 0x0000001C) Layer Default Color Register */
  390. volatile uint32_t RT_SRC_SIZE; /*!< (@ 0x00000020) Layer Rotation Source Size Register */
  391. volatile uint32_t RT_SW_X_XY; /*!< (@ 0x00000024) Layer Rotation SW X Register */
  392. volatile uint32_t RT_SW_Y_XY; /*!< (@ 0x00000028) Layer Rotation SW Y Register */
  393. volatile uint32_t RT_SW_X0; /*!< (@ 0x0000002C) Layer Rotation SW X0 Register */
  394. volatile uint32_t RT_SW_Y0; /*!< (@ 0x00000030) Layer Rotation SW Y0 Register */
  395. const volatile uint32_t RESERVED2[51];
  396. } __attribute__((__packed__)) DE_LAYER_Type;
  397. typedef struct { /*!< (@ 0x4006C000) DE Structure */
  398. volatile uint32_t CTL; /*!< (@ 0x00000000) DE Control Register */
  399. volatile uint32_t GAT_CTL; /*!< (@ 0x00000004) DE Gatting Control Register */
  400. volatile uint32_t REG_UD; /*!< (@ 0x00000008) DE Layer0 Size Register */
  401. volatile uint32_t IRQ_CTL; /*!< (@ 0x0000000C) DE IRQ Control Register */
  402. volatile uint32_t BG_SIZE; /*!< (@ 0x00000010) DE BG Size Register */
  403. volatile uint32_t BG_COLOR; /*!< (@ 0x00000014) DE default color Register */
  404. volatile uint32_t MEM_OPT; /*!< (@ 0x00000018) DE Mem Opt Register */
  405. volatile uint32_t EN; /*!< (@ 0x0000001C) DE Mem Enable Register */
  406. volatile uint32_t CTL2; /*!< (@ 0x00000020) DE Control2 Register */
  407. volatile uint32_t CTL1; /*!< (@ 0x00000024) DE Control1 Register */
  408. const volatile uint32_t RESERVED1[54];
  409. DE_LAYER_Type LX_CTL[2]; /*!< (@ 0x00000100) DE Layer Control Register */
  410. volatile uint32_t ALPHA_CTL; /*!< (@ 0x00000300) DE Alpha Control Register */
  411. volatile uint32_t ALPHA_POS; /*!< (@ 0x00000304) Alpha Position Register */
  412. volatile uint32_t ALPHA_SIZE; /*!< (@ 0x00000308) Alpha Size Register */
  413. volatile uint32_t STA; /*!< (@ 0x0000030C) DE Status Register */
  414. const volatile uint32_t RESERVED2[3];
  415. volatile uint32_t WB_MEM_ADR; /*!< (@ 0x0000031C) WriteBack Mem Start Address Register */
  416. volatile uint32_t WB_MEM_STRIDE; /*!< (@ 0x00000320) WriteBack Mem Stride Register */
  417. volatile uint32_t COLOR_FILL_POS; /*!< (@ 0x00000324) Color Fill Position Register */
  418. volatile uint32_t COLOR_FILL_SIZE; /*!< (@ 0x00000328) Fill Size Register */
  419. volatile uint32_t FILL_COLOR; /*!< (@ 0x0000032C) Fill Color Register */
  420. volatile uint32_t AX_COLOR; /*!< (@ 0x00000330) Ax Color Register */
  421. volatile uint32_t AX_CTL; /*!< (@ 0x00000334) Ax Control Register */
  422. volatile uint32_t CLUT_CTL; /*!< (@ 0x00000338) Color LUT Control Register */
  423. volatile uint32_t CLUT_DATA; /*!< (@ 0x0000033C) Color LUT Data Register */
  424. volatile uint32_t LX_ABMP_CTL; /*!< (@ 0x00000340) Layer ABMP Control Register */
  425. const volatile uint32_t RESERVED3[47];
  426. volatile uint32_t RT_CTL; /*!< (@ 0x00000400) Rotate Control Register */
  427. volatile uint32_t RT_IMG_SIZE; /*!< (@ 0x00000404) Rotate Image Size Register */
  428. volatile uint32_t RT_SRC_ADDR; /*!< (@ 0x00000408) Rotate Source Mem Start Register */
  429. volatile uint32_t RT_SRC_STRIDE; /*!< (@ 0x0000040C) Rotate Source Mem Stride Register */
  430. volatile uint32_t RT_DST_ADDR; /*!< (@ 0x00000410) Rotate Dest Mem Start Register */
  431. volatile uint32_t RT_DST_STRIDE; /*!< (@ 0x00000414) Rotate Dest Mem Stride Register */
  432. volatile uint32_t RT_START_HEIGHT; /*!< (@ 0x00000418) Rotate Start Height Register */
  433. volatile uint32_t RT_SW_X_XY; /*!< (@ 0x0000041C) Rotate Source Delta X/Y along Dest X Register */
  434. volatile uint32_t RT_SW_Y_XY; /*!< (@ 0x00000420) Rotate Source Delta X/Y along Dest Y Register */
  435. volatile uint32_t RT_SW_X0; /*!< (@ 0x00000424) Rotate Source Start X mapping to Dest (0,0) Register */
  436. volatile uint32_t RT_SW_Y0; /*!< (@ 0x00000428) Rotate Source Start Y mapping to Dest (0,0) Register */
  437. volatile uint32_t RT_SW_FIRST_DIST; /*!< (@ 0x0000042C) Rotate Source First Distance Register */
  438. volatile uint32_t RT_R1M2; /*!< (@ 0x00000430) Rotate Source Outer Radius Square Register */
  439. volatile uint32_t RT_R0M2; /*!< (@ 0x00000434) Rotate Source Inner Radius Square Register */
  440. volatile uint32_t RT_FILL_COLOR; /*!< (@ 0x00000438) Rotate Fill Color Register */
  441. volatile uint32_t RT_SRC_IMG_SIZE; /*!< (@ 0x0000043C) Rotate Source Image Size */
  442. const volatile uint32_t RESERVED4[48];
  443. volatile uint32_t RT_RESULT_X0; /*!< (@ 0x00000500) Rotate Result of RT_SW_X0 Register */
  444. volatile uint32_t RT_RESULT_Y0; /*!< (@ 0x00000504) Rotate Result of RT_SW_Y0 Register */
  445. volatile uint32_t RT_RESULT_FIRST_DIST; /*!< (@ 0x00000508) Rotate Result of RT_SW_FIRST_DIST Register */
  446. volatile uint32_t RESULT_SRC_ADDR; /*!< (@ 0x0000050C) Rotate Result of RT_SRC_ADDR Register */
  447. const volatile uint32_t RESERVED5[60];
  448. volatile uint32_t SC_LX_SRC_IMG_SIZE; /*!< (@ 0x00000600) LX Scaling Source Image Register */
  449. volatile uint32_t SC_LX_RATE; /*!< (@ 0x00000604) LX Scaling Rate Register */
  450. volatile uint32_t SC_LX_POS; /*!< (@ 0x00000608) LX Scaling Start Position Register */
  451. const volatile uint32_t RESERVED6[61];
  452. DE_LAYER_Type L2_CTL; /*!< (@ 0x00000700) DE Layer2 Control Register */
  453. } __attribute__((__packed__)) DE_Type; /*!< Size = 2048 (0x800) */
  454. /**
  455. * @brief DE Command Configuration
  456. */
  457. typedef struct {
  458. uint32_t pos;
  459. uint32_t size;
  460. uint32_t addr;
  461. uint32_t stride;
  462. uint32_t length;
  463. uint32_t def_color;
  464. } __attribute__((__packed__)) de_layer_cfg_t;
  465. typedef struct {
  466. uint32_t ctl;
  467. uint32_t bg_color;
  468. uint32_t ctl1;
  469. uint32_t alpha_ctl;
  470. uint32_t wb_addr;
  471. uint32_t wb_stride;
  472. uint32_t color_fill_pos;
  473. uint32_t color_fill_size;
  474. uint32_t fill_color;
  475. uint32_t lx_abmp_ctl;
  476. uint32_t has_nor_access : 1;
  477. uint32_t has_rotation : 1;
  478. uint32_t has_scaling : 1;
  479. uint32_t n_layers : 2; /* number of layers */
  480. uint32_t blend_idx : 2; /* blending layer index */
  481. uint32_t x : 9; /* display pos x */
  482. uint32_t y : 9; /* display pos y */
  483. uint16_t w; /* bg width */
  484. uint16_t h; /* bg height */
  485. struct {
  486. uint32_t src_size;
  487. uint32_t sw_x_xy;
  488. uint32_t sw_y_xy;
  489. int32_t sw_x0;
  490. int32_t sw_y0;
  491. } rotate;
  492. struct {
  493. uint32_t sc_lx_src_size;
  494. uint32_t sc_lx_rate;
  495. uint32_t sc_lx_pos;
  496. } scaling;
  497. de_layer_cfg_t layers[3];
  498. } __attribute__((__packed__)) de_overlay_cfg_t;
  499. typedef struct {
  500. uint16_t layer_idx; /* index of layer */
  501. uint16_t size;
  502. const uint32_t *clut; /* clut table address */
  503. } __attribute__((__packed__)) de_clut_cfg_t;
  504. typedef struct {
  505. uint32_t ctl;
  506. uint32_t img_size;
  507. uint32_t src_addr;
  508. uint32_t src_stride;
  509. uint32_t dst_addr;
  510. uint32_t dst_stride;
  511. uint32_t start_height;
  512. uint32_t sw_x_xy;
  513. uint32_t sw_y_xy;
  514. int32_t sw_x0;
  515. int32_t sw_y0;
  516. uint32_t sw_first_dist;
  517. uint32_t r1m2;
  518. uint32_t r0m2;
  519. uint32_t fill_color;
  520. uint32_t src_img_size;
  521. } __attribute__((__packed__)) de_transform_cfg_t;
  522. #endif /* ZEPHYR_DRIVERS_DISPLAY_ENGINE_DE_LEOPARD_H_ */