Commit graph

1419 commits

Author SHA1 Message Date
Joshua Ashton
5fd65fd5f5 steamcompmgr: Implement --cursor-scale-height 2023-01-16 05:03:08 +00:00
Joshua Ashton
4668680555 steamcompmgr: Initial groundwork for cursor scale 2023-01-16 05:03:08 +00:00
Alex Maese
81a32b85fb Add support for grabbing the keyboard 2023-01-15 23:34:17 +00:00
Joshua Ashton
eff0ac001e wlserver: Add some locking assertions 2023-01-12 17:56:06 +00:00
Joshua Ashton
4281cea0e4 sdlwindow: Add missing lock around wlserver_touchmotion
Closes: #745
2023-01-12 17:46:28 +00:00
Joshua Ashton
bf61af1f82 ime: Fix local_ime segfault
Error in rebasing
2023-01-12 15:07:12 +00:00
Joshua Ashton
c2e9b5f50f sdlwindow: Use fake timestamp instead of passing thru
Fixes Wayland value too large errors.
2023-01-12 01:40:03 +00:00
Joshua Ashton
2d7ec208c4 sdlwindow: Forward cursor in absolute mode to host compositor 2023-01-12 01:29:25 +00:00
Joshua Ashton
86ff9cfc58 main: Fix compilation 2023-01-12 00:55:02 +00:00
Joshua Ashton
054458fdaf sdlwindow: Default to non-relative mouse when a cursor image exists
Add --force-grab-cursor to keep old behaviour
2023-01-12 00:52:38 +00:00
Joshua Ashton
f8e66bf4fb sdlwindow: Refactor user events
Allows us to have more user events, and submit them nicely instead of ugly derping into one big user event.
2023-01-12 00:33:21 +00:00
Joshua Ashton
d3424703a8 steamcompmgr: Load host cursor by default in nested 2023-01-12 00:17:20 +00:00
Joshua Ashton
b124200e36 steamcompmgr: Default to left_ptr from cursor font
Avoids having ugly X cursor by default.

Based in part on #280.
2023-01-12 00:11:04 +00:00
Joshua Ashton
f2a4533cce steamcompmgr: Avoid leaking title in get_win_title 2023-01-11 22:43:19 +00:00
Joshua Ashton
cae9b3efb7 vr: Fix usage of HAVE_OPENVR macro 2023-01-11 21:20:24 +00:00
Joshua Ashton
33f1103155 vr_session: Add Steam UI integration 2023-01-11 21:20:24 +00:00
Joshua Ashton
48d726c72b steamcompmgr: Make get_appid_from_pid more robust
Was some undefined value ptrs going on here, and not checking if the PID stat opened successfully.
2023-01-11 21:20:24 +00:00
Joshua Ashton
f4f0239b31 vr_session: Initial implementation 2023-01-11 21:20:24 +00:00
Joshua Ashton
b0f2b7e89f ime: Add support for local IMEs 2023-01-11 21:20:24 +00:00
Joshua Ashton
1c186cd286 ime: Fix warnings on newer compilers
Should unbreak CI.
2023-01-11 19:19:03 +00:00
Joshua Ashton
201d5feb39 steamcompmgr: Add --force-windows-fullscreen
Useful for browsers or nested desktop environments.

