Commit graph

178 commits

Author SHA1 Message Date
Pierre-Loup A. Griffais
4dcacf3cc1 steamcompmgr: make cursor scaling more current, remove some cruft. 2020-01-20 01:58:39 -08:00
Pierre-Loup A. Griffais
d6ff686b64 nested: make Meta+f toggle fullscreen for the output window. 2020-01-20 01:45:43 -08:00
Pierre-Loup A. Griffais
188ea49e51 nested: let the output surface be resizeable
And let the SDL window be resizeable too.
2020-01-20 01:32:54 -08:00
Pierre-Loup A. Griffais
e5d888d56e Make README cool and add some usage examples. 2020-01-18 21:54:55 -08:00
Pierre-Loup A. Griffais
228c5e049c We needed our threads to block SIGUSR1, not ignore it.
It's a requirement of wlroots, since it uses it to get notified of
Xwayland readiness.

Having our threads use SIG_IGN would mean that they could still get
selected to get the signal and would just discard it, as opposed to
not being in the running at all. So the more threads we added, the
least chance we had of the notify function running consistently at
startup.

Now seems to consistently agree that XWayland is up every startup.
2020-01-18 21:08:37 -08:00
Pierre-Loup A. Griffais
3ca59feabd inputsdl: grab cursor when focused, send mouse input through X.
This more or less makes everything pretty playable.
2020-01-18 20:37:11 -08:00
Pierre-Loup A. Griffais
946b49c7a6 steamcompmgr: fix bug from 2013 with cursor hiding.
We don't want to unhide the cursor in the small period of time where we
don't have a foxued window.
2020-01-18 18:12:39 -08:00
Pierre-Loup A. Griffais
6481e1d777 rendervulkan: offset rendering a bit to avoid blurry text.
This isn't a perfect fix, see comment.
2020-01-18 17:35:23 -08:00
Pierre-Loup A. Griffais
303c702547 rendervulkan: it's 2020, surely GPUs understand integers by now?! 2020-01-18 17:24:56 -08:00
Pierre-Loup A. Griffais
7b2220003c Let it take a command to run in its DISPLAY after "--". 2020-01-18 17:14:49 -08:00
Pierre-Loup A. Griffais
90fa0770e8 nested: plumb some more output options.
Output window size, scaling filter, border.

TODO: make output dynamically resizeable, and some settings reloadable.
2020-01-18 16:05:19 -08:00
Pierre-Loup A. Griffais
19e2e511b6 sdlinput: nested keyboard support. 2020-01-18 15:10:14 -08:00
Pierre-Loup A. Griffais
b306714f3c drm: always set DRM_MODE_ATOMIC_ALLOW_MODESET for now.
That seems to make DC happier when we change the src and dst rects.
2020-01-18 03:40:51 +00:00
Pierre-Loup A. Griffais
bb52b60301 wlserver: some more basic tweaks for touch logic.
Add primitive hold-n-drag.
2020-01-17 03:27:55 -08:00
Pierre-Loup A. Griffais
3f51eb4d25 steamcompmgr: fix a bug where the cursor would only unhide if clicked
Ideally we'd get actual MotionNotify and redraw if needed, but probably
grabbed in this case. This was Shadowverse.
2020-01-17 02:45:43 -08:00
Pierre-Loup A. Griffais
56b2aa2d92 wlserver: wire kb+mouse+touch input coming from wlr, mainly libinput.
Add the concept of a cursor coordinate when that initializes when focusing
a surface.

Put some super primitive tap to left-click emulation in there for now.
2020-01-17 02:36:53 -08:00
Pierre-Loup A. Griffais
3eacb24d01 steamcompmgr: fix launchers/etc not displaying at first.
If a window already has a buffer attached by the time we figure out it
exists and sets its role, we missed the initial commit and will never
get it. For windows that animate interactively, that's fine, as we'll
get another one soon enough, but 2D apps like launchers repaint on
demand, so it's not fine there.
2020-01-17 00:45:21 +00:00
Pierre-Loup A. Griffais
bb945da160 steamcompmgr: Remove skipping all frames if no main plane.
If the base game is stuck before having rendered anything, we still want
to show overlay layers when they animate so the user can get out.

