Commit Graph

179 Commits

Author SHA1 Message Date
Quantum
5649d1ad95 [client] wayland: split Wayland display server into modules
The Wayland display server is getting unwieldy due to the sheer size.
To make it easier to edit in the future, I split it into many components
based on logical boundaries.
2021-02-21 10:31:49 +11:00
Quantum
db16efe68b [common] add a reference counted buffer type
This allows buffers to be shared between different asynchronous operations.
Once all users no longer need the buffer, it will be freed.

The motivation for this is being able to stream Wayland clipboard data
asynchronously to multiple clients. The buffer should only be freed after
the clipboard has changed and all ongoing transfer completes.
2021-02-21 10:31:49 +11:00
Quantum
e01666b6ad [client] wayland: implement epoll registration mechanism
This will be used to register async clipboard I/O callbacks later.
2021-02-21 10:31:49 +11:00
Quantum
62b27760ea [common] ivshmem: do not create dmabuf for simple mmap
It used to be the case that you need to create dmabuf for kvmfr devices
to be able to mmap them. But after #457, this is no longer needed.

Directly mmaping the kvmfr device has the advantage of avoiding the
creation of a dmabuf, which has cost (e.g. the list of pages, the
scatterlist, etc.).
2021-02-21 10:31:48 +11:00
Quantum
8e98f863b6 [host] windows: detect whether screensaver is disabled in the guest
This will allow us to add an option to disable the screensaver on the client
when an application in the guest requests it. This behaviour may be useful
when the guest is doing media playback.
2021-02-21 10:31:48 +11:00
Geoffrey McRae
ca5c3938e4 [client] all: move all SDL specific code into displayservers/sdl 2021-02-21 10:31:48 +11:00
Geoffrey McRae
dbb18a6ecb [client] x11/sdl: get the border dimensions from the backend 2021-02-21 10:31:48 +11:00
Geoffrey McRae
bf583290a4 [client/common] restructure project in prep for full SDL removal 2021-02-21 10:31:46 +11:00
Geoffrey McRae
6f1c19b3b0 [all] improve backtrace and debugging support 2021-02-21 10:30:57 +11:00
Quantum
7e15ec5e66 [common] windows: implement crash handler for stack traces
This commit uses the DbgHelp library which is shipped with Windows to
generate stack traces with function names and line number information.
It takes advantage of the pdb file generated by cv2pdb that is now
installed with looking-glass-host.exe.
2021-01-27 07:56:12 +11:00
Geoffrey McRae
4c1893fe20 [all] fix numerous memory leaks at application shutdown 2021-01-24 21:47:53 +11:00
Geoffrey McRae
428b498cca [common] fix invalid read from unaligned addresses (fixes #410) 2021-01-20 23:18:46 +11:00
Geoffrey McRae
14cc57071c [host] remove the remainder of the YUV420 support 2021-01-18 13:55:44 +11:00
Geoffrey McRae
f5587b6b6b [host] all: pass back the desktop rotation to the client 2021-01-18 13:53:29 +11:00
Geoffrey McRae
27a38294ea [client] major restructure of platform specific code 2021-01-16 20:41:13 +11:00
Quantum
afa277f8ee [common] ivshmem/linux: add stubs for ivshmemInit and ivshmemFree
These two functions were added in 9ff1859dc1
for Windows, but were never used on Linux.

Adding stubs will allow the host to compile on Linux.
These should be fixed later.
2021-01-15 08:49:30 +11:00
Tudor Brindus
a46a3a2668 [all] use explicit void parameter lists
This makes it a compile-time error to call a function that semantically
takes no parameters with a nonzero number of arguments.

Previously, such code would still compile, but risk blowing up the stack
if a compiler chose to use something other than caller-cleanup calling
conventions.
2021-01-14 17:29:37 +11:00
Geoffrey McRae
f85b6418b8 [common] linux: stop event signals accumulating after they are serviced 2021-01-08 01:18:02 +11:00
Quantum
7e4d323427 get display DPI info to scale mouse movement 2021-01-05 09:03:29 +11:00
Geoffrey McRae
0badf2a84c [all] move defines for LGMP_QUEUE_*_LEN into KVMFR.h 2020-10-30 18:48:41 +11:00
Geoffrey McRae
6799d518a5 [client] common: added spin timeout to framebuffer wait 2020-10-30 03:27:28 +11:00
Geoffrey McRae
4f9544d61d [client] egl: added DMA texture support for direct upload
Note: This only works with the KVMFR kernel module in a VM->VM
configuration. If this causes issues it can be disabled with the new
option `app:allowDMA`
2020-10-30 02:36:45 +11:00
Geoffrey McRae
5522e93fb9 [common] linux: added helpers for ivshmem DMA usage 2020-10-30 02:36:45 +11:00
Geoffrey McRae
0efe7dc63c [common] linux: added support for kvmfr dmabuf 2020-10-30 02:36:45 +11:00
Geoffrey McRae
a70858aea0 [client] reworked frame timing waits for better responsiveness 2020-10-26 18:09:45 +11:00
Geoffrey McRae
9ff1859dc1 [host] windows: check the ivshmem device exists in the service 2020-10-19 02:49:15 +11:00
Geoffrey McRae
58ba76a27f [client] seperate frame setup and data events 2020-10-12 19:43:29 +11:00
Geoffrey McRae
b2961c7939 [all] added new format version field to frame header 2020-10-12 18:52:37 +11:00
Geoffrey McRae
6650e58a4a [common] linux: print reason for failure to open the shm file/device 2020-10-12 17:48:31 +11:00
Geoffrey McRae
9c6bd888fd [host/client] added experimental RGBA16 float support (EGL only) 2020-10-11 19:22:31 +11:00
Geoffrey McRae
e6c88a4af3 [all] be smarter about getting the git version 2020-10-09 02:17:20 +11:00
Geoffrey McRae
7e362050f7 [all] update KVMFR to provide cursor hotspot information
This commit bumps the KVMFR protocol version as it adds additional
hotspot x & y fields to the KVMFRCursor struct. This corrects the issue
of invalid alignment of the local mouse when the shape has an offset
such as the 'I' beam.
2020-08-20 13:51:01 +10:00
Geoffrey McRae
431ae3fc55 [common] linux: fix issue with infinite timeout events 2020-08-11 19:31:11 +10:00
Geoffrey McRae
d9a80b16f0 [common] properly define _GNU_SOURCE and set the thread names 2020-08-10 16:22:02 +10:00
Geoffrey McRae
90d0cd873d [common] added a sleep to the framebuffer spinlock and a sane timeout 2020-08-10 16:18:08 +10:00
Geoffrey McRae
19c2fe9b5e Revert "[common] linux: improve event mechanics"
The logic here is wrong, this should be done externally as multiple
waiters will cause issues
2020-08-09 14:44:00 +10:00
Geoffrey McRae
88d25ee98c [common] linux: improve event mechanics 2020-08-09 13:26:55 +10:00
Geoffrey McRae
be7820303f [common] fixed debug formatting across platforms 2020-08-03 15:05:35 +10:00
Geoffrey McRae
43503222c7 [common] framebuffer: fixed incorrect streaming usage 2020-08-03 14:41:57 +10:00
Geoffrey McRae
85b8c12abf [common] adjust framebuffer read/write strategy for better cache usage 2020-08-03 12:33:08 +10:00
Geoffrey McRae
7af053497e [common] unroll the framebuffer write loop and increase the chunk size 2020-08-03 12:24:17 +10:00
Geoffrey McRae
aa32c5ffad [common] framebuffer: added missing header include 2020-08-03 11:58:38 +10:00
Geoffrey McRae
62d1bd1ea2 [common] framebuffer: use stream load instead of plain load 2020-08-03 11:55:38 +10:00
Geoffrey McRae
2329e993ee [common] fixed framebuffer write SIMD code performance 2020-08-03 11:44:24 +10:00
Geoffrey McRae
da655b86c3 [common] improve frambuffer copy to avoid cache pollution (SIMD) 2020-08-03 11:16:30 +10:00
Max Sistemich
c5ff8bd4ce [common] linux: implement timers 2020-07-25 00:38:15 +10:00
Geoffrey McRae
553e2830bb [client/host] share the host version with the client for diagnostics 2020-05-29 14:14:31 +10:00
Geoffrey McRae
4441427943 [client] implemented better clock drift correction 2020-05-22 20:45:59 +10:00
Geoffrey McRae
e31f38eadc [client] allow frame updates to be triggered by a timed event
This is a major change to how the LG client performs it's updates. In
the past LG would operate a fixed FPS regardless of incoming update
speed and/or frequency. This change allows LG to dynamically increase
it's FPS in order to better sync with the guest as it's rate changes.
2020-05-21 13:41:59 +10:00
Geoffrey McRae
b7ca3d7e37 [client] cleanup debug output 2020-05-17 11:25:27 +10:00