Commit Graph

423 Commits

Author SHA1 Message Date
Geoffrey McRae
b515fa80d5 [host] nvfbc: be more intellegent when unionizing disjointed sets 2021-10-27 00:00:38 +11:00
Geoffrey McRae
9969896876 [host] app: zero the new client sub count
If a new client connects but there has not been a capture timeout the
new client count wont be zeroed on a valid capture. If there is a
timeout later the host will still think there is a new client and
re-send a frame when it should not. This fixes this by reading the value
on a valid frame which zeros the new subs count.
2021-10-20 15:56:35 +11:00
Quantum
13fabc2e4a [host] windows: fix NSIS install directory on 64-bit builds
This is probably an NSIS bug.
2021-10-18 16:17:36 +11:00
Quantum
1f24ab0742 [host] nvfbc: avoid waking up pointer thread for no reason
If the wait times out, we used to simply restart the loop, which causes
it to check this->stop and exit if set to true. However, nvfbc_stop
already calls lgSignalEvent, which would wake up the pointer thread to
perform the check, so there is no need to set a timeout on the wait.
2021-09-29 17:47:02 +10:00
Quantum
bc65de5987 [host] installer: build 64-bit NSIS installers
The host is a 64-bit application, so requiring 64-bit Windows isn't an
issue. However, not using 32-bit installers has an advantage: we don't
need to require WoW64.
2021-09-21 22:26:10 +10:00
Quantum
286da11172 [host] windows: don't register exit event when none exists 2021-09-04 13:25:06 +10:00
Quantum
e05bb196f0 [host] app: print CPU information on startup 2021-08-31 20:14:10 +10:00
Quantum
1e2caf4c9f [host] pipewire: implement basic capture
It works, with the following limitations:
1. user is forced to select the monitor through platform-specific mechanisms
   every time the client starts.
2. cursor is composed onto the screen, and no position can be reported.
2021-08-21 23:01:11 +10:00
Quantum
28eae3bd86 [host] linux: add skeleton pipewire capture backend 2021-08-21 23:01:11 +10:00
Quantum
4b3aaa7e0c [host] cmake: report capture backends enabled 2021-08-20 21:03:50 +10:00
Geoffrey McRae
3c3c0f70be [all] bump the LGMP version to obtain access to data serial tracking 2021-08-19 21:29:03 +10:00
Quantum
5a906131eb [all] cmake: tell users to clone submodules when they haven't
This gives users a command to run that will automagically fix the submodule
situation, and should reduce the amount of support requests.
2021-08-19 21:28:36 +10:00
Quantum
2dbd4f168e [all] cmake: provide an uninstall target 2021-08-16 19:56:37 +10:00
Quantum
4ecf749f7e [host] remove all casts around malloc 2021-08-16 16:26:58 +10:00
Quantum
cdda89cef7 [host] use correct argument order for calloc 2021-08-16 16:25:59 +10:00
Tudor Brindus
982b4e6625 [host] use variable-relative sizeof where possible 2021-08-16 16:22:55 +10:00
Quantum
4f7ce91e7f [host] capture: switch all asserts to DEBUG_ASSERT 2021-08-14 12:19:07 +10:00
Quantum
10ee6cd031 [host] nvfbc: read nvfbc:diffRes option with the correct type 2021-08-14 09:21:34 +10:00
Quantum
e5d252290d [common] array: add ALIGN_PAD macro for common logic
ALIGN_PAD(x, a) returns x rounded up to the nearest multiple of a.
2021-08-14 08:05:29 +10:00
Quantum
712dcee07f [host] app: remove useless ALIGN_DN and ALIGN_UP macros 2021-08-14 08:05:18 +10:00
Quantum
074341e421 [host] windows/crash: do not report absolute paths on build machines
This commit makes the crash handler show relative paths instead of absolute
ones, which makes the stack traces generated easier to read.

On the other hand, absolute paths makes sense on Linux, since the user is
expected to build the binaries themselves, and gdb will be able to find the
source code.
2021-08-13 20:23:40 +10:00
Quantum
acd5ce51db [host] dxgi: use FAILED macro instead of comparing against S_OK 2021-08-13 20:21:50 +10:00
Quantum
d3ea9662bf [host] nvfbc: remove rectangles that are entirely contained in others
This makes nvfbc report less useless damage and makes the client run faster.
2021-08-13 20:21:27 +10:00
Quantum
566c89e9d8 [host] dxgi: correctly count moved rectangles 2021-08-13 20:21:08 +10:00
Quantum
b3173bdddc [host] dxgi: include correct DXGI headers
The declarations in dxgi_extra.h are not missing, they are in dxgi1_2.h and
dxgi1_5.h, which exist in MinGW-w64 since 2017.
2021-08-12 12:35:45 +10:00
Quantum
61a4b0744d [host] dxgi: use standard MinGW libd3d11.a
MinGW has been shipping this file since 2014, and that version contains the
only function from the dll that we call: D3D11CreateDevice.
2021-08-12 11:58:34 +10:00
Quantum
9bded74543 [host] dxgi: use CopySubresourceRegion when possible
This commit adds damage tracking to the DXGI textures, and only copies the
damaged areas to the textures with ID3D11DeviceContext::CopySubresourceRegion.