Also adds GAMESCOPE_FORCE_WINDOWS_FULLSCREEN atom per-xwayland.
2023-01-11 19:14:12 +00:00
Joshua Ashton
041ee8dcd8 drm: Simplify some hdr_output_metadata logic 2023-01-11 00:22:47 +00:00
Joshua Ashton
a9541332b7 drm: Set Colorspace+HDR_OUTPUT_METADATA on non-modeset path too 2023-01-11 00:21:58 +00:00
Joshua Ashton
d19872963e steamcompmgr: Support Xwayland resizing in nested 2023-01-07 10:09:46 +00:00
Joshua Ashton
10ca15cc1c steamcompmgr: Handle commit size != window size for layer 2023-01-07 10:02:45 +00:00
Joshua Ashton
5054054768 drm, steamcompmgr: Implement 3DLUT + SHAPERLUT support 2023-01-06 15:54:31 +00:00
Joshua Ashton
dc6d755ada drm: Use 'contains' on map to simplify property code
May as well use C++20 for everything now we need it for the
layer.
2023-01-06 15:25:04 +00:00
Joshua Ashton
67d79cfee7 steamcompmgr: Always composite when debug heatmap is enabled. 2023-01-06 14:21:50 +00:00
Joshua Ashton
d2c14e78b7 steamcompmgr: Fix GAMESCOPE_DEBUG_HDR_HEATMAP 2023-01-06 14:21:50 +00:00
Joaquín Ignacio Aramendía
45c9ffd088
steamcompmgr: add basic handling of system() ffmpeg call 2023-01-05 12:11:42 +01:00
Joshua Ashton
054dcec856 steamcompmgr: Replicate gamescopeHDROutputFeedback to other servers properly 2023-01-05 06:26:33 +00:00
Joshua Ashton
a1bff9fc70 shaders: Fix primaries for scRGB content
Need to go from 709 -> 2020.
2023-01-04 08:40:46 +00:00
Joshua Ashton
da33453174 steamcompmgr: Add GAMESCOPE_HDR_SDR_CONTENT_BRIGHTNESS atom 2023-01-03 14:53:00 +00:00
Joshua Ashton
7251fdd878 shaders: Improved heatmap code frol Lilium 2023-01-03 14:03:06 +00:00
Joshua Ashton
d1fd41fd5b rendervulkan: Apply tonemapping to HDR content on SDR outputs
Also add a debug flag for Reinhard.
2023-01-03 14:02:54 +00:00
Joshua Ashton
905376f036 steamcompmgr: Add GAMESCOPE_DEBUG_HDR_HEATMAP 2023-01-03 12:43:38 +00:00
Joshua Ashton
0c3653d159 color_helpers: Handle naughty clients/EDIDs with more grace
Avoid asserting and simply clamping to deal with broken EDIDs like
on LG OLED panels for now.
2023-01-03 12:14:32 +00:00
Joshua Ashton
d2cc74c570 main: Add heatmap debug to help 2023-01-03 06:00:39 +00:00
Joshua Ashton
eb29ba4af5 main: Add hdr-sdr-content-nits argument 2023-01-02 04:04:15 +00:00
Jan Beich
50d5ea83b6 steamcompmgr: reap children like Linux on some BSDs
DragonFly and FreeBSD adopted a similar API to Linux. Other sytems
maybe interested as well, so add a warning.

src/steamcompmgr.cpp:51:10: fatal error: 'sys/prctl.h' file not found
 #include <sys/prctl.h>
         ^~~~~~~~~~~~~
src/steamcompmgr.cpp:3118:9: error: use of undeclared identifier 'PR_SET_CHILD_SUBREAPER'
        prctl( PR_SET_CHILD_SUBREAPER, 1, 0, 0, 0 );
               ^
2023-01-01 19:40:07 +00:00
Jan Beich
241df252fd main: don't renice as non-root on non-Linux
On BSD systems only the super-user may lower priority values.

meson.build:40:0: ERROR: Dependency "libcap" not found, tried pkgconfig and cmake

src/main.cpp:7:10: fatal error: 'sys/capability.h' file not found
 #include <sys/capability.h>
          ^~~~~~~~~~~~~~~~~~
src/main.cpp:244:2: error: unknown type name 'cap_t'
        cap_t caps = cap_get_proc();
        ^
src/main.cpp:244:15: error: use of undeclared identifier 'cap_get_proc'
        cap_t caps = cap_get_proc();
                     ^
src/main.cpp:247:3: error: unknown type name 'cap_flag_value_t'
                cap_flag_value_t nicecapvalue = CAP_CLEAR;
                ^
src/main.cpp:247:35: error: use of undeclared identifier 'CAP_CLEAR'
                cap_flag_value_t nicecapvalue = CAP_CLEAR;
                                                ^
