2019-09-13 09:33:49 +02:00
|
|
|
#ifndef LIFTOFF_LIBDRM_MOCK_H
|
|
|
|
#define LIFTOFF_LIBDRM_MOCK_H
|
|
|
|
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdint.h>
|
2023-02-15 14:06:01 +01:00
|
|
|
#include <xf86drm.h>
|
2019-09-13 09:33:49 +02:00
|
|
|
#include <xf86drmMode.h>
|
|
|
|
|
|
|
|
extern uint32_t liftoff_mock_drm_crtc_id;
|
2019-10-14 17:34:32 +02:00
|
|
|
extern size_t liftoff_mock_commit_count;
|
2019-09-13 09:33:49 +02:00
|
|
|
|
2021-08-13 12:28:13 +02:00
|
|
|
/**
|
|
|
|
* Some drivers require the primary plane to be enabled in order to light up a
|
|
|
|
* CRTC (e.g. i915). If this variable is set to true, this behavior is mimicked.
|
|
|
|
*/
|
|
|
|
extern bool liftoff_mock_require_primary_plane;
|
|
|
|
|
2019-09-13 09:33:49 +02:00
|
|
|
struct liftoff_layer;
|
|
|
|
|
2021-08-13 22:02:33 +02:00
|
|
|
int
|
|
|
|
liftoff_mock_drm_open(void);
|
|
|
|
|
|
|
|
uint32_t
|
|
|
|
liftoff_mock_drm_create_fb(struct liftoff_layer *layer);
|
|
|
|
|
2023-02-09 12:30:09 +01:00
|
|
|
void
|
|
|
|
liftoff_mock_drm_set_fb_info(const drmModeFB2 *fb_info);
|
|
|
|
|
2021-08-13 22:02:33 +02:00
|
|
|
struct liftoff_mock_plane *
|
2023-02-16 21:33:36 +01:00
|
|
|
liftoff_mock_drm_create_plane(uint64_t type);
|
2021-08-13 22:02:33 +02:00
|
|
|
|
|
|
|
struct liftoff_mock_plane *
|
|
|
|
liftoff_mock_drm_get_plane(uint32_t id);
|
|
|
|
|
|
|
|
void
|
|
|
|
liftoff_mock_plane_add_compatible_layer(struct liftoff_mock_plane *plane,
|
|
|
|
struct liftoff_layer *layer);
|
|
|
|
struct liftoff_layer *
|
|
|
|
liftoff_mock_plane_get_layer(struct liftoff_mock_plane *plane);
|
2023-02-09 10:37:07 +01:00
|
|
|
uint32_t
|
|
|
|
liftoff_mock_plane_get_id(struct liftoff_mock_plane *plane);
|
2021-08-13 22:02:33 +02:00
|
|
|
|
|
|
|
uint32_t
|
|
|
|
liftoff_mock_plane_add_property(struct liftoff_mock_plane *plane,
|
2023-02-15 18:38:59 +01:00
|
|
|
const drmModePropertyRes *prop,
|
|
|
|
uint64_t value);
|
2023-02-13 12:36:34 +01:00
|
|
|
void
|
|
|
|
liftoff_mock_plane_add_in_formats(struct liftoff_mock_plane *plane,
|
|
|
|
const struct drm_format_modifier_blob *data,
|
|
|
|
size_t size);
|
2019-09-13 09:33:49 +02:00
|
|
|
|
|
|
|
#endif
|