-
Notifications
You must be signed in to change notification settings - Fork 0
/
RockchipRga.h
executable file
·96 lines (71 loc) · 2.5 KB
/
RockchipRga.h
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*
* Copyright (C) 2016 Rockchip Electronics Co.Ltd
* Authors:
* Zhiqin Wei <wzq@rock-chips.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
*/
#ifndef _rockchip_rga_h_
#define _rockchip_rga_h_
#include <stdint.h>
#include <vector>
#include <sys/types.h>
//#include <system/window.h>
#include <utils/Thread.h>
#ifndef UN_NEED_GL
#include <EGL/egl.h>
#include <GLES/gl.h>
#endif
//////////////////////////////////////////////////////////////////////////////////
#include <hardware/hardware.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <time.h>
#include <unistd.h>
#include <utils/Singleton.h>
#include <sys/mman.h>
#include <linux/stddef.h>
#include <hardware/rga.h>
#include "stdio.h"
#include "drmrga.h"
#ifndef UN_NEED_GL
#include "GraphicBuffer.h"
#endif
//////////////////////////////////////////////////////////////////////////////////
namespace android {
// -------------------------------------------------------------------------------
class RockchipRga :public Singleton<RockchipRga>
{
/************************************public**************************************/
public:
static inline RockchipRga& get() {return getInstance();}
int RkRgaInit();
int RkRgaGetBufferFd(buffer_handle_t handle, int *fd);
int RkRgaBlit(rga_info *src, rga_info *dst, rga_info *src1);
int RkRgaCollorFill(rga_info *dst);
int RkRgaFlush();
void RkRgaSetLogOnceFlag(int log) {mLogOnce = log;}
void RkRgaSetAlwaysLogFlag(bool log) {mLogAlways = log;}
void RkRgaLogOutRgaReq(struct rga_req rgaReg);
int RkRgaLogOutUserPara(rga_info *rgaInfo);
inline bool RkRgaIsReady() { return mSupportRga; }
/************************************private***********************************/
private:
bool mSupportRga;
int mLogOnce;
int mLogAlways;
void * mContext;
static Mutex mMutex;
friend class Singleton<RockchipRga>;
RockchipRga();
~RockchipRga();
};
// ---------------------------------------------------------------------------
}; // namespace android
#endif // ANDROID_BOOTANIMATION_H