Commit Graph

251 Commits

Author SHA1 Message Date
Geoffrey McRae
5501d22a2d [client] fixed missed usage of new locking semantics 2017-12-21 01:03:21 +11:00
Geoffrey McRae
2f6b7e08f8 [client] define locking types and semantics to allow for alt methods 2017-12-21 00:58:16 +11:00
Geoffrey McRae
695822bd6d [client] redesign of the renderer archiceture for mt support
This is the first of two commits that completely turn the rendering code
on it's head. This change set decouples the guest's capture rate from
the host's render rate for both cursor and frame updates. This helps
prevent the host application from stalling when waiting for frame draws
when all it want's to do is send cursor updates.

* Breaks OpenGL-Basic for now
2017-12-20 00:53:45 +11:00
Geoffrey McRae
a70adb2568 [client] correct help text for new -o argument 2017-12-19 15:40:52 +11:00
Geoffrey McRae
21a4e15868 [client] cosmetics 2017-12-19 15:37:49 +11:00
Geoffrey McRae
8b25f8a344 [client] opengl: show actual FPS seperate from updates per second (UPS) 2017-12-19 12:17:50 +11:00
Geoffrey McRae
7d307c0a9c [client] improved option parsing 2017-12-19 11:58:38 +11:00
Geoffrey McRae
133d8ec21f [client] opengl: added preventBuffer option 2017-12-19 11:02:35 +11:00
Geoffrey McRae
f4b95eeda9 [client] fix option output counts and dynamic name padding 2017-12-19 10:56:23 +11:00
Geoffrey McRae
c38e38d43d [client] opengl: add splitmouse option
This feature was previously hardcoded enabled, it is now optional as
some hardware pipelines stall with the excessive flushes resulting in a
jumpy cursor. Default is disabled and may be re-enabled with
`-o opengl:splitmouse=1` or `-o opengl-basic:splitmouse=1` depending on
the renderer selected.
2017-12-19 10:21:45 +11:00
Geoffrey McRae
0ac1992019 [client] add new OpenGL-Basic renderer
This is based on bf8da7fd7e4397fe9931e82e52753806f1eee7e0 by @kiljacken
Per issue #11 on some cards this method performs much better then the
persistant buffering used in the standard OpenGL renderer.

Closes #11
2017-12-17 23:32:08 +11:00
Geoffrey McRae
5305ec5dd1 [client] opengl: made vsync option function again 2017-12-17 23:24:58 +11:00
Geoffrey McRae
313a4122bc [client] add -g option to force a specific renderer 2017-12-17 23:15:18 +11:00
Geoffrey McRae
065b8c1eab [client] fix typo in help text 2017-12-17 22:45:26 +11:00
Geoffrey McRae
424dc8bb13 [client] add renderer option list 2017-12-17 22:33:02 +11:00
Geoffrey McRae
06e38d897d [client] implemented renderer specific option API
Please note the vsync and mipmap options are now specific to OpenGL
To configure them use the following options:

  -o opengl:mipmap=1
  -o opengl:vsync=0
2017-12-17 22:21:59 +11:00
Geoffrey McRae
f3e19b743c [client] added ability to pass options to renderers 2017-12-17 20:32:44 +11:00
Geoffrey McRae
deee61efa9 [client] cosmetics 2017-12-17 20:16:43 +11:00
Geoffrey McRae
71c7f30265 [client] added -Q feature to prevent accidental applicaiton closure
Closes #21
2017-12-17 20:11:52 +11:00
Geoffrey McRae
3784e9c06f [client] added support for new header format 2017-12-17 05:21:02 +11:00
Geoffrey McRae
287b983d27 [client] opengl: fixed broken mipmap logic
mipmapping is turned off for images that are scaled up a it degrades the
output quality.
2017-12-16 11:25:01 +11:00
Geoffrey McRae
2bb8b0227c [client] don't send renderer mouse events until it's configured 2017-12-15 19:14:02 +11:00
Geoffrey McRae
ae4156d041 [client] don't update mouse scaling values until started 2017-12-15 19:14:02 +11:00
Patrick Steinhardt
fe337cf510 [client] ivshmem: fix missing <sys/select.h> include
While the function `ivshmem_wait_irq` makes use of the select(3)
function, it does not include <sys/select.h>. This happens to work on
glibc based systems, which include thet file transitively via other
header files. But on musl libc based systems, this breaks compilation.

