summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/sti/delta/delta-ipc.h
blob: 9fba6b5d169a2bf5154821a87303349d5315fec5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (C) STMicroelectronics SA 2015
 * Author: Hugues Fruchet <hugues.fruchet@st.com> for STMicroelectronics.
 */

#ifndef DELTA_IPC_H
#define DELTA_IPC_H

int delta_ipc_init(struct delta_dev *delta);
void delta_ipc_exit(struct delta_dev *delta);

/*
 * delta_ipc_open - open a decoding instance on firmware side
 * @ctx:		(in) delta context
 * @name:		(in) name of decoder to be used
 * @param:		(in) open command parameters specific to decoder
 *  @param.size:		(in) size of parameter
 *  @param.data:		(in) virtual address of parameter
 * @ipc_buf_size:	(in) size of IPC shared buffer between host
 *			     and copro used to share command data.
 *			     Client have to set here the size of the biggest
 *			     command parameters (+ status if any).
 *			     Allocation will be done in this function which
 *			     will give back to client in @ipc_buf the virtual
 *			     & physical addresses & size of shared IPC buffer.
 *			     All the further command data (parameters + status)
 *			     have to be written in this shared IPC buffer
 *			     virtual memory. This is done to avoid
 *			     unnecessary copies of command data.
 * @ipc_buf:		(out) allocated IPC shared buffer
 *  @ipc_buf.size:		(out) allocated size
 *  @ipc_buf.vaddr:		(out) virtual address where to copy
 *				      further command data
 * @hdl:		(out) handle of decoding instance.
 */

int delta_ipc_open(struct delta_ctx *ctx, const char *name,
		   struct delta_ipc_param *param, u32 ipc_buf_size,
		   struct delta_buf **ipc_buf, void **hdl);

/*
 * delta_ipc_set_stream - set information about stream to decoder
 * @hdl:		(in) handle of decoding instance.
 * @param:		(in) set stream command parameters specific to decoder
 *  @param.size:		(in) size of parameter
 *  @param.data:		(in) virtual address of parameter. Must be
 *				     within IPC shared buffer range
 */
int delta_ipc_set_stream(void *hdl, struct delta_ipc_param *param);

/*
 * delta_ipc_decode - frame decoding synchronous request, returns only
 *		      after decoding completion on firmware side.
 * @hdl:		(in) handle of decoding instance.
 * @param:		(in) decode command parameters specific to decoder
 *  @param.size:		(in) size of parameter
 *  @param.data:		(in) virtual address of parameter. Must be
 *				     within IPC shared buffer range
 * @status:		(in/out) decode command status specific to decoder
 *  @status.size:		(in) size of status
 *  @status.data:		(in/out) virtual address of status. Must be
 *					 within IPC shared buffer range.
 *					 Status is filled by decoding instance
 *					 after decoding completion.
 */
int delta_ipc_decode(void *hdl, struct delta_ipc_param *param,
		     struct delta_ipc_param *status);

/*
 * delta_ipc_close - close decoding instance
 * @hdl:		(in) handle of decoding instance to close.
 */
void delta_ipc_close(void *hdl);

#endif /* DELTA_IPC_H */
OpenPOWER on IntegriCloud