1 /* 2 * Copyright 2015 Rockchip Electronics Co. LTD 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef __RGA_API_H__ 18 #define __RGA_API_H__ 19 20 #include "rk_type.h" 21 #include "mpp_err.h" 22 #include "mpp_frame.h" 23 24 /* 25 * NOTE: Normal rga usage should consider address align issue. 26 * But memory in mpp is always aligned. So we do not tak align issue into 27 * consideration. 28 */ 29 typedef enum RgaCmd_e { 30 RGA_CMD_INIT, // reset msg to all zero 31 RGA_CMD_SET_SRC, // config source image info 32 RGA_CMD_SET_DST, // config destination image info 33 34 RGA_CMD_SET_SCALE_CFG = 0x0100, // config copy parameter 35 36 RGA_CMD_SET_COLOR_CONVERT = 0x0200, // config color convert parameter 37 38 RGA_CMD_SET_ROTATION = 0x0300, // config rotation parameter 39 40 // hardware trigger command 41 RGA_CMD_RUN_SYNC = 0x1000, // start sync mode process 42 RGA_CMD_RUN_ASYNC, // start async mode process 43 } RgaCmd; 44 45 typedef void* RgaCtx; 46 47 #ifdef __cplusplus 48 extern "C" { 49 #endif 50 51 MPP_RET rga_init(RgaCtx *ctx); 52 MPP_RET rga_deinit(RgaCtx ctx); 53 54 MPP_RET rga_control(RgaCtx ctx, RgaCmd cmd, void *param); 55 56 #ifdef __cplusplus 57 } 58 #endif 59 60 #endif /* __RGA_API_H__ */ 61