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 36extern "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 ( { \ 48 int ret = 0; \ 49 ret = c_RkRgaInit(); \ 50 c_RkRgaGetContext(ctx); \ 51 ret; \ 52 }) 53#define RgaDeInit(ctx) \ 54 do { \ 55 (void)(ctx); /* unused */ \ 56 c_RkRgaDeInit(); \ 57 } while (0) 58#define RgaBlit(...) c_RkRgaBlit(__VA_ARGS__) 59#define RgaCollorFill(...) c_RkRgaColorFill(__VA_ARGS__) 60#define RgaFlush() c_RkRgaFlush() 61 62int c_RkRgaInit(void); 63void c_RkRgaDeInit(void); 64void c_RkRgaGetContext(void **ctx); 65int c_RkRgaBlit(rga_info_t *src, rga_info_t *dst, rga_info_t *src1); 66int c_RkRgaColorFill(rga_info_t *dst); 67int c_RkRgaFlush(void); 68 69int c_RkRgaGetAllocBuffer(bo_t *bo_info, int width, int height, int bpp); 70int c_RkRgaGetAllocBufferCache(bo_t *bo_info, int width, int height, int bpp); 71int c_RkRgaGetMmap(bo_t *bo_info); 72int c_RkRgaUnmap(bo_t *bo_info); 73int c_RkRgaFree(bo_t *bo_info); 74int c_RkRgaGetBufferFd(bo_t *bo_info, int *fd); 75 76#ifdef __cplusplus 77} 78#endif 79 80#endif /* #ifndef _rockchip_rga_c_h_ */ 81