77 lines · c
1/* SPDX-License-Identifier: GPL-2.0 */2/*3 * Copyright (C) STMicroelectronics SA 20154 * Author: Hugues Fruchet <hugues.fruchet@st.com> for STMicroelectronics.5 */6 7#ifndef DELTA_IPC_H8#define DELTA_IPC_H9 10int delta_ipc_init(struct delta_dev *delta);11void delta_ipc_exit(struct delta_dev *delta);12 13/*14 * delta_ipc_open - open a decoding instance on firmware side15 * @ctx: (in) delta context16 * @name: (in) name of decoder to be used17 * @param: (in) open command parameters specific to decoder18 * @param.size: (in) size of parameter19 * @param.data: (in) virtual address of parameter20 * @ipc_buf_size: (in) size of IPC shared buffer between host21 * and copro used to share command data.22 * Client have to set here the size of the biggest23 * command parameters (+ status if any).24 * Allocation will be done in this function which25 * will give back to client in @ipc_buf the virtual26 * & physical addresses & size of shared IPC buffer.27 * All the further command data (parameters + status)28 * have to be written in this shared IPC buffer29 * virtual memory. This is done to avoid30 * unnecessary copies of command data.31 * @ipc_buf: (out) allocated IPC shared buffer32 * @ipc_buf.size: (out) allocated size33 * @ipc_buf.vaddr: (out) virtual address where to copy34 * further command data35 * @hdl: (out) handle of decoding instance.36 */37 38int delta_ipc_open(struct delta_ctx *ctx, const char *name,39 struct delta_ipc_param *param, u32 ipc_buf_size,40 struct delta_buf **ipc_buf, void **hdl);41 42/*43 * delta_ipc_set_stream - set information about stream to decoder44 * @hdl: (in) handle of decoding instance.45 * @param: (in) set stream command parameters specific to decoder46 * @param.size: (in) size of parameter47 * @param.data: (in) virtual address of parameter. Must be48 * within IPC shared buffer range49 */50int delta_ipc_set_stream(void *hdl, struct delta_ipc_param *param);51 52/*53 * delta_ipc_decode - frame decoding synchronous request, returns only54 * after decoding completion on firmware side.55 * @hdl: (in) handle of decoding instance.56 * @param: (in) decode command parameters specific to decoder57 * @param.size: (in) size of parameter58 * @param.data: (in) virtual address of parameter. Must be59 * within IPC shared buffer range60 * @status: (in/out) decode command status specific to decoder61 * @status.size: (in) size of status62 * @status.data: (in/out) virtual address of status. Must be63 * within IPC shared buffer range.64 * Status is filled by decoding instance65 * after decoding completion.66 */67int delta_ipc_decode(void *hdl, struct delta_ipc_param *param,68 struct delta_ipc_param *status);69 70/*71 * delta_ipc_close - close decoding instance72 * @hdl: (in) handle of decoding instance to close.73 */74void delta_ipc_close(void *hdl);75 76#endif /* DELTA_IPC_H */77