aboutsummaryrefslogtreecommitdiff
path: root/include/backend/drm
diff options
context:
space:
mode:
Diffstat (limited to 'include/backend/drm')
-rw-r--r--include/backend/drm/drm.h20
-rw-r--r--include/backend/drm/renderer.h47
2 files changed, 49 insertions, 18 deletions
diff --git a/include/backend/drm/drm.h b/include/backend/drm/drm.h
index c57493f3..b13cb5e7 100644
--- a/include/backend/drm/drm.h
+++ b/include/backend/drm/drm.h
@@ -17,6 +17,7 @@
#include "iface.h"
#include "properties.h"
+#include "renderer.h"
struct wlr_drm_plane {
uint32_t type;
@@ -24,13 +25,7 @@ struct wlr_drm_plane {
uint32_t possible_crtcs;
- uint32_t width, height;
-
- struct gbm_surface *gbm;
- EGLSurface egl;
-
- struct gbm_bo *front;
- struct gbm_bo *back;
+ struct wlr_drm_surface surf;
// Only used by cursor
float matrix[16];
@@ -70,17 +65,6 @@ struct wlr_drm_connector {
struct wl_list link;
};
-struct wlr_drm_renderer {
- int fd;
- struct gbm_device *gbm;
- struct wlr_egl egl;
-};
-
-bool wlr_drm_renderer_init(struct wlr_drm_renderer *renderer, int fd);
-void wlr_drm_renderer_free(struct wlr_drm_renderer *renderer);
-
-struct wlr_drm_interface;
-
struct wlr_drm_backend {
struct wlr_backend backend;
diff --git a/include/backend/drm/renderer.h b/include/backend/drm/renderer.h
new file mode 100644
index 00000000..bbcf4f0c
--- /dev/null
+++ b/include/backend/drm/renderer.h
@@ -0,0 +1,47 @@
+#ifndef BACKEND_DRM_RENDERER_H
+#define BACKEND_DRM_RENDERER_H
+
+#include <stdbool.h>
+#include <stdint.h>
+
+#include <EGL/egl.h>
+#include <gbm.h>
+
+struct wlr_drm_renderer {
+ int fd;
+ struct gbm_device *gbm;
+ struct wlr_egl egl;
+};
+
+struct wlr_drm_surface {
+ uint32_t width;
+ uint32_t height;
+
+ struct gbm_surface *gbm;
+ EGLSurface egl;
+
+ struct gbm_bo *front;
+ struct gbm_bo *back;
+};
+
+bool wlr_drm_renderer_init(struct wlr_drm_renderer *renderer, int fd);
+
+void wlr_drm_renderer_finish(struct wlr_drm_renderer *renderer);
+
+bool wlr_drm_surface_init(struct wlr_drm_renderer *renderer,
+ struct wlr_drm_surface *surf, uint32_t width, uint32_t height,
+ uint32_t format, uint32_t flags);
+
+void wlr_drm_surface_finish(struct wlr_drm_renderer *renderer,
+ struct wlr_drm_surface *surf);
+
+void wlr_drm_surface_make_current(struct wlr_drm_renderer *renderer,
+ struct wlr_drm_surface *surf);
+
+struct gbm_bo *wlr_drm_surface_swap_buffers(struct wlr_drm_renderer *renderer,
+ struct wlr_drm_surface *surf);
+
+struct gbm_bo *wlr_drm_surface_get_front(struct wlr_drm_renderer *renderer,
+ struct wlr_drm_surface *surf);
+
+#endif