Commit graph

1275 commits

Author SHA1 Message Date
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
Joshua Ashton
cb59480be0 drm: Add backdoor to disable liftoff caching for debugging 2022-08-17 02:01:46 +00:00
Joshua Ashton
3cda5e8f2e steamcompmgr: Add more blurb to WS_EX_LAYERED 2022-08-17 00:17:06 +00:00
Joshua Ashton
d5eb6667a9 steamcompmgr: Handle LAYERED win32 windows
The Launcher in Witcher 2 (20920) has a clear window with WS_EX_LAYERED on top of it.

Layered windows are windows that are meant to be transparent
with alpha blending + visual fx.
https://docs.microsoft.com/en-us/windows/win32/winmsg/window-features
2022-08-17 00:12:17 +00:00
Joshua Ashton
910ae1b3c7 steamcompmgr: Parse Windows styles/stylesex 2022-08-17 00:08:10 +00:00
Joshua Ashton
f32e8637b7 steamcompmgr, rendervulkan: Add GAMESCOPE_COMPOSITE_FORCE and GAMESCOPE_COMPOSITE_DEBUG for debugging 2022-08-16 23:39:13 +00:00
Joshua Ashton
c3d6959669 steamcompmgr: Add workaround for Antichamber
Has a splash screen that ends up being treat as a dropdown.

Workaround this until we hook up the Proton window style deduction.
2022-08-16 23:21:33 +00:00
Joshua Ashton
a8592be47d vblankmanager: Push back drawtime if we are compositing
Avoids getting into a feedback loop with clocks when we need to composite.

Fixes stutter when using FSR on Steam Deck.
2022-08-16 23:13:56 +00:00
Joshua Ashton
092aef1f95 drm: Cache composition results from liftoff 2022-08-16 23:55:23 +01:00
hexchain
db99b92e2b Reformat the help text 2022-08-16 09:43:57 +02:00
Joshua Ashton
65d97cb152 steamcompmgr: Don't skip taskbar+pager windows if they are fullscreen
Fixes fullscreen in Batman: Arkham City GOTY (200260)
2022-08-11 12:48:13 +00:00
Joshua Ashton
60513c0925 drm: Unset COLOR_RANGE and COLOR_ENCODING if not YCbCr or unbound 2022-08-11 08:46:24 +02:00
Joshua Ashton
e2bc5d4c71 rendervulkan: Add isYcbcr helper for layers 2022-08-11 08:46:24 +02:00
Simon Ser
6371958e1a drm: log when connectors appear/disappear 2022-07-29 10:44:29 +02:00
Simon Ser
2e03b8fb6b drm: always parse EDID on hotplug uevent
Don't parse it only when we see the connector for the first time.
2022-07-29 10:39:18 +02:00
Simon Ser
ce4699fc6d drm: improve preferred flag comparison in compare_modes
Two preferred modes shouldn't happen, but this ensures a copy-paste
for another flag doesn't result in mis-sorted modes and it's more
consistent with the rest of the logic.
2022-07-29 09:25:50 +02:00
Joshua Ashton
90693b72cd drm: Call drmModeGetConnector before getting object properties
Works around a DRM bug where the EDID blob would be 0.

We always get modes from DRM from this, which means it MUST be getting the edid.

Surprise! Calling this before getting the object props makes it so it gets the edid. Yipee!
2022-07-27 18:03:42 +00:00
Joshua Ashton
a23fd5ff54 drm: Always prefer modes > 60Hz to any others
Avoids picking 4K@30Hz and other modes which feel really bad.
Happens on a lot of USB C -> HDMI adapters, even if they advertise support for it online.
2022-07-27 17:51:04 +00:00
Joshua Ashton
30b74a762a vblankmanager: Fix build 2022-07-27 15:58:56 +00:00
Joshua Ashton
7adbdd3f80 drm: Use unordered_map for connectors
When adding/removing from a normal map, the iterators become undefined, which means drm->connector can change randomly to the wrong connector or garbage memory.
2022-07-27 15:50:17 +00:00
Joshua Ashton
282eaae796 steamcompmgr: Split GAMESCOPE_DYNAMIC_REFRESH into internal/external
GAMESCOPE_DYNAMIC_REFRESH remains for internal
GAMESCOPE_DYNAMIC_REFRESH_EXTERNAL will be used for external displays.
2022-07-27 15:46:42 +00:00
Joshua Ashton
9c81cd1d80 vblankmanager: Only move back redzone by refresh for external screens
Deck screen can handle this with our custom clocks and this just increases latency otherwise.
2022-07-27 15:44:17 +00:00
Joshua Ashton
81cd2bbc6d drm: Add method to get screen type
Either internal or external
2022-07-27 15:43:50 +00:00
Sam Lantinga
c0e152ff01
Merge pull request #565 from emersion/drm-conn-name
drm: improve wl_output.description
2022-07-27 05:50:44 -07:00
Joshua Ashton
312a616501 vblankmanager: Scale vblank redzone against target refresh
Fixes frametimings at 4K@30Hz
2022-07-27 10:46:49 +00:00
Simon Ser
cd1fed6c2d drm: simplify CRTC loop in drm_prepare() 2022-07-27 12:40:55 +02:00
Simon Ser
ab409892ed drm: fix add_*_property() error handling
This function doesn't return a bool.
2022-07-27 12:28:53 +02:00
Simon Ser
8e6c1b16d1 drm: use slightly more appropriate error value for add_property 2022-07-27 12:22:56 +02:00
Simon Ser
4dbcd068ed drm: de-duplicate EDID parsing 2022-07-27 09:35:25 +02:00
Simon Ser
5fca0702ab drm: parse make/model from EDID 2022-07-27 09:30:45 +02:00
Simon Ser
09a53dc416 drm: change wl_output.description for internal screens 2022-07-26 17:46:51 +02:00
Simon Ser
cce6a29a24 wlserver: ignore commit if buffer didn't change 2022-07-25 17:09:48 +02:00
Joshua Ashton
7167877bca wlserver: Fix creating headless backend when nested
Otherwise we don't have it and it segfaults.

