2021-02-02 16:06:43 +01:00
|
|
|
/*
|
|
|
|
* This an unstable interface of wlroots. No guarantees are made regarding the
|
|
|
|
* future consistency of this API.
|
|
|
|
*/
|
|
|
|
#ifndef WLR_USE_UNSTABLE
|
|
|
|
#error "Add -DWLR_USE_UNSTABLE to enable unstable wlroots features"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef WLR_TYPES_WLR_DRM_H
|
|
|
|
#define WLR_TYPES_WLR_DRM_H
|
|
|
|
|
|
|
|
#include <wayland-server-protocol.h>
|
2022-12-02 14:33:02 +01:00
|
|
|
#include <wlr/render/drm_format_set.h>
|
2022-12-03 13:57:40 +01:00
|
|
|
#include <wlr/types/wlr_buffer.h>
|
2021-02-02 16:06:43 +01:00
|
|
|
|
|
|
|
struct wlr_renderer;
|
|
|
|
|
2021-06-30 15:41:56 +02:00
|
|
|
struct wlr_drm_buffer {
|
|
|
|
struct wlr_buffer base;
|
|
|
|
|
|
|
|
struct wl_resource *resource; // can be NULL if the client destroyed it
|
|
|
|
struct wlr_dmabuf_attributes dmabuf;
|
|
|
|
|
|
|
|
struct wl_listener release;
|
|
|
|
};
|
|
|
|
|
2021-02-02 16:06:43 +01:00
|
|
|
/**
|
|
|
|
* A stub implementation of Mesa's wl_drm protocol.
|
|
|
|
*
|
|
|
|
* It only implements the minimum necessary for modern clients to behave
|
|
|
|
* properly. In particular, flink handles are left unimplemented.
|
2023-11-23 13:20:48 +01:00
|
|
|
*
|
|
|
|
* Deprecated: this protocol is legacy and superseded by linux-dmabuf. The
|
|
|
|
* implementation will be dropped in a future wlroots version.
|
2021-02-02 16:06:43 +01:00
|
|
|
*/
|
|
|
|
struct wlr_drm {
|
|
|
|
struct wl_global *global;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
struct wl_signal destroy;
|
|
|
|
} events;
|
|
|
|
|
2022-12-02 14:33:02 +01:00
|
|
|
// private state
|
|
|
|
|
|
|
|
char *node_name;
|
|
|
|
struct wlr_drm_format_set formats;
|
|
|
|
|
2021-02-02 16:06:43 +01:00
|
|
|
struct wl_listener display_destroy;
|
|
|
|
};
|
|
|
|
|
2023-10-19 18:04:59 +02:00
|
|
|
struct wlr_drm_buffer *wlr_drm_buffer_try_from_resource(
|
2021-06-30 15:41:56 +02:00
|
|
|
struct wl_resource *resource);
|
|
|
|
|
2021-02-02 16:06:43 +01:00
|
|
|
struct wlr_drm *wlr_drm_create(struct wl_display *display,
|
|
|
|
struct wlr_renderer *renderer);
|
|
|
|
|
|
|
|
#endif
|