src/main.cpp:248:23: error: use of undeclared identifier 'CAP_SYS_NICE'
                cap_get_flag( caps, CAP_SYS_NICE, CAP_EFFECTIVE, &nicecapvalue );
                                    ^
src/main.cpp:248:37: error: use of undeclared identifier 'CAP_EFFECTIVE'
                cap_get_flag( caps, CAP_SYS_NICE, CAP_EFFECTIVE, &nicecapvalue );
                                                  ^
src/main.cpp:250:24: error: use of undeclared identifier 'CAP_SET'
                if ( nicecapvalue == CAP_SET )
                                     ^
2023-01-01 19:40:07 +00:00
Joshua Ashton
ba467640a8 shaders: Fix output scaling of heatmap 2022-12-31 10:53:12 +00:00
Joshua Ashton
5b805dda00 rendervulkan: Framework for configurable SDR on HDR content brightness 2022-12-31 10:39:41 +00:00
Joshua Ashton
1fea04e073 steamcompmgr: Fix cached value of ST2084 support 2022-12-31 09:59:18 +00:00
Joshua Ashton
8f0008e3a6 rendervulkan: Add Lilium's HDR heatmap 2022-12-30 03:21:55 +00:00
Joshua Ashton
31c94f8869 rendervulkan: Add HDR heatmap debug + way to force support but not PQ output 2022-12-30 03:21:55 +00:00
Joshua Ashton
c25a368193 rendervulkan: Turn composite debug into flags rather than bool 2022-12-30 03:21:55 +00:00
Joshua Ashton
269bbc8444 rendervulkan: Expose 16161616_UNORM format for surfaces 2022-12-30 03:21:55 +00:00
Joshua Ashton
6bc6a85d6d build: Add options for building layer/executable 2022-12-30 03:21:55 +00:00
Joshua Ashton
a4f30a87ff layer: Only expose HDR formats when gamescope HDR output is enabled and it isn't blacklisted for this app 2022-12-30 03:21:55 +00:00
Joshua Ashton
acf76d6cff steamcompmgr: Add GAMESCOPE_HDR_OUTPUT_FEEDBACK
Exposes whether HDR output is currently enabled.
2022-12-30 03:21:55 +00:00
Joshua Ashton
418a84dfb7 steamcompmgr, rendervulkan: Add force wide gammut option 2022-12-30 03:21:55 +00:00
Joshua Ashton
06c7c3efff drm: Respect connector HDR capabilities 2022-12-30 03:21:55 +00:00
Joshua Ashton
0d86168480 drm: Respect app's HDR metadata 2022-12-30 03:21:55 +00:00
Joshua Ashton
70b74e73be drm: Hook up Colorspace and HDR_OUTPUT_METADATA 2022-12-30 03:21:55 +00:00
Joshua Ashton
b5bb169889 drm, rendervulkan: Hook up composite ST2084 output 2022-12-30 03:21:55 +00:00
Joshua Ashton
24a7c40c47 steamcompmgr, main: Add hdr atoms + startup options 2022-12-30 03:21:55 +00:00
Joshua Ashton
22806541e2 drm: Parse out HDR/colorimetry metadata from EDID 2022-12-30 03:21:55 +00:00
Joshua Ashton
7fffcc813c protocol, wlserver: Add override_window_content2 2022-12-30 03:21:55 +00:00
Joshua Ashton
87b75026f8 protocol: Add set_hdr_metadata to gamescope_xwayland 2022-12-30 03:21:55 +00:00
Joshua Ashton
b83516ed4e rendervulkan: Expose R8G8B8A8 surfaces 2022-12-30 03:21:55 +00:00
Joshua Ashton
a1d5c0583d shaders: Convert primaries for non-HDR10PQ formats when outputting to HDR10PQ 2022-12-30 03:21:55 +00:00
Joshua Ashton
47069426f7 rendervulkan: Handle manual sRGB->Linear for formats without SRGB views
We need these for 1010102 formats.
2022-12-30 03:21:55 +00:00
Joshua Ashton
c2665304c3 rendervulkan: Hook up colorspace mask 2022-12-30 03:21:55 +00:00
Joshua Ashton
49a6c0f451 wlserver, steamcompmgr: Track swapchain feedback per-commit 2022-12-30 03:21:55 +00:00
Joshua Ashton
31e9e4b345 wlserver: Use swapchain feedback for tearing 2022-12-30 03:21:55 +00:00
Joshua Ashton
2aa4791ba0 layer, wlserver: Implement swapchain feedback 2022-12-30 03:21:55 +00:00
Joshua Ashton
49aeaf31b8 rendervulkan, shaders: Support PQ+scRGB colorspaces + HDR10 output 2022-12-30 03:21:55 +00:00
Joshua Ashton
d3aa886373 shaders: Add colorimetry helpers 2022-12-30 03:21:55 +00:00
Joshua Ashton
7009ff4a9a rendervulkan: Expose 16161616F format
For scRGB.
2022-12-30 03:21:55 +00:00
Joshua Ashton
a162024467 rendervulkan: Expose 1010102 formats 2022-12-30 03:21:55 +00:00
Benjamin Cheng
67a908584d sdlwindow: request HiDPI window
If we ask for a HiDPI SDL window on Wayland, we can output
higher-resolution buffers to support the HiDPI case.

