delta-ipc.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) STMicroelectronics SA 2015
  4. * Author: Hugues Fruchet <hugues.fruchet@st.com> for STMicroelectronics.
  5. */
  6. #ifndef DELTA_IPC_H
  7. #define DELTA_IPC_H
  8. int delta_ipc_init(struct delta_dev *delta);
  9. void delta_ipc_exit(struct delta_dev *delta);
  10. /*
  11. * delta_ipc_open - open a decoding instance on firmware side
  12. * @ctx: (in) delta context
  13. * @name: (in) name of decoder to be used
  14. * @param: (in) open command parameters specific to decoder
  15. * @param.size: (in) size of parameter
  16. * @param.data: (in) virtual address of parameter
  17. * @ipc_buf_size: (in) size of IPC shared buffer between host
  18. * and copro used to share command data.
  19. * Client have to set here the size of the biggest
  20. * command parameters (+ status if any).
  21. * Allocation will be done in this function which
  22. * will give back to client in @ipc_buf the virtual
  23. * & physical addresses & size of shared IPC buffer.
  24. * All the further command data (parameters + status)
  25. * have to be written in this shared IPC buffer
  26. * virtual memory. This is done to avoid
  27. * unnecessary copies of command data.
  28. * @ipc_buf: (out) allocated IPC shared buffer
  29. * @ipc_buf.size: (out) allocated size
  30. * @ipc_buf.vaddr: (out) virtual address where to copy
  31. * further command data
  32. * @hdl: (out) handle of decoding instance.
  33. */
  34. int delta_ipc_open(struct delta_ctx *ctx, const char *name,
  35. struct delta_ipc_param *param, u32 ipc_buf_size,
  36. struct delta_buf **ipc_buf, void **hdl);
  37. /*
  38. * delta_ipc_set_stream - set information about stream to decoder
  39. * @hdl: (in) handle of decoding instance.
  40. * @param: (in) set stream command parameters specific to decoder
  41. * @param.size: (in) size of parameter
  42. * @param.data: (in) virtual address of parameter. Must be
  43. * within IPC shared buffer range
  44. */
  45. int delta_ipc_set_stream(void *hdl, struct delta_ipc_param *param);
  46. /*
  47. * delta_ipc_decode - frame decoding synchronous request, returns only
  48. * after decoding completion on firmware side.
  49. * @hdl: (in) handle of decoding instance.
  50. * @param: (in) decode command parameters specific to decoder
  51. * @param.size: (in) size of parameter
  52. * @param.data: (in) virtual address of parameter. Must be
  53. * within IPC shared buffer range
  54. * @status: (in/out) decode command status specific to decoder
  55. * @status.size: (in) size of status
  56. * @status.data: (in/out) virtual address of status. Must be
  57. * within IPC shared buffer range.
  58. * Status is filled by decoding instance
  59. * after decoding completion.
  60. */
  61. int delta_ipc_decode(void *hdl, struct delta_ipc_param *param,
  62. struct delta_ipc_param *status);
  63. /*
  64. * delta_ipc_close - close decoding instance
  65. * @hdl: (in) handle of decoding instance to close.
  66. */
  67. void delta_ipc_close(void *hdl);
  68. #endif /* DELTA_IPC_H */