Let us composite and the empty texture should take care of it.
2020-01-15 22:58:22 -08:00
Pierre-Loup A. Griffais
ba4fbb3b30
Update README 2020-01-15 18:47:09 -08:00
Pierre-Loup A. Griffais
9b39124301
Update README 2020-01-15 18:46:36 -08:00
Pierre-Loup A. Griffais
c1c739a520
Update README 2020-01-15 18:46:10 -08:00
Pierre-Loup A. Griffais
3353b5845f
Update README 2020-01-15 18:40:53 -08:00
Pierre-Loup A. Griffais
dd6d0d5ad8 drm: drmModeAtomicCommit can return -ENOSPC, make non-fatal.
It's non-fatal, presumably we messed up source coordinates for that flip
but needs root-causing. Can happen in the very early loading of MGSV:TPP.

Fix a bug with the new flip lock where non-fatal flip errors would hang.
2020-01-15 18:31:05 -08:00
Pierre-Loup A. Griffais
c0a793e290 wlserver: handle EINTR in the main loop epoll.
Fixes the server going away when we need it most, or when attaching GDB.
2020-01-15 17:48:20 -08:00
Pierre-Loup A. Griffais
1b0f273f21 steamcompmgr: flush output to startup pipe with a newline. 2020-01-15 15:38:21 -08:00
Pierre-Loup A. Griffais
bdbdabe19b steamcompmgr: add option to send DISPLAY back to invoker.
So the session script can read it back and know when gamescope is ready.
2020-01-14 23:51:22 -08:00
Pierre-Loup A. Griffais
e1c4298d2a Rename project and executable to gamescope.
We're a superset of steamcompmgr now, but have a wider scope, so new
name to reflect it.
2020-01-14 17:35:36 -08:00
Pierre-Loup A. Griffais
83ccb4d74d composite.hlsl: This seems a bit faster on Raven? 2020-01-13 22:42:12 -08:00
Pierre-Loup A. Griffais
901103af3f wlserver: anti-fd exhaustion measures.
If we only take the first commit, we leave a bunch in the queue, which
makes us that much more likely to run out of FDs when importing the
myriad of buffer referenced coming from a non-vsynced client. Fixes
crashes with vblank_mode=0 glxgears after the recent changes.

We were always subject to such crashes, just getting lucky/fast before.
2020-01-13 22:09:55 -08:00
Pierre-Loup A. Griffais
fb49601138 steamcompmgr: use next wayland buffer.
Not last. Prevents non-vsynced clients from getting too far ahead.
2020-01-13 21:14:02 -08:00
Pierre-Loup A. Griffais
94ecdfdc6e drm: more logging. 2020-01-13 20:57:39 -08:00
Pierre-Loup A. Griffais
1a1fa8629f drm: workaround for flip failures launching The Witcher 3.
Tries to flip a 1x1 surface, apparently amdgpu doesn't like it

In a liftoff future it would surely detect that and let us know.
2020-01-13 20:19:17 -08:00
Pierre-Loup A. Griffais
8827ea367e drm: re-add non-liftoff path, with logging. 2020-01-13 20:18:28 -08:00
Pierre-Loup A. Griffais
3a17f3eed7 steamcompmgr: small fixes to not fix damage until we really painted. 2020-01-13 18:53:29 -08:00
Pierre-Loup A. Griffais
e637bdad10 steamcompmgr: gpuvis frame cadence debugging.
Now that things are generally more stable, let's take a look.
2020-01-13 18:45:53 -08:00
Pierre-Loup A. Griffais
c77df96523 rendervulkan: always write all layers in the descriptor.
Use an empty dummy texture for unbound slots, as the driver can't know
what the shader will sample from.