Closes: #553
2022-07-15 23:46:59 +00:00
Joshua Ashton
71717b2ce3 wlserver: Fix pending surfaces getting xwayland server set
Fixes Warhammer 40,000: Dawn of War II (15620)
2022-07-15 10:45:08 +02:00
Joshua Ashton
8b99305352 wlserver: Fix type of wl_id, x11_id
These are uint32_t
2022-07-15 10:45:08 +02:00
Simon Ser
fde74ee8d0 Update wl_output info after hotplug 2022-07-14 16:20:14 -07:00
Joshua Ashton
12ef7685eb shaders: If running with composite debug, show colored borders 2022-07-14 23:13:50 +00:00
Clément Guérin
f999685153 add --prefer-vk-device option
allows selecting a preferred Vulkan device for compositing, for example
to use the iGPU over the dGPU.

should help #498.
2022-07-14 17:26:35 +01:00
Ben Jackson
8c816a4685 ime: Force Hangul Compat Jamo codepoints to use generic keysyms 2022-07-12 13:11:48 -07:00
Clément Guérin
1b3ad77181 handle SDL touch events
disable SDL mouse emulation to avoid getting mouse events.
2022-06-20 08:59:18 +02:00
Joshua Ashton
1b34a570a5 drm: Implement COLOR_ENCODING + COLOR_RANGE and hook up to env var for now
There is no way to tel a NV12 buffer in Wayland's color space. Why?
What a glaring omission.

Even then, the color management protocol that has supposedly been in
development for 2 years is missing basic features like setting the
color range. Great!

For now we are just setting an env var both us and Remote Play Together
are going to listen to and call it a day until the situation is
properly resolved.
2022-06-16 01:31:47 +00:00
Ben Jackson
27ab72ec72 ime: Avoid keymap reset on each injection. 2022-06-14 14:56:56 -07:00
trigg
541ea8fa53 Always use the newest external overlay window
Currently creating a new external overlay window will not show up until all others close or are killed.

With this change when the user starts a new external overlay it will take precedence until a newer one appears or it is closed or killed.

This will help alleviate a lot of bugs where overlays 'don't start' because another overlay is already in the slot and not drawing into it.
2022-06-09 13:36:22 +02:00
trigg
8ee041c5f4 Drop reference to last known overlay window
Once external overlay windows set their XAtom `GAMESCOPE_EXTERNAL_OVERLAY` to 0 they should be removed from the pool of known external overlays, but reference is kept until they are closed and is never replaced as all current overlays use maximum opacity.

This change is untested and written in a coffee break.
2022-06-09 13:34:47 +02:00
Pierre-Loup A. Griffais
ee043b2ca9 drm: add more EDID make/model combinations as Steam Deck displays
Needed for a future Deck EDID update.
2022-06-08 10:49:54 -07:00
Georg Lehmann
b1c38598ee Remove useless extensions from shaders. 2022-05-26 23:11:25 +00:00
Georg Lehmann
009d4959d1 Use array for descriptor bindings. 2022-05-26 23:11:25 +00:00
Georg Lehmann
3a1f4fbacd Move some code for a more logical order 2022-05-26 23:11:25 +00:00
Georg Lehmann
e2139bc0bb Use more designated initalizers. 2022-05-26 23:11:25 +00:00
Georg Lehmann
166395a619 Use VK_NO_PROTOTYPES 2022-05-26 23:11:25 +00:00
Georg Lehmann
11760e8bd8 rewrite compositing with CVulkanCmdBuffer 2022-05-26 23:11:25 +00:00
Georg Lehmann
7f1e55dd96 Introduce CVulkanCmdBuffer 2022-05-26 23:11:25 +00:00
Georg Lehmann
0a0a000a89 Use vulkan_create_texture_from_bits for NIS images. 2022-05-26 23:11:25 +00:00
Georg Lehmann
b406bba47e Only use two descriptors for samplers 2022-05-26 23:11:25 +00:00
Georg Lehmann
326d7e1f96 Use CVulkanTexture for swapchain images 2022-05-26 23:11:25 +00:00
Georg Lehmann
fa26f16fa9 Introduce CVulkanDevice. 2022-05-26 23:11:25 +00:00
Joshua Ashton
549d22094b drm: Implement gamma and degamma exponent 2022-05-26 23:08:34 +00:00
sad-goldfish
e4892543a0 Add realtime flag for SCHED_RR
Use sched_get_priority_min for priority

Accommodates other unixes with odd minimum priorities.

Manually handle save/restore of scheduling.

Add space. (formatting)

Exit on failure to get scheduler parameters.

Add missing braces.

Copy and edit existing sched_parm rather than new.

