forked from embear-engineering/drm-framebuffer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathframebuffer.h
More file actions
32 lines (25 loc) · 767 Bytes
/
framebuffer.h
File metadata and controls
32 lines (25 loc) · 767 Bytes
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
#ifndef _FRAMEBUFFER_H
#define _FRAMEBUFFER_H
#include <stdint.h>
#include <libdrm/drm.h>
#include <libdrm/drm_mode.h>
#include <xf86drm.h>
#include <xf86drmMode.h>
#define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]))
struct framebuffer {
int fd;
uint32_t buffer_id;
uint16_t res_x;
uint16_t res_y;
uint8_t *data;
uint32_t size;
struct drm_mode_create_dumb dumb_framebuffer;
drmModeCrtcPtr crtc;
drmModeConnectorPtr connector;
drmModeModeInfoPtr resolution;
};
void release_framebuffer(struct framebuffer *fb);
int get_framebuffer(const char *dri_device, const char *connector_name, struct framebuffer *fb,
int selected_resolution);
const char *connector_type_name(unsigned int type);
#endif