Commit graph

974 commits

Author SHA1 Message Date
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
Georg Lehmann
eff99fdf81 rendervulkan: Add acquire and release barriers for imported images. 2022-01-20 07:37:20 +00:00
Georg Lehmann
10ba9f3908 rendervulkan: Fix WAW hazard for screenshot image. 2022-01-20 07:37:20 +00:00
Georg Lehmann
ca09577632 rendervulkan: Stop using unnormalized ycbcr samplers.
This is not allowed for ycbcr samplers.
2022-01-20 07:37:20 +00:00
Georg Lehmann
73025b24e2 rendervulkan: Avoid writing rgb descriptors for ycbcr images. 2022-01-20 07:37:20 +00:00
Georg Lehmann
1bb24ded57 rendervulkan: Remove empty texture. 2022-01-20 07:37:20 +00:00
Georg Lehmann
dcc290725a rendervulkan: Enable NULL descriptor feature. 2022-01-20 07:37:20 +00:00
Georg Lehmann
7d6ad29757 rendervulkan: Enable samplerYcbcrConversion. 2022-01-20 07:37:20 +00:00
Georg Lehmann
ca2c770d64 rendervulkan: Always account for push frameid even if it's unused. 2022-01-20 07:37:20 +00:00
Georg Lehmann
95d25290d3 rendervulkan: Switch to GL_ARB_shader_clock and enable shaderSubgroupClock.
shaderSubgroupClock is better supported than shaderDeviceClock (e.g. anv
and before radv < gfx8).
2022-01-20 07:37:20 +00:00
Georg Lehmann
e1397a26e3 rendervulkan: Transition present image to general before compositing. 2022-01-20 07:37:20 +00:00
Georg Lehmann
96fb7aeed0 rendervulkan: Transition present image to PRESENT_SRC in nested mode. 2022-01-20 07:37:20 +00:00
Georg Lehmann
2c5dae8439 rendervulkan: Wait for fence after acquire next image. 2022-01-20 07:37:20 +00:00
Joshua Ashton
497c07387d steamcompmgr: Always composite our first frame
AMDGPU gets very very upset if the first commit that also does display bringup+modeset has multiple planes. :(
2022-01-20 07:29:48 +00:00
Joshua Ashton
9c8948cec4 steamcompmgr: Disable DrawBorders for video UI
Fixes cursor having a black border here.
2022-01-20 07:29:48 +00:00
Joshua Ashton
ad2bf6663e steamcompmgr: Don't let overlays account for valid contents
Stops mangoapp breaking seamless boot.
2022-01-20 07:29:48 +00:00
Joshua Ashton
d84f7068b4 steamcompmgr: Move to empty instead of size != 0 2022-01-20 08:26:13 +01:00
Joshua Ashton
4237d3d2bb steamcompmgr: Fallback to whatever is best for local focus if focus control appid is not present inside of xwayland context
Allows us to run with multiple xwayland contexts and still have proper focus if the game launches into the first xwayland context
2022-01-20 07:11:40 +00:00
Joshua Ashton
a3cbe5d079 steamcompmgr: Move mangoapp_update to the imageWaitThread
More correct, stops reported frametimes being all over the place if steamcompmgr is waiting for stuff to happen.
2022-01-20 07:11:40 +00:00
Joshua Ashton
ae268ec9c9 steamcompmgr: Remove 1 appid per ctx assumption, factor out primary focus + override determination 2022-01-20 07:11:40 +00:00
Joshua Ashton
80101e1932 steamcompmgr: Use overlay's ctx rather than root ctx
Makes more sense when reading
2022-01-20 07:11:40 +00:00
Joshua Ashton
4eda19aa69 steamcompmgr: Resolve transient overrides in new multi xwayland focus logic 2022-01-20 07:11:40 +00:00
Joshua Ashton
d781082888 wlserver: Make content overrides per xwayland server 2022-01-20 07:11:40 +00:00
Joshua Ashton
ac09776607 steamcompmgr: Restore per-ctx appid logic if running in single xwayland mode 2022-01-20 07:11:40 +00:00
Joshua Ashton
3556ee4174 steamcompmgr: Add some comments to what we are doing in the global focus code 2022-01-20 07:11:40 +00:00
Joshua Ashton
e7cd2dbb25 steamcompmgr: Add win_surface helper
Makes this easier to read
2022-01-20 07:11:40 +00:00
Joshua Ashton
062a2bf496 steamcompmgr: Simplify global_focus member names
Now we have an entire struct of previous_focus to go off of, we can remove the word current from them.
2022-01-20 07:11:40 +00:00
Joshua Ashton
205cfbdf87 wlserver: Add a mode for multiple xwaylands
Adds --xwayland-count to control the number of xwaylands.
2022-01-20 07:11:40 +00:00
Joshua Ashton
74236fd13f steamcompmgr: Localize gameFocused to context 2022-01-20 07:11:40 +00:00
Joshua Ashton
e29d76ef44 steamcompmgr: Fix stale keybaord focus bug
When the focus changes but the input focus does not (ie. overlay -> steam) the keyboard focus can be left behind on the game, which is not what we want.

Track this more ganularly.
2022-01-20 07:11:40 +00:00
Joshua Ashton
e8faa8647e steamcompmgr: Respect global focus when updating wayland window surface focus 2022-01-20 07:11:40 +00:00
Joshua Ashton
0040709c30 steamcompmgr: Provide feedback about focused display, mouse focus and keyboard focus 2022-01-20 07:11:40 +00:00
Joshua Ashton
a8a1084331 steamcompmgr: Track ctx in win structure 2022-01-20 07:11:40 +00:00
Joshua Ashton
97056e7a3f steamcompmgr: Make commit wait lists per-xwayland server 2022-01-20 07:11:40 +00:00
Joshua Ashton
ca8fd6552a wlserver: Move commit queues to per-xwayland server, rather than global 2022-01-20 07:11:40 +00:00
Joshua Ashton
1536604533 wlserver: Handle mousemotion only for focused server 2022-01-20 07:11:40 +00:00
Joshua Ashton
9946d2380d steamcompmgr: Focus and paint support for multiple xwaylands 2022-01-20 07:11:40 +00:00
Joshua Ashton
ef109369f1 steamcompmgr: Use win* instead of Window for focus tracking 2022-01-20 07:11:40 +00:00
Joshua Ashton
43d9cf4e6a steamcompmgr: Initial support for multiple xwaylands
Doesn't handle focus or painting anything other than the root context yet.
2022-01-20 07:11:40 +00:00
Joshua Ashton
deb0364c05 wlserver: Move xdisplay init and ownership to xwayland_server
Allows us to bring back the sdlwindow mouse behaviour
2022-01-20 07:11:40 +00:00
Joshua Ashton
75c5617f58 steamcompmgr: Split out xwayland_ctx initialization to own function 2022-01-20 07:11:40 +00:00
Joshua Ashton
26f9942e6c wlserver: Split out xwayland_server from global wlserver state 2022-01-20 07:11:40 +00:00
Joshua Ashton
582da1d967 steamcompmgr: Split globals into xwayland_ctx_t
Doesn't fully support multiple xwaylands or have all the infrastructure for that yet. This just splits the globals out for now and passes the ctx around.
2022-01-20 07:11:40 +00:00
Joshua Ashton
7357f46ac7 steamcompmgr: Update last done commit on focus change
Fixes Origin windows being in funny places when fading.
2022-01-14 21:19:18 +00:00
Georg Lehmann
78482d3f08 rendervulkan: Remove dead fence code.
This was already commented out when it was added 2 years ago, and it doesn't
seem useful.
2022-01-11 15:35:20 +01:00
Joshua Ashton
b9cfd6dd21 steamcompmgr: Handle mangoapp for video streaming 2022-01-11 00:09:33 +00:00
Joshua Ashton
3037f37ed0 mangoapp: only send updates when window exists 2022-01-11 00:09:33 +00:00
Joshua Ashton
4deff0af27 steamcompmgr: Draw external overlay with no scale
Good enough for mangoapp for now.
We can add more control to this via. atoms for corner positioning, scaling, later.
2022-01-11 00:09:33 +00:00
Joshua Ashton
583714cffa steamcompmgr: Add NoScale window flag 2022-01-11 00:09:33 +00:00
Joshua Ashton
a8e3a40a03 steamcompmgr: Add a BlackBorders flag
Replaces the old implicit notification mode logic with something much more explicit.

We don't want to draw borders for external overlays of other sizes
2022-01-11 00:09:33 +00:00
Joshua Ashton
f65884ee4e steamcompmgr: Refactor paint_window to use flags instead of random bools 2022-01-11 00:09:33 +00:00
Joshua Ashton
49f55ed80c steamcompmgr: External overlay fixes
- Fix repainting when we get a new overlay
- Fix opacity check
- Fix atom update check for external overlays
2022-01-11 00:09:33 +00:00
FlightlessMango
0b6d3607e4 mangoapp: frametime message queue
Co-Authored-By: Martin Roukala <martin.roukala@mupuf.org>
2022-01-11 00:09:33 +00:00
Trigg
610483bd23 steamcompmgr: Implement external overlay support 2022-01-11 00:09:33 +00:00
Joshua Ashton
9a26fa583a rendervulkan: Up layer count to 6 and document the layers we have 2022-01-11 00:09:33 +00:00
Joshua Ashton
89b145dbca rendervulkan: Replace flBorderAlpha with nBorderMask of layers
Allows us to fit more layers in push constants. We never use anything other than 0/1 anyway.
2022-01-11 00:09:33 +00:00
Joshua Ashton
68a68e6bb2 drm: Fix inverted CRTC_Y when rotated
This was doing 90deg logic here, not 270deg.
2022-01-07 17:15:43 +01:00
Georg Lehmann
7c94fc3437 rendervulkan: Compact descriptor set bindings. 2022-01-05 05:02:10 +00:00
Joshua Ashton
b8f66db496 steamcompmgr: Remove valid contents check
We hold onto base commits now -- no need to fhis logic when we can just test the layer count.
2022-01-05 05:00:59 +00:00
Joshua Ashton
2accc343f8 steamcompmgr: Fix returning valid contents 2022-01-05 05:00:59 +00:00
Georg Lehmann
7c5cc5e67e rendervulkan: Rework sampler cache.
Less awkward to use and also fixes a texture leak because the shared_ptr
to the texture is no longer stored in the sampler cache.
2022-01-05 05:00:46 +00:00
Joshua Ashton
95eba7e549 drm: Don't forget about modesetting + modesetting robustness
Makes it so that we don't forget about any required modesets we need to
undertake, and makes modesetting robust by trying again when compositing
(in case the error was not mode but plane related), and falling back to
the previous mode if that fails.

If we have no mode to fall back to then we abort, same if we fail our
mode fallback commit.

Co-authored-by: Simon Ser <contact@emersion.fr>
2021-12-21 22:11:33 +01:00
badsectoracula
bbfbf0dd8d
Update SDL window title from the focused window's title
* Update SDL window title from the focused window's title.

Instead of using the default "gamescope" title for the SDL window, this
makes the SDL window title be updated with the focused window's title
whenever a window is focused or whenever the focused window's title is
changed. "gamescope" is still used whenever a title cannot be obtained.

* Call SDL_SetWindowTitle from the sdlwindow thread.

This calls SDL_SetWindowTitle from the sdlwindow thread instead of from
wherever sdlwindow_title is called. sdlwindow_title stores the title
locally to be picked up by sdlwindow_update.

* Make SDL title update bool check atomic and use a mutex for title change.

* Ensure *all* accesses to g_SDLWindowTitle are behind the mutex lock.

* The atomic bool isn't really necessary with the mutex in place, so remove it.
2021-12-21 18:27:23 +01:00
Simon Ser
c1958be1d9 Drop leftover noop.h include 2021-12-20 14:09:39 +01:00
Simon Ser
11f89c1b15 Upgrade wlroots to 0.15.0 2021-12-20 10:22:17 +01:00
Georg Lehmann
0729954674 steamcompmgr: Fix undefined state of wayland_commit_queue after move. 2021-12-19 18:14:40 +01:00
Pierre-Loup A. Griffais
eba963b9fa drm: abort() on fatal flip failure
exit() would get stuck running exit handlers for global locks.
2021-12-18 00:49:20 -08:00
Joshua Ashton
d87fe5a00d steamcompmgr: Use std::move for tmp_queue
No point wasting cycles copying then freeing when we can just transfer ownership
2021-12-17 15:43:26 -08:00
Joshua Ashton
be1a784278 drm: Handle the same fb_id being held more than once
Ref this properly -- this can happen when a window is recreated sometimes
it seems.
2021-12-17 15:43:26 -08:00
Joshua Ashton
50ee712429 drm: Fix n_refs atomic check 2021-12-17 15:43:26 -08:00
Joshua Ashton
8ad367948f steamcompmgr: Always exit out if we don't have valid contents
This is solved by holding onto the base commit now so this isn't a problem.

Avoid situations where we try to paint with 0 layers.
2021-12-17 15:43:26 -08:00
Joshua Ashton
6f284f2cce steamcompmgr: Treat video underlay as a base plane if we have it -- otherwise treat the focus window as one when streaming
Fixes a case where we can get 0 layers.
2021-12-17 15:43:26 -08:00
Joshua Ashton
589fd61d58 rendervulkan: Refactor to use shared_ptr for VulkanTexture_t 2021-12-17 15:43:26 -08:00
Joshua Ashton
ee91053acc steamcompmgr: Use video underlay as base held commit if available 2021-12-17 15:43:26 -08:00
Joshua Ashton
0e7ef385d5 steamcompmgr: Move commit refs to shared_ptr
This is the right thing to do given a vulkanTexture could refer to muliple commits.
2021-12-17 15:43:26 -08:00
Joshua Ashton
ec92dc75e5 rendervulkan: Fix release barrier
Need to use our queueFamilyIndex as the src.
2021-12-17 11:58:06 +01:00
Pierre-Loup A. Griffais
a7b484135d steamcompmgr: acknowledge screenshot request once it's actually done 2021-12-16 17:18:36 -08:00
Pierre-Loup A. Griffais
0a8346384b steamcompmgr: fix touch scaling bugs
We want to scale to remote play main UI plane even when we skip it, since
that's the one that properly sized to be a fullscreen  proxy for game input.
2021-12-16 01:46:13 -08:00
Joshua Ashton
8f67acdeb3 sdlwindow: Only process mouse motion when we're focused
Annoying to have the cursor moving around or the game view having a moment when we're not focused on the window.
2021-12-16 08:49:13 +01:00
Joshua Ashton
4b48c80ed3 steamcompmgr: Fix transient override focus crash
Only should try to find overrides if we have a focus (ie. focusing the right appid) and only of the appid we want.
2021-12-15 22:38:00 -08:00
Joshua Ashton
ced63bf255 rendervulkan: Clean up some stuff dependent on k_nMaxSamplers 2021-12-15 22:37:50 -08:00
Joshua Ashton
c102e49c2f steamcompmgr: Only release commits when window is gone 2021-12-15 21:29:16 -08:00
Joshua Ashton
023948e22d rendervulkan: Fix dangling YCbCr descriptors 2021-12-15 21:29:16 -08:00
Pierre-Loup A. Griffais
11a3bfb199 rendervulkan: change default YUV mode to limited color range
That's what Remote Play uses, we can add metadata to pick eventually but that'll
work for now.
2021-12-15 16:45:03 -08:00
Pierre-Loup A. Griffais
99e7ccf74d steamcompmgr: add programmatic way to take screenshots. 2021-12-15 00:57:53 -08:00
Joshua Ashton
ec58813268 steamcompmgr: Flush XSelectInput before reading properties 2021-12-14 15:51:50 -08:00
Joshua Ashton
ad244097db steamcompmgr: Set set_ignore before XDamageSubtract
Seems to be common across X compositors to do this from what I have seen.
2021-12-14 15:51:50 -08:00
Joshua Ashton
966439e84b steamcompmgr: Defer focus setting in X event loop
Otherwise we can get BadWindow errors as the window may have been destroyed later in the event list.
2021-12-14 15:51:50 -08:00
Joshua Ashton
bb3fd430eb sdlwindow: Don't hide window in Steam mode
Enables testing held commits, etc better.
2021-12-14 15:51:50 -08:00
Joshua Ashton
e6726ccc3a steamcompmgr: Clean up dangling commits on shutdown 2021-12-14 15:51:50 -08:00
Joshua Ashton
2019359448 steamcompmgr: Release commits on Window destruction
We could still have these hanging out in the commit queue after import doing nothing.
2021-12-14 15:51:50 -08:00
Joshua Ashton
c85de4a59c steamcompmgr: Add debugging for commit refs 2021-12-14 15:51:50 -08:00
Jan Beich
9553362865 steamcompmgr: add missing header for libc++ after 296a3d498d
src/steamcompmgr.cpp:270:41: error: implicit instantiation of undefined template 'std::array<commit_t, 2>'
std::array<commit_t, HELD_COMMIT_COUNT> g_HeldCommits;
                                        ^
/usr/include/c++/v1/__tuple:219:64: note: template is declared here
template <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array;
                                                               ^
src/steamcompmgr.cpp:1160:50: error: implicit instantiation of undefined template 'std::array<BaseLayerInfo_t, 2>'
std::array< BaseLayerInfo_t, HELD_COMMIT_COUNT > g_CachedPlanes = {};
                                                 ^
/usr/include/c++/v1/__tuple:219:64: note: template is declared here
template <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array;
                                                               ^
2021-12-14 18:12:19 +01:00
Joshua Ashton
dd22f8db76 steamcompmgr: Fix validContents nullptr deref
We check for this below, we should check it here too otherwise it's pointless
2021-12-13 23:47:29 -08:00
Joshua Ashton
cf20a692d8 steamcompmgr: Add --fade-out-duration option
Allows controling the fade out duration without recompiling the whole compositor.
2021-12-13 23:47:29 -08:00
Joshua Ashton
95baa301c7 steamcompmgr: Implement fades 2021-12-13 23:47:29 -08:00
Joshua Ashton
8a84b4d7e6 drm: Remove assertion about base layer opacity
We want this for fades.
2021-12-13 23:47:29 -08:00
Joshua Ashton
0252f44ffe rendervulkan: Handle base layer opacity 2021-12-13 23:47:29 -08:00
Joshua Ashton
06cb10683a steamcompmgr: Cache and preserve base commit until we get a new one
Fixes black frames when focusing new windows without commits yet.
2021-12-13 23:47:29 -08:00
Joshua Ashton
296a3d498d steamcompmgr: Add framework for held commits 2021-12-13 23:47:29 -08:00
Joshua Ashton
a5af1a78c1 steamcompmgr: Avoid deadlock between import_commit and destroy_buffer
Very rarely we can see a deadlock between import_commit and destroy_buffer where:

- destroy_buffer is waiting on `wlr_buffer_map_lock` and has `wlserver_lock` (from up the chain)

- import_commit has `wlr_buffer_map_lock` and is waiting on `wlserver_lock`

To avoid this, we simply replace the lock_guard in import_commit with a unique_lock and manually unlock this before going into the section where we need to lock the wl_server.

This is safe for a few reasons:
- 1: All accesses to wlr_buffer_map are done before this lock.
- 2: destroy_buffer cannot be called from this buffer before now
     as it only happens because of the signal added below.
- 3: "References to elements in the unordered_map container remain
	  valid in all cases, even after a rehash."
2021-12-13 23:46:39 -08:00
Joshua Ashton
952949f1a1 steamcompmgr: Fix crusty cursor in some scenarios
The PNG spec says that alpha is not premultiplied, so we need to do that.

(Although there are some things that do use PNG with premultiplied alpha... but let's just ignore that for now and go with the PNG spec and what we are getting exported to us to use on Deck.)

Cursor in X must have premultiplied alpha, our blending setup breaks a lot if this is not true.
2021-11-26 21:55:40 +01:00