Commit graph

1273 commits

Author SHA1 Message Date
Joshua Ashton
9a984234ba steamcompmgr: Avoid duplicate commits
Xwayland blits sometimes send us duplicate commits when strange things happen such as connector hotplugs.
2022-09-23 21:26:46 +01:00
Joshua Ashton
777fe39010 steamcompmgr: Be more lenient when failing flips
Replaces the abort here to be more lenient.

Some intense connector hotplugging could be occuring and the
connector could become destroyed before we had a chance to use it
as we hadn't reffed it in a commit yet.
2022-09-23 21:26:38 +01:00
Joshua Ashton
554a4af14d wlserver: Only update first xwayland server wlserver_set_output_info
Only [0] should get updated with any of this info.
Games do NOT need to see hotplug because they just crash... The Xrandr interface for crtc stuff is VERY broken with MST and our reconnect spam here.
2022-09-21 23:01:48 +00:00
Simon Ser
b1d928ab6f rendervulkan: fix inverted wlr_buffer_begin_data_ptr_access() check 2022-09-21 19:42:18 +02:00
Joshua Ashton
8608e017ec wlserver: Handle wl commits before X11 surface has come up
The inverse case of the pending surfaces...
2022-09-19 09:51:57 +01:00
Joshua Ashton
b305a97e9d drm: Don't re-zero connector CRTCs we already have zero-ed.
Fixes an issue where we would use an invalid connector because
the MST connector object got destroyed from our last CRTC set.

This avoids just using it again.
2022-09-16 06:06:50 +01:00
Joshua Ashton
4f62e5d18b wlserver: Avoid use after free of wlr surface data when wlserver_wl_surface_info is destroyed 2022-09-16 01:08:28 +00:00
Joshua Ashton
8562f4ee5a steamcompmgr: Workaround X11 bug for ASAN testing 2022-09-16 00:16:50 +00:00
Joshua Ashton
4754b17824 wlserver: Fix stale wlr pointer in x11_surface_info + fix mouse focus surface destruction
Stale pointers aaaa
2022-09-16 00:44:22 +01:00
Joshua Ashton
716552b7d6 wlserver: Fix crash in content_override_handle_surface_destroy
The x11 surface owned by the window can be destroyed, causing us to access a stale ptr.

Assume server 0 to delete the content override, because thats the only one it can be created on.

We should rev the protocol at some point with support for specifying the DISPLAY... ughghghghghghgh
2022-09-16 00:44:22 +01:00
Joshua Ashton
c8057afbc4 wlserver: Clear out x11_surface ptr when destroyed 2022-09-16 00:44:22 +01:00
Simon Ser
6237c3452b wlserver: explain why filter_global may need to handle NULL wlr_output
1. output plugged in, gamescope creates new wlr_output and sends a
   wl_registry.global event
2. client sees it, sends a wl_registry.bind request
3. output plugged out, gamescope sends a wl_registry.global_remove
   event and destroys the wlr_output
4. gamescope receives the wl_registry.bind request, but the wlr_output
   no longer exists
