From 6a45ae871cbf0a0d399b90f82695dd99c4c09e82 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Thu, 29 Dec 2022 20:36:20 +0000 Subject: [PATCH] backend-rdp: Add renderer parameter to backend config Add an explicit request to the backend config to choose the renderer. Currently, only Pixman remains supported, with auto defaulting to that. Signed-off-by: Daniel Stone --- compositor/main.c | 1 + include/libweston/backend-rdp.h | 3 ++- libweston/backend-rdp/rdp.c | 11 +++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/compositor/main.c b/compositor/main.c index b596ce078..111ddebcb 100644 --- a/compositor/main.c +++ b/compositor/main.c @@ -3097,6 +3097,7 @@ weston_rdp_backend_config_init(struct weston_rdp_backend_config *config) config->base.struct_version = WESTON_RDP_BACKEND_CONFIG_VERSION; config->base.struct_size = sizeof(struct weston_rdp_backend_config); + config->renderer = WESTON_RENDERER_AUTO; config->bind_address = NULL; config->port = 3389; config->rdp_key = NULL; diff --git a/include/libweston/backend-rdp.h b/include/libweston/backend-rdp.h index c9eb16090..eea013c15 100644 --- a/include/libweston/backend-rdp.h +++ b/include/libweston/backend-rdp.h @@ -55,7 +55,7 @@ weston_rdp_output_get_api(struct weston_compositor *compositor) return (const struct weston_rdp_output_api *)api; } -#define WESTON_RDP_BACKEND_CONFIG_VERSION 2 +#define WESTON_RDP_BACKEND_CONFIG_VERSION 3 typedef void *(*rdp_audio_in_setup)(struct weston_compositor *c, void *vcm); typedef void (*rdp_audio_in_teardown)(void *audio_private); @@ -64,6 +64,7 @@ typedef void (*rdp_audio_out_teardown)(void *audio_private); struct weston_rdp_backend_config { struct weston_backend_config base; + enum weston_renderer_type renderer; char *bind_address; int port; char *rdp_key; diff --git a/libweston/backend-rdp/rdp.c b/libweston/backend-rdp/rdp.c index 9fd1a3caa..ef163a2d6 100644 --- a/libweston/backend-rdp/rdp.c +++ b/libweston/backend-rdp/rdp.c @@ -1686,6 +1686,16 @@ rdp_backend_create(struct weston_compositor *compositor, goto err_free_strings; } + switch (config->renderer) { + case WESTON_RENDERER_PIXMAN: + case WESTON_RENDERER_AUTO: + weston_log("Using Pixman renderer\n"); + break; + default: + weston_log("Unsupported renderer requested\n"); + goto err_free_strings; + } + /* if we are listening for client connections on an external listener * fd, we don't need to enforce TLS or RDP security, since FreeRDP * will consider it to be a local connection */ @@ -1790,6 +1800,7 @@ err_free_strings: static void config_init_to_defaults(struct weston_rdp_backend_config *config) { + config->renderer = WESTON_RENDERER_AUTO; config->bind_address = NULL; config->port = 3389; config->rdp_key = NULL;