regs-rotator.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /* drivers/gpu/drm/exynos/regs-rotator.h
  3. *
  4. * Copyright (c) 2012 Samsung Electronics Co., Ltd.
  5. * http://www.samsung.com/
  6. *
  7. * Register definition file for Samsung Rotator Interface (Rotator) driver
  8. */
  9. #ifndef EXYNOS_REGS_ROTATOR_H
  10. #define EXYNOS_REGS_ROTATOR_H
  11. /* Configuration */
  12. #define ROT_CONFIG 0x00
  13. #define ROT_CONFIG_IRQ (3 << 8)
  14. /* Image Control */
  15. #define ROT_CONTROL 0x10
  16. #define ROT_CONTROL_PATTERN_WRITE (1 << 16)
  17. #define ROT_CONTROL_FMT_YCBCR420_2P (1 << 8)
  18. #define ROT_CONTROL_FMT_RGB888 (6 << 8)
  19. #define ROT_CONTROL_FMT_MASK (7 << 8)
  20. #define ROT_CONTROL_FLIP_VERTICAL (2 << 6)
  21. #define ROT_CONTROL_FLIP_HORIZONTAL (3 << 6)
  22. #define ROT_CONTROL_FLIP_MASK (3 << 6)
  23. #define ROT_CONTROL_ROT_90 (1 << 4)
  24. #define ROT_CONTROL_ROT_180 (2 << 4)
  25. #define ROT_CONTROL_ROT_270 (3 << 4)
  26. #define ROT_CONTROL_ROT_MASK (3 << 4)
  27. #define ROT_CONTROL_START (1 << 0)
  28. /* Status */
  29. #define ROT_STATUS 0x20
  30. #define ROT_STATUS_IRQ_PENDING(x) (1 << (x))
  31. #define ROT_STATUS_IRQ(x) (((x) >> 8) & 0x3)
  32. #define ROT_STATUS_IRQ_VAL_COMPLETE 1
  33. #define ROT_STATUS_IRQ_VAL_ILLEGAL 2
  34. /* Buffer Address */
  35. #define ROT_SRC_BUF_ADDR(n) (0x30 + ((n) << 2))
  36. #define ROT_DST_BUF_ADDR(n) (0x50 + ((n) << 2))
  37. /* Buffer Size */
  38. #define ROT_SRC_BUF_SIZE 0x3c
  39. #define ROT_DST_BUF_SIZE 0x5c
  40. #define ROT_SET_BUF_SIZE_H(x) ((x) << 16)
  41. #define ROT_SET_BUF_SIZE_W(x) ((x) << 0)
  42. #define ROT_GET_BUF_SIZE_H(x) ((x) >> 16)
  43. #define ROT_GET_BUF_SIZE_W(x) ((x) & 0xffff)
  44. /* Crop Position */
  45. #define ROT_SRC_CROP_POS 0x40
  46. #define ROT_DST_CROP_POS 0x60
  47. #define ROT_CROP_POS_Y(x) ((x) << 16)
  48. #define ROT_CROP_POS_X(x) ((x) << 0)
  49. /* Source Crop Size */
  50. #define ROT_SRC_CROP_SIZE 0x44
  51. #define ROT_SRC_CROP_SIZE_H(x) ((x) << 16)
  52. #define ROT_SRC_CROP_SIZE_W(x) ((x) << 0)
  53. /* Round to nearest aligned value */
  54. #define ROT_ALIGN(x, align, mask) (((x) + (1 << ((align) - 1))) & (mask))
  55. /* Minimum limit value */
  56. #define ROT_MIN(min, mask) (((min) + ~(mask)) & (mask))
  57. /* Maximum limit value */
  58. #define ROT_MAX(max, mask) ((max) & (mask))
  59. #endif /* EXYNOS_REGS_ROTATOR_H */