Directly include <sys/select.h> to fix the problem.
2017-12-15 18:25:21 +11:00
Geoffrey McRae
7bfed41523 [client] opengl: update mouse draw time when doing decoupled draws 2017-12-15 17:03:51 +11:00
Geoffrey McRae
9bb66b7bd6 [client] opengl: decouple mouse updates from vsync 2017-12-15 16:58:21 +11:00
Geoffrey McRae
f7420317f1 [client] opengl: mouse shape updates bypass the draw timeout 2017-12-15 16:53:26 +11:00
Geoffrey McRae
c1379a45d2 [client] opengl: increase maximum mouse draw frequency 2017-12-15 16:34:29 +11:00
Geoffrey McRae
9c03327701 [client] opengl: added back double buffering and vsync support
This adds back in double buffering and vsync support. This has been
carefully implemented so that the render function blocks until the video
card reports that it has advanced a frame, this ensures that the OpenGL
pipeline never buffers frames.
2017-12-15 16:21:38 +11:00
Geoffrey McRae
0d8b2449cf [client] added back missing vsync disable option 2017-12-15 16:19:47 +11:00
Arti Zirk
d1bd5b3115 Do not minimize fullscreen window on focus loss 2017-12-15 15:59:28 +11:00
Jack Karamanian
e03621a622 [client] Add borderless fullscreen usage 2017-12-15 15:59:09 +11:00
Jack Karamanian
606da0ae47 Add borderless fullscreen option 2017-12-15 12:59:34 +11:00
Geoffrey McRae
b6c8136565 [client] initialize the local header copy for proper startup 2017-12-15 12:02:37 +11:00
Geoffrey McRae
8ae9f8464b [client] updated client to support new KVMFR cursor dataPos field 2017-12-15 10:51:40 +11:00
Geoffrey McRae
3c61814c56 [client] windows cursors are in BGRA format 2017-12-15 10:20:20 +11:00
Geoffrey McRae
cd54cb179b [client] make gcc happy about the ignored read result
Fixes #5
2017-12-15 00:57:49 +11:00
Geoffrey McRae
67bdf2ba97
[client] fix SDL_ttf.h include path. 2017-12-14 22:05:32 +11:00
Geoffrey McRae
ead48195db [client] opengl: use the stride rather then rect width for padded widths 2017-12-14 20:35:36 +11:00
Geoffrey McRae
2ae9b479f6 [client] update window dimensions when the spice client is disabled 2017-12-14 20:09:48 +11:00
Geoffrey McRae
3fa9f371b4 [client] added license to opengl.c 2017-12-14 20:06:48 +11:00
Geoffrey McRae
8ec4abc544 [client] adjusted renderer interface to allow for APIs such as Vulkan 2017-12-14 17:42:59 +11:00
Geoffrey McRae
7b64d35cd1 [client] corrected path to SDL2_ttf header 2017-12-14 16:09:39 +11:00
Geoffrey McRae
8c2709a3f4 Revert "[client] disable hacky vsync code now we are single buffering"
This reverts commit d55f0bf841.
2017-12-14 10:40:51 +11:00
Geoffrey McRae
d55f0bf841 [client] disable hacky vsync code now we are single buffering 2017-12-14 10:35:38 +11:00
Geoffrey McRae
dd0930d265 [client] our source is vairable frame rate, we can't double buffer at all 2017-12-14 10:30:55 +11:00
Geoffrey McRae
04f7800df4 [client] remove silly wait logic 2017-12-14 10:12:31 +11:00
Geoffrey McRae
d8a80a1cfc [client] move startup later as DXGI stalls when nothing is going on 2017-12-14 10:08:47 +11:00
Geoffrey McRae
9d29b1195d [client] treat buffers correctly 2017-12-14 10:06:22 +11:00
Geoffrey McRae
2374b1a9fb [client] make methods static inline 2017-12-14 08:23:58 +11:00
Geoffrey McRae
a7180a5609 [client] another try at better screen sync 2017-12-14 06:54:53 +11:00
Geoffrey McRae
81f4a7fade [client] slow down mouse updates to something reasonable 2017-12-14 04:18:30 +11:00
Geoffrey McRae
7986350cb8 [client] switch to polling mode to fix stutting issues 2017-12-14 02:24:18 +11:00
Geoffrey McRae
afff50dfde [client] don't try to realign the mouse until we know where the mouse is 2017-12-13 22:05:47 +11:00
Geoffrey McRae
233b7755ae [client] moved host startup sync before window creation 2017-12-13 21:57:01 +11:00
Geoffrey McRae
3bc2506d92 [client] added clean client restart mechanisim 2017-12-13 21:08:35 +11:00
Geoffrey McRae
371f7ce535 [client] cosmetics 2017-12-13 20:44:58 +11:00
Geoffrey McRae
a6b253197f [client/opengl] removed extra calls to make the context current 2017-12-13 14:26:31 +11:00
Geoffrey McRae
b5cb796b7c [client] changed opengl to process every frame 2017-12-13 14:10:24 +11:00
Geoffrey McRae
d0e5bd02bd [client] use lists to draw the cursor 2017-12-13 13:10:32 +11:00
Geoffrey McRae
85c83d2417 [client] enable vsync again but draw to front for cursor updates 2017-12-13 05:55:01 +11:00
Geoffrey McRae
e7511b30bb [client] kick the guest before waiting for updates 2017-12-13 05:28:53 +11:00
Geoffrey McRae
d2957228ef [client] added monochrome cursor support 2017-12-13 04:49:43 +11:00
Geoffrey McRae
b5a5d4cda2 [common/client] add pitch to cursor shape structure 2017-12-13 04:42:09 +11:00
Geoffrey McRae
c36e948bdb [client] added RGB cursor support 2017-12-13 03:51:25 +11:00
Geoffrey McRae
a950f7b187 [client] added initial code for rendering the cursor shape 2017-12-13 03:08:38 +11:00
Geoffrey McRae
5cfae05cae [client] corrected screen resize bug and incorrect scissor 2017-12-13 02:28:41 +11:00
Geoffrey McRae
893bb7e603 [client] huge rewrite of renderer API deal with mouse updates 2017-12-13 02:22:47 +11:00
Geoffrey McRae
301d394f50 [client] updates for new protocol and vsync disable method 2017-12-12 08:08:14 +11:00
Geoffrey McRae
219179b375 [misc] added website url to sources 2017-12-12 04:30:47 +11:00
Geoffrey McRae
9f790ff51d [client] corrected polling logic
Calculating the pollDelay for the next frame is impossible as the
frame rate is determined by the host application's capture API and
may wildly vary.
2017-12-12 03:59:58 +11:00
Geoffrey McRae
ce278d17a7 [client] print out video card information 2017-12-12 03:59:58 +11:00
Geoffrey McRae
3d462928a6 [client] added git version to build 2017-12-12 03:59:58 +11:00
Geoffrey McRae
5863160c69 [client] fixed incorrect usage of glXWaitVideoSyncSGI 2017-12-12 03:59:58 +11:00
Geoffrey McRae
7574e03d86 [client] fixed out by one error on frame sleep sync 2017-12-12 03:59:58 +11:00
Geoffrey McRae
38d458ac7d [client] added dependency on X11 2017-12-12 03:59:58 +11:00
Geoffrey McRae
e2c1f1cd77 [client] set the compositor bypass hint 2017-12-12 03:59:58 +11:00
Geoffrey McRae
8adf7cbacd [client] remove debug print 2017-12-12 03:59:58 +11:00
Geoffrey McRae
0ad1f21ffb [client] renderer interface improvements and use gl lists for opengl 2017-12-12 03:59:58 +11:00
Geoffrey McRae
fcfea1b65d [client] fixed basic renderer 2017-12-12 03:59:58 +11:00
Geoffrey McRae
e6a21d1049 [client] implemented SGI_video_sync for better frame sync 2017-12-12 03:59:58 +11:00
Geoffrey McRae
31c9693cbf [client] move remaining opengl code into the opengl renderer 2017-12-12 03:59:58 +11:00
Geoffrey McRae
5e9885bec1 [client] apply fps limiter when presentation time is too low 2017-12-12 03:59:58 +11:00
Geoffrey McRae
786b9ec723 [client] altered makefile to link fontconfig 2017-12-12 03:59:58 +11:00
Geoffrey McRae
421b091448 [client] Added fontconfig for font path detection 2017-12-12 03:59:58 +11:00
Geoffrey McRae
a4d8fd2237 [client] added rate limiting to failed kicks (guest not ready) 2017-12-12 03:59:58 +11:00
Geoffrey McRae
3899556cbf [client] added extra sanity checks to the header's data format 2017-12-12 03:59:58 +11:00
Geoffrey McRae
81f1b43581 [client] makefile, enable -O3 as the default now 2017-12-12 03:59:58 +11:00
Geoffrey McRae
79dffa047f [client] dont mipmap when enlarging smaller screens 2017-12-12 03:59:58 +11:00
Geoffrey McRae
0ccb38940e [client] make autoResize work again 2017-12-12 03:59:58 +11:00
Geoffrey McRae
59a894ae04 [client] switched srcRect to srcSize and type to SDL_Point 2017-12-12 03:59:57 +11:00
Geoffrey McRae
34f07ec77f [client] minor logical order optimization of the render loop 2017-12-12 03:59:57 +11:00
Geoffrey McRae
1d5f98db32 [client] adjusted presentation time to be more accurate 2017-12-12 03:59:57 +11:00
Geoffrey McRae
032602f336 [client] reworked the polling logic yet again 2017-12-12 03:59:57 +11:00
Geoffrey McRae
eb52ee9412 [client] added retard/resync counts for debugging 2017-12-12 03:59:57 +11:00
Geoffrey McRae
d09bb1146d [client] removed unused useBufferStorage app state variable 2017-12-12 03:59:57 +11:00
Geoffrey McRae
ea5d0ddfe0 [client] removed deprecated option to disable GL_ARB_buffer_storage 2017-12-12 03:59:57 +11:00
Geoffrey McRae
852309464f [client] more polling improvements 2017-12-12 03:59:57 +11:00
Geoffrey McRae
32c6989654 [client] removed debugging print 2017-12-12 03:59:57 +11:00
Geoffrey McRae
7349334811 [client] reworked polling logic and added GPU magic
SDL_RenderPresent calls SwapBuffers which doesn't block even with vsync
enabled until the driver/gpu has buffered several frames, this is no good
for our use case where low latency is of ultimate importance. This patch
measures the swap interval, ensures the time is consumed and then calls
glFinish to ensure that there is no buffered data. The results on NVidia
hardware are exceptional, but will need verification on AMD hardware.

Polling logic has also been improved, the client will hunt for the best
delay rather then resorting to waiting on an event from the guest, avoiding
scheduler latency caused by waiting on the irq event.
2017-12-12 03:59:57 +11:00