aboutsummaryrefslogtreecommitdiff
path: root/include/backend
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2022-08-18 20:14:34 +0200
committerSimon Ser <contact@emersion.fr>2023-02-20 18:38:57 +0100
commit4d6fbb2289ae5a6fcf2061a00ff49a9850c5198f (patch)
tree86a2b402c0153800bef8c318547560caec07c5b5 /include/backend
parent2398621b8bd33f0e21590f88c363fd4ed7905e0f (diff)
backend/drm: add support for output layers
Diffstat (limited to 'include/backend')
-rw-r--r--include/backend/drm/drm.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/backend/drm/drm.h b/include/backend/drm/drm.h
index f61be026..36e72b7a 100644
--- a/include/backend/drm/drm.h
+++ b/include/backend/drm/drm.h
@@ -10,6 +10,7 @@
#include <wlr/backend/drm.h>
#include <wlr/backend/session.h>
#include <wlr/render/drm_format_set.h>
+#include <wlr/types/wlr_output_layer.h>
#include <xf86drmMode.h>
#include "backend/drm/iface.h"
#include "backend/drm/properties.h"
@@ -36,11 +37,27 @@ struct wlr_drm_plane {
struct liftoff_layer *liftoff_layer;
};
+struct wlr_drm_layer {
+ struct liftoff_layer *liftoff;
+ struct wlr_addon addon; // wlr_output_layer.addons
+ struct wl_list link; // wlr_drm_crtc.layers
+
+ /* Buffer to be submitted to the kernel on the next page-flip */
+ struct wlr_drm_fb *pending_fb;
+ /* Buffer submitted to the kernel, will be presented on next vblank */
+ struct wlr_drm_fb *queued_fb;
+ /* Buffer currently displayed on screen */
+ struct wlr_drm_fb *current_fb;
+
+ int pending_width, pending_height;
+};
+
struct wlr_drm_crtc {
uint32_t id;
struct wlr_drm_lease *lease;
struct liftoff_output *liftoff;
struct liftoff_layer *liftoff_composition_layer;
+ struct wl_list layers; // wlr_drm_layer.link
// Atomic modesetting only
uint32_t mode_id;
@@ -163,6 +180,8 @@ size_t drm_crtc_get_gamma_lut_size(struct wlr_drm_backend *drm,
void drm_lease_destroy(struct wlr_drm_lease *lease);
struct wlr_drm_fb *get_next_cursor_fb(struct wlr_drm_connector *conn);
+struct wlr_drm_layer *get_drm_layer(struct wlr_drm_backend *drm,
+ struct wlr_output_layer *layer);
#define wlr_drm_conn_log(conn, verb, fmt, ...) \
wlr_log(verb, "connector %s: " fmt, conn->name, ##__VA_ARGS__)