backend-vnc: 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:38:28 +00:00 committed by Marius Vlad
parent 6a45ae871c
commit 54356be853
3 changed files with 13 additions and 1 deletions

View File

@ -3208,6 +3208,7 @@ weston_vnc_backend_config_init(struct weston_vnc_backend_config *config)
config->base.struct_version = WESTON_VNC_BACKEND_CONFIG_VERSION;
config->base.struct_size = sizeof(struct weston_vnc_backend_config);
config->renderer = WESTON_RENDERER_AUTO;
config->bind_address = NULL;
config->port = 5900;
config->refresh_rate = VNC_DEFAULT_FREQ;

View File

@ -55,10 +55,11 @@ weston_vnc_output_get_api(struct weston_compositor *compositor)
return (const struct weston_vnc_output_api *)api;
}
#define WESTON_VNC_BACKEND_CONFIG_VERSION 1
#define WESTON_VNC_BACKEND_CONFIG_VERSION 2
struct weston_vnc_backend_config {
struct weston_backend_config base;
enum weston_renderer_type renderer;
char *bind_address;
int port;
int refresh_rate;

View File

@ -972,6 +972,16 @@ vnc_backend_create(struct weston_compositor *compositor,
if (weston_compositor_set_presentation_clock_software(compositor) < 0)
goto err_compositor;
switch (config->renderer) {
case WESTON_RENDERER_AUTO:
case WESTON_RENDERER_PIXMAN:
weston_log("Using Pixman renderer\n");
break;
default:
weston_log("Unsupported renderer requested\n");
goto err_compositor;
}
if (pixman_renderer_init(compositor) < 0)
goto err_compositor;