Commit graph

405 commits

Author SHA1 Message Date
Simon Ser
f6fb47ad12
Explicitly enable VK_KHR_get_physical_device_properties2
VUID-vkCreateInstance-ppEnabledExtensionNames-01388(ERROR / SPEC): msgNum: -437968512 - Validation Error: [ VUID-vkCreateInstance-ppEnabledExtensionNames-01388 ] Object 0: VK_NULL_HANDLE, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0xe5e52180 | Missing extension required by the instance extension VK_KHR_external_memory_capabilities: VK_KHR_get_physical_device_properties2. The Vulkan spec states: All required extensions for each extension in the VkInstanceCreateInfo::ppEnabledExtensionNames list must also be present in that list (https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VUID-vkCreateInstance-ppEnabledExtensionNames-01388)
2020-10-23 17:24:53 +02:00
Simon Ser
fdc8527d01
sdlwindow: improve SDL error handling 2020-10-23 15:54:39 +02:00
Jan Beich
e8c9098187 steamcompmgr: drop unused private field after f7d815a203
In file included from ../src/steamcompmgr.cpp:74:
src/steamcompmgr.hpp:75:7: warning: private field 'm_hasPlane' is not used [-Wunused-private-field]
        bool m_hasPlane;
             ^
2020-10-22 10:23:40 +02:00
Jan Beich
1488ccc923 build: abort if wlroots is too old or lacks xwayland
src/wlserver.cpp:28:10: fatal error: 'wlr/xwayland.h' file not found
 #include <wlr/xwayland.h>
          ^~~~~~~~~~~~~~~~
src/drm.cpp:666:9: error: use of undeclared identifier 'wlr_buffer_lock'; did you mean 'wlr_buffer_ref'?
                buf = wlr_buffer_lock( buf );
                      ^~~~~~~~~~~~~~~
                      wlr_buffer_ref
/usr/include/wlr/types/wlr_buffer.h:55:20: note: 'wlr_buffer_ref' declared here
struct wlr_buffer *wlr_buffer_ref(struct wlr_buffer *buffer);
                   ^
src/drm.cpp:691:3: error: use of undeclared identifier 'wlr_buffer_unlock'; did you mean 'wlr_buffer_unref'?
                wlr_buffer_unlock( fb->buf );
                ^~~~~~~~~~~~~~~~~
                wlr_buffer_unref
/usr/include/wlr/types/wlr_buffer.h:60:6: note: 'wlr_buffer_unref' declared here
void wlr_buffer_unref(struct wlr_buffer *buffer);
     ^
src/steamcompmgr.cpp:593:2: error: use of undeclared identifier 'wlr_buffer_unlock'; did you mean 'wlr_buffer_unref'?
        wlr_buffer_unlock( commit.buf );
        ^~~~~~~~~~~~~~~~~
        wlr_buffer_unref
/usr/include/wlr/types/wlr_buffer.h:60:6: note: 'wlr_buffer_unref' declared here
void wlr_buffer_unref(struct wlr_buffer *buffer);
     ^
src/steamcompmgr.cpp:2491:4: error: use of undeclared identifier 'wlr_buffer_unlock'; did you mean 'wlr_buffer_unref'?
                        wlr_buffer_unlock( buf );
                        ^~~~~~~~~~~~~~~~~
                        wlr_buffer_unref
/usr/include/wlr/types/wlr_buffer.h:60:6: note: 'wlr_buffer_unref' declared here
void wlr_buffer_unref(struct wlr_buffer *buffer);
     ^
src/steamcompmgr.cpp:2507:46: error: member access into incomplete type 'struct wlr_client_buffer'
                        result = wlr_texture_to_dmabuf( client_buf->texture, &dmabuf );
                                                                  ^
src/steamcompmgr.cpp:2506:11: note: forward declaration of 'wlr_client_buffer'
                        struct wlr_client_buffer *client_buf = (struct wlr_client_buffer *) buf;
                               ^
2020-10-21 17:40:40 +02:00
Jan Beich
50093f7ee6 build: rename _dep vars to match pkg-config name
- wlroots_static_dep is wrong when dynamically linking system wlroots
- liftoff_dep contains a typo and `lib` prefix not present in pkg-config
2020-10-21 17:40:40 +02:00
Jan Beich
fc8c8fcfa8 build: fall back to system system deps without subprojects
`git archive` and `git clone` don't include submodules by default.
Downstream with up-to-date wlroots package may want to skip
populating subprojects/wlroots.
2020-10-21 17:40:40 +02:00
Jan Beich
6250685f0a build: drop unused dependencies per -Wl,--as-needed
- pixman and libinput are only used by wlroots
- xfixes is used directly, not just via xdamage
2020-10-20 23:53:54 +02:00
Jan Beich
0416b5fe08 steamcompmgr: add missing header
src/steamcompmgr.cpp: In function 'void statsThreadMain()':
src/steamcompmgr.cpp:357:62: error: 'O_WRONLY' was not declared in this scope
  357 |                 statsPipeFD = open( statsThreadPath.c_str(), O_WRONLY );
      |                                                              ^~~~~~~~
