From 612ffac8382b8e51a5b30c09c8cf649dd15877e7 Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Tue, 26 Mar 2024 11:03:03 +0200 Subject: compositor/build: Remove HEADLESS backend Headless backend was introduced to test out the compositor but never materialized. Besides removing headless loading of the backend, also do a bit of clean-up and remove vnc and pipewire strings as we currently have no such backend capability at this moment. Bug-AGL: SPEC-5096, SPEC-5061 Signed-off-by: Marius Vlad Change-Id: I87fdc0aa6c41bdcc8b1f53880860df7139ca7ae8 --- meson.build | 14 +++++----- src/compositor.c | 80 -------------------------------------------------------- 2 files changed, 7 insertions(+), 87 deletions(-) diff --git a/meson.build b/meson.build index 292308a..3b92cca 100644 --- a/meson.build +++ b/meson.build @@ -171,17 +171,17 @@ if libweston_dep.found() if not meson.is_cross_build() if not prefix_path.contains('/usr') dir_path_x11_backend = join_paths(prefix_path, 'include', libweston_version, 'libweston', 'backend-x11.h') - dir_path_headless_backend = join_paths(prefix_path, 'include', libweston_version, 'libweston', 'backend-headless.h') + dir_path_wayland_backend = join_paths(prefix_path, 'include', libweston_version, 'libweston', 'backend-wayland.h') dir_path_rdp_backend = join_paths(prefix_path, 'include', libweston_version, 'libweston', 'backend-rdp.h') else dir_path_x11_backend = join_paths(libweston_version, 'libweston', 'backend-x11.h') - dir_path_headless_backend = join_paths(libweston_version, 'libweston', 'backend-headless.h') - dir_path_rdp = join_paths(libweston_version, 'libweston', 'backend-rdp.h') + dir_path_wayland_backend = join_paths(libweston_version, 'libweston', 'backend-wayland.h') + dir_path_rdp_backend = join_paths(libweston_version, 'libweston', 'backend-rdp.h') endif else message('Building with cross environment') dir_path_x11_backend = join_paths(libweston_version, 'libweston', 'backend-x11.h') - dir_path_headless_backend = join_paths(libweston_version, 'libweston', 'backend-headless.h') + dir_path_wayland_backend = join_paths(libweston_version, 'libweston', 'backend-wayland.h') dir_path_rdp_backend = join_paths(libweston_version, 'libweston', 'backend-rdp.h') endif @@ -191,9 +191,9 @@ if libweston_dep.found() message('Building with X11 backend') endif - if cc.has_header(dir_path_headless_backend) - config_h.set('HAVE_BACKEND_HEADLESS', 1) - message('Building with headless backend') + if cc.has_header(dir_path_wayland_backend) + config_h.set('HAVE_BACKEND_WAYLAND', 1) + message('Building with Wayland backend') endif if cc.has_header(dir_path_rdp_backend) diff --git a/src/compositor.c b/src/compositor.c index 59c3d9f..5fe4cf5 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -42,9 +42,6 @@ #ifdef HAVE_BACKEND_RDP #include #endif -#ifdef HAVE_BACKEND_HEADLESS -#include -#endif #ifdef HAVE_BACKEND_X11 #include #endif @@ -93,8 +90,6 @@ ivi_init_parsed_options(struct weston_compositor *compositor) return config; } - - static void sigint_helper(int sig) { @@ -117,10 +112,7 @@ struct { enum weston_compositor_backend backend; } backend_name_map[] = { { "drm", "drm-backend.so", WESTON_BACKEND_DRM }, - { "headless", "headless-backend.so", WESTON_BACKEND_HEADLESS }, - { "pipewire", "pipewire-backend.so", WESTON_BACKEND_PIPEWIRE }, { "rdp", "rdp-backend.so", WESTON_BACKEND_RDP }, - { "vnc", "vnc-backend.so", WESTON_BACKEND_VNC }, { "wayland", "wayland-backend.so", WESTON_BACKEND_WAYLAND }, { "x11", "x11-backend.so", WESTON_BACKEND_X11 }, }; @@ -142,7 +134,6 @@ get_backend_from_string(const char *name, return false; } - bool get_renderer_from_string(const char *name, enum weston_renderer_type *renderer) { @@ -1302,75 +1293,6 @@ load_x11_backend(struct ivi_compositor *ivi, int *argc, char **argv, } #endif -#ifdef HAVE_BACKEND_HEADLESS -static int -load_headless_backend(struct ivi_compositor *ivi, int *argc, char **argv, - enum weston_renderer_type renderer) -{ - struct weston_headless_backend_config config = {}; - - bool force_pixman = false; - bool fullscreen; - bool force_gl = false; - int output_count; - - struct weston_compositor *c = ivi->compositor; - struct weston_backend *wb = NULL; - - const struct weston_option options[] = { - { WESTON_OPTION_BOOLEAN, "use-pixman", false, &force_pixman }, - { WESTON_OPTION_BOOLEAN, "use-gl", false, &force_gl }, - }; - - windowed_parse_common_options(ivi, argc, argv, &force_pixman, - &fullscreen, &output_count); - - parse_options(options, ARRAY_LENGTH(options), argc, argv); - - if ((force_pixman && force_gl) || - (renderer != WESTON_RENDERER_AUTO && (force_pixman || force_gl))) { - weston_log("Conflicting renderer specifications\n"); - return -1; - } else if (force_pixman) { - config.renderer = WESTON_RENDERER_PIXMAN; - } else if (force_gl) { - config.renderer = WESTON_RENDERER_GL; - } else { - config.renderer = renderer; - } - - config.base.struct_version = WESTON_HEADLESS_BACKEND_CONFIG_VERSION; - config.base.struct_size = sizeof(struct weston_headless_backend_config); - - /* load the actual headless-backend and configure it */ - if (!weston_compositor_load_backend(c, WESTON_BACKEND_HEADLESS, &config.base)) - return -1; - - ivi->window_api = weston_windowed_output_get_api(c); - if (!ivi->window_api) { - weston_log("Cannot use weston_windowed_output_api.\n"); - return -1; - } - - wb = weston_compositor_load_backend(ivi->compositor, WESTON_BACKEND_HEADLESS, &config.base); - if (!wb) - return -1; - - if (ivi->window_api->create_head(wb, "headless") < 0) { - weston_log("Cannot create headless back-end\n"); - return -1; - } - - return 0; -} -#else -static int -load_headless_backend(struct ivi_compositor *ivi, int *argc, char **argv, enum weston_renderer_type renderer) -{ - return -1; -} -#endif - #ifdef HAVE_BACKEND_RDP static void weston_rdp_backend_config_init(struct weston_rdp_backend_config *config) @@ -1525,8 +1447,6 @@ load_backend(struct ivi_compositor *ivi, int *argc, char **argv, switch (backend) { case WESTON_BACKEND_DRM: return load_drm_backend(ivi, argc, argv, renderer); - case WESTON_BACKEND_HEADLESS: - return load_headless_backend(ivi, argc, argv, renderer); case WESTON_BACKEND_RDP: return load_rdp_backend(ivi, argc, argv); case WESTON_BACKEND_WAYLAND: -- cgit 1.2.3-korg