5. client receives the wl_registry.global_remove event
2022-09-15 08:05:41 +01:00
Joshua Ashton
7b51f5964d wlserver: Crappy workaround for rare filter_global crash... 2022-09-15 01:59:02 +00:00
Joshua Ashton
215a19b0e8 wlserver: Expose base wl_output to non-xwayland server clients 2022-09-15 01:53:51 +01:00
Ben Jackson
40cbcd87ef ime: Delay release of last keypress
More closely simulate a human pressing by holding the last (or only) key in
key pressed for 30ms before releasing. The key is released automatically
after the timer expires or just in time before a subsequent injected key.
2022-09-13 10:18:00 -07:00
Simon Ser
3303289afa ime: add move_{up,down} actions 2022-09-13 17:56:33 +01:00
Simon Ser
343e286308 build: bump wayland-server dep version
Wayland global filtering requires 1.21 to work properly with
globals which are created and destroyed on-the-fly.
2022-09-10 00:06:44 +00:00
Simon Ser
26bbb53de7 wlserver: create one wl_output global per Xwayland server
Closes: https://github.com/Plagman/gamescope/issues/571
2022-09-10 00:06:44 +00:00
Simon Ser
697818a228 wlserver: start all Xwayland processes in parallel
The next commit will need to inspect wlserver.wlr.xwayland_servers
to figure out which wl_output global to expose.
2022-09-10 00:06:44 +00:00
Joshua Ashton
ec1ce12f13 steamcompmgr: Add GAMESCOPE_DISPLAY_MODE_LIST_EXTERNAL and GAMESCOPE_DISPLAY_IS_EXTERNAL 2022-09-07 12:58:16 +00:00
Joshua Ashton
5ec3b7cffb drm, steamcompmgr: Add GAMESCOPE_DISPLAY_MODE_NUDGE 2022-09-07 11:36:44 +00:00
Joshua Ashton
0d171a7346 drm: Add support for a mode set file 2022-09-07 11:31:40 +00:00
Joshua Ashton
88e5980cd9 drm: Use PNP name for make if not in hwids 2022-09-07 12:14:37 +01:00
Joshua Ashton
1c7a2db86d steamcompmgr: Implement GAMESCOPE_DISPLAY_FORCE_INTERNAL 2022-09-07 11:11:09 +00:00
Joshua Ashton
5f610d8614 main: Fix build
Forgot to commit this :s
2022-09-07 11:06:04 +00:00
Joshua Ashton
f0f19b3499 steamcompmgr: Add basic infra for fifo relaxed 2022-09-07 10:47:44 +00:00
Joshua Ashton
440d0f1b53 steamcompmgr: Don't force base plane repaint for cursor movement 2022-09-07 10:40:32 +00:00
Joshua Ashton
6198e1be07 steamcompmgr: Don't tear if Steam Overlay is open
Looks bad
2022-09-06 17:01:22 +01:00
Joshua Ashton
21ce7baf0f steamcompmgr: Use presentation hints to determine whether to tear 2022-09-06 17:01:22 +01:00
Joshua Ashton
d9cab62e80 steamcompmgr: Store per-commit tearing state in commit_t 2022-09-06 17:01:22 +01:00
Joshua Ashton
55f764fa7f wlserver: Add wlserver_surface_is_async 2022-09-06 17:01:22 +01:00
Joshua Ashton
2e62575518 wlserver: Grab presentation hints 2022-09-06 17:01:22 +01:00
Joshua Ashton
6dde7bd8bc wlserver: Add wlserver_wl_surface_info
A stop gap before x11_surface_info which is held by steamcompmgr
2022-09-06 17:01:22 +01:00
Joshua Ashton
dad0939bed wlserver: Rename wlserver_surface to wlserver_x11_surface_info 2022-09-06 17:01:22 +01:00
Joshua Ashton
23ba26ce99 protocol: Add tearing control protocol 2022-09-06 17:01:22 +01:00
Joshua Ashton
733f2e2a17 wlserver: Make wlr_surface's data point to wlserver_surface
This used to point directly to gamescope_xwayland_server_t, but we can amke it pooint to wlserver_surface and get it from it's structure.
This lets us add more data.
2022-09-06 17:01:22 +01:00
Joshua Ashton
df908e691a main: Add --immediate-flips
Defaults g_bAsyncFlipsEnabled which is otherwise controlled by the atom, by Steam.
2022-09-06 17:01:22 +01:00
Joshua Ashton
a4ab1b0459 drm, steamcompmgr: Allow async flips if supported with GAMESCOPE_ALLOW_TEARING
Reworks some logic re. frame pacing and presentation to flip directly when an app asks when this is enabled.

The next step for us would be to make this respect whether the app has vsync enabled or not using the tearing protocol too.

This is a good starting point though.
2022-09-06 17:01:22 +01:00
Simon Ser
c40c8aa482 build: bump libdrm dep version
We use drmGetDeviceFromDevId() now.
2022-09-01 17:58:48 +02:00
Simon Ser
fc1fc35d5c Drop find_drm_node_by_devid()
Use drmGetDeviceFromDevId() instead.
2022-09-01 17:57:35 +02:00
Joshua Ashton
c5269642a2 build: fix ci 2022-08-23 23:18:58 +00:00
Ben Jackson
5f974de2eb ime: Don't reset to default keymap for actions (enter, etc) if ime keyboard in use 2022-08-23 16:06:26 -07:00
Joshua Ashton
6da2f90e51 Revert "wlserver: create one wl_output global per Xwayland server"
This reverts commit 5b7f70a9e5.
2022-08-23 20:40:10 +00:00
Joshua Ashton
8ef0922b02 steamcompmgr: Only account for LAYERED when CONTROLPARENT is also set
Fixes Street Fighter V (310950) splash always being overlayed

We should find more cases as we go along as well.
2022-08-23 14:48:01 +00:00
Joshua Ashton
c49cac3a00 drm: Blacklist 4096x2160 mode
This mode is required for certaiin certifications but is effectively useless and doesn't fit the actual screen size of displays. (Gets scaled down)
2022-08-22 23:56:13 +00:00
Simon Ser
608de1c19e Remove unused wlserver_movecursor() 2022-08-21 13:12:05 +02:00
Simon Ser
5b7f70a9e5 wlserver: create one wl_output global per Xwayland server
Closes: https://github.com/Plagman/gamescope/issues/571
2022-08-21 13:08:57 +02:00
Joshua Ashton
9aada10be3 drm: Split GAMESCOPE_COLOR_GAMMA_EXPONENT for EXTERNAL displays 2022-08-19 22:10:21 +00:00
Joshua Ashton
bbc240390c drm: Split GAMESCOPE_COLOR_MATRIX for EXTERNAL displays 2022-08-19 22:01:36 +00:00
Joshua Ashton
518c5042fd wlserver: Put accum mouse dx/dy on wlserver
Given we move that, store it there. Doesn't really matter though.
2022-08-19 21:28:38 +00:00