aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-12-17 20:48:01 -0500
committerGitHub <noreply@github.com>2017-12-17 20:48:01 -0500
commitf3769a4b1f552b7dc826418e78b88bffe277c2c4 (patch)
treefe07e6a1333f8f96a9075deb26e3ea96519e618b /include
parent10c72f4bf6202bfce89e5a40b03475dd28cd68df (diff)
parentb99d1f4fcca0f8d7b1d2042f51fdefcc73304e6f (diff)
Merge pull request #496 from emersion/headless-backend
Headless backend
Diffstat (limited to 'include')
-rw-r--r--include/backend/headless.h35
-rw-r--r--include/wlr/backend/headless.h14
-rw-r--r--include/wlr/interfaces/wlr_output.h6
-rw-r--r--include/wlr/render/egl.h3
-rw-r--r--include/wlr/types/wlr_output.h1
5 files changed, 56 insertions, 3 deletions
diff --git a/include/backend/headless.h b/include/backend/headless.h
new file mode 100644
index 00000000..91ff37dd
--- /dev/null
+++ b/include/backend/headless.h
@@ -0,0 +1,35 @@
+#ifndef BACKEND_HEADLESS_H
+#define BACKEND_HEADLESS_H
+
+#include <wlr/backend/interface.h>
+#include <wlr/backend/headless.h>
+#include <wlr/types/wlr_output.h>
+
+struct wlr_headless_backend {
+ struct wlr_backend backend;
+ struct wlr_egl egl;
+ struct wl_display *display;
+ struct wl_list outputs;
+ struct wl_list input_devices;
+ struct wl_listener display_destroy;
+ bool started;
+};
+
+struct wlr_headless_output {
+ struct wlr_output wlr_output;
+
+ struct wlr_headless_backend *backend;
+ struct wl_list link;
+
+ void *egl_surface;
+ struct wl_event_source *frame_timer;
+ int frame_delay; // ms
+};
+
+struct wlr_headless_input_device {
+ struct wlr_input_device wlr_input_device;
+
+ struct wlr_headless_backend *backend;
+};
+
+#endif
diff --git a/include/wlr/backend/headless.h b/include/wlr/backend/headless.h
new file mode 100644
index 00000000..68ad84da
--- /dev/null
+++ b/include/wlr/backend/headless.h
@@ -0,0 +1,14 @@
+#ifndef WLR_BACKEND_HEADLESS_H
+#define WLR_BACKEND_HEADLESS_H
+
+#include <wlr/backend.h>
+#include <wlr/types/wlr_input_device.h>
+
+struct wlr_backend *wlr_headless_backend_create(struct wl_display *display);
+struct wlr_output *wlr_headless_add_output(struct wlr_backend *backend,
+ unsigned int width, unsigned int height);
+struct wlr_input_device *wlr_headless_add_input_device(
+ struct wlr_backend *backend, enum wlr_input_device_type type);
+bool wlr_backend_is_headless(struct wlr_backend *backend);
+
+#endif
diff --git a/include/wlr/interfaces/wlr_output.h b/include/wlr/interfaces/wlr_output.h
index 1cfe7568..6d71f9b6 100644
--- a/include/wlr/interfaces/wlr_output.h
+++ b/include/wlr/interfaces/wlr_output.h
@@ -28,8 +28,10 @@ struct wlr_output_impl {
void wlr_output_init(struct wlr_output *output, struct wlr_backend *backend,
const struct wlr_output_impl *impl);
void wlr_output_free(struct wlr_output *output);
-void wlr_output_update_size(struct wlr_output *output, int32_t width,
- int32_t height);
+void wlr_output_update_mode(struct wlr_output *output,
+ struct wlr_output_mode *mode);
+void wlr_output_update_custom_mode(struct wlr_output *output, int32_t width,
+ int32_t height, int32_t refresh);
struct wl_global *wlr_output_create_global(struct wlr_output *wlr_output,
struct wl_display *display);
void wlr_output_destroy_global(struct wlr_output *wlr_output);
diff --git a/include/wlr/render/egl.h b/include/wlr/render/egl.h
index 67a81f37..bdb8d286 100644
--- a/include/wlr/render/egl.h
+++ b/include/wlr/render/egl.h
@@ -22,7 +22,8 @@ struct wlr_egl {
* Initializes an egl context for the given platform and remote display.
* Will attempt to load all possibly required api functions.
*/
-bool wlr_egl_init(struct wlr_egl *egl, EGLenum platform, EGLint visual_id, void *display);
+bool wlr_egl_init(struct wlr_egl *egl, EGLenum platform, void *remote_display,
+ EGLint *config_attribs, EGLint visual_id);
/**
* Frees all related egl resources, makes the context not-current and
diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h
index 037fa515..a974a154 100644
--- a/include/wlr/types/wlr_output.h
+++ b/include/wlr/types/wlr_output.h
@@ -47,6 +47,7 @@ struct wlr_output {
char serial[16];
float scale;
int32_t width, height;
+ int32_t refresh; // mHz
int32_t phys_width, phys_height; // mm
enum wl_output_subpixel subpixel;
enum wl_output_transform transform;