• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2016 Rockchip Electronics Co., Ltd.
3  * Authors:
4  *    Zhiqin Wei <wzq@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 _rockchip_rga_c_h_
19 #define _rockchip_rga_c_h_
20 
21 #include <stdint.h>
22 #include <sys/types.h>
23 #include <stdlib.h>
24 #include <stdio.h>
25 #include <string.h>
26 #include <errno.h>
27 #include <time.h>
28 #include <unistd.h>
29 
30 #include <sys/mman.h>
31 
32 #include "drmrga.h"
33 #include "rga.h"
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 /*
40  * Compatible with the old version of C interface.The new
41  * version of the C interface no longer requires users to
42  * initialize rga, so RgaInit and RgaDeInit are just for
43  * compatibility with the old C interface, so please do
44  * not use ctx, because it is usually a NULL.
45  */
46 #define RgaInit(ctx) ( { \
47     int ret = 0; \
48     ret = c_RkRgaInit(); \
49     c_RkRgaGetContext(ctx); \
50     ret; \
51 })
52 #define RgaDeInit(ctx) do { \
53     (void)(ctx);        /* unused */ \
54     c_RkRgaDeInit(); \
55 } while (0)
56 #define RgaBlit(...) c_RkRgaBlit(__VA_ARGS__)
57 #define RgaCollorFill(...) c_RkRgaColorFill(__VA_ARGS__)
58 #define RgaFlush() c_RkRgaFlush()
59 
60 int  c_RkRgaInit(void);
61 void c_RkRgaDeInit(void);
62 void c_RkRgaGetContext(void **ctx);
63 int  c_RkRgaBlit(rga_info_t *src, rga_info_t *dst, rga_info_t *src1);
64 int  c_RkRgaColorFill(rga_info_t *dst);
65 int  c_RkRgaFlush(void);
66 
67 int c_RkRgaGetAllocBuffer(bo_t *bo_info, int width, int height, int bpp);
68 int c_RkRgaGetAllocBufferCache(bo_t *bo_info, int width, int height, int bpp);
69 int c_RkRgaGetMmap(bo_t *bo_info);
70 int c_RkRgaUnmap(bo_t *bo_info);
71 int c_RkRgaFree(bo_t *bo_info);
72 int c_RkRgaGetBufferFd(bo_t *bo_info, int *fd);
73 
74 #ifdef __cplusplus
75 }
76 #endif
77 
78 #endif /* #ifndef _rockchip_rga_c_h_ */
79