Commit graph

227 commits

Author SHA1 Message Date
Simon Ser
fc72bda2cf Build libliftoff as a static library 2020-05-08 22:17:07 +02:00
Simon Ser
267036754c Build wlroots as a static subproject 2020-05-08 22:17:07 +02:00
Simon Ser
c147de2134 Fix alloc-dealloc-mismatch for win objects
win objects are allocated with `new`, so they need to be de-allocated
with `delete` instead of `free`.

    ==589398==ERROR: AddressSanitizer: alloc-dealloc-mismatch (operator new vs free) on 0x61200017f140
    (EE) failed to read Wayland events: Broken pipe
    X connection to :1 broken (explicit kill or server shutdown).
        #0 0x7f5468ae4720 in __interceptor_free /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:122
        #1 0x559820f5c9a0 in finish_destroy_win ../src/steamcompmgr.cpp:1743
        #2 0x559820f5ca6d in destroy_win ../src/steamcompmgr.cpp:1759
        #3 0x559820f6163e in steamcompmgr_main ../src/steamcompmgr.cpp:2288
        #4 0x559820f8e977 in steamCompMgrThreadRun() ../src/main.cpp:121
        #5 0x559820f8e3e9 in void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) /usr/include/c++/9.3.0/bits/invoke.h:60
        #6 0x559820f8e24f in std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) /usr/include/c++/9.3.0/bits/invoke.h:95
        #7 0x559820f8e0b3 in void std:🧵:_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) /usr/include/c++/9.3.0/thread:244
        #8 0x559820f8dfae in std:🧵:_Invoker<std::tuple<void (*)()> >::operator()() /usr/include/c++/9.3.0/thread:251
        #9 0x559820f8d7ba in std:🧵:_State_impl<std:🧵:_Invoker<std::tuple<void (*)()> > >::_M_run() /usr/include/c++/9.3.0/thread:195
        #10 0x7f5468006b23 in execute_native_thread_routine /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:80
        #11 0x7f546745346e in start_thread (/usr/lib/libpthread.so.0+0x946e)
        #12 0x7f54673833d2 in clone (/usr/lib/libc.so.6+0xff3d2)

    0x61200017f140 is located 0 bytes inside of 296-byte region [0x61200017f140,0x61200017f268)
    allocated by thread T40 here:
        #0 0x7f5468ae6968 in operator new(unsigned long) /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cc:104
        #1 0x559820f595fe in add_win ../src/steamcompmgr.cpp:1548
        #2 0x559820f614e8 in steamcompmgr_main ../src/steamcompmgr.cpp:2278
        #3 0x559820f8e977 in steamCompMgrThreadRun() ../src/main.cpp:121
        #4 0x559820f8e3e9 in void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) /usr/include/c++/9.3.0/bits/invoke.h:60
        #5 0x559820f8e24f in std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) /usr/include/c++/9.3.0/bits/invoke.h:95
        #6 0x559820f8e0b3 in void std:🧵:_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) /usr/include/c++/9.3.0/thread:244
        #7 0x559820f8dfae in std:🧵:_Invoker<std::tuple<void (*)()> >::operator()() /usr/include/c++/9.3.0/thread:251
        #8 0x559820f8d7ba in std:🧵:_State_impl<std:🧵:_Invoker<std::tuple<void (*)()> > >::_M_run() /usr/include/c++/9.3.0/thread:195
        #9 0x7f5468006b23 in execute_native_thread_routine /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:80

    Thread T40 created by T0 here:
        #0 0x7f5468a0e377 in __interceptor_pthread_create /build/gcc/src/gcc/libsanitizer/asan/asan_interceptors.cc:208
        #1 0x7f5468006df9 in __gthread_create /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu/bits/gthr-default.h:663
        #2 0x7f5468006df9 in std:🧵:_M_start_thread(std::unique_ptr<std:🧵:_State, std::default_delete<std:🧵:_State> >, void (*)()) /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:135
        #3 0x559820f8ea10 in startSteamCompMgr ../src/main.cpp:126
        #4 0x559820f95cfb in xwayland_ready ../src/wlserver.c:119
        #5 0x5598210de191 in wlr_signal_emit_safe ../subprojects/wlroots/util/signal.c:29
        #6 0x559820ff596b in xserver_handle_ready ../subprojects/wlroots/xwayland/xwayland.c:251
        #7 0x7f5468744434  (/usr/lib/libwayland-server.so.0+0xa434)
        #8 0x7ffc9796869f  ([stack]+0x1f69f)
