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 <daniels@collabora.com>
This commit is contained in:
Daniel Stone 2022-12-29 20:36:20 +00:00 committed by Marius Vlad
parent 53a32e7888
commit 6a45ae871c
3 changed files with 14 additions and 1 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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;