xref: /OK3568_Linux_fs/external/rknpu2/examples/3rdparty/rga/RK3588/include/im2d_mpi.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  * Copyright (C) 2022 Rockchip Electronics Co., Ltd.
3  * Authors:
4  *  Cerf Yu <cerf.yu@rock-chips.com>
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *      http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 #ifndef _im2d_mpi_hpp_
19 #define _im2d_mpi_hpp_
20 
21 #include "im2d_type.h"
22 
23 /**
24  * Create and config an rga ctx for rockit-ko
25  *
26  * @param flags
27  *      Some configuration flags for this job
28  *
29  * @returns job id.
30  */
31 IM_EXPORT_API im_ctx_id_t imbegin(uint32_t flags);
32 
33 /**
34  * Cancel and delete an rga ctx for rockit-ko
35  *
36  * @param flags
37  *      Some configuration flags for this job
38  *
39  * @returns success or else negative error code.
40  */
41 IM_EXPORT_API IM_STATUS imcancel(im_ctx_id_t id);
42 
43 /**
44  * process for rockit-ko
45  *
46  * @param src
47  *      The input source image and is also the foreground image in blend.
48  * @param dst
49  *      The output destination image and is also the foreground image in blend.
50  * @param pat
51  *      The foreground image, or a LUT table.
52  * @param srect
53  *      The rectangle on the src channel image that needs to be processed.
54  * @param drect
55  *      The rectangle on the dst channel image that needs to be processed.
56  * @param prect
57  *      The rectangle on the pat channel image that needs to be processed.
58  * @param acquire_fence_fd
59  * @param release_fence_fd
60  * @param opt
61  *      The image processing options configuration.
62  * @param usage
63  *      The image processing usage.
64  * @param ctx_id
65  *      ctx id
66  *
67  * @returns success or else negative error code.
68  */
69 #ifdef __cplusplus
70 IM_API IM_STATUS improcess(rga_buffer_t src, rga_buffer_t dst, rga_buffer_t pat,
71                            im_rect srect, im_rect drect, im_rect prect,
72                            int acquire_fence_fd, int *release_fence_fd,
73                            im_opt_t *opt, int usage, im_ctx_id_t ctx_id);
74 #endif
75 IM_EXPORT_API IM_STATUS improcess_ctx(rga_buffer_t src, rga_buffer_t dst, rga_buffer_t pat,
76                                       im_rect srect, im_rect drect, im_rect prect,
77                                       int acquire_fence_fd, int *release_fence_fd,
78                                       im_opt_t *opt, int usage, im_ctx_id_t ctx_id);
79 
80 #endif /* #ifndef _im2d_mpi_hpp_ */