wlroots-hyprland/include/backend/drm/renderer.h

60 lines
1.6 KiB
C
Raw Normal View History

2017-09-30 09:52:58 +02:00
#ifndef BACKEND_DRM_RENDERER_H
#define BACKEND_DRM_RENDERER_H
2018-02-12 21:29:23 +01:00
#include <stdbool.h>
#include <stdint.h>
#include <wlr/backend.h>
#include <wlr/render/wlr_renderer.h>
2023-06-05 22:45:28 +02:00
#include <wlr/util/addon.h>
2017-10-01 08:22:47 +02:00
2017-10-01 11:44:24 +02:00
struct wlr_drm_backend;
2023-06-05 22:45:28 +02:00
struct wlr_drm_format;
2017-10-01 08:22:47 +02:00
struct wlr_drm_plane;
struct wlr_buffer;
2017-10-01 08:22:47 +02:00
2017-09-30 09:52:58 +02:00
struct wlr_drm_renderer {
struct wlr_drm_backend *backend;
2017-10-01 08:22:47 +02:00
struct wlr_renderer *wlr_rend;
struct wlr_allocator *allocator;
2017-09-30 09:52:58 +02:00
};
struct wlr_drm_surface {
struct wlr_drm_renderer *renderer;
2020-06-01 19:49:51 +02:00
struct wlr_swapchain *swapchain;
};
struct wlr_drm_fb {
struct wlr_buffer *wlr_buf;
2021-08-17 09:34:49 +02:00
struct wlr_addon addon;
struct wlr_drm_backend *backend;
struct wl_list link; // wlr_drm_backend.fbs
uint32_t id;
2017-09-30 09:52:58 +02:00
};
bool init_drm_renderer(struct wlr_drm_backend *drm,
struct wlr_drm_renderer *renderer);
void finish_drm_renderer(struct wlr_drm_renderer *renderer);
2017-09-30 09:52:58 +02:00
bool init_drm_surface(struct wlr_drm_surface *surf,
struct wlr_drm_renderer *renderer, int width, int height,
const struct wlr_drm_format *drm_format);
2017-09-30 09:52:58 +02:00
bool drm_fb_import(struct wlr_drm_fb **fb, struct wlr_drm_backend *drm,
struct wlr_buffer *buf, const struct wlr_drm_format_set *formats);
void drm_fb_destroy(struct wlr_drm_fb *fb);
void drm_fb_clear(struct wlr_drm_fb **fb);
void drm_fb_move(struct wlr_drm_fb **new, struct wlr_drm_fb **old);
struct wlr_drm_fb *drm_fb_lock(struct wlr_drm_fb *fb);
struct wlr_buffer *drm_surface_blit(struct wlr_drm_surface *surf,
struct wlr_buffer *buffer);
bool drm_plane_pick_render_format(struct wlr_drm_plane *plane,
struct wlr_drm_format *fmt, struct wlr_drm_renderer *renderer);
void drm_plane_finish_surface(struct wlr_drm_plane *plane);
2017-09-30 09:52:58 +02:00
#endif