May be relevant on some exotic unixes.
2022-05-25 19:01:18 +02:00
Eric
a515153a93 rendervulkan: Add support for NVIDIA image scaling 2022-05-18 01:41:01 +00:00
Eric
0dac3ceac4 nis: Import NIS SDK
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.2.tar.gz
2022-05-18 01:41:01 +00:00
Joshua Ashton
3c59167b67 steamcompmgr, drm: Add GAMESCOPE_COLOR_MATRIX to control CTM matrix 2022-05-18 01:20:49 +00:00
Georg Lehmann
97288b8b1a remove unused wlr egl/gles includes 2022-05-12 11:32:05 +00:00
Georg Lehmann
867308b010 remove dead code 2022-05-12 11:32:05 +00:00
Georg Lehmann
9ba37d923c Make actual cursor extent a CVulkanTexture property 2022-05-12 11:32:05 +00:00
Georg Lehmann
2c47fc57f0 Remove CVulkanTexture::m_bTransitioned
No real reason to overcompilicate things.
2022-05-12 11:32:05 +00:00
Georg Lehmann
2f111b0b98 Stop accessing CVulkanTexture members directly. 2022-05-12 11:32:05 +00:00
Georg Lehmann
d29d83f792 Remove those two terrible structs 2022-05-12 11:32:05 +00:00
Joshua Ashton
d760586543 main: Set XWAYLAND_FORCE_ENABLE_EXTRA_MODES 2022-05-12 09:44:57 +00:00
Joshua Ashton
1c731b61c8 steamcompmgr: When window_wants_no_focus_when_mouse_hidden, move to width -1, height -1 instead 2022-05-12 08:29:15 +00:00
Joshua Ashton
ff14b6a5dd steamcompmgr: Add workaround for Warframe (230410) launcher's language dialog 2022-05-09 01:12:14 +00:00
Joshua Ashton
27eaf5f926 steamcompmgr: Add support for retrieving motif hints 2022-05-09 01:12:14 +00:00
Joshua Ashton
964a9b15cf steamcompmgr: Initialize maybe_a_dropdown 2022-05-09 01:12:14 +00:00
James Jones
22660ce088 drm: Skip gamma LUT on CRTCs that don't support it
On hardware and drivers that don't support a gamma
LUT property, don't attempt to generate or set
one. Log the lack of gamma LUT support at the
informational level.
2022-05-06 22:45:44 +02:00
James Jones
e24348da39 main: Raise the file descriptor limit at launch
Gamescope currently uses 1024 VkFence objects to
synchronize CPU and GPU work. The NVIDIA Vulkan
driver currently creates a file descriptor for
each VKFence object created. To ensure there are
sufficient file descriptors, attempt to raise the
limit to 2048 file descriptors if it is currently
lower than that. Failure to raise the limit for
any reason is non-fatal, as the increased limit
is not required on some drivers.
2022-05-06 22:45:44 +02:00
Sam Lantinga
a32244de62 Switched the default YUV color conversion to full range BT.709
This matches the hardware color conversion on Steam Deck
2022-05-05 01:03:46 +00:00
Joshua Ashton
2855219311 wlserver: Add WLSERVER_TOUCH_CLICK_DISABLED 2022-05-03 23:55:08 +00:00
Joshua Ashton
4a153094b5 steamcompmgr: Fix setting dynamic refresh without FPS limit 2022-04-28 01:40:53 +00:00
Sam Lantinga
d4bdeb71e2
ime: fix typing the EURO symbol using the on-screen keyboard 2022-04-27 19:03:28 +02:00
Simon Ser
1b54be4aca pipewire: add support for DMA-BUFs 2022-04-27 14:04:43 +02:00
Simon Ser
3c2235dadc pipewire: acquire textures in stream_handle_add_buffer 2022-04-27 14:04:43 +02:00
Simon Ser
0c5dcc5ba3 rendervulkan: add exportable flag to vulkan_acquire_screenshot_texture 2022-04-27 14:04:43 +02:00
Simon Ser
b5c0a0f7fe pipewire: group shm-specific fields 2022-04-27 14:04:43 +02:00
Simon Ser
6b59f377ce rendervulkan: make caller responsible for providing screenshot texture 2022-04-27 14:04:43 +02:00
Joshua Ashton
4d631e240e steamcompmgr: Fix a regression in FO4 with win_maybe_a_dropdown and document 2022-04-26 04:16:43 +00:00
Joshua Ashton
0865717165 steamcompmgr: Don't follow transients if we have a focusControlWindow 2022-04-26 04:06:56 +00:00
Joshua Ashton
3e81a24171 steamcompmgr: Only set GAMESCOPE_FOCUSED_APP in steam mode
Closes: #416
2022-04-26 00:51:06 +00:00
Simon Ser
f810a8563d Add exportable flag to CVulkanTexture 2022-04-23 23:13:17 +00:00
Alistair Findlay
accadbb291 Fixed typo - "renegociating" changed to "renegotiating" 2022-04-23 10:01:25 +02:00
Alex Maras
b5aa05ae8f
sdlwindow: Handle SDL_WINDOWEVENT_CLOSE 2022-04-20 17:16:36 +02:00
Joshua Ashton
34957bc383 rendervulkan: Don't enable VK_KHR_image_format_list
This is in 1.2 now
2022-04-18 16:09:20 +01:00
Joshua Ashton
ce1c428788 rendervulkan: Use float16 in Vulkan 1.2 now 2022-04-18 16:09:20 +01:00
Joshua Ashton
76aad316ce rendervulkan: Use timeline semaphores for scratch cmd buffers (used for imports, etc) 2022-04-18 16:09:20 +01:00
Joshua Ashton
e478a746a5 rendervulkan: Create Vulkan 1.2 device
For timeline semaphores. It's common enough for us to do that now.
2022-04-18 16:09:20 +01:00
Joshua Ashton
a85d71cc9e steamcompmgr: Don't require a fps limit for dynamic refresh 2022-04-17 22:55:46 +01:00
Joshua Ashton
34c6904234 wlserver: Be more defensive in content_override_handle_surface_destroy
Better to be defensive here than crashing.
2022-03-25 23:13:05 +00:00
Joshua Ashton
45ba90bc40 steamcompmgr: Don't XSelectInput PointerMotionMask
Otherwise it can end up not propogating to windows properly, and they will never recieve the PointerMotion event.