src/steamcompmgr.cpp:357:31: error: 'open' was not declared in this scope; did you mean 'popen'?
  357 |                 statsPipeFD = open( statsThreadPath.c_str(), O_WRONLY );
      |                               ^~~~
      |                               popen
src/steamcompmgr.cpp: In function 'void steamcompmgr_main(int, char**)':
src/steamcompmgr.cpp:2559:61: error: 'O_WRONLY' was not declared in this scope
 2559 |                                 readyPipeFD = open( optarg, O_WRONLY );
      |                                                             ^~~~~~~~
src/steamcompmgr.cpp:2559:47: error: 'open' was not declared in this scope; did you mean 'popen'?
 2559 |                                 readyPipeFD = open( optarg, O_WRONLY );
      |                                               ^~~~
      |                                               popen
2020-10-20 23:53:54 +02:00
Pierre-Loup A. Griffais
667d8afc54 wlserver: was wrong clickmode, we want 4, also fix some logic issues 2020-09-23 15:22:42 -07:00
Pierre-Loup A. Griffais
4f70525fc6 wlserver: add touch passthrough support, if clickmode == 0 2020-09-18 14:59:26 -07:00
Pierre-Loup A. Griffais
3a9aa01ded
Update README.md 2020-09-17 17:22:07 -07:00
Pierre-Loup A. Griffais
405f18b08d sdlwindow: add alternate refresh rate option when out-of-focus. 2020-09-15 14:57:11 -07:00
Pierre-Loup A. Griffais
fd7a81547a vblankmanager: obey nested refresh rate if set 2020-09-15 14:46:12 -07:00
Pierre-Loup A. Griffais
afccf2a4d1 steamcompmgr: still affect LD_PRELOAD if we strip everything from it
In cases where LD_PRELOAD only contained things we wanted to strip, we
weren't actually setting the result and stripping nothing.
2020-09-14 23:57:56 -07:00
Pierre-Loup A. Griffais
cdfe50d53b steamcompmgr: unset ENABLE_VKBASALT for subcommands
We only want gamescope's outermost swapchain to get hooked, similar as the
Steam overlay.
2020-09-14 13:13:30 -07:00
Pierre-Loup A. Griffais
0619998a49 rendervulkan: fall back to compute+graphics if compute-only can't be found
Should let people run against Intel and other non-AMD Mesa GPUs.

Also force compute+graphics if vkBasalt is enabled, as it won't support
compute-only rings. Also always composite if vkBasalt is enabled, so it
applies always in embedded.
2020-09-13 15:10:23 -07:00
Pierre-Loup A. Griffais
ebdd156df6 steamcompmgr: gracefully exit stats thread if exists. 2020-09-13 00:34:36 -07:00
Pierre-Loup A. Griffais
bff790eccb steamcompmgr: gracefully exit imageWaitThread and steamcompmgr loop. 2020-09-13 00:31:52 -07:00
Pierre-Loup A. Griffais
d7a85b00d9 sdlwindow: mimic window shown. 2020-09-13 00:19:02 -07:00
Simon Ser
0a5ecb45a9 Remove hack checking the window size
We now properly detect system tray icons, no need for this hack anymore.
2020-09-12 22:26:48 -07:00
Simon Ser
08e8b048e9 Add support for the system tray protocol
Blacklist system tray icons when deciding which window should have
focus.

Closes: https://github.com/Plagman/gamescope/issues/80
2020-09-12 22:26:48 -07:00
Joshua Ashton
9af5c3f254 Cleanup vblankmanager
Keep everything on the same timescale.
Avoid using floats here when we can just use integer maths.
Add demarcations.
Misc. cleanup.
2020-09-12 22:26:31 -07:00
Joshua Ashton
bb9d0cdf8f Use nanoseconds for vblank timing
Avoids locking on-vblank
STL's clock's accuracy can be funky also.
2020-09-12 22:26:31 -07:00
Joshua Ashton
325445a061 Add nano sleep helper functions 2020-09-12 22:26:31 -07:00
Joshua Ashton
50a508ae74 Encode vblank time in client message
Eliminates the atomic hack here
2020-09-12 22:26:31 -07:00
Joshua Ashton
d49c95569b Add get_time_in_nanos to header 2020-09-12 22:26:31 -07:00
Joshua Ashton
56442322cf Move nLayerCount and bSwapLayers to spec constants
Eliminates these comparisons being done from the constant buffer.
2020-09-02 20:43:40 -07:00
Joshua Ashton
b247f9f164 Move layer info to CompositeData_t struct
Have a nice struct for us to copy into the constant buffer
once we eliminate nLayerCount and nSwapChannels.
2020-09-02 20:43:40 -07:00
Joshua Ashton
d9920c9087 Add to-do note for frame submission time 2020-09-02 20:41:38 -07:00
Joshua Ashton
62b0a46cf3 Add demarcations to large time values
Increases readability
2020-09-02 20:41:38 -07:00
Joshua Ashton
1b8ff8a512 Base get_time_in_milliseconds off get_time_in_nanos
Avoids NTP drift and ensures time is uniformly monotonic.

