vdec_ipi_msg.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*
  2. * Copyright (c) 2016 MediaTek Inc.
  3. * Author: PC Chen <pc.chen@mediatek.com>
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * 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 _VDEC_IPI_MSG_H_
  16. #define _VDEC_IPI_MSG_H_
  17. /**
  18. * enum vdec_ipi_msgid - message id between AP and VPU
  19. * @AP_IPIMSG_XXX : AP to VPU cmd message id
  20. * @VPU_IPIMSG_XXX_ACK : VPU ack AP cmd message id
  21. */
  22. enum vdec_ipi_msgid {
  23. AP_IPIMSG_DEC_INIT = 0xA000,
  24. AP_IPIMSG_DEC_START = 0xA001,
  25. AP_IPIMSG_DEC_END = 0xA002,
  26. AP_IPIMSG_DEC_DEINIT = 0xA003,
  27. AP_IPIMSG_DEC_RESET = 0xA004,
  28. VPU_IPIMSG_DEC_INIT_ACK = 0xB000,
  29. VPU_IPIMSG_DEC_START_ACK = 0xB001,
  30. VPU_IPIMSG_DEC_END_ACK = 0xB002,
  31. VPU_IPIMSG_DEC_DEINIT_ACK = 0xB003,
  32. VPU_IPIMSG_DEC_RESET_ACK = 0xB004,
  33. };
  34. /**
  35. * struct vdec_ap_ipi_cmd - generic AP to VPU ipi command format
  36. * @msg_id : vdec_ipi_msgid
  37. * @vpu_inst_addr : VPU decoder instance address
  38. */
  39. struct vdec_ap_ipi_cmd {
  40. uint32_t msg_id;
  41. uint32_t vpu_inst_addr;
  42. };
  43. /**
  44. * struct vdec_vpu_ipi_ack - generic VPU to AP ipi command format
  45. * @msg_id : vdec_ipi_msgid
  46. * @status : VPU exeuction result
  47. * @ap_inst_addr : AP video decoder instance address
  48. */
  49. struct vdec_vpu_ipi_ack {
  50. uint32_t msg_id;
  51. int32_t status;
  52. uint64_t ap_inst_addr;
  53. };
  54. /**
  55. * struct vdec_ap_ipi_init - for AP_IPIMSG_DEC_INIT
  56. * @msg_id : AP_IPIMSG_DEC_INIT
  57. * @reserved : Reserved field
  58. * @ap_inst_addr : AP video decoder instance address
  59. */
  60. struct vdec_ap_ipi_init {
  61. uint32_t msg_id;
  62. uint32_t reserved;
  63. uint64_t ap_inst_addr;
  64. };
  65. /**
  66. * struct vdec_ap_ipi_dec_start - for AP_IPIMSG_DEC_START
  67. * @msg_id : AP_IPIMSG_DEC_START
  68. * @vpu_inst_addr : VPU decoder instance address
  69. * @data : Header info
  70. * H264 decoder [0]:buf_sz [1]:nal_start
  71. * VP8 decoder [0]:width/height
  72. * VP9 decoder [0]:profile, [1][2] width/height
  73. * @reserved : Reserved field
  74. */
  75. struct vdec_ap_ipi_dec_start {
  76. uint32_t msg_id;
  77. uint32_t vpu_inst_addr;
  78. uint32_t data[3];
  79. uint32_t reserved;
  80. };
  81. /**
  82. * struct vdec_vpu_ipi_init_ack - for VPU_IPIMSG_DEC_INIT_ACK
  83. * @msg_id : VPU_IPIMSG_DEC_INIT_ACK
  84. * @status : VPU exeuction result
  85. * @ap_inst_addr : AP vcodec_vpu_inst instance address
  86. * @vpu_inst_addr : VPU decoder instance address
  87. */
  88. struct vdec_vpu_ipi_init_ack {
  89. uint32_t msg_id;
  90. int32_t status;
  91. uint64_t ap_inst_addr;
  92. uint32_t vpu_inst_addr;
  93. };
  94. #endif