regs-rotator.h 2.2 KB

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