All this seemed to be doing was trapping what was going to be sent to the game, and then using it, despite us already always knowing the cursor position.
2022-03-24 22:54:17 +00:00
Joshua Ashton
c7962c3e6b steamcompmgr: Tie break by map sequence before damage sequence 2022-03-24 18:58:23 +00:00
Joshua Ashton
e4a517b4b8 steamcompmgr: Handle maybe dropdowns better + resolve override transients after finding a first transient
Fixes regressions in TES:IV Oblivion launcher + Zwei launchers
2022-03-24 18:53:47 +00:00
FlightlessMango
6d0c84d163 mangoapp: send focusWindow pid 2022-03-19 01:35:19 +00:00
Joshua Ashton
9eb7445a62 steamcompmgr: Move 1x1 windows down the priority queue below override redirects
Fixes Origin launcher being parented to a 1x1 centred window.
2022-03-18 17:36:35 +00:00
Joshua Ashton
49125a2d17 steamcompmgr: Ignore win_skip_taskbar_and_pager for maybe overrides 2022-03-18 17:29:19 +00:00
Joshua Ashton
499573c5fb steamcompmgr: Ignore overrides that are 1x1 2022-03-18 16:34:21 +00:00
Joshua Ashton
edbf409d07 steamcompmgr: Fix transient following for maybe dropdowns
For Warframe language selection (but not specifically, this is just the right thing.)
2022-03-18 00:07:23 +00:00
Joshua Ashton
e30b5636b0 steamcompmgr: Fix dialog preference check
For Warframe language selection.
2022-03-18 00:07:20 +00:00
Joshua Ashton
8a3a0893cd steamcompmgr: Tie-break dropdowns w/ transient-for presence
For Warframe language selection.
2022-03-18 00:07:16 +00:00
Joshua Ashton
ade9eca823 steamcompmgr: Fix gravity + position check for determining maybe a dropdown state
For Warframe language selection.
2022-03-18 00:07:12 +00:00
Joshua Ashton
be4b83cff2 steamcompmgr: Handle potential dropdowns better in focus order
For Warframe language selection.
2022-03-18 00:07:00 +00:00
Joshua Ashton
a913f8566f steamcompmgr: Don't disable dynamic refresh when the QAM/Overlay comes up 2022-03-11 22:46:08 +00:00
Philip Nilsson
d3d0bc189e sdlwindow: Fix extra mouse button mapping
This changes the mouse button mapping in gamescope to match the mapping in SDL2-2.0.20:src/core/linux/SDL_evdev.c.

Fixes issue #234.
2022-03-02 20:41:33 +01:00
Simon Ser
66f603e6c4 ime: use default keymap if possible 2022-03-01 18:46:51 +00:00
Simon Ser
279321fa73 ime: fix utf8_size for the NUL character 2022-03-01 18:46:51 +00:00
Joshua Ashton
82948d87e0 steamcompmgr: Make maybe_an_override path respect focus window's appids and good candidate state 2022-02-27 09:41:10 +00:00
Joshua Ashton
bfefe62933 steamcompmgr: Fix on-screen check for override candidates
Fixes Apex Legends Origin signup via. Steam Overlay browser
2022-02-27 09:36:34 +00:00
Joshua Ashton
5b8f9e6a64 steamcompmgr: Handle some non-explicit dropdowns
Fixes Rockstar Launcher dropdowns
2022-02-25 08:40:31 +00:00
Joshua Ashton
8597753b75 steamcompmgr: Fix integer scaling when supersampling 2022-02-25 08:02:18 +00:00
Joshua Ashton
e190d55f65 steamcompmgr: Exclude skip taskbar + page & 1x1 windows & override redirects from reported focusable windows 2022-02-25 06:59:07 +00:00
Joshua Ashton
58a9aa6543 steamcompmgr: Bring back inputFocusMode 2
Now we have input split properly, we can have this again.
2022-02-23 23:33:30 +00:00
Simon Ser
7004d98223 drm: add support for DP-MST connectors
These are created/destroyed dynamically by the kernel.
2022-02-23 23:07:21 +00:00
Simon Ser
483e2729ec drm: store connectors in map
We'll need to create/destroy connectors for DP-MST. A vector
invalidates pointers/references when new elements are inserted.
2022-02-23 23:07:21 +00:00
Joshua Ashton
d6b6428143 rendervulkan: Support blur for override redirect layer too
Essentially just shoves that into the horizontal pass and cleans it out of the normal composite when we go to do vertical and also makes the blur image the same size as the output, which should have been done anwyay to avoid harsh borders.
2022-02-23 23:00:48 +00:00
Joshua Ashton
b7dd42e0b8 steamcompmgr: Remove useless zpos hack
Not needed anymore, this got fixed in liftoff
2022-02-23 23:00:48 +00:00
Bas Nieuwenhuizen
46beac1556 Add support for communicating a swapchain override to apps.
With matching stuff in mesa to dynamically change the swapchain
to FIFO (or the approximate GL equivalent).
2022-02-23 03:02:55 +00:00
Georg Lehmann
a56b56d401 rendervulkan: Fix half pixel offset (again)
Some quick debugging code that I forgot to change properly.
Derp.
2022-02-18 19:53:29 +00:00
Joshua Ashton
ff5d585785 steamcompmgr: Make GAMESCOPE_DYNAMIC_REFRESH control the refresh rate directly 2022-02-18 03:20:37 +00:00
Joshua Ashton
75f3506a1a steamcompmgr: Add FPS limiting through frame callback timing 2022-02-18 03:20:37 +00:00
Joshua Ashton
aa94b6dec1 steamcompmgr: Add GAMESCOPE_FOCUSED_APP_GFX atom 2022-02-18 02:56:58 +00:00
Georg Lehmann
4153272274 rendervulkan: Reduce blur pipeline count. 2022-02-18 02:44:11 +00:00
Georg Lehmann
7708d62801 rendervulkan: Layer 0 blur support. 2022-02-18 02:44:08 +00:00
Joshua Ashton
4ed0c26364 vblankmanager: Nuke FPS limiter code for now
Not baked enough right now, needs a rework for several reasons.