Closes: #551
2022-12-28 06:22:12 +00:00
Joshua Ashton
10e4c8d1e7 main: Force disable AMDVLK switchable graphics layer
This layer sucks butts and has done nothing but cause constant problems to me for the past 2 years.

Goodbye!

Closes: #725
2022-12-27 18:28:27 +00:00
Joshua Ashton
f863708a1f steamcompmgr: Disable NV12 screenshot hack
Closes: #716
2022-12-21 11:42:09 +00:00
Simon Ser
9f3e152d13 Wait for POLLIN instead of POLLOUT
POLLIN waits for the buffer to be ready for reading, POLLOUT waits
for writing.

In gamescope we're reading client buffers, so we need to use POLLIN.

We were using POLLOUT to workaround an amdgpu bug, but that got
fixed in kernel 5.15, so shouldn't be necessary anymore.
2022-12-20 10:12:52 +00:00
Simon Ser
bdd08a7b44 rendervulkan: print DRM format name 2022-12-09 13:32:18 +01:00
Joshua Ashton
7aef264dfc wlserver: Fix crash on Steam startup sometimes
Don't leave the pending surface list entry on the x11_surface_info in a bad state when it's only destroyed on the wayland side.
2022-12-07 18:47:54 +00:00
Sam Lantinga
d5ea069dc3
Merge pull request #701 from slouken/master
Fixed NV12 format negotiation
2022-12-06 15:38:29 -08:00
Sam Lantinga
2d885378fd Fixed stride calculation for NV12 pipewire stream 2022-12-06 10:39:06 -08:00
Sam Lantinga
5038f50f10 Make sure we don't set the pipewire state to running if there was an error during startup 2022-12-06 10:37:55 -08:00
Joshua Ashton
c0cb4c336c steamcompmgr, drm: Add GAMESCOPE_DISPLAY_EDID_PATH atom 2022-12-06 01:25:38 +00:00
Joshua Ashton
dff1b3f390 wlserver: Allow late binding of content overrides 2022-12-06 01:25:38 +00:00
Joshua Ashton
d394ae402f wlserver: Rename wlr in wlserver_x11_surface_info to main_surface 2022-12-06 01:25:38 +00:00
Joshua Ashton
eec3517fde wlserver: Move commit handler to wl_surface_info 2022-12-06 01:25:38 +00:00
llyyr
212638e9d0 wlserver: fix pointer scroll in nested mode 2022-12-05 11:56:53 +01:00
Simon Ser
5a9bf10c81 drm: make g_drmEffectiveOrientation atomic
It's accessed from multiple threads.
2022-11-29 11:19:05 +01:00
Simon Ser
3f03b0c392 drm: fix enum mixup in g_drmEffectiveOrientation 2022-11-29 11:15:48 +01:00
Simon Ser
bb67298e95 wlserver: stop using surface role
Instead use a regular commit listener.

