mirror of
https://gitlab.freedesktop.org/emersion/libliftoff.git
synced 2025-01-13 20:01:35 +01:00
42db49c6fe
Many drivers don't expose the zpos plane property. We can guess it from the plane type though: primary, overlay, cursor. Except some drivers expose underlays too: underlays, primary, overlay, cursor. Underlay planes don't have a special type, they are just marked as overlays. To detect them, check whether their plane ID is less than the primary plane ID. References: https://github.com/emersion/libhwc/issues/3
59 lines
1 KiB
C
59 lines
1 KiB
C
#ifndef PRIVATE_H
|
|
#define PRIVATE_H
|
|
|
|
#include "libhwc.h"
|
|
#include "list.h"
|
|
|
|
struct hwc_display {
|
|
int drm_fd;
|
|
|
|
struct hwc_list planes; /* hwc_plane.link */
|
|
struct hwc_list outputs; /* hwc_output.link */
|
|
|
|
uint32_t *crtcs;
|
|
size_t crtcs_len;
|
|
};
|
|
|
|
struct hwc_output {
|
|
struct hwc_display *display;
|
|
uint32_t crtc_id;
|
|
size_t crtc_index;
|
|
struct hwc_list link; /* hwc_display.outputs */
|
|
|
|
struct hwc_list layers; /* hwc_layer.link */
|
|
};
|
|
|
|
struct hwc_layer {
|
|
struct hwc_output *output;
|
|
struct hwc_list link; /* hwc_output.layers */
|
|
|
|
struct hwc_layer_property *props;
|
|
size_t props_len;
|
|
|
|
struct hwc_plane *plane;
|
|
};
|
|
|
|
struct hwc_layer_property {
|
|
char name[DRM_PROP_NAME_LEN];
|
|
uint64_t value;
|
|
};
|
|
|
|
struct hwc_plane {
|
|
uint32_t id;
|
|
uint32_t possible_crtcs;
|
|
int zpos; /* greater values mean closer to the eye */
|
|
/* TODO: formats */
|
|
struct hwc_list link; /* hwc_display.planes */
|
|
|
|
struct hwc_plane_property *props;
|
|
size_t props_len;
|
|
|
|
struct hwc_layer *layer;
|
|
};
|
|
|
|
struct hwc_plane_property {
|
|
char name[DRM_PROP_NAME_LEN];
|
|
uint32_t id;
|
|
};
|
|
|
|
#endif
|