2020-05-08 22:12:13 +02:00
Simon Ser
7733ffb769 Fix crash on touch up 2020-05-08 22:11:38 +02:00
Pierre-Loup A. Griffais
de16a27674 steamcompmgr: attempt to get rid of damage_sequence
It probably won't be as simple as that, but we'll see...
2020-04-06 18:28:54 -07:00
Pierre-Loup A. Griffais
37d30471af steamcompmgr: Add support for obeying transient windows. 2020-04-06 17:05:43 -07:00
Pierre-Loup A. Griffais
db062a47cd steamcompmgr: fixed unsigned math in screen magnifier
Offsets would wrap around and go nuts past the center, only top-left would
work.
2020-04-06 12:55:13 -07:00
Pierre-Loup A. Griffais
29eaa16785 wlserver: greatly simplify touch handling
Remove drag stickiness, delay before click, etc.

Also let the session specify which button is pressed on touch, if any.
2020-04-01 19:13:58 -07:00
Roman Gilg
f416279a1c Revert "feat: use global pointer position variable"
This reverts commit 0f8d679994.
2020-04-01 22:42:15 +02:00
Roman Gilg
5868f20502 Revert "feat: add relative pointer and constraints support"
This reverts commit a4fa525255.
2020-04-01 22:42:09 +02:00
Roman Gilg
b23b5b7189 Revert "refactor: unify pointer movement"
This reverts commit d4361f4649.
2020-04-01 22:41:58 +02:00
Roman Gilg
c2058733e3 Revert "refactor: remove unneeded cursor query functions"
This reverts commit 9547ec9a15.
2020-04-01 22:41:50 +02:00
Roman Gilg
4565766cc5 Revert "refactor: remove unneeded cursor calls on paint"
This reverts commit be1ff3d903.
2020-04-01 22:41:40 +02:00
Roman Gilg
beb29e251e build: update wlroots subproject
This has now recent change to include protocols directory explicitly.
2020-03-10 14:21:05 +01:00
Roman Gilg
42a268bd27 refactor: clean up layers properties loop
Restructure the loop a bit to have less code repetition and make it easier to
understand.
2020-03-10 02:02:40 +01:00
Roman Gilg
8833e07618 feat: add layer debugging via libliftoff log
Activate libliftoff's internal log when layers are enabled and the parameter
'd' is provided.

Note: this needs some patches to libliftoff to make the debug readable that I
have proposed upstream.
2020-03-10 02:02:40 +01:00
Roman Gilg
d17f234738 fix: continue layering when fbs available
Trying to layer onto planes should be continued when fb ids are set and
not the other way around. Here the assert also failed when only having
one layer.
2020-03-10 02:02:40 +01:00
Roman Gilg
be1ff3d903 refactor: remove unneeded cursor calls on paint
It is enough to get the global cursor location when repainting it. So we do not
need to query the relative position. If later on we find this is not right we
should be still able to get the relative position from the surface position
instead of calling into XWayland.

Also it is not expected and apparently unnecessary to move the cursor in the
paint function. Therefore remove this call too.
2020-03-10 01:55:58 +01:00
Roman Gilg
9547ec9a15 refactor: remove unneeded cursor query functions
With cursor position going through global variables we do not need to query the
global position anymore. Remove the MouseCursor function for that.

Furtheron the relative position getter is also not necessary, but let's remove
this one in a separate commit.

This commit also adds a debug line for debugging flaky focus changing.
2020-03-10 01:55:58 +01:00
Roman Gilg
d4361f4649 refactor: unify pointer movement
In nested mode we can use the same code path as in drm mode now.
2020-03-10 01:55:58 +01:00
Roman Gilg
a4fa525255 feat: add relative pointer and constraints support
For now only available on drm backend. For nested there is currently a
different workaround active making it work.

Closes #19
2020-03-10 01:55:58 +01:00
Roman Gilg
0f8d679994 feat: use global pointer position variable
Instead of going through the X11 connection just set the pointer position
directly via global variable.
2020-03-10 01:55:58 +01:00
Roman Gilg
f7d815a203 refactor: add cursor class
Puts all cursor relevant code into a single class. Preparation for getting
cursor movement directly through libinput.
2020-03-10 01:55:58 +01:00
Roman Gilg
920fe8bd8f style: remove trailing whitespace
Many code editiors remove trailing whitespace automatically making patches
difficult since often unrelated lines get changed with the same commit.

