meson_viu.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Copyright (C) 2016 BayLibre, SAS
  4. * Author: Neil Armstrong <[email protected]>
  5. */
  6. /* Video Input Unit */
  7. #ifndef __MESON_VIU_H
  8. #define __MESON_VIU_H
  9. /* OSDx_BLKx_CFG */
  10. #define OSD_MALI_SRC_EN BIT(30)
  11. #define OSD_CANVAS_SEL 16
  12. #define OSD_ENDIANNESS_LE BIT(15)
  13. #define OSD_ENDIANNESS_BE (0)
  14. #define OSD_BLK_MODE_422 (0x03 << 8)
  15. #define OSD_BLK_MODE_16 (0x04 << 8)
  16. #define OSD_BLK_MODE_32 (0x05 << 8)
  17. #define OSD_BLK_MODE_24 (0x07 << 8)
  18. #define OSD_OUTPUT_COLOR_RGB BIT(7)
  19. #define OSD_OUTPUT_COLOR_YUV (0)
  20. #define OSD_COLOR_MATRIX_32_RGBA (0x00 << 2)
  21. #define OSD_COLOR_MATRIX_32_ARGB (0x01 << 2)
  22. #define OSD_COLOR_MATRIX_32_ABGR (0x02 << 2)
  23. #define OSD_COLOR_MATRIX_32_BGRA (0x03 << 2)
  24. #define OSD_COLOR_MATRIX_24_RGB (0x00 << 2)
  25. #define OSD_COLOR_MATRIX_16_RGB655 (0x00 << 2)
  26. #define OSD_COLOR_MATRIX_16_RGB565 (0x04 << 2)
  27. #define OSD_MALI_COLOR_MODE_R8 (0 << 8)
  28. #define OSD_MALI_COLOR_MODE_YUV422 (1 << 8)
  29. #define OSD_MALI_COLOR_MODE_RGB565 (2 << 8)
  30. #define OSD_MALI_COLOR_MODE_RGBA5551 (3 << 8)
  31. #define OSD_MALI_COLOR_MODE_RGBA4444 (4 << 8)
  32. #define OSD_MALI_COLOR_MODE_RGBA8888 (5 << 8)
  33. #define OSD_MALI_COLOR_MODE_RGB888 (7 << 8)
  34. #define OSD_MALI_COLOR_MODE_YUV422_10B (8 << 8)
  35. #define OSD_MALI_COLOR_MODE_RGBA1010102 (9 << 8)
  36. #define OSD_INTERLACE_ENABLED BIT(1)
  37. #define OSD_INTERLACE_ODD BIT(0)
  38. #define OSD_INTERLACE_EVEN (0)
  39. /* OSDx_CTRL_STAT */
  40. #define OSD_ENABLE BIT(21)
  41. #define OSD_MEM_LINEAR_ADDR BIT(2)
  42. #define OSD_BLK0_ENABLE BIT(0)
  43. #define OSD_GLOBAL_ALPHA_SHIFT 12
  44. /* OSDx_CTRL_STAT2 */
  45. #define OSD_DPATH_MALI_AFBCD BIT(15)
  46. #define OSD_REPLACE_EN BIT(14)
  47. #define OSD_REPLACE_SHIFT 6
  48. #define OSD_PENDING_STAT_CLEAN BIT(1)
  49. void meson_viu_osd1_reset(struct meson_drm *priv);
  50. void meson_viu_g12a_enable_osd1_afbc(struct meson_drm *priv);
  51. void meson_viu_g12a_disable_osd1_afbc(struct meson_drm *priv);
  52. void meson_viu_gxm_enable_osd1_afbc(struct meson_drm *priv);
  53. void meson_viu_gxm_disable_osd1_afbc(struct meson_drm *priv);
  54. void meson_viu_init(struct meson_drm *priv);
  55. #endif /* __MESON_VIU_H */