regs-mfc-v8.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /*
  2. * Register definition file for Samsung MFC V8.x Interface (FIMV) driver
  3. *
  4. * Copyright (c) 2014 Samsung Electronics Co., Ltd.
  5. * http://www.samsung.com/
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #ifndef _REGS_MFC_V8_H
  12. #define _REGS_MFC_V8_H
  13. #include <linux/sizes.h>
  14. #include "regs-mfc-v7.h"
  15. /* Additional registers for v8 */
  16. #define S5P_FIMV_D_MVC_NUM_VIEWS_V8 0xf104
  17. #define S5P_FIMV_D_FIRST_PLANE_DPB_SIZE_V8 0xf144
  18. #define S5P_FIMV_D_SECOND_PLANE_DPB_SIZE_V8 0xf148
  19. #define S5P_FIMV_D_MV_BUFFER_SIZE_V8 0xf150
  20. #define S5P_FIMV_D_FIRST_PLANE_DPB_STRIDE_SIZE_V8 0xf138
  21. #define S5P_FIMV_D_SECOND_PLANE_DPB_STRIDE_SIZE_V8 0xf13c
  22. #define S5P_FIMV_D_FIRST_PLANE_DPB_V8 0xf160
  23. #define S5P_FIMV_D_SECOND_PLANE_DPB_V8 0xf260
  24. #define S5P_FIMV_D_MV_BUFFER_V8 0xf460
  25. #define S5P_FIMV_D_NUM_MV_V8 0xf134
  26. #define S5P_FIMV_D_INIT_BUFFER_OPTIONS_V8 0xf154
  27. #define S5P_FIMV_D_SCRATCH_BUFFER_ADDR_V8 0xf560
  28. #define S5P_FIMV_D_SCRATCH_BUFFER_SIZE_V8 0xf564
  29. #define S5P_FIMV_D_CPB_BUFFER_ADDR_V8 0xf5b0
  30. #define S5P_FIMV_D_CPB_BUFFER_SIZE_V8 0xf5b4
  31. #define S5P_FIMV_D_AVAILABLE_DPB_FLAG_LOWER_V8 0xf5bc
  32. #define S5P_FIMV_D_CPB_BUFFER_OFFSET_V8 0xf5c0
  33. #define S5P_FIMV_D_SLICE_IF_ENABLE_V8 0xf5c4
  34. #define S5P_FIMV_D_STREAM_DATA_SIZE_V8 0xf5d0
  35. /* Display information register */
  36. #define S5P_FIMV_D_DISPLAY_FRAME_WIDTH_V8 0xf600
  37. #define S5P_FIMV_D_DISPLAY_FRAME_HEIGHT_V8 0xf604
  38. /* Display status */
  39. #define S5P_FIMV_D_DISPLAY_STATUS_V8 0xf608
  40. #define S5P_FIMV_D_DISPLAY_FIRST_PLANE_ADDR_V8 0xf60c
  41. #define S5P_FIMV_D_DISPLAY_SECOND_PLANE_ADDR_V8 0xf610
  42. #define S5P_FIMV_D_DISPLAY_FRAME_TYPE_V8 0xf618
  43. #define S5P_FIMV_D_DISPLAY_CROP_INFO1_V8 0xf61c
  44. #define S5P_FIMV_D_DISPLAY_CROP_INFO2_V8 0xf620
  45. #define S5P_FIMV_D_DISPLAY_PICTURE_PROFILE_V8 0xf624
  46. /* Decoded picture information register */
  47. #define S5P_FIMV_D_DECODED_STATUS_V8 0xf644
  48. #define S5P_FIMV_D_DECODED_FIRST_PLANE_ADDR_V8 0xf648
  49. #define S5P_FIMV_D_DECODED_SECOND_PLANE_ADDR_V8 0xf64c
  50. #define S5P_FIMV_D_DECODED_THIRD_PLANE_ADDR_V8 0xf650
  51. #define S5P_FIMV_D_DECODED_FRAME_TYPE_V8 0xf654
  52. #define S5P_FIMV_D_DECODED_NAL_SIZE_V8 0xf664
  53. /* Returned value register for specific setting */
  54. #define S5P_FIMV_D_RET_PICTURE_TAG_TOP_V8 0xf674
  55. #define S5P_FIMV_D_RET_PICTURE_TAG_BOT_V8 0xf678
  56. #define S5P_FIMV_D_MVC_VIEW_ID_V8 0xf6d8
  57. /* SEI related information */
  58. #define S5P_FIMV_D_FRAME_PACK_SEI_AVAIL_V8 0xf6dc
  59. /* Encoder Registers */
  60. #define S5P_FIMV_E_FIXED_PICTURE_QP_V8 0xf794
  61. #define S5P_FIMV_E_RC_CONFIG_V8 0xf798
  62. #define S5P_FIMV_E_RC_QP_BOUND_V8 0xf79c
  63. #define S5P_FIMV_E_RC_RPARAM_V8 0xf7a4
  64. #define S5P_FIMV_E_MB_RC_CONFIG_V8 0xf7a8
  65. #define S5P_FIMV_E_PADDING_CTRL_V8 0xf7ac
  66. #define S5P_FIMV_E_MV_HOR_RANGE_V8 0xf7b4
  67. #define S5P_FIMV_E_MV_VER_RANGE_V8 0xf7b8
  68. #define S5P_FIMV_E_VBV_BUFFER_SIZE_V8 0xf78c
  69. #define S5P_FIMV_E_VBV_INIT_DELAY_V8 0xf790
  70. #define S5P_FIMV_E_ASPECT_RATIO_V8 0xfb4c
  71. #define S5P_FIMV_E_EXTENDED_SAR_V8 0xfb50
  72. #define S5P_FIMV_E_H264_OPTIONS_V8 0xfb54
  73. /* MFCv8 Context buffer sizes */
  74. #define MFC_CTX_BUF_SIZE_V8 (30 * SZ_1K) /* 30KB */
  75. #define MFC_H264_DEC_CTX_BUF_SIZE_V8 (2 * SZ_1M) /* 2MB */
  76. #define MFC_OTHER_DEC_CTX_BUF_SIZE_V8 (20 * SZ_1K) /* 20KB */
  77. #define MFC_H264_ENC_CTX_BUF_SIZE_V8 (100 * SZ_1K) /* 100KB */
  78. #define MFC_OTHER_ENC_CTX_BUF_SIZE_V8 (10 * SZ_1K) /* 10KB */
  79. /* Buffer size defines */
  80. #define S5P_FIMV_TMV_BUFFER_SIZE_V8(w, h) (((w) + 1) * ((h) + 1) * 8)
  81. #define S5P_FIMV_SCRATCH_BUF_SIZE_H264_DEC_V8(w, h) (((w) * 704) + 2176)
  82. #define S5P_FIMV_SCRATCH_BUF_SIZE_VP8_DEC_V8(w, h) \
  83. (((w) * 576 + (h) * 128) + 4128)
  84. #define S5P_FIMV_SCRATCH_BUF_SIZE_H264_ENC_V8(w, h) \
  85. (((w) * 592) + 2336)
  86. #define S5P_FIMV_SCRATCH_BUF_SIZE_VP8_ENC_V8(w, h) \
  87. (((w) * 576) + 10512 + \
  88. ((((((w) * 16) * ((h) * 16)) * 3) / 2) * 4))
  89. #define S5P_FIMV_ME_BUFFER_SIZE_V8(imw, imh, mbw, mbh) \
  90. ((DIV_ROUND_UP((mbw * 16), 64) * DIV_ROUND_UP((mbh * 16), 64) * 256) \
  91. + (DIV_ROUND_UP((mbw) * (mbh), 32) * 16))
  92. /* BUffer alignment defines */
  93. #define S5P_FIMV_D_ALIGN_PLANE_SIZE_V8 64
  94. /* MFCv8 variant defines */
  95. #define MAX_FW_SIZE_V8 (SZ_1M) /* 1MB */
  96. #define MAX_CPB_SIZE_V8 (3 * SZ_1M) /* 3MB */
  97. #define MFC_VERSION_V8 0x80
  98. #define MFC_NUM_PORTS_V8 1
  99. #endif /*_REGS_MFC_V8_H*/