-
Notifications
You must be signed in to change notification settings - Fork 0
/
hwcomposer_drm.h
78 lines (62 loc) · 1.55 KB
/
hwcomposer_drm.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
#ifndef ANDROID_HWC_H_
#define ANDROID_HWC_H_
#include <errno.h>
#include <fcntl.h>
#include <math.h>
#include <poll.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <cutils/compiler.h>
#include <cutils/log.h>
#include <cutils/properties.h>
#include <hardware/gralloc.h>
#include <hardware/hardware.h>
#include <hardware/hwcomposer.h>
#include <EGL/egl.h>
#include <sync/sync.h>
#include "sw_sync.h"
#include "gralloc_priv.h"
#include "drm_fourcc.h"
#include "xf86drm.h"
#include "xf86drmMode.h"
#define HWC_DEFAULT_CONFIG 0
#define to_ctx(dev) ((hwc_context_t *)dev)
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(arr) (sizeof(arr)/sizeof((arr)[0]))
#endif
#define FENCE_DELAY 2
typedef struct kms_display {
drmModeConnectorPtr con;
drmModeEncoderPtr enc;
drmModeCrtcPtr crtc;
int crtc_id;
drmModeModeInfoPtr mode;
drmEventContext evctx;
int vsync_on;
struct hwc_context *ctx;
/* sync */
int timeline;
unsigned signaled_fences;
} kms_display_t;
typedef struct hwc_context {
hwc_composer_device_1_t device;
pthread_mutex_t ctx_mutex;
const hwc_procs_t *cb_procs;
const struct gralloc_module_t *gralloc;
int drm_fd;
kms_display_t displays[HWC_NUM_DISPLAY_TYPES];
pthread_t event_thread;
int32_t xres;
int32_t yres;
int32_t xdpi;
int32_t ydpi;
int32_t vsync_period;
/* drm planes management*/
uint64_t used_planes;
} hwc_context_t;
#endif //#ifndef ANDROID_HWC_H_