-
Notifications
You must be signed in to change notification settings - Fork 4
/
driver.h
52 lines (38 loc) · 937 Bytes
/
driver.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
#ifndef _DRIVER_H
#define _DRIVER_H
#include <xf86drm.h>
#include <xf86drmMode.h>
//include gbm before gl header
#include <gbm.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <EGL/egl.h>
#include "glutil.h"
#include "atlas.h"
struct DisplayContext {
int fd; //drm device handle
EGLDisplay display;
EGLContext gl_context;
drmModeModeInfo mode;
uint32_t conn; // connector id
uint32_t crtc; // crtc id
drmModeCrtc *saved_crtc;
struct gbm_device *gbm;
struct gbm_surface *gbm_surface;
EGLSurface surface;
struct gbm_bo *bo;
struct gbm_bo *next_bo;
uint32_t next_fb_id;
bool pflip_pending;
bool cleanup;
bool paused;
//vt
int vtfd;
bool vt_activated;
int vt_mode; //current mode: graphics or text
int origin_vt_mode;
//communication id
int commid;
ActionMode* action_mode;
};
#endif