Fixes the following error:

    (EE)
    Fatal server error:
    (EE) [destroyed object]: error -1: surface was destroyed before its role object
    (EE)
2022-11-29 11:09:09 +01:00
Joshua Ashton
48ba04f7f8 steamcompmgr: Bump down focus priority of disabled windows 2022-11-26 06:44:24 +00:00
Jason Aunkst
b7b41a7bf2 fix issue with sdl touch_ids being out of range 2022-11-25 21:21:58 +01:00
Jason Aunkst
fc71041c3e fix issue with sdl touch_ids being out of range 2022-11-25 21:21:58 +01:00
Simon Ser
be5e7d23e4 wlserver: fix missing commit events
Set role_data to a non-NULL pointer. A NULL pointer indicates to
wlroots that the role is destroyed, and wlroots skips invoking the
commit handler in that case.
2022-11-25 21:18:11 +01:00
Simon Ser
f4a33bd37e build: use hwdata's pkg-config file
Ensures the system has the proper dependency, and avoids hardcoding
the path.
2022-11-24 19:58:38 +01:00
Joshua Ashton
91fbb22bda wlserver, ime: Port to wlroots 0.16.0
Co-authored-by: Simon Ser <contact@emersion.fr>
2022-11-24 19:56:17 +01:00
Joshua Ashton
4f422b7492 rendervulkan: Default to bt601 limited for mtx stuff 2022-11-22 01:19:07 +00:00
Joshua Ashton
a5a6d511d2 pipewire: Hook up colorspaces 2022-11-22 01:15:30 +00:00
Joshua Ashton
0e4d6b17f8 rendervulkan: Add stream colorspace property to CVulkanTexture 2022-11-22 01:13:47 +00:00
Joshua Ashton
0b8c53dcbd rendervulkan: Add vulkan_acquire_screenshot_texture DRMFormat param 2022-11-22 01:08:35 +00:00
Joshua Ashton
b3205caec4 rendervulkan: Fix srgb-ness + use color space matrix for rgb to NV12 pass 2022-11-22 01:02:12 +00:00
Joshua Ashton
d85d0a1525 pipewire: Remove format assertion
No longer true
2022-11-22 00:07:08 +00:00
Joshua Ashton
8755aa0523 rendervulkan: Fix RGB blit path for screenshot textures 2022-11-21 23:52:58 +00:00
Joshua Ashton
57cba0107a pipewire: NV12 path for pipewire 2022-11-21 22:12:34 +00:00
Joshua Ashton
aeffc39ab0 rendervulkan: Make mappedData() return a uint8_t 2022-11-21 21:08:23 +00:00
Joshua Ashton
f7a23ef808 rendervulkan: Add lumaPitch/chromaPitch to CVulkanTexture 2022-11-21 21:06:50 +00:00
Joshua Ashton
b5b1589d45 drm: Add some nullptr checks for drm->connector 2022-11-20 20:26:58 +00:00
Georg Lehmann
ed48ef3b05 rendervulkan: Fix a typo
How did I not see this before 🐸.
2022-11-19 17:46:19 +01:00
Georg Lehmann
a038985ee4 rendervulkan: Update push sizes. 2022-11-19 16:14:08 +00:00
Joshua Ashton
50d385d326 rendervulkan: Introduce CaptureConvertBlitData_t
Stores the half-extent for the NV12 blit
2022-11-19 00:46:21 +00:00
Joshua Ashton
98220bdf3f steamcompmgr: Fix build
Typo before committing >.>
2022-11-19 00:45:28 +00:00
Joshua Ashton
30519fd9ec rendervulkan: Add NV12 capture blit infra
Performs blit + rgb -> nv12 in one.
2022-11-19 00:39:05 +00:00
Joshua Ashton
dba8480d18 main: Set GamescopeUpscaleFilter::LINEAR to 0 2022-11-15 20:01:51 +00:00
Joshua Ashton
2791466692 wlserver: Handle default in apply_touchscreen_orientation
We use this for VR now!
2022-11-10 04:34:17 +00:00
Joshua Ashton
c10eb7dcd7 rendervulkan: Eliminate blur radius spec constant 2022-11-10 04:34:11 +00:00
Joshua Ashton
c61db3c49c rendervulkan: Limit number of pre-compiled ycbcr masks 2022-11-10 04:33:49 +00:00
Joshua Ashton
989806791f main: Add --adaptive-sync commandline arg
Enables VRR if the display is capable if this flag is set.

