Commit Graph

16 Commits

Author SHA1 Message Date
Philipp Zabel 6f977640e6 libweston, backends: pass backend parameter to weston_backend functions
Passing the backend as a parameter to the weston_backend function
pointers seems more natural and will be very useful once there can be
more than one backend.

Since all backends already store a pointer to the compositor instance,
replace the compositor parameter with the backend in all functions.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2023-01-13 18:55:59 +01:00
Philipp Zabel 102acac6a9 backend-vnc: fix vnc_switch_mode
Fix the incorrect fb_pool stride set in vnc_switch_mode.
Also replace nvnc_fb_pool_unref/new with nvnc_fb_pool_resize.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
2023-01-11 17:58:06 +01:00
Daniel Stone 54356be853 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>
2023-01-10 10:59:04 +02:00
Philipp Zabel ce4cf2d060 backend-vnc: move accumulated damage with output
When the output is moved, move its per-framebuffer accumulated damage
with it. The alternative would be to track accumulated damage in the
local output coordinate system, but that would require translating back
into global coordinates for repaint_output.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2022-12-16 15:51:27 +02:00
Philipp Zabel 746a03068e libweston, backends: store backend pointer in struct weston_head
Compositor code can use opaque pointer comparison to determine whether
a head belongs to a given backend. Store a backend pointer in struct
weston_head to enable the compositor to select the correct backend
specific output configuration code.

This also allows to use the backend pointer instead of the opaque
backend_id pointer to check whether a head belongs to a backend, so
replace the checks in all to_xyz_head() functions and drop backend_id.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2022-12-12 15:21:16 +01:00
Philipp Zabel 1e901fa2b7 backend-vnc: drop unnecessary output release
No output is created at this point. Even if an output existed,
it should be relased when the head ist destroyed.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2022-12-12 13:55:20 +01:00
Philipp Zabel 635aa225c6 backend-vnc: set flags of current mode instead of template
vnc_ensure_matching_mode() does not transfer flags from init_mode.
Set flags on the returned mode instead.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2022-12-12 13:55:20 +01:00
Philipp Zabel 853eb7327f backend-vnc: set head properties in vnc_head_create
Set static monitor strings and physical size once, on head creation.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2022-12-12 13:55:20 +01:00
Philipp Zabel 233e056b50 backend-vnc: allocate mode with xzalloc
Let xzalloc warn and abort when running out of memory.
With this, vnc_insert_new_mode() and vnc_ensure_matching_mode() can not
return NULL anymore. Remove the now unnecessary error handling.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2022-12-12 13:55:20 +01:00
Philipp Zabel 1e6e885e36 backend-vnc: allocate head with xzalloc
Let xzalloc warn and abort when running out of memory.
With this, vnc_head_create() doesn't need an error return value anymore.
Remove the now unnecessary error handling.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2022-12-12 13:55:20 +01:00
Philipp Zabel 2b3f5f7821 backend-vnc: allocate seat with xzalloc
Let xzalloc warn and abort when running out of memory and remove the
now unnecessary error handling.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2022-12-12 13:55:09 +01:00
Philipp Zabel 133417b016 backend-vnc: Add user authentication
Let VNC clients authenticate using the local username and password of
the user weston is running as. To avoid transmitting the password in
cleartext, make TLS security mandatory.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
2022-11-23 16:58:48 +01:00
Philipp Zabel 1a027e63cb backend-vnc: enable TLS support
Add TLS key and certificate parameters to enable encryption support.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2022-11-23 11:04:19 +01:00
Philipp Zabel 2f0be4b4d0 backend-vnc: use configured keymap
Use the keymap rules/model/layout configured in the weston.ini [keyboard]
section.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2022-10-18 16:06:13 +02:00
Philipp Zabel 5cd87ff801 backend-vnc: implement direct key code handling
Allow clients that support the QEMU Extended Key Event Message to send
keycodes directly.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2022-10-18 16:06:13 +02:00
Stefan Agner 12f7665310 backend-vnc: add VNC support using Neat VNC library
This adds basic VNC protocol support using the Neat VNC library
(https://github.com/any1/neatvnc). Neat VNC depends on the AML main
loop library. The backend makes use of AML's integrated epoll backend
and connects AML via file descriptor with the Wayland event loop.

This implementation does not support authentication and hardcodes the
pixel format currently.

Co-authored-by: Philipp Zabel <p.zabel@pengutronix.de>
Co-authored-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Signed-off-by: Stefan Agner <stefan@agner.ch>
[r.czerwinski@pengutronix.de:
 - use new (as of 0.5.0) Neat VNC buffer API, with a buffer pool]
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
[p.zabel@pengutronix.de:
 - transform repaint damage to output coordinates
 - transform pointer coordinates into global space
 - check that outputs and heads are in fact ours, see aab722bb1785..060ef82d9360
 - track damage across multiple frame buffers
 - choose pixel format by drm_fourcc, see 8b6c3fe0ad
 - enable ctrl and alt modifiers
 - fix frame timing to achieve a constant repaint rate
 - pass initial size explicitly, see f4559b0760
 - use resize_output with pixman-renderer, see 55d08f9634e8..84b5d0eb4bee
 - allow configuring the refresh rate]
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2022-10-18 07:31:42 +02:00