mtk_mdp_ipi.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /*
  2. * Copyright (c) 2015-2016 MediaTek Inc.
  3. * Author: Houlong Wei <houlong.wei@mediatek.com>
  4. * Ming Hsiu Tsai <minghsiu.tsai@mediatek.com>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. */
  15. #ifndef __MTK_MDP_IPI_H__
  16. #define __MTK_MDP_IPI_H__
  17. #define MTK_MDP_MAX_NUM_PLANE 3
  18. enum mdp_ipi_msgid {
  19. AP_MDP_INIT = 0xd000,
  20. AP_MDP_DEINIT = 0xd001,
  21. AP_MDP_PROCESS = 0xd002,
  22. VPU_MDP_INIT_ACK = 0xe000,
  23. VPU_MDP_DEINIT_ACK = 0xe001,
  24. VPU_MDP_PROCESS_ACK = 0xe002
  25. };
  26. #pragma pack(push, 4)
  27. /**
  28. * struct mdp_ipi_init - for AP_MDP_INIT
  29. * @msg_id : AP_MDP_INIT
  30. * @ipi_id : IPI_MDP
  31. * @ap_inst : AP mtk_mdp_vpu address
  32. */
  33. struct mdp_ipi_init {
  34. uint32_t msg_id;
  35. uint32_t ipi_id;
  36. uint64_t ap_inst;
  37. };
  38. /**
  39. * struct mdp_ipi_comm - for AP_MDP_PROCESS, AP_MDP_DEINIT
  40. * @msg_id : AP_MDP_PROCESS, AP_MDP_DEINIT
  41. * @ipi_id : IPI_MDP
  42. * @ap_inst : AP mtk_mdp_vpu address
  43. * @vpu_inst_addr : VPU MDP instance address
  44. */
  45. struct mdp_ipi_comm {
  46. uint32_t msg_id;
  47. uint32_t ipi_id;
  48. uint64_t ap_inst;
  49. uint32_t vpu_inst_addr;
  50. };
  51. /**
  52. * struct mdp_ipi_comm_ack - for VPU_MDP_DEINIT_ACK, VPU_MDP_PROCESS_ACK
  53. * @msg_id : VPU_MDP_DEINIT_ACK, VPU_MDP_PROCESS_ACK
  54. * @ipi_id : IPI_MDP
  55. * @ap_inst : AP mtk_mdp_vpu address
  56. * @vpu_inst_addr : VPU MDP instance address
  57. * @status : VPU exeuction result
  58. */
  59. struct mdp_ipi_comm_ack {
  60. uint32_t msg_id;
  61. uint32_t ipi_id;
  62. uint64_t ap_inst;
  63. uint32_t vpu_inst_addr;
  64. int32_t status;
  65. };
  66. /**
  67. * struct mdp_config - configured for source/destination image
  68. * @x : left
  69. * @y : top
  70. * @w : width
  71. * @h : height
  72. * @w_stride : bytes in horizontal
  73. * @h_stride : bytes in vertical
  74. * @crop_x : cropped left
  75. * @crop_y : cropped top
  76. * @crop_w : cropped width
  77. * @crop_h : cropped height
  78. * @format : color format
  79. */
  80. struct mdp_config {
  81. int32_t x;
  82. int32_t y;
  83. int32_t w;
  84. int32_t h;
  85. int32_t w_stride;
  86. int32_t h_stride;
  87. int32_t crop_x;
  88. int32_t crop_y;
  89. int32_t crop_w;
  90. int32_t crop_h;
  91. int32_t format;
  92. };
  93. struct mdp_buffer {
  94. uint64_t addr_mva[MTK_MDP_MAX_NUM_PLANE];
  95. int32_t plane_size[MTK_MDP_MAX_NUM_PLANE];
  96. int32_t plane_num;
  97. };
  98. struct mdp_config_misc {
  99. int32_t orientation; /* 0, 90, 180, 270 */
  100. int32_t hflip; /* 1 will enable the flip */
  101. int32_t vflip; /* 1 will enable the flip */
  102. int32_t alpha; /* global alpha */
  103. };
  104. struct mdp_process_vsi {
  105. struct mdp_config src_config;
  106. struct mdp_buffer src_buffer;
  107. struct mdp_config dst_config;
  108. struct mdp_buffer dst_buffer;
  109. struct mdp_config_misc misc;
  110. };
  111. #pragma pack(pop)
  112. #endif /* __MTK_MDP_IPI_H__ */