zx_plane_regs.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * Copyright 2016 Linaro Ltd.
  3. * Copyright 2016 ZTE Corporation.
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. *
  9. */
  10. #ifndef __ZX_PLANE_REGS_H__
  11. #define __ZX_PLANE_REGS_H__
  12. /* GL registers */
  13. #define GL_CTRL0 0x00
  14. #define GL_UPDATE BIT(5)
  15. #define GL_CTRL1 0x04
  16. #define GL_DATA_FMT_SHIFT 0
  17. #define GL_DATA_FMT_MASK (0xf << GL_DATA_FMT_SHIFT)
  18. #define GL_FMT_ARGB8888 0
  19. #define GL_FMT_RGB888 1
  20. #define GL_FMT_RGB565 2
  21. #define GL_FMT_ARGB1555 3
  22. #define GL_FMT_ARGB4444 4
  23. #define GL_CTRL2 0x08
  24. #define GL_GLOBAL_ALPHA_SHIFT 8
  25. #define GL_GLOBAL_ALPHA_MASK (0xff << GL_GLOBAL_ALPHA_SHIFT)
  26. #define GL_CTRL3 0x0c
  27. #define GL_SCALER_BYPASS_MODE BIT(0)
  28. #define GL_STRIDE 0x18
  29. #define GL_ADDR 0x1c
  30. #define GL_SRC_SIZE 0x38
  31. #define GL_SRC_W_SHIFT 16
  32. #define GL_SRC_W_MASK (0x3fff << GL_SRC_W_SHIFT)
  33. #define GL_SRC_H_SHIFT 0
  34. #define GL_SRC_H_MASK (0x3fff << GL_SRC_H_SHIFT)
  35. #define GL_POS_START 0x9c
  36. #define GL_POS_END 0xa0
  37. #define GL_POS_X_SHIFT 16
  38. #define GL_POS_X_MASK (0x1fff << GL_POS_X_SHIFT)
  39. #define GL_POS_Y_SHIFT 0
  40. #define GL_POS_Y_MASK (0x1fff << GL_POS_Y_SHIFT)
  41. #define GL_SRC_W(x) (((x) << GL_SRC_W_SHIFT) & GL_SRC_W_MASK)
  42. #define GL_SRC_H(x) (((x) << GL_SRC_H_SHIFT) & GL_SRC_H_MASK)
  43. #define GL_POS_X(x) (((x) << GL_POS_X_SHIFT) & GL_POS_X_MASK)
  44. #define GL_POS_Y(x) (((x) << GL_POS_Y_SHIFT) & GL_POS_Y_MASK)
  45. /* CSC registers */
  46. #define CSC_CTRL0 0x30
  47. #define CSC_COV_MODE_SHIFT 16
  48. #define CSC_COV_MODE_MASK (0xffff << CSC_COV_MODE_SHIFT)
  49. #define CSC_BT601_IMAGE_RGB2YCBCR 0
  50. #define CSC_BT601_IMAGE_YCBCR2RGB 1
  51. #define CSC_BT601_VIDEO_RGB2YCBCR 2
  52. #define CSC_BT601_VIDEO_YCBCR2RGB 3
  53. #define CSC_BT709_IMAGE_RGB2YCBCR 4
  54. #define CSC_BT709_IMAGE_YCBCR2RGB 5
  55. #define CSC_BT709_VIDEO_RGB2YCBCR 6
  56. #define CSC_BT709_VIDEO_YCBCR2RGB 7
  57. #define CSC_BT2020_IMAGE_RGB2YCBCR 8
  58. #define CSC_BT2020_IMAGE_YCBCR2RGB 9
  59. #define CSC_BT2020_VIDEO_RGB2YCBCR 10
  60. #define CSC_BT2020_VIDEO_YCBCR2RGB 11
  61. #define CSC_WORK_ENABLE BIT(0)
  62. /* RSZ registers */
  63. #define RSZ_SRC_CFG 0x00
  64. #define RSZ_DEST_CFG 0x04
  65. #define RSZ_ENABLE_CFG 0x14
  66. #define RSZ_VER_SHIFT 16
  67. #define RSZ_VER_MASK (0xffff << RSZ_VER_SHIFT)
  68. #define RSZ_HOR_SHIFT 0
  69. #define RSZ_HOR_MASK (0xffff << RSZ_HOR_SHIFT)
  70. #define RSZ_VER(x) (((x) << RSZ_VER_SHIFT) & RSZ_VER_MASK)
  71. #define RSZ_HOR(x) (((x) << RSZ_HOR_SHIFT) & RSZ_HOR_MASK)
  72. /* HBSC registers */
  73. #define HBSC_SATURATION 0x00
  74. #define HBSC_HUE 0x04
  75. #define HBSC_BRIGHT 0x08
  76. #define HBSC_CONTRAST 0x0c
  77. #define HBSC_THRESHOLD_COL1 0x10
  78. #define HBSC_THRESHOLD_COL2 0x14
  79. #define HBSC_THRESHOLD_COL3 0x18
  80. #define HBSC_CTRL0 0x28
  81. #define HBSC_CTRL_EN BIT(2)
  82. #endif /* __ZX_PLANE_REGS_H__ */