pbsplash/include/tfblib_drm.h
Caleb Connolly 1a6bb17cb1
drm: make optional
Make DRM configurable at build time to avoid increasing the size of
pbsplash. DRM support is not yet suitable to be enabled by default, but
it's nice to have it merged in so the code doesn't bitrot.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2023-11-26 10:37:00 +01:00

43 lines
679 B
C

#pragma once
#include <stdint.h>
#include "config.h"
#ifdef CONFIG_DRM_SUPPORT
#include <libdrm/drm.h>
#include <libdrm/drm_mode.h>
#include <xf86drm.h>
#include <xf86drmMode.h>
struct modeset_buf {
uint32_t width;
uint32_t height;
uint32_t pitch;
uint32_t size;
uint32_t handle;
uint8_t *map;
uint32_t fb;
};
struct drm_framebuffer {
unsigned int front_buf;
struct modeset_buf bufs[2];
drmModeModeInfo mode;
uint32_t conn;
uint32_t mm_width;
uint32_t mm_height;
uint32_t crtc;
drmModeCrtc *saved_crtc;
};
extern struct drm_framebuffer *drm;
#endif
int drm_framebuffer_init(int *handle, const char *card);
void drm_framebuffer_close(int handle);