The sleep logic in waitFrame makes it difficult for this to reduce the
latency, but removing it shows significant improvements (6-7 ms to ~3 ms)
when a tiny portion of the screen is damaged, while showing no difference on
full screen damage.
2021-08-11 19:01:52 +10:00
Quantum
5e13549f74 [host] windows: use DEBUG_WINERROR for MsgWaitForMultipleObjects 2021-08-09 17:07:25 +10:00
Quantum
87a21f5f5e [host] windows: use DEBUG_WINERROR for CallNtPowerInformation
We need to use the function RtlNtStatusToDosError to convert NTSTATUS to
Windows error codes.
2021-08-09 17:07:25 +10:00
Quantum
9246e00163 [host] windows: use DEBUG_WINERROR for exit event opening code 2021-08-09 17:07:25 +10:00
Quantum
cab95c5eed [common] rects: refactor rect buffer copy code to common module
This also fixes a bug of accidentally multiplying the stride by 4 when
the stride is already in bytes and not pixels.
2021-08-08 08:30:11 +10:00
Quantum
3d29967a8d [host] dxgi: copy only damaged regions to IVSHMEM
This implementation uses a line sweep algorithm to copy the precisely the
intersection of all accumulated damage rectangles, ensuring that every
pixel is copied exactly once, and no pixel is ever copied multiple times.
Furthermore, once a row has been swept, we update the framebuffer write
pointer immediately.
2021-08-06 22:55:15 +10:00
Quantum
3651852430 [host] nvfbc: round pitch to multiple of 128 for dmabuf import
Certain drivers do not support pitches that are not multiples of 128 bytes,
and instead just does some kind of rounding internally. On DXGI, this is not
a problem because the API rounds pixel pitch, but NvFBC does not. This causes
certain resolutions to simply not work with dmabuf, most notably 3440x1440,
which is 1440p ultrawide.

Since we are copying pixels with the CPU anyways, we might as well round the
pitch up to 128 bytes (32 pixels).
2021-08-06 22:48:33 +10:00
Geoffrey McRae
2856928b57 [host] windows: implement KVMFR_FEATURE_SETCURSORPOS 2021-08-05 22:35:22 +10:00
Quantum
4da0c64583 [host] nvfbc: make diff map size configurable
This commit adds a new host configuration option, nvfbc:diffRes, which
specifies the dimensions of every block in the diff map. This defaults to
128, meaning the default 128x128 block size.

Since block sizes other than 128x128 is not guaranteed to be supported by
NvFBC, the function NvFBCGetDiffMapBlockSize was introduced to query the
support and output the actual block size used.
2021-08-05 07:27:28 +10:00
Quantum
4e81c7f724 [host] windows: make copyright string in resource use © 2021-08-04 21:16:35 +10:00
Quantum
51b9cd4e5a [all] copyright: use unicode copyright sign ©
This is done for consistency with the license strings in appstrings.c.
2021-08-04 21:16:35 +10:00
arcnmx
c0aec7d8f4 [host] nvfbc: disable pointerThread when unused
fixes log spam that would occur when decoupleCursor=false
2021-08-03 21:05:39 +10:00
Quantum
7801575d99 [host] nvfbc: log error codes for various errors
This makes troubleshooting easier.

We also switch to use %d instead of 0x%x because all error codes in nvfbc.h
are negative decimal numbers.
2021-07-31 15:02:39 +10:00
arcnmx
552a37122a [host] app: add throttleFPS option 2021-07-28 02:47:24 +10:00
Geoffrey McRae
5f5f497cbd [host/common] windows: provide delayExecution via nsleep
This change moves this platform specific sleep to `common` as the OS
agnostic `nsleep` function.

Ref PR #661
2021-07-26 16:36:56 +10:00
Geoffrey McRae
dafd7e7b42 [host] app: when running in sync mode send frame repeats as needed 2021-07-25 17:10:51 +10:00
Quantum
8528969efd [host] nvfbc: clamp damage rectangles to screen size 2021-07-25 14:34:10 +10:00
Geoffrey McRae
b39f38350f [common] kvmfr: add a new frameSerial field to the KVMFRFrame struct
This new field is used so that when a new client connects an already
connected client can identify any repeated frame that is sent and ignore
it.
2021-07-25 13:46:48 +10:00
arcnmx
2c745db544 [host] windows: use CMAKE_DLLTOOL if available
cmake automatically finds dlltool as of version 3.16
2021-07-24 14:52:32 +10:00
arcnmx
3b37898eb2 [all] use cmake FindPkgConfig IMPORTED_TARGETs 2021-07-24 12:35:48 +10:00
arcnmx
aa2ea05af9 [client] removed unused GMP dependency 2021-07-24 12:35:48 +10:00
arcnmx
be664c49c8 [all] cmake: use -march=x86-64-v2 when it becomes available
Moves the logic in 0525515 to a common cmake include, and applies it to
the other binaries.
2021-07-24 12:35:17 +10:00
Quantum
3cf0257f34 [host] windows: do not complain about failed timer destruction at exit
When our window is destroyed, our timers are also destroyed. This causes our
attempt at destruction to fail. Instead, set MessageHWND to NULL in the
WM_DESTROY handler and don't try destroying the timers if the window is gone.
2021-07-23 15:52:45 +10:00
Quantum
4c60409aaf [host] windows: use WM_CLOSE to signal window destruction
DestroyWindow can only be invoked on the thread that created the window.
All other threads must use WM_CLOSE or another message to signal tell the
window to destroy itself.
2021-07-22 18:55:11 +10:00