Closes: #199
2022-11-08 03:14:24 +00:00
Simon Ser
f374689a4e drm: use drmModeConnectorGetPossibleCrtcs
This function has been upstreamed in libdrm.
2022-11-04 12:48:18 +01:00
Simon Ser
7b5a338e7e drm: remove connector type table
We can just rely on libdrm instead.
2022-11-04 12:48:18 +01:00
Georg Lehmann
5ef7d0cb66 rendervulkan: Enable VK_KHR_swapchain_mutable_format when nessecary. 2022-11-03 20:36:02 +00:00
Georg Lehmann
c1fd2d7f7a rendervulkan: Fix validation errors for linear swapchain view.
VK_FORMAT_B8G8R8A8_SRGB doesn't support STORAGE usage.
Otherwise we hit asserts in mesa.
2022-11-03 20:36:02 +00:00
Joshua Ashton
a7f8b26833 wlserver: Add thread name to wlserver 2022-10-31 01:35:31 +00:00
Joshua Ashton
7f9a685515 sdlwindow: Add thread name to sdlwindow input thread 2022-10-31 01:35:27 +00:00
Joshua Ashton
f65092a441 rendervulkan: Add thread name to shader compile 2022-10-31 01:35:18 +00:00
Sam Lantinga
f072cbd58b gamescope: Implemented scaling support for pipeware capture
Co-authored-by: Joshua Ashton <joshua@froggi.es>
2022-10-28 03:35:55 +01:00
Sam Lantinga
fbceed2ab5 pipewire: Add metadata to note how the capture image was scaled 2022-10-28 03:34:31 +01:00
Sam Lantinga
a316418c89 pipwire: Added protocol requesting scaling on the pipewire capture
The capture texture will scaled to fit the requested capture size while
maintaining correct aspect ratio. The actual scaling will be implemented
in a separate commit.
2022-10-28 03:34:00 +01:00
Joshua Ashton
c20e14ee74 steamcompmgr: Force Steam to use FIT + LINEAR 2022-10-28 02:57:00 +01:00
Joshua Ashton
62775c765b steamcompmgr: Account for globalScaleRatio for STRETCH 2022-10-28 02:25:37 +01:00
Joshua Ashton
a7203603fe steamcompmgr: Add STRETCH scaling mode 2022-10-28 02:20:19 +01:00
Joshua Ashton
f302a23069 steamcompmgr: Add FILL upscaler 2022-10-28 02:18:11 +01:00
Joshua Ashton
9b86a797a8 steamcompmgr: Refactor out to calc_scale_factor helper 2022-10-28 02:17:01 +01:00
Joshua Ashton
f5f0fc8c24 steamcompmgr: Rename SMART_FIT to AUTO 2022-10-28 02:02:29 +01:00
Joshua Ashton
c9c0044250 steamcompmgr: Add regular FIT as an option 2022-10-28 02:02:06 +01:00
Joshua Ashton
4a4178075e steamcompmgr: Refactor scaling
Split out scalers and scaling filters.
2022-10-28 02:01:15 +01:00
Eric Sullivan
2f95c0fa5d nis: Update to v1.0.3
The docs, and samples directories have been removed along with the third_party_licenses.txt file.