Keeps dynamic refresh.
2022-02-17 21:58:14 +00:00
Simon Ser
c82cefbdee mangoapp: fix msgsnd size arg
The size argument must not include the `long msg_type` field.

Fixes the following ASan error:

    =================================================================
    ==25745==ERROR: AddressSanitizer: global-buffer-overflow on address 0x55cb6beea08a at pc 0x7f118e89525d bp
     0x7f117620a8a0 sp 0x7f117620a048
    READ of size 50 at 0x55cb6beea08a thread T10

        #0 0x7f118e89525c in __interceptor_msgsnd /usr/src/debug/gcc/libsanitizer/sanitizer_common/sanitizer_c
    ommon_interceptors.inc:3138
        #1 0x55cb6b6518ed in mangoapp_update(unsigned long, unsigned long, unsigned long) ../src/mangoapp.cpp:
    48
        #2 0x55cb6b484dde in imageWaitThreadMain() ../src/steamcompmgr.cpp:521
        #3 0x55cb6b538298 in void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) /usr
    /include/c++/11.2.0/bits/invoke.h:61
        #4 0x55cb6b5381b3 in std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) /u
    sr/include/c++/11.2.0/bits/invoke.h:96
        #5 0x55cb6b538063 in void std:🧵:_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_t
    uple<0ul>) /usr/include/c++/11.2.0/bits/std_thread.h:253
        #6 0x55cb6b537f23 in std:🧵:_Invoker<std::tuple<void (*)()> >::operator()() /usr/include/c++/11.
    2.0/bits/std_thread.h:260
        #7 0x55cb6b537ae9 in std:🧵:_State_impl<std:🧵:_Invoker<std::tuple<void (*)()> > >::_M_run
    () /usr/include/c++/11.2.0/bits/std_thread.h:211
        #8 0x7f118e0a34d3 in execute_native_thread_routine /usr/src/debug/gcc/libstdc++-v3/src/c++11/thread.cc
    :82
        #9 0x7f118d3d75c1 in start_thread (/usr/lib/libc.so.6+0x8d5c1)
        #10 0x7f118d45c583 in __clone (/usr/lib/libc.so.6+0x112583)

    0x55cb6beea08a is located 0 bytes to the right of global variable 'mangoapp_msg_v1' defined in '../src/mangoapp.cpp:27:27' (0x55cb6beea060) of size 42
2022-02-16 12:54:49 +00:00
Simon Ser
5f8fa27029 steamcompmgr: cleanup on X11 error
The cleanup sequence run on X11 I/O error was incomplete. Let's
extract it to a function to make sure it doesn't go out-of-sync
again.
2022-02-15 17:55:51 -08:00
Joshua Ashton
fd3e8182fd vblankmanager: Rework fps limiter a bunch
Tracks consecutive missed frames much better, handles latent buffers much better.

Disable mangoapp hack for now -- it's obscuring useful data, need a better solution.

Disable low latency by default, still controlable by atom.
2022-02-16 00:55:21 +00:00
Joshua Ashton
b471a05d8a steamcompmgr: Don't yank input focus from subwindows when dirtying focus for no reason 2022-02-15 02:46:35 +00:00
Joshua Ashton
367a92833d steamcompmgr: Only reset to corner if we change real input focus focus 2022-02-15 02:15:40 +00:00
Joshua Ashton
a44c0dbc43 steamcompmgr: Handle dropdown positioning if the main window is the current output width & height 2022-02-15 02:02:09 +00:00
Joshua Ashton
82c098f117 pipewire, steamcompmgr: Fix odr violations for event_type 2022-02-14 23:50:31 +00:00
Joshua Ashton
ddf468a8e6 modegen: Add tuned clocks for Steam Deck's display 2022-02-14 22:50:15 +00:00
Georg Lehmann
ada1c7f89d rendervulkan: Do rcas opacity in the correct colorspace if we calculate it anyway. 2022-02-14 21:48:40 +00:00
Georg Lehmann
2d537df252 rendervulkan: Don't calculate a garbage alpha value. 2022-02-14 21:48:40 +00:00
Georg Lehmann
35b381ce51 rendervulkan: Don't use clock for random debug output.
Not supported on turnip.
2022-02-14 21:48:40 +00:00
Joshua Ashton
ecdf214130 vblankmanager: Fix offsetting by vblank time -- use 0 for min sleepy time 2022-02-14 20:08:19 +00:00
Joshua Ashton
a8d59607b3 vblankmanager: Don't resize latency graph when misaligned from vblank + latent frames 2022-02-14 19:54:21 +00:00
Joshua Ashton
f65339de0f vblankmanager: Don't disable latency graph when latent
Causes a bunch of mangoapp resizing which affects frametime, just make it 0 if we don't know.
2022-02-14 19:51:29 +00:00
Joshua Ashton
6c541f184c steamcompmgr: Fix compile on clang 2022-02-14 19:48:19 +00:00
Joshua Ashton
a59c89d2ec steamcompmgr: Handle X11 errors for other displays
Closes: #382
2022-02-14 19:33:28 +00:00
Joshua Ashton
7ec498af0a vblankmanager: Track latent frames 2022-02-14 19:15:52 +00:00
Joshua Ashton
765ddd74b1 Revert "vblankmanager: Make min sleepy time 0"
This reverts commit 0c3eb8f83d.
2022-02-14 15:01:07 +00:00
Joshua Ashton
0c3eb8f83d vblankmanager: Make min sleepy time 0 2022-02-14 14:56:54 +00:00
Joshua Ashton
82d372e95d vblankmanager: Change sleepyTime min values
Allows us to be more consistent at high GPU loads
2022-02-14 14:45:48 +00:00
Joshua Ashton
392a63d62b steamcompmgr: Add GAMESCOPE_LOW_LATENCY atom 2022-02-14 14:13:47 +00:00
Joshua Ashton
7f2696f51a vblankmanager: Be more aggressive about ramping back up 2022-02-14 14:11:18 +00:00
Joshua Ashton
561d7c4552 vblankmanager: Tune vblank redzone values
Couldn't do the other thing, causes some wackiness when compositing.
2022-02-14 13:48:12 +00:00
Joshua Ashton
fde42a4323 vblankmanager: Fix mangoapp latency value when late frame 2022-02-14 12:52:48 +00:00
Joshua Ashton
a2e01b5701 mangoapp: Handle frametimes from fps limiting better
Also logs latency and app's real frametime
2022-02-14 10:19:10 +00:00
Joshua Ashton
d3b5a758d1 vblankmanager: Put some of the vblank redzone into a min value
Just matters that we call drmAtomicCommit before 1.6ms, we can keep this value more stable for 99% of cases this way.
2022-02-13 18:35:59 +00:00
Joshua Ashton
12ee4304ec vblankmanager: Use vblank offset for alignment in FPS limiter 2022-02-13 10:38:41 +00:00
Joshua Ashton
555bf125c6 vblankmanager: Fix leftover FPS_LIMIT_DEBUG 2022-02-13 09:40:17 +00:00
Joshua Ashton
40fba97cea vblankmanager: Fix targeting framerates less than current with FPS limiter 2022-02-13 09:36:28 +00:00
Joshua Ashton
1594e02c84 vblankmanager: Discard first non-missed frames after a missed frame
Additionally fix some vblank limiting stuff for FSR at 4K.