So remove the whitespace in the steamcompmgr file all at once in this separate
commit.
2020-03-10 01:55:58 +01:00
Pierre-Loup A. Griffais
95caa5c2fc
Merge pull request #27 from Oschowa/no-xxd
Use build in glslangValidator functionally to generate shader include
2020-03-03 17:50:07 -08:00
Oschowa
2a74683c11 Use build in glslangValidator functionally to generate shader include
file.
This removes the xxd dependency.
2020-01-28 21:30:20 +01:00
Pierre-Loup A. Griffais
bc39b20a8f steamcompmgr: fix rare crash when starting games (DOOM in this case). 2020-01-27 23:18:34 -08:00
Pierre-Loup A. Griffais
1bcd0bd930 Vulkan: fix a nasty race.
We could garbage-collect fences before/during their wait.
2020-01-27 22:46:38 -08:00
Pierre-Loup A. Griffais
578849e429 Vulkan: fix validation errors. 2020-01-27 22:32:16 -08:00
Pierre-Loup A. Griffais
06db3d903a steamcompmgr: close commit fd if no matching window.
That was probably a leak on app exit before?
2020-01-27 21:24:10 -08:00
Pierre-Loup A. Griffais
7e4b1d971c steamcompmgr: cleanup check_new_wayland_res.
Now that we can process everything in the queue, we can make the flow
a bit simpler.
2020-01-27 21:08:47 -08:00
Pierre-Loup A. Griffais
7df0b8655a steamcompmgr: add detail to fence debugging. 2020-01-28 04:10:58 +00:00
Pierre-Loup A. Griffais
e72724f050 embedded: fix a crash on startup in Portal.
Trying to push a new frame with no valid contents would send an
uninitialized texture handle to the Vulkan renderer.
2020-01-27 22:21:12 +00:00
Pierre-Loup A. Griffais
2b111b43dd SDL: initialize after wayland.
Otherwise the input thread can start doing wayland stuff before it's safe.
2020-01-26 17:51:27 -08:00
Pierre-Loup A. Griffais
b4893840eb vblank: more tweaks, align to DRM vblank. 2020-01-26 16:28:35 -08:00
Pierre-Loup A. Griffais
4ca73da9f6 vblankmanager: initial system to let steamcompmgr know when to repaint
For now just mark one repaint per refresh interval without any particular
alignment, as that can be hard to get in nested. We'll use the display
timing extensions for that later.

We'll have it align properly in embedded mode soon.
2020-01-26 14:59:51 -08:00
Pierre-Loup A. Griffais
5e3a9c9408 Vulkan: have a whole bunch more scratch command buffer slots
If running non-vsynced apps, we might need to keep track of 500+ in-flight
commits. Maybe make dynamic at some point?
2020-01-26 13:36:30 -08:00
Pierre-Loup A. Griffais
ca954bb237 steamcompmgr: rework how commits are handled
Keep track of a queue of commits and use the wait thread to get notified
when they're done.

Only repaint when new commits are done, not just queued.
2020-01-26 13:25:28 -08:00
Pierre-Loup A. Griffais
4f01be3bf5 Vulkan: shouldn't need to have synchronous uploads anymore. 2020-01-25 20:34:03 -08:00
Pierre-Loup A. Griffais
dfba164987 Vulkan: Remove one TODO by implementing deferred free for textures. 2020-01-25 20:31:19 -08:00
Pierre-Loup A. Griffais
9a177050e5 Vulkan: fix everything using the same command buffer.
We can't quite get away with it now that we want to kick off several
waits at the same time.
2020-01-25 19:51:11 -08:00
Pierre-Loup A. Griffais
982e61e28d steamcompmgr: add support for spewing stats into a pipe 2020-01-24 01:47:26 +00:00
Pierre-Loup A. Griffais
dde441b13f steamcompmgr: tweak focus logic to know about Steam pop-up windows
Like the standalone input configurator view.
2020-01-24 00:45:24 +00:00
Pierre-Loup A. Griffais
4079d0c785 steamcompmgr: rework a couple of things to plan for decoupling paints
- Add a commit wait thread that just waits for the work associated with
   an in-bound dma-buff is done. We'd like to be getting a fence directly
   from Wayland, but in the absence of that we'll make our own by tapping
   into implicit-sync, DX11-style. gpuvis logging of the outcome of the
   waits in the thread are consistent with the end of GPU work.

 - Rework wayland commit handoff between wlserver and steamcompmgr to let
   steamcompmgr have full access to the commit queue, letting it remove
   elements in the middle and still keep going, compared to the previous
   interface. This lets steamcompmgr get one commit per window per loop,
   for now. We should be able to kick off waits and ref/unref resources
   for all pending commits soon, with some work on the accounting first.

This should also fix an issue introduced recently where the overlay
could get really starved in embedded mode, as we were just getting
the first commit in the queue for a single frame.
2020-01-23 00:52:17 -08:00
Pierre-Loup A. Griffais
cf16f59e84 steamcompmgr: exit when subcommand exits, if there is one 2020-01-22 22:34:38 -08:00
Pierre-Loup A. Griffais
1830b53c2e steamcompmgr.cpp: rise 2020-01-22 21:50:01 -08:00
Pierre-Loup A. Griffais
74143121cd Fix instant crash on embedded from recent nested resize work. 2020-01-20 23:47:55 +00:00
Pierre-Loup A. Griffais
99af917abc README: document shortcuts. 2020-01-20 02:10:36 -08:00
Pierre-Loup A. Griffais
6183a70564 nested: toggle filter with meta+n 2020-01-20 02:04:57 -08:00
Pierre-Loup A. Griffais
4dcacf3cc1 steamcompmgr: make cursor scaling more current, remove some cruft. 2020-01-20 01:58:39 -08:00