aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorScott Anderson <ascent12@hotmail.com>2017-09-30 20:52:58 +1300
committerScott Anderson <ascent12@hotmail.com>2017-09-30 20:52:58 +1300
commit096249a2a1dc604b062a6fef6c4ca56065724d79 (patch)
tree81df91b26fd1d2b20722e6ac23f053fc27c2bd0a /include
parentd0708b1a3a3fb9fd3a073d6c5406b26e8bf617e9 (diff)
Split DRM rendering to its own file
Diffstat (limited to 'include')
-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