This is our late frame.
2022-02-13 09:16:10 +00:00
Joshua Ashton
8fe9322578 vblankmanager: Explain divergence situation in a comment 2022-02-12 18:24:12 +00:00
Joshua Ashton
e690b00f7b vblankmanager: Allow going back in time by fixed redzones
Going back a little bit okay, it's when we use varying values to go back, we become divergent from target over time with varying clocks
2022-02-12 18:13:45 +00:00
Joshua Ashton
f156763458 vblankmanager: Don't sleep back in time
Fixes getting stuck in a feedback loop with high variance
2022-02-12 17:59:20 +00:00
Joshua Ashton
2cac416000 vblankmanager: When calculating fps limiter sleep time, take the min of the rolling max frame time against target interval - redzone
We account for redzone later, and don't want to go over vblank time and preceed into previous vblank or whatever here.
2022-02-12 13:46:36 +00:00
Joshua Ashton
0862a2b896 steamcompmgr: Only free all buffers on setting target fps if disabling 2022-02-12 13:25:38 +00:00
Joshua Ashton
29060cc87c steamcompmgr: Detect stalls in fps limiter latent buffer heuristic 2022-02-12 12:11:00 +00:00
Joshua Ashton
a5c660e54f vblankmanager: More value tuning
Based on some rough data across a variety of games that are both GPU bound and also ones that are very not and cause GPU clocks to vary wildly
2022-02-12 11:54:51 +00:00
Joshua Ashton
70442294c0 steamcompmgr: Only allow one latent buffer when falling behind 2022-02-12 09:10:55 +00:00
Joshua Ashton
a1fa55c3a3 steamcompmgr: Add FSR active feedback
Also use this for mangoapp
2022-02-12 08:50:52 +00:00
Joshua Ashton
1df5c3a147 modegen: Always ceil clocks for fixed modes
Some modes like 55Hz end up off by one at 54 like we had with 30 before.
2022-02-11 09:35:48 +00:00
Joshua Ashton
e53f986048 vblankmanager: Tune FPS limiter and dynamic vblank heuristics 2022-02-11 05:28:03 +00:00
Joshua Ashton
8a94186522 steamcompmgr: Release all on IO error 2022-02-10 02:34:38 +00:00
Joshua Ashton
d759bd5efd vblankmanager: Fix shutting down fps limiter thread
Closes: #406
2022-02-10 02:34:03 +00:00
Joshua Ashton
30e91fc24f steamcompmgr: Don't hide cursor when going from dropdown->focus window and vice versa 2022-02-10 02:25:42 +00:00
Joshua Ashton
291d788b4f steamcompmgr: Show cursor on tap always 2022-02-10 02:19:08 +00:00
Joshua Ashton
15c254fd7f steamcompmgr: Hide new cursor when transitioning our global input focus
Fixes going from QAM -> game and keeping the cursor from the game.
2022-02-10 02:04:36 +00:00
Joshua Ashton
bf427b8156 steamcompmgr: Fix dynamic refresh crash if no focus window 2022-02-09 02:45:31 +00:00
Joshua Ashton
e5c3a1e1da steamcompmgr: Prefer non-dialog override redirects
Prefers dropdowns over popups.

Fixes dropdowns in Zwei: The Ilvard Insurrection (427700) where when you
tap on a dropdown, it'd immediately start preferring to show a popup with a hint
that you get from hovering.
2022-02-09 01:30:56 +00:00
Joshua Ashton
6d2cb3073c steamcompmgr: Implement dynamic refresh rate based on FPS limit
Adds a mode to dynamically change the refresh rate based on the existing FPS limit.
2022-02-09 00:34:58 +00:00
Joshua Ashton
c5ab6f388b vblankmanager: Implement FPS limiter by strategic buffer withholding 2022-02-09 00:34:58 +00:00
Joshua Ashton
9fa6fcd9ac modegen: Round display clocks up instead of down
Fixes oboe getting 29fps for vrefresh or whatever

