File: common.h

package info (click to toggle)
libliftoff 0.5.0-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 352 kB
  • sloc: ansic: 5,432; makefile: 3
file content (34 lines) | stat: -rw-r--r-- 704 bytes parent folder | download | duplicates (2)
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
#ifndef EXAMPLE_COMMON_H
#define EXAMPLE_COMMON_H

#include <stdbool.h>
#include <stdint.h>
#include <xf86drmMode.h>

struct dumb_fb {
	uint32_t format;
	uint32_t width, height, stride, size;
	uint32_t handle;
	uint32_t id;
};

drmModeConnector *
pick_connector(int drm_fd, drmModeRes *drm_res);

drmModeCrtc *
pick_crtc(int drm_fd, drmModeRes *drm_res, drmModeConnector *connector);

void
disable_all_crtcs_except(int drm_fd, drmModeRes *drm_res, uint32_t crtc_id);

bool
dumb_fb_init(struct dumb_fb *fb, int drm_fd, uint32_t format,
	     uint32_t width, uint32_t height);

void *
dumb_fb_map(struct dumb_fb *fb, int drm_fd);

void
dumb_fb_fill(struct dumb_fb *fb, int drm_fd, uint32_t color);

#endif