Source downloaded from: https://github.com/NVIDIAGameWorks/NVIDIAImageScaling/archive/refs/tags/v1.0.3.tar.gz
2022-10-22 00:11:13 +01:00
Joshua Ashton
677e3b6624 vblankmanager: Fix build 2022-10-19 18:59:09 +01:00
Joshua Ashton
ec6bd30bb6 drm, steamcompmgr: Support for VRR
Exposes GAMESCOPE_VRR_ENABLED, GAMESCOPE_VRR_CAPABLE and GAMESCOPE_VRR_FEEDBACK
2022-10-19 18:57:14 +01:00
Joshua Ashton
4e748ba1e5 main: Set XDG_CURRENT_DESKTOP to gamescope
A proper session will already do this from eg. SDDM, but when running nested, we want this to still be present.
2022-10-19 15:41:04 +01:00
Joshua Ashton
98d61844d8 main: Reset XDG_SESSION_TYPE to x11
We don't support Wayland clients, so let's convince any child apps that are launched that we are just X11.

Fixes QT apps misbehaving.
2022-10-19 15:40:20 +01:00
Simon Ser
0626c7c8f8 Add note that --force-orientation is for internal display only 2022-10-17 13:26:26 +02:00
Simon Ser
45061ad3e3 drm: drop trailing whitespace 2022-10-13 15:50:41 +02:00
Simon Ser
14f0b78f61 drm: cleanup orientation code 2022-10-13 15:49:23 +02:00
ruineka
12bff31008
drm: fix an issue where g_nOutputWidth and g_nOutputHeight weren't updated 2022-10-13 15:43:47 +02:00
Simon Ser
f51b7229ae drm: de-duplicate connector type logic 2022-10-11 19:05:44 +02:00
ruineka
cf89b2fbae
drm: add support for the panel orientation property 2022-10-11 18:20:14 +02:00
ruineka
647e1d96d0
Add --force-orientation option
Co-authored-by: Joaquín Ignacio Aramendía <samsagax@gmail.com>
Co-authored-by: alphonsez1 <alphonsez743@gmail.com>
Co-authored-by: Ruineka <ruineka@pop-os.localdomain>
2022-10-07 15:29:52 +02:00
Joshua Ashton
b87660561f drm: Fix respecting custom mode refresh rates
This was being overwritten by some dynamic refresh code.
2022-10-01 21:10:34 -02:30
Joshua Ashton
20062ec645 steamcompmgr: Add GAMESCOPE_STEAM_MAX_HEIGHT
0 to disable, any other value sets the max height of Steam
2022-10-01 20:33:37 -02:30
Simon Ser
79ad108c41 wlserver: fix output global not exposed
Fixes: 7c0f65e62d ("wlserver: stop re-creating wl_output global")
2022-10-01 19:11:52 +02:00
Simon Ser
870d54c54e Force repaint on SDL_WINDOWEVENT_EXPOSED
Co-authored-by: Bad Sector <badsector@runtimeterror.com>
2022-10-01 18:42:44 +02:00
Simon Ser
7c0f65e62d wlserver: stop re-creating wl_output global 2022-09-27 19:03:00 +01:00
Simon Ser
576041c2b3 wlserver: remove trailing whitespace 2022-09-27 19:38:29 +02:00
Joshua Ashton
7f2db65c00 steamcompmgr: Add GAMESCOPE_CURSOR_VISIBLE_FEEDBACK 2022-09-23 20:44:51 +00:00
Joshua Ashton
122ba3dda9 steamcompmgr: Undirty cursor when resolving empty state
Otherwise we read this back every single paint, which is bruh.
2022-09-23 20:40:14 +00:00
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
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
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
fc1fc35d5c Drop find_drm_node_by_devid()
Use drmGetDeviceFromDevId() instead.
2022-09-01 17:57:35 +02: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
Joshua Ashton
bf3093bc2c wlserver: Fix relative mouse movements
Do the same thing as SDL2
2022-08-19 21:18:18 +00:00