Stops using floats here too, floats bad.
2022-02-09 00:34:58 +00:00
Joshua Ashton
02e0086856 steamcompmgr: New night mode color toys 2022-02-09 00:20:35 +00:00
FlightlessMango
c61d936cd9 mangoapp: FSR 2022-02-09 00:19:15 +00:00
Joshua Ashton
f65d54e61d steamcompmgr: Add atom to control exposed modes per-xwayland server 2022-02-09 00:17:15 +00:00
Joshua Ashton
4a308c97f7 steamcompmgr: Handle being initially connected to external display 2022-02-09 00:17:15 +00:00
Joshua Ashton
bf119ee44b steamcompmgr: Mark focus dirty on root window resize 2022-02-09 00:17:15 +00:00
Joshua Ashton
4f25eefbad steamcompmgr: Resize Steam's xwayland mode to output mode 2022-02-09 00:17:15 +00:00
Joshua Ashton
d272cebb38 steamcompmgr: Resize nested height to match output aspect ratio in Steam mode 2022-02-09 00:17:15 +00:00
Joshua Ashton
5ed0753165 wlserver: Add wlserver_set_xwayland_server_mode
Sets the current mode and stuff for a specific xwayland server.
2022-02-09 00:17:15 +00:00
Joshua Ashton
aca867e60f rendervulkan: Fix half-texel offset
Previously this was doing scale / 2 but it gets multiplied by scale, so this didn't work when it wasn't 1.0

Found when testing higher reses
2022-02-05 02:07:52 +00:00
Joshua Ashton
f1646c8f03 steamcompmgr: Fix nested max scale factor 2022-02-05 02:02:24 +00:00
Joshua Ashton
04e9eaebe3 drm: Be safe against blob destruction 2022-02-04 03:31:13 +00:00
Sam Lantinga
ab4684078c Fixed pipewire stream stopping after a few seconds
With the latest version of pipewire, the process callback is no longer automatically called. Instead, you should call pw_stream_trigger_process() when frames are ready, to have the processing callback happen.

Since the only processing we're doing is requesting a buffer, I'm calling that directly from the callback, since that is thread-safe for a single reader.
2022-02-04 00:49:48 +00:00
Joshua Ashton
b4cf9d3203 wlserver: Use root server for content overrides 2022-02-04 00:49:26 +00:00
Joshua Ashton
7b75629040 steamcompmgr: Hide our cursor when forcing position for Steam touch stuff 2022-02-03 23:10:05 +00:00
Joshua Ashton
c1f9ec7ecf steamcompmgr: Fix default gain when disabled
This was yellow for testing, somehow slipped in.
2022-02-03 18:52:46 +00:00
Florian
2079de25e5 fixed missing newline after -U in help message 2022-02-03 10:37:44 +01:00
Joshua Ashton
c5ccd71ff6 drm: Implement linear color gain control via atoms
Adds GAMESCOPE_COLOR_LINEARGAIN to control the linear color gain.
2022-02-03 05:29:33 +00:00
Joshua Ashton
55cb27fd15 steamcompmgr: Fix X's idea of interactive focus
Always update X's idea of focus, but still dirty
the it being outdated so we can resolve that globally later.

