regs-scaler.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /* drivers/gpu/drm/exynos/regs-scaler.h
  3. *
  4. * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  5. * http://www.samsung.com/
  6. * Author: Andrzej Pietrasiewicz <[email protected]>
  7. *
  8. * Register definition file for Samsung scaler driver
  9. */
  10. #ifndef EXYNOS_REGS_SCALER_H
  11. #define EXYNOS_REGS_SCALER_H
  12. /* Register part */
  13. /* Global setting */
  14. #define SCALER_STATUS 0x0 /* no shadow */
  15. #define SCALER_CFG 0x4
  16. /* Interrupt */
  17. #define SCALER_INT_EN 0x8 /* no shadow */
  18. #define SCALER_INT_STATUS 0xc /* no shadow */
  19. /* SRC */
  20. #define SCALER_SRC_CFG 0x10
  21. #define SCALER_SRC_Y_BASE 0x14
  22. #define SCALER_SRC_CB_BASE 0x18
  23. #define SCALER_SRC_CR_BASE 0x294
  24. #define SCALER_SRC_SPAN 0x1c
  25. #define SCALER_SRC_Y_POS 0x20
  26. #define SCALER_SRC_WH 0x24
  27. #define SCALER_SRC_C_POS 0x28
  28. /* DST */
  29. #define SCALER_DST_CFG 0x30
  30. #define SCALER_DST_Y_BASE 0x34
  31. #define SCALER_DST_CB_BASE 0x38
  32. #define SCALER_DST_CR_BASE 0x298
  33. #define SCALER_DST_SPAN 0x3c
  34. #define SCALER_DST_WH 0x40
  35. #define SCALER_DST_POS 0x44
  36. /* Ratio */
  37. #define SCALER_H_RATIO 0x50
  38. #define SCALER_V_RATIO 0x54
  39. /* Rotation */
  40. #define SCALER_ROT_CFG 0x58
  41. /* Coefficient */
  42. /*
  43. * YHCOEF_{x}{A|B|C|D} CHCOEF_{x}{A|B|C|D}
  44. *
  45. * A B C D A B C D
  46. * 0 60 64 68 6c 140 144 148 14c
  47. * 1 70 74 78 7c 150 154 158 15c
  48. * 2 80 84 88 8c 160 164 168 16c
  49. * 3 90 94 98 9c 170 174 178 17c
  50. * 4 a0 a4 a8 ac 180 184 188 18c
  51. * 5 b0 b4 b8 bc 190 194 198 19c
  52. * 6 c0 c4 c8 cc 1a0 1a4 1a8 1ac
  53. * 7 d0 d4 d8 dc 1b0 1b4 1b8 1bc
  54. * 8 e0 e4 e8 ec 1c0 1c4 1c8 1cc
  55. *
  56. *
  57. * YVCOEF_{x}{A|B} CVCOEF_{x}{A|B}
  58. *
  59. * A B A B
  60. * 0 f0 f4 1d0 1d4
  61. * 1 f8 fc 1d8 1dc
  62. * 2 100 104 1e0 1e4
  63. * 3 108 10c 1e8 1ec
  64. * 4 110 114 1f0 1f4
  65. * 5 118 11c 1f8 1fc
  66. * 6 120 124 200 204
  67. * 7 128 12c 208 20c
  68. * 8 130 134 210 214
  69. */
  70. #define _SCALER_HCOEF_DELTA(r, c) ((r) * 0x10 + (c) * 0x4)
  71. #define _SCALER_VCOEF_DELTA(r, c) ((r) * 0x8 + (c) * 0x4)
  72. #define SCALER_YHCOEF(r, c) (0x60 + _SCALER_HCOEF_DELTA((r), (c)))
  73. #define SCALER_YVCOEF(r, c) (0xf0 + _SCALER_VCOEF_DELTA((r), (c)))
  74. #define SCALER_CHCOEF(r, c) (0x140 + _SCALER_HCOEF_DELTA((r), (c)))
  75. #define SCALER_CVCOEF(r, c) (0x1d0 + _SCALER_VCOEF_DELTA((r), (c)))
  76. /* Color Space Conversion */
  77. #define SCALER_CSC_COEF(x, y) (0x220 + (y) * 0xc + (x) * 0x4)
  78. /* Dithering */
  79. #define SCALER_DITH_CFG 0x250
  80. /* Version Number */
  81. #define SCALER_VER 0x260 /* no shadow */
  82. /* Cycle count and Timeout */
  83. #define SCALER_CYCLE_COUNT 0x278 /* no shadow */
  84. #define SCALER_TIMEOUT_CTRL 0x2c0 /* no shadow */
  85. #define SCALER_TIMEOUT_CNT 0x2c4 /* no shadow */
  86. /* Blending */
  87. #define SCALER_SRC_BLEND_COLOR 0x280
  88. #define SCALER_SRC_BLEND_ALPHA 0x284
  89. #define SCALER_DST_BLEND_COLOR 0x288
  90. #define SCALER_DST_BLEND_ALPHA 0x28c
  91. /* Color Fill */
  92. #define SCALER_FILL_COLOR 0x290
  93. /* Multiple Command Queue */
  94. #define SCALER_ADDR_Q_CONFIG 0x2a0 /* no shadow */
  95. #define SCALER_SRC_ADDR_Q_STATUS 0x2a4 /* no shadow */
  96. #define SCALER_SRC_ADDR_Q 0x2a8 /* no shadow */
  97. /* CRC */
  98. #define SCALER_CRC_COLOR00_10 0x2b0 /* no shadow */
  99. #define SCALER_CRC_COLOR20_30 0x2b4 /* no shadow */
  100. #define SCALER_CRC_COLOR01_11 0x2b8 /* no shadow */
  101. #define SCALER_CRC_COLOR21_31 0x2bc /* no shadow */
  102. /* Shadow Registers */
  103. #define SCALER_SHADOW_OFFSET 0x1000
  104. /* Bit definition part */
  105. #define SCALER_MASK(hi_b, lo_b) ((1 << ((hi_b) - (lo_b) + 1)) - 1)
  106. #define SCALER_GET(reg, hi_b, lo_b) \
  107. (((reg) >> (lo_b)) & SCALER_MASK(hi_b, lo_b))
  108. #define SCALER_SET(val, hi_b, lo_b) \
  109. (((val) & SCALER_MASK(hi_b, lo_b)) << lo_b)
  110. /* SCALER_STATUS */
  111. #define SCALER_STATUS_SCALER_RUNNING (1 << 1)
  112. #define SCALER_STATUS_SCALER_READY_CLK_DOWN (1 << 0)
  113. /* SCALER_CFG */
  114. #define SCALER_CFG_FILL_EN (1 << 24)
  115. #define SCALER_CFG_BLEND_COLOR_DIVIDE_ALPHA_EN (1 << 17)
  116. #define SCALER_CFG_BLEND_EN (1 << 16)
  117. #define SCALER_CFG_CSC_Y_OFFSET_SRC_EN (1 << 10)
  118. #define SCALER_CFG_CSC_Y_OFFSET_DST_EN (1 << 9)
  119. #define SCALER_CFG_16_BURST_MODE (1 << 8)
  120. #define SCALER_CFG_SOFT_RESET (1 << 1)
  121. #define SCALER_CFG_START_CMD (1 << 0)
  122. /* SCALER_INT_EN */
  123. #define SCALER_INT_EN_TIMEOUT (1 << 31)
  124. #define SCALER_INT_EN_ILLEGAL_BLEND (1 << 24)
  125. #define SCALER_INT_EN_ILLEGAL_RATIO (1 << 23)
  126. #define SCALER_INT_EN_ILLEGAL_DST_HEIGHT (1 << 22)
  127. #define SCALER_INT_EN_ILLEGAL_DST_WIDTH (1 << 21)
  128. #define SCALER_INT_EN_ILLEGAL_DST_V_POS (1 << 20)
  129. #define SCALER_INT_EN_ILLEGAL_DST_H_POS (1 << 19)
  130. #define SCALER_INT_EN_ILLEGAL_DST_C_SPAN (1 << 18)
  131. #define SCALER_INT_EN_ILLEGAL_DST_Y_SPAN (1 << 17)
  132. #define SCALER_INT_EN_ILLEGAL_DST_CR_BASE (1 << 16)
  133. #define SCALER_INT_EN_ILLEGAL_DST_CB_BASE (1 << 15)
  134. #define SCALER_INT_EN_ILLEGAL_DST_Y_BASE (1 << 14)
  135. #define SCALER_INT_EN_ILLEGAL_DST_COLOR (1 << 13)
  136. #define SCALER_INT_EN_ILLEGAL_SRC_HEIGHT (1 << 12)
  137. #define SCALER_INT_EN_ILLEGAL_SRC_WIDTH (1 << 11)
  138. #define SCALER_INT_EN_ILLEGAL_SRC_CV_POS (1 << 10)
  139. #define SCALER_INT_EN_ILLEGAL_SRC_CH_POS (1 << 9)
  140. #define SCALER_INT_EN_ILLEGAL_SRC_YV_POS (1 << 8)
  141. #define SCALER_INT_EN_ILLEGAL_SRC_YH_POS (1 << 7)
  142. #define SCALER_INT_EN_ILLEGAL_DST_SPAN (1 << 6)
  143. #define SCALER_INT_EN_ILLEGAL_SRC_Y_SPAN (1 << 5)
  144. #define SCALER_INT_EN_ILLEGAL_SRC_CR_BASE (1 << 4)
  145. #define SCALER_INT_EN_ILLEGAL_SRC_CB_BASE (1 << 3)
  146. #define SCALER_INT_EN_ILLEGAL_SRC_Y_BASE (1 << 2)
  147. #define SCALER_INT_EN_ILLEGAL_SRC_COLOR (1 << 1)
  148. #define SCALER_INT_EN_FRAME_END (1 << 0)
  149. /* SCALER_INT_STATUS */
  150. #define SCALER_INT_STATUS_TIMEOUT (1 << 31)
  151. #define SCALER_INT_STATUS_ILLEGAL_BLEND (1 << 24)
  152. #define SCALER_INT_STATUS_ILLEGAL_RATIO (1 << 23)
  153. #define SCALER_INT_STATUS_ILLEGAL_DST_HEIGHT (1 << 22)
  154. #define SCALER_INT_STATUS_ILLEGAL_DST_WIDTH (1 << 21)
  155. #define SCALER_INT_STATUS_ILLEGAL_DST_V_POS (1 << 20)
  156. #define SCALER_INT_STATUS_ILLEGAL_DST_H_POS (1 << 19)
  157. #define SCALER_INT_STATUS_ILLEGAL_DST_C_SPAN (1 << 18)
  158. #define SCALER_INT_STATUS_ILLEGAL_DST_Y_SPAN (1 << 17)
  159. #define SCALER_INT_STATUS_ILLEGAL_DST_CR_BASE (1 << 16)
  160. #define SCALER_INT_STATUS_ILLEGAL_DST_CB_BASE (1 << 15)
  161. #define SCALER_INT_STATUS_ILLEGAL_DST_Y_BASE (1 << 14)
  162. #define SCALER_INT_STATUS_ILLEGAL_DST_COLOR (1 << 13)
  163. #define SCALER_INT_STATUS_ILLEGAL_SRC_HEIGHT (1 << 12)
  164. #define SCALER_INT_STATUS_ILLEGAL_SRC_WIDTH (1 << 11)
  165. #define SCALER_INT_STATUS_ILLEGAL_SRC_CV_POS (1 << 10)
  166. #define SCALER_INT_STATUS_ILLEGAL_SRC_CH_POS (1 << 9)
  167. #define SCALER_INT_STATUS_ILLEGAL_SRC_YV_POS (1 << 8)
  168. #define SCALER_INT_STATUS_ILLEGAL_SRC_YH_POS (1 << 7)
  169. #define SCALER_INT_STATUS_ILLEGAL_DST_SPAN (1 << 6)
  170. #define SCALER_INT_STATUS_ILLEGAL_SRC_Y_SPAN (1 << 5)
  171. #define SCALER_INT_STATUS_ILLEGAL_SRC_CR_BASE (1 << 4)
  172. #define SCALER_INT_STATUS_ILLEGAL_SRC_CB_BASE (1 << 3)
  173. #define SCALER_INT_STATUS_ILLEGAL_SRC_Y_BASE (1 << 2)
  174. #define SCALER_INT_STATUS_ILLEGAL_SRC_COLOR (1 << 1)
  175. #define SCALER_INT_STATUS_FRAME_END (1 << 0)
  176. /* SCALER_SRC_CFG */
  177. #define SCALER_SRC_CFG_TILE_EN (1 << 10)
  178. #define SCALER_SRC_CFG_GET_BYTE_SWAP(r) SCALER_GET(r, 6, 5)
  179. #define SCALER_SRC_CFG_SET_BYTE_SWAP(v) SCALER_SET(v, 6, 5)
  180. #define SCALER_SRC_CFG_GET_COLOR_FORMAT(r) SCALER_GET(r, 4, 0)
  181. #define SCALER_SRC_CFG_SET_COLOR_FORMAT(v) SCALER_SET(v, 4, 0)
  182. #define SCALER_YUV420_2P_UV 0
  183. #define SCALER_YUV422_2P_UV 2
  184. #define SCALER_YUV444_2P_UV 3
  185. #define SCALER_RGB_565 4
  186. #define SCALER_ARGB1555 5
  187. #define SCALER_ARGB8888 6
  188. #define SCALER_ARGB8888_PRE 7
  189. #define SCALER_YUV422_1P_YVYU 9
  190. #define SCALER_YUV422_1P_YUYV 10
  191. #define SCALER_YUV422_1P_UYVY 11
  192. #define SCALER_ARGB4444 12
  193. #define SCALER_L8A8 13
  194. #define SCALER_RGBA8888 14
  195. #define SCALER_L8 15
  196. #define SCALER_YUV420_2P_VU 16
  197. #define SCALER_YUV422_2P_VU 18
  198. #define SCALER_YUV444_2P_VU 19
  199. #define SCALER_YUV420_3P 20
  200. #define SCALER_YUV422_3P 22
  201. #define SCALER_YUV444_3P 23
  202. /* SCALER_SRC_SPAN */
  203. #define SCALER_SRC_SPAN_GET_C_SPAN(r) SCALER_GET(r, 29, 16)
  204. #define SCALER_SRC_SPAN_SET_C_SPAN(v) SCALER_SET(v, 29, 16)
  205. #define SCALER_SRC_SPAN_GET_Y_SPAN(r) SCALER_GET(r, 13, 0)
  206. #define SCALER_SRC_SPAN_SET_Y_SPAN(v) SCALER_SET(v, 13, 0)
  207. /* SCALER_SRC_Y_POS */
  208. #define SCALER_SRC_Y_POS_GET_YH_POS(r) SCALER_GET(r, 31, 16)
  209. #define SCALER_SRC_Y_POS_SET_YH_POS(v) SCALER_SET(v, 31, 16)
  210. #define SCALER_SRC_Y_POS_GET_YV_POS(r) SCALER_GET(r, 15, 0)
  211. #define SCALER_SRC_Y_POS_SET_YV_POS(v) SCALER_SET(v, 15, 0)
  212. /* SCALER_SRC_WH */
  213. #define SCALER_SRC_WH_GET_WIDTH(r) SCALER_GET(r, 29, 16)
  214. #define SCALER_SRC_WH_SET_WIDTH(v) SCALER_SET(v, 29, 16)
  215. #define SCALER_SRC_WH_GET_HEIGHT(r) SCALER_GET(r, 13, 0)
  216. #define SCALER_SRC_WH_SET_HEIGHT(v) SCALER_SET(v, 13, 0)
  217. /* SCALER_SRC_C_POS */
  218. #define SCALER_SRC_C_POS_GET_CH_POS(r) SCALER_GET(r, 31, 16)
  219. #define SCALER_SRC_C_POS_SET_CH_POS(v) SCALER_SET(v, 31, 16)
  220. #define SCALER_SRC_C_POS_GET_CV_POS(r) SCALER_GET(r, 15, 0)
  221. #define SCALER_SRC_C_POS_SET_CV_POS(v) SCALER_SET(v, 15, 0)
  222. /* SCALER_DST_CFG */
  223. #define SCALER_DST_CFG_GET_BYTE_SWAP(r) SCALER_GET(r, 6, 5)
  224. #define SCALER_DST_CFG_SET_BYTE_SWAP(v) SCALER_SET(v, 6, 5)
  225. #define SCALER_DST_CFG_GET_COLOR_FORMAT(r) SCALER_GET(r, 4, 0)
  226. #define SCALER_DST_CFG_SET_COLOR_FORMAT(v) SCALER_SET(v, 4, 0)
  227. /* SCALER_DST_SPAN */
  228. #define SCALER_DST_SPAN_GET_C_SPAN(r) SCALER_GET(r, 29, 16)
  229. #define SCALER_DST_SPAN_SET_C_SPAN(v) SCALER_SET(v, 29, 16)
  230. #define SCALER_DST_SPAN_GET_Y_SPAN(r) SCALER_GET(r, 13, 0)
  231. #define SCALER_DST_SPAN_SET_Y_SPAN(v) SCALER_SET(v, 13, 0)
  232. /* SCALER_DST_WH */
  233. #define SCALER_DST_WH_GET_WIDTH(r) SCALER_GET(r, 29, 16)
  234. #define SCALER_DST_WH_SET_WIDTH(v) SCALER_SET(v, 29, 16)
  235. #define SCALER_DST_WH_GET_HEIGHT(r) SCALER_GET(r, 13, 0)
  236. #define SCALER_DST_WH_SET_HEIGHT(v) SCALER_SET(v, 13, 0)
  237. /* SCALER_DST_POS */
  238. #define SCALER_DST_POS_GET_H_POS(r) SCALER_GET(r, 29, 16)
  239. #define SCALER_DST_POS_SET_H_POS(v) SCALER_SET(v, 29, 16)
  240. #define SCALER_DST_POS_GET_V_POS(r) SCALER_GET(r, 13, 0)
  241. #define SCALER_DST_POS_SET_V_POS(v) SCALER_SET(v, 13, 0)
  242. /* SCALER_H_RATIO */
  243. #define SCALER_H_RATIO_GET(r) SCALER_GET(r, 18, 0)
  244. #define SCALER_H_RATIO_SET(v) SCALER_SET(v, 18, 0)
  245. /* SCALER_V_RATIO */
  246. #define SCALER_V_RATIO_GET(r) SCALER_GET(r, 18, 0)
  247. #define SCALER_V_RATIO_SET(v) SCALER_SET(v, 18, 0)
  248. /* SCALER_ROT_CFG */
  249. #define SCALER_ROT_CFG_FLIP_X_EN (1 << 3)
  250. #define SCALER_ROT_CFG_FLIP_Y_EN (1 << 2)
  251. #define SCALER_ROT_CFG_GET_ROTMODE(r) SCALER_GET(r, 1, 0)
  252. #define SCALER_ROT_CFG_SET_ROTMODE(v) SCALER_SET(v, 1, 0)
  253. #define SCALER_ROT_MODE_90 1
  254. #define SCALER_ROT_MODE_180 2
  255. #define SCALER_ROT_MODE_270 3
  256. /* SCALER_HCOEF, SCALER_VCOEF */
  257. #define SCALER_COEF_SHIFT(i) (16 * (1 - (i) % 2))
  258. #define SCALER_COEF_GET(r, i) \
  259. (((r) >> SCALER_COEF_SHIFT(i)) & 0x1ff)
  260. #define SCALER_COEF_SET(v, i) \
  261. (((v) & 0x1ff) << SCALER_COEF_SHIFT(i))
  262. /* SCALER_CSC_COEFxy */
  263. #define SCALER_CSC_COEF_GET(r) SCALER_GET(r, 11, 0)
  264. #define SCALER_CSC_COEF_SET(v) SCALER_SET(v, 11, 0)
  265. /* SCALER_DITH_CFG */
  266. #define SCALER_DITH_CFG_GET_R_TYPE(r) SCALER_GET(r, 8, 6)
  267. #define SCALER_DITH_CFG_SET_R_TYPE(v) SCALER_SET(v, 8, 6)
  268. #define SCALER_DITH_CFG_GET_G_TYPE(r) SCALER_GET(r, 5, 3)
  269. #define SCALER_DITH_CFG_SET_G_TYPE(v) SCALER_SET(v, 5, 3)
  270. #define SCALER_DITH_CFG_GET_B_TYPE(r) SCALER_GET(r, 2, 0)
  271. #define SCALER_DITH_CFG_SET_B_TYPE(v) SCALER_SET(v, 2, 0)
  272. /* SCALER_TIMEOUT_CTRL */
  273. #define SCALER_TIMEOUT_CTRL_GET_TIMER_VALUE(r) SCALER_GET(r, 31, 16)
  274. #define SCALER_TIMEOUT_CTRL_SET_TIMER_VALUE(v) SCALER_SET(v, 31, 16)
  275. #define SCALER_TIMEOUT_CTRL_GET_TIMER_DIV(r) SCALER_GET(r, 7, 4)
  276. #define SCALER_TIMEOUT_CTRL_SET_TIMER_DIV(v) SCALER_SET(v, 7, 4)
  277. #define SCALER_TIMEOUT_CTRL_TIMER_ENABLE (1 << 0)
  278. /* SCALER_TIMEOUT_CNT */
  279. #define SCALER_TIMEOUT_CTRL_GET_TIMER_COUNT(r) SCALER_GET(r, 31, 16)
  280. /* SCALER_SRC_BLEND_COLOR */
  281. #define SCALER_SRC_BLEND_COLOR_SEL_INV (1 << 31)
  282. #define SCALER_SRC_BLEND_COLOR_GET_SEL(r) SCALER_GET(r, 30, 29)
  283. #define SCALER_SRC_BLEND_COLOR_SET_SEL(v) SCALER_SET(v, 30, 29)
  284. #define SCALER_SRC_BLEND_COLOR_OP_SEL_INV (1 << 28)
  285. #define SCALER_SRC_BLEND_COLOR_GET_OP_SEL(r) SCALER_GET(r, 27, 24)
  286. #define SCALER_SRC_BLEND_COLOR_SET_OP_SEL(v) SCALER_SET(v, 27, 24)
  287. #define SCALER_SRC_BLEND_COLOR_GET_COLOR0(r) SCALER_GET(r, 23, 16)
  288. #define SCALER_SRC_BLEND_COLOR_SET_COLOR0(v) SCALER_SET(v, 23, 16)
  289. #define SCALER_SRC_BLEND_COLOR_GET_COLOR1(r) SCALER_GET(r, 15, 8)
  290. #define SCALER_SRC_BLEND_COLOR_SET_COLOR1(v) SCALER_SET(v, 15, 8)
  291. #define SCALER_SRC_BLEND_COLOR_GET_COLOR2(r) SCALER_GET(r, 7, 0)
  292. #define SCALER_SRC_BLEND_COLOR_SET_COLOR2(v) SCALER_SET(v, 7, 0)
  293. /* SCALER_SRC_BLEND_ALPHA */
  294. #define SCALER_SRC_BLEND_ALPHA_SEL_INV (1 << 31)
  295. #define SCALER_SRC_BLEND_ALPHA_GET_SEL(r) SCALER_GET(r, 30, 29)
  296. #define SCALER_SRC_BLEND_ALPHA_SET_SEL(v) SCALER_SET(v, 30, 29)
  297. #define SCALER_SRC_BLEND_ALPHA_OP_SEL_INV (1 << 28)
  298. #define SCALER_SRC_BLEND_ALPHA_GET_OP_SEL(r) SCALER_GET(r, 27, 24)
  299. #define SCALER_SRC_BLEND_ALPHA_SET_OP_SEL(v) SCALER_SET(v, 27, 24)
  300. #define SCALER_SRC_BLEND_ALPHA_GET_ALPHA(r) SCALER_GET(r, 7, 0)
  301. #define SCALER_SRC_BLEND_ALPHA_SET_ALPHA(v) SCALER_SET(v, 7, 0)
  302. /* SCALER_DST_BLEND_COLOR */
  303. #define SCALER_DST_BLEND_COLOR_SEL_INV (1 << 31)
  304. #define SCALER_DST_BLEND_COLOR_GET_SEL(r) SCALER_GET(r, 30, 29)
  305. #define SCALER_DST_BLEND_COLOR_SET_SEL(v) SCALER_SET(v, 30, 29)
  306. #define SCALER_DST_BLEND_COLOR_OP_SEL_INV (1 << 28)
  307. #define SCALER_DST_BLEND_COLOR_GET_OP_SEL(r) SCALER_GET(r, 27, 24)
  308. #define SCALER_DST_BLEND_COLOR_SET_OP_SEL(v) SCALER_SET(v, 27, 24)
  309. #define SCALER_DST_BLEND_COLOR_GET_COLOR0(r) SCALER_GET(r, 23, 16)
  310. #define SCALER_DST_BLEND_COLOR_SET_COLOR0(v) SCALER_SET(v, 23, 16)
  311. #define SCALER_DST_BLEND_COLOR_GET_COLOR1(r) SCALER_GET(r, 15, 8)
  312. #define SCALER_DST_BLEND_COLOR_SET_COLOR1(v) SCALER_SET(v, 15, 8)
  313. #define SCALER_DST_BLEND_COLOR_GET_COLOR2(r) SCALER_GET(r, 7, 0)
  314. #define SCALER_DST_BLEND_COLOR_SET_COLOR2(v) SCALER_SET(v, 7, 0)
  315. /* SCALER_DST_BLEND_ALPHA */
  316. #define SCALER_DST_BLEND_ALPHA_SEL_INV (1 << 31)
  317. #define SCALER_DST_BLEND_ALPHA_GET_SEL(r) SCALER_GET(r, 30, 29)
  318. #define SCALER_DST_BLEND_ALPHA_SET_SEL(v) SCALER_SET(v, 30, 29)
  319. #define SCALER_DST_BLEND_ALPHA_OP_SEL_INV (1 << 28)
  320. #define SCALER_DST_BLEND_ALPHA_GET_OP_SEL(r) SCALER_GET(r, 27, 24)
  321. #define SCALER_DST_BLEND_ALPHA_SET_OP_SEL(v) SCALER_SET(v, 27, 24)
  322. #define SCALER_DST_BLEND_ALPHA_GET_ALPHA(r) SCALER_GET(r, 7, 0)
  323. #define SCALER_DST_BLEND_ALPHA_SET_ALPHA(v) SCALER_SET(v, 7, 0)
  324. /* SCALER_FILL_COLOR */
  325. #define SCALER_FILL_COLOR_GET_ALPHA(r) SCALER_GET(r, 31, 24)
  326. #define SCALER_FILL_COLOR_SET_ALPHA(v) SCALER_SET(v, 31, 24)
  327. #define SCALER_FILL_COLOR_GET_FILL_COLOR0(r) SCALER_GET(r, 23, 16)
  328. #define SCALER_FILL_COLOR_SET_FILL_COLOR0(v) SCALER_SET(v, 23, 16)
  329. #define SCALER_FILL_COLOR_GET_FILL_COLOR1(r) SCALER_GET(r, 15, 8)
  330. #define SCALER_FILL_COLOR_SET_FILL_COLOR1(v) SCALER_SET(v, 15, 8)
  331. #define SCALER_FILL_COLOR_GET_FILL_COLOR2(r) SCALER_GET(r, 7, 0)
  332. #define SCALER_FILL_COLOR_SET_FILL_COLOR2(v) SCALER_SET(v, 7, 0)
  333. /* SCALER_ADDR_Q_CONFIG */
  334. #define SCALER_ADDR_Q_CONFIG_RST (1 << 0)
  335. /* SCALER_SRC_ADDR_Q_STATUS */
  336. #define SCALER_SRC_ADDR_Q_STATUS_Y_FULL (1 << 23)
  337. #define SCALER_SRC_ADDR_Q_STATUS_Y_EMPTY (1 << 22)
  338. #define SCALER_SRC_ADDR_Q_STATUS_GET_Y_WR_IDX(r) SCALER_GET(r, 21, 16)
  339. #define SCALER_SRC_ADDR_Q_STATUS_CB_FULL (1 << 15)
  340. #define SCALER_SRC_ADDR_Q_STATUS_CB_EMPTY (1 << 14)
  341. #define SCALER_SRC_ADDR_Q_STATUS_GET_CB_WR_IDX(r) SCALER_GET(r, 13, 8)
  342. #define SCALER_SRC_ADDR_Q_STATUS_CR_FULL (1 << 7)
  343. #define SCALER_SRC_ADDR_Q_STATUS_CR_EMPTY (1 << 6)
  344. #define SCALER_SRC_ADDR_Q_STATUS_GET_CR_WR_IDX(r) SCALER_GET(r, 5, 0)
  345. /* SCALER_DST_ADDR_Q_STATUS */
  346. #define SCALER_DST_ADDR_Q_STATUS_Y_FULL (1 << 23)
  347. #define SCALER_DST_ADDR_Q_STATUS_Y_EMPTY (1 << 22)
  348. #define SCALER_DST_ADDR_Q_STATUS_GET_Y_WR_IDX(r) SCALER_GET(r, 21, 16)
  349. #define SCALER_DST_ADDR_Q_STATUS_CB_FULL (1 << 15)
  350. #define SCALER_DST_ADDR_Q_STATUS_CB_EMPTY (1 << 14)
  351. #define SCALER_DST_ADDR_Q_STATUS_GET_CB_WR_IDX(r) SCALER_GET(r, 13, 8)
  352. #define SCALER_DST_ADDR_Q_STATUS_CR_FULL (1 << 7)
  353. #define SCALER_DST_ADDR_Q_STATUS_CR_EMPTY (1 << 6)
  354. #define SCALER_DST_ADDR_Q_STATUS_GET_CR_WR_IDX(r) SCALER_GET(r, 5, 0)
  355. /* SCALER_CRC_COLOR00_10 */
  356. #define SCALER_CRC_COLOR00_10_GET_00(r) SCALER_GET(r, 31, 16)
  357. #define SCALER_CRC_COLOR00_10_GET_10(r) SCALER_GET(r, 15, 0)
  358. /* SCALER_CRC_COLOR20_30 */
  359. #define SCALER_CRC_COLOR20_30_GET_20(r) SCALER_GET(r, 31, 16)
  360. #define SCALER_CRC_COLOR20_30_GET_30(r) SCALER_GET(r, 15, 0)
  361. /* SCALER_CRC_COLOR01_11 */
  362. #define SCALER_CRC_COLOR01_11_GET_01(r) SCALER_GET(r, 31, 16)
  363. #define SCALER_CRC_COLOR01_11_GET_11(r) SCALER_GET(r, 15, 0)
  364. /* SCALER_CRC_COLOR21_31 */
  365. #define SCALER_CRC_COLOR21_31_GET_21(r) SCALER_GET(r, 31, 16)
  366. #define SCALER_CRC_COLOR21_31_GET_31(r) SCALER_GET(r, 15, 0)
  367. #endif /* EXYNOS_REGS_SCALER_H */