No need to implement differently, this will overflow every 500-ish years.
2020-09-02 20:41:38 -07:00
Joshua Ashton
c57eb1bf28 Use MONOTONIC_RAW clock for vblank timing
``gettimeofday`` is expensive and suffers from NTP drift which means
we could miss vblank on time updates.
2020-09-02 20:41:38 -07:00
Oschowa
5954361cc3 Add an option to start in fullscreen if nested 2020-09-02 23:59:52 +02:00
Simon Ser
f268c17fb1 Setup an X IO error handler
The default erro handler calls exit(), which doesn't work well when
multiple threads are involved.

Closes: https://github.com/Plagman/gamescope/issues/46
2020-09-02 12:44:57 -07:00
Oschowa
9d6b37ee22 steamcompmgr: don't use 'd' suffix on float constant.
Fixes clang build error.
2020-09-02 11:15:02 -07:00
Oschowa
1ecb8d3b46 rendervulkan: don't mix designated and non-designated initializers 2020-09-02 11:15:02 -07:00
Pierre-Loup A. Griffais
e1d4937310 Different method of bumping priority.
Calling nice() in the very beginning ensures that Mesa worker threads in
gamescope and Xwayland can properly reduce their priority without us stomping
it later.

Move away from posix_spawn, since there's no easy way (that seems to work)
to keep priority normal for the spawned process and get the right behaviour
for gamescope and Xwayland.

The intermediate fork() lets us simplify the logic for LD_PRELOAD rewriting.
2020-09-02 11:06:30 -07:00
Simon Ser
f70308a36f
Exit with status 1 on error 2020-09-02 11:45:29 +02:00
Pierre-Loup A. Griffais
60ecb0f1f8 steamcompmgr: also set thread priorities for ourselves and Xwayland.
Avoid setting it for our children processes, by spawning them in a new
thread group and setting group-wide priority, which also conveniently
gets Xwayland.
2020-09-02 00:27:18 -07:00
Pierre-Loup A. Griffais
79d85ed532 steamcompmgr: better error handling for Vulkan device create failure.
alarm!!!
2020-09-01 23:29:49 -07:00
Pierre-Loup A. Griffais
22f20882b9 rendervulkan: use realtime priority async compute if CAP_SYS_NICE is set.
Fixes: https://github.com/Plagman/gamescope/issues/20.
2020-09-01 23:25:53 -07:00
Pierre-Loup A. Griffais
79cb130dcc sdlwindow: put all the SDL I/O code in the same spot. 2020-09-01 23:00:06 -07:00
Pierre-Loup A. Griffais
81b8e8c33c steamcompmgr: ignore vblank messages if we get them too late. 2020-09-01 22:59:44 -07:00
Pierre-Loup A. Griffais
b196cd063b steamcompmgr: show which window we're pushing commit waits for. 2020-09-01 18:03:09 -07:00
Pierre-Loup A. Griffais
8854cd8bd6 steamcompmgr: add 100ms timeout for commit wait thread.
poll() inexplicably blocks forever for some commits right now, this helps
a bit while we understand why.
2020-09-01 17:51:11 -07:00
Pierre-Loup A. Griffais
9f183ae76c drm: add gpuvis error spew when failing a legacy flip. 2020-09-01 16:16:45 -07:00
Pierre-Loup A. Griffais
11dd8014ad main: set R600_DEBUG=nodcc ourselves if we have a sub-command.
We know it's strictly better than not having it in the current state,
so might as well, if we know it'll apply to clients as well.
2020-09-01 16:01:20 -07:00
Simon Ser
aac57e7c75 Hold client buffers till KMS stops using them 2020-09-01 12:36:35 -07:00
Simon Ser
31a0713455 Copy commit queue in check_new_wayland_res
This will allow us to call wlr_buffer_lock/unlock in import_commit without
causing a deadlock.
2020-09-01 12:36:35 -07:00
Simon Ser
d88cfec0c2 Add wlr_buffer to commit queue
This lets us keep the buffers for pending commits locked.
2020-09-01 12:36:35 -07:00