Only affecting X and not the WL idea of focus here,
we always want to think the window is focused.
but our real presenting focus and input focus can be elsewhere.
2022-02-02 23:00:44 +00:00
Joshua Ashton
a953bd276e drm: Fix leaking mode properties 2022-02-02 23:00:38 +00:00
Joshua Ashton
88852d187c steamcompmgr: HACK! Always composite with a cursor
Cursor plane on AMDGPU is very broken with both rotation and overlay planes that are not screen sized. Workaround for now.
2022-02-02 23:00:30 +00:00
Joshua Ashton
a1d560e836 steamcompmgr: Handle cursor image width being different to surface width for rotation offset
The surface width for the cursor is 256, but the image width is 64 which means we have a bunch of blank space, so we need to account for this in DRM code for the CRTC offsets.
2022-02-02 22:58:11 +00:00
Joshua Ashton
8313853802 steamcompmgr: Fix clang build 2022-02-01 00:34:10 +00:00
Joshua Ashton
f4c3425a85 steamcompmgr: Add GAMESCOPE_FSR_SHARPNESS property
0 to 20, controls FSR sharpness
2022-02-01 00:30:59 +00:00
Joshua Ashton
d01363e35e steamcompmgr: Implement GAMESCOPE_SCALING_MODE atom
0 = linear
1 = nearest
2 = integer
3 = fsr
2022-02-01 00:26:45 +00:00
Joshua Ashton
7755bb635d steamcompmgr: Clean up code to determine if we need composite 2022-02-01 00:06:08 +00:00
Joshua Ashton
0b5368efe7 steamcompmgr: Force composite when we must force nearest filtering
SCALING_FILTER is not hooked up in AMDGPU.
2022-02-01 00:04:25 +00:00
Joshua Ashton
0bc3a2493d steamcompmgr: Add tuneables for vblank red zone + decay rate 2022-01-31 23:49:39 +00:00
Joshua Ashton
797ee59cbb vblankmanager: Estimate draw buffer time based on max rolling average draw time
Handles spikes much better and allows us to have a lower buffer when not needed.
2022-01-31 23:49:39 +00:00
Joshua Ashton
a659fef806 drm: Use vblank time from page flip handler 2022-01-31 23:49:39 +00:00
Joshua Ashton
779d8f1bee wlserver: Handle tapping overrides off screen
This clamp was stopping us from clicking off the current surface, which we want now.
2022-01-31 23:45:45 +00:00
Joshua Ashton
15dc09adfb steamcompmgr: Extend cursor barriers tto override
It's only fair we can click what we can now see!
2022-01-31 23:45:45 +00:00
Joshua Ashton
289a739358 steamcompmgr: Resize to fit dropdowns 2022-01-31 23:45:45 +00:00
Joshua Ashton
3416cde9f4 steamcompmgr: Raise override redirects
Don't give them explicit focus. Allows us to have the cursor off them and have taps and stuff work.
2022-01-31 23:45:45 +00:00
Georg Lehmann
b70ec1b1ad rendervulkan: Restore force nearest optimization. 2022-01-31 23:41:04 +00:00
Georg Lehmann
3fbcb4d3cd steamcompmgr: Force compositing for FSR. 2022-01-31 23:41:04 +00:00
Georg Lehmann
a9dac11f15 main: FSR sharpness setting. 2022-01-31 23:41:04 +00:00
Georg Lehmann
96acb9de7e rendervulkan: Fp16 easu. 2022-01-31 23:41:04 +00:00
Georg Lehmann
3aec05925c rendervulkan: Enable fp16 extension and feature. 2022-01-31 23:41:04 +00:00
Georg Lehmann
ead46a2db0 main: Add FSR command line option and shortcut. 2022-01-31 23:41:04 +00:00
Georg Lehmann
6cfe2fe09c rendervulkan: Inital FSR support. 2022-01-31 23:41:04 +00:00
Georg Lehmann
3d3b9ad503 rendervulkan: Create FSR pipelines. 2022-01-31 23:41:04 +00:00
Georg Lehmann
d0605bef22 rendervulkan: Add fsr shaders. 2022-01-31 23:41:04 +00:00
Georg Lehmann
463dabe199 rendervulkan: Move descriptor set definition to separate header. 2022-01-31 23:41:04 +00:00
Georg Lehmann
9a8b3bd22c rendervulkan: Import fsr headers. 2022-01-31 23:41:04 +00:00
Georg Lehmann
7f3aebbcc0 rendervulkan: Prepare for multiple descriptor sets. 2022-01-31 23:41:04 +00:00
Georg Lehmann
56fb91ea72 rendervulkan: Use drmformats everywhere, create srgb and linear image views 2022-01-31 23:41:04 +00:00
Georg Lehmann
861435aeba rendervulkan: Allow readwrite images. 2022-01-31 23:41:04 +00:00
Georg Lehmann
5d20c56f2e rendervulkan: Compile Pipelines on a separate thread. 2022-01-31 23:41:04 +00:00
Georg Lehmann
ebc159869e rendervulkan: Move VkPipeline creation to its own function. 2022-01-31 23:41:04 +00:00
Joshua Ashton
3dc36c8799 wlserver: Redirect volume events to root xwayland
Avoids games being the ones to recieve our lower volume/raise volume keys -- Steam should handle these.
2022-01-31 20:39:35 +00:00
Joshua Ashton
3f4aa2a75f sdlwindow: Do nothing for title or PushUpdate when nested
Waste of cycles.
2022-01-31 18:45:58 +00:00
Joshua Ashton
a5ec3728d9 steamcompmgr: Fix focusDirty tracking being lost when switching to windows without commits 2022-01-31 18:45:58 +00:00
Joshua Ashton
899f1c802e steamcompmgr: Bring back stats to un-break CI
Don't know if we want to bring this back or not... We have better things for this now. But it's breaking CI.
2022-01-31 17:16:18 +00:00
Georg Lehmann
a9654d6cfb rendervulkan: Only create useful pipelines. 2022-01-31 17:09:10 +00:00
Georg Lehmann
bf55e08712 rendervulkan: Remove swap channels pipeline variant. 2022-01-26 13:06:30 +00:00
Georg Lehmann
4f0f0065ad rendervulkan: Remove swap channels.
Unused since 76292f01cb, partially broken and
unnecessary because we should be able to always use the correct VkFormat.
2022-01-26 13:06:30 +00:00
Joshua Ashton
698d14b7e9 steamcompmgr: Use SRGB for cursor image
This is it's correct color space after all!

Thanks to Georg Lehmann for pointing this out.
2022-01-25 05:13:20 +00:00
Joshua Ashton
10943045ff rendervulkan: Support modifiers on SRGB images 2022-01-25 05:13:20 +00:00
Joshua Ashton
79f66f9729 steamcompmgr: Warp cursor off of Steam when cursor is hidden
Stops misleading hover events from happening while also not intefering with touch.
2022-01-24 11:38:41 -08:00
Georg Lehmann
5bfc27576d build: preparations for more shaders 2022-01-23 05:10:41 +00:00
Joshua Ashton
3ae7c0c0f5 steamcompmgr: Keep being interactive when switching between focus windows and waiting for commits
Avoids bubbles of no focus window
2022-01-23 05:09:18 +00:00
Joshua Ashton
60f20b9fe5 steamcompmgr: Don't care if game is focused to paint
We could just want to render the overlay and our held base commit.
2022-01-23 05:09:18 +00:00
Joshua Ashton
98dc1a5a7e steamcompmgr: Track X dirtying outside of dispatch
If we dirty the X server outside of the dispatch, xlib can flush its events, leading us to a state where XPending(dpy), would be true but the poll returns false.

Check if we have locally queued events before polling and flush those to mitigate this. This does not involve a system call.
2022-01-20 10:39:30 +01:00
Joshua Ashton
57eee35f29 wlserver: Wait for steamcompmgr to shutdown before cleaning up xwayland
Makes shutdown cleaner
2022-01-20 08:55:26 +00:00
Georg Lehmann
edb77e2490 rendervulkan: Add missing barriers in vulkan_create_texture_from_bits. 2022-01-20 07:37:20 +00:00