Commit graph

491 commits

Author SHA1 Message Date
Simon Ser
02b233429f
Add error handling to drm_fbid_from_dmabuf 2020-05-19 10:52:51 +02:00
Simon Ser
d70df758a8
Remove dead code in xwayland_surface_role_commit
The FDs are guaranteed to be set if wlr_texture_to_dmabuf doesn't return
an error.
2020-05-15 15:26:48 +02:00
Simon Ser
48b429e7b1
Add n_planes == 1 assert in drm_fbid_from_dmabuf
This code assumes a single planes. Let's add a safe-guard so that we
don't forget this function when adding support for multiple planes.
2020-05-15 15:26:47 +02:00
Simon Ser
b305b7f123
Dup FD in CVulkanTexture::BInit
This saves us the wlr_dmabuf_attributes juggle and makes it easier to
understand the FDs ownership and lifetime.
2020-05-15 15:26:47 +02:00
Simon Ser
db876af1c4
Use wlr_dmabuf_attributes_finish instead of close
This ensures we don't leak any FD.
2020-05-15 14:48:07 +02:00
Simon Ser
8c2b9849ec
Update wlroots fork 2020-05-15 10:33:45 +02:00
Simon Ser
51259bba1c
Silence -Wunused-parameter for C code too 2020-05-15 10:20:59 +02:00
Simon Ser
b84750e775
Enable more warnings
Makes it easier to spot mistakes.
2020-05-15 10:03:55 +02:00
Pierre-Loup A. Griffais
09bc171666 Revert "steamcompmgr: attempt to get rid of damage_sequence"
This reverts commit de16a27674.
2020-05-13 13:52:02 -07:00
Rajdeep Nanua
810972b074 Correct integer scaling example in README 2020-05-13 01:37:31 +02:00
Simon Ser
c0bdf361d5
Don't set WAYLAND_DISPLAY
We don't actually support Wayland clients (yet). Xwayland doesn't use
WAYLAND_DISPLAY, the compositor creates a special Wayland socket instead.
2020-05-12 15:55:01 +02:00
Simon Ser
1e82803574
Improve initOutput error handling
Bail out on DRM error.
2020-05-12 15:07:52 +02:00
Simon Ser
dced8a88da
Switch VT on Ctrl+Alt+F<n>
Only works when switching to fbcon for now. We need to stop
page-flipping when the DRM FD is paused to support switching to another
compositor.

References: https://github.com/Plagman/gamescope/issues/6
2020-05-12 11:19:21 +02:00
Simon Ser
16d74b8e15
Fix segfault when system doesn't support Vulkan 2020-05-12 10:14:57 +02:00
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