Also remove any sort of implicit attempts at compaction of slots.
2020-01-09 02:34:54 +00:00
Pierre-Loup A. Griffais
807b24f731 steamcompmgr: Added a debug option to always composite.
This way we never flip anything but our own buffers, to facilitate bug
isolation.
2020-01-08 02:40:14 +00:00
Pierre-Loup A. Griffais
6efedbb587 DRM: Protect ourselves against a race condition in flip accounting.
The flip handler could try to deref before we had added the refs.
2020-01-08 01:38:36 +00:00
Pierre-Loup A. Griffais
2092afd078 steamcompmgr: we weren't hiding the Steam window anymore.
Also fix the mouse focus edge condition to actually be correct.
2020-01-07 23:39:24 +00:00
Pierre-Loup A. Griffais
5598fcfa57 steamcompmgr: Handle early WL_SURFACE_ID notification.
Untested for now as it only happens when we lose a race, leaving a
printout to confirm if it worked in the wild later.
2020-01-07 19:50:34 +00:00
Pierre-Loup A. Griffais
94c4c05e40 Reconcile new cursor DRM code and nested path. 2020-01-06 20:16:27 -08:00
Pierre-Loup A. Griffais
4d6602ba4b DRM: Make liftoff layers conditional for now.
Can't get them to be useful, might need library and amdgpu DC fixes.
2020-01-06 19:36:20 -08:00
Pierre-Loup A. Griffais
6b3e2ddf68 DRM: multi-plane support via libliftoff.
Import libliftoff as subproject and plumb our planes through it.

Wait for a flip to complete immediately after queuing it for now.

Also immediately wait for cursor image uploads, as we don't have to
do Vulkan rendering anymore after queuing an upload.

Cursor shows up with format hack, but is badly corrupt. We might need
to use a DRM dumb_fb rather than going through the same Vulkan image.

Alpha bits of surfaces are ignored again, need to make Steam select
an ARGB visual for overlay windows, probably.

Setting up the "alpha" plane property somehow makes overlays not
show up at all despite liftoff happily letting us go with scanout.
2020-01-05 22:19:04 -08:00
Pierre-Loup A. Griffais
a8d96fb227 steamcompmgr: let's go with -e instead, for embedded.
As opposed to nested.
2020-01-05 22:19:03 -08:00
Pierre-Loup A. Griffais
d5e90511d5 rendervulkan: Fix corruption at the bottom of the compute path.
Thread group size doesn't have to be aligned with image dimensions, as
is the case with 16x16 on a 1920x1080 output.
2020-01-05 19:01:44 -08:00
Pierre-Loup A. Griffais
0565c32a55 steamcompmgr: Don't composite the cursor when it's empty. 2020-01-05 18:10:15 -08:00
Pierre-Loup A. Griffais
c4321e54b2 rendervulkan: Some attempted fixes, in vain.
Only set implicit_sync on in-bound buffers, we'll sync our scanout image
ourselves by exporting the fence and passing to DRM, and flushing.

The fence export actually fails, so leave it commented our for now.

Flushing also doesn't do anything, the bottom of our scanout image is still
corrupt when scanning out to DRM.
2020-01-05 17:56:59 -08:00
Pierre-Loup A. Griffais
db94055511 Fix DRM output, initializing SDL apparently breaks it.
We don't want SDL input in the non-nested case at any rate.
2020-01-05 04:45:45 -08:00
Pierre-Loup A. Griffais
83683d270c steamcompmgr: Add command-line argument for relying on Steam GameIDs.
So we can easily test single-app scenarios by generating placeholder
ones. Will also make it more robust by using Xres1.2, which should
remove the need for Alkazar's patch for Dead Cells and other apps that
don't get tagged right by the current overlay.
2020-01-04 19:37:04 -08:00
Pierre-Loup A. Griffais
97aac0bbf9 Add some code to detect if the cursor becomes fully hidden.
That should come in handy for auto-grabbing in the nested case.
2020-01-04 19:19:54 -08:00