Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

script: Add beginnings of config + script system #1527

Merged
merged 2 commits into from
Oct 7, 2024
Merged

Conversation

misyltoad
Copy link
Collaborator

Port our known display configs to this system, and expose some basic features such as logging and printing convars.

Very early work. See README.md in the scripts folder for more info.

@matte-schwartz
Copy link

LCD deck config table style currently coredumps, confirmed on both LCD Deck and ROG Ally. OLED Deck config style seems fine.

backtrace:
(gdb) thread apply all bt

Thread 6 (Thread 0x7f7b22bbc6c0 (LWP 1175)):
#0  0x00007f7b38db9ebe in ??? () at /usr/lib/libc.so.6
#1  0x00007f7b38dbc750 in pthread_cond_wait () at /usr/lib/libc.so.6
#2  0x00007f7b2d6ace5e in ??? () at /usr/lib/libvulkan_radeon.so
#3  0x00007f7b2d68774c in ??? () at /usr/lib/libvulkan_radeon.so
#4  0x00007f7b2d6acd8c in ??? () at /usr/lib/libvulkan_radeon.so
#5  0x00007f7b38dbd55a in ??? () at /usr/lib/libc.so.6
#6  0x00007f7b38e3aa5c in ??? () at /usr/lib/libc.so.6

Thread 5 (Thread 0x7f7b2e97a6c0 (LWP 1174)):
#0  0x00007f7b38e3ae86 in epoll_wait () at /usr/lib/libc.so.6
#1  0x000055848c55151e in gamescope::CWaiter<1024ul>::PollEvents (this=0x55848cb1b5e0 <g_LibEisWaiter>, nTimeOut=-1) at ../src/waitable.h:270
#2  0x000055848c5b0aca in gamescope::CAsyncWaiter<gamescope::CRawPointer<gamescope::IWaitable>, 1024ul>::WaiterThreadFunc (this=0x55848cb1b5e0 <g_LibEisWaiter>, pszThreadName=0x55848c849b17 "gamescope-eis") at ../src/waitable.h:456
#3  0x000055848c5ad174 in gamescope::CAsyncWaiter<gamescope::CRawPointer<gamescope::IWaitable>, 1024ul>::CAsyncWaiter(char const*)::{lambda()#1}::operator()() const (__closure=0x55848d53f568) at ../src/waitable.h:380
#4  0x000055848c5bfc37 in std::__invoke_impl<void, gamescope::CAsyncWaiter<gamescope::CRawPointer<gamescope::IWaitable>, 1024ul>::CAsyncWaiter(char const*)::{lambda()#1}>(std::__invoke_other, gamescope::CAsyncWaiter<gamescope::CRawPointer<gamescope::IWaitable>, 1024ul>::CAsyncWaiter(char const*)::{lambda()#1}&&) (__f=...) at /usr/include/c++/13.2.1/bits/invoke.h:61
#5  0x000055848c5bfbc1 in std::__invoke<gamescope::CAsyncWaiter<gamescope::CRawPointer<gamescope::IWaitable>, 1024ul>::CAsyncWaiter(char const*)::{lambda()#1}>(gamescope::CAsyncWaiter<gamescope::CRawPointer<gamescope::IWaitable>, 1024ul>::CAsyncWaiter(char const*)::{lambda()#1}&&) (__fn=...) at /usr/include/c++/13.2.1/bits/invoke.h:96
#6  0x000055848c5bfb02 in std::thread::_Invoker<std::tuple<gamescope::CAsyncWaiter<gamescope::CRawPointer<gamescope::IWaitable>, 1024ul>::CAsyncWaiter(char const*)::{lambda()#1}> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) (this=0x55848d53f568) at /usr/include/c++/13.2.1/bits/std_thread.h:292
#7  0x000055848c5bfa0e in std::thread::_Invoker<std::tuple<gamescope::CAsyncWaiter<gamescope::CRawPointer<gamescope::IWaitable>, 1024ul>::CAsyncWaiter(char const*)::{lambda()#1}> >::operator()() (this=0x55848d53f568) at /usr/include/c++/13.2.1/bits/std_thread.h:299
#8  0x000055848c5bf836 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<gamescope::CAsyncWaiter<gamescope::CRawPointer<gamescope::IWaitable>, 1024ul>::CAsyncWaiter(char const*)::{lambda()#1}> > >::_M_run() (this=0x55848d53f560) at /usr/include/c++/13.2.1/bits/std_thread.h:244
#9  0x00007f7b390e1b63 in std::execute_native_thread_routine (__p=0x55848d53f560) at /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/thread.cc:104
#10 0x00007f7b38dbd55a in ??? () at /usr/lib/libc.so.6
#11 0x00007f7b38e3aa5c in ??? () at /usr/lib/libc.so.6

Thread 4 (Thread 0x7f7b2f17b6c0 (LWP 1173)):
#0  0x00007f7b38e3ae86 in epoll_wait () at /usr/lib/libc.so.6
#1  0x000055848c55151e in gamescope::CWaiter<1024ul>::PollEvents (this=0x55848caf50a0 <g_ImageWaiter>, nTimeOut=-1) at ../src/waitable.h:270
#2  0x000055848c552d07 in gamescope::CAsyncWaiter<gamescope::Rc<commit_t, true>, 1024ul>::WaiterThreadFunc (this=0x55848caf50a0 <g_ImageWaiter>, pszThreadName=0x55848c83ba22 "gamescope_img") at ../src/waitable.h:456
#3  0x000055848c54cf8c in gamescope::CAsyncWaiter<gamescope::Rc<commit_t, true>, 1024ul>::CAsyncWaiter(char const*)::{lambda()#1}::operator()() const (__closure=0x55848d53d468) at ../src/waitable.h:380
#4  0x000055848c5855f3 in std::__invoke_impl<void, gamescope::CAsyncWaiter<gamescope::Rc<commit_t, true>, 1024ul>::CAsyncWaiter(char const*)::{lambda()#1}>(std::__invoke_other, gamescope::CAsyncWaiter<gamescope::Rc<commit_t, true>, 1024ul>::CAsyncWaiter(char const*)::{lambda()#1}&&) (__f=...) at /usr/include/c++/13.2.1/bits/invoke.h:61
#5  0x000055848c585563 in std::__invoke<gamescope::CAsyncWaiter<gamescope::Rc<commit_t, true>, 1024ul>::CAsyncWaiter(char const*)::{lambda()#1}>(gamescope::CAsyncWaiter<gamescope::Rc<commit_t, true>, 1024ul>::CAsyncWaiter(char const*)::{lambda()#1}&&) (__fn=...) at /usr/include/c++/13.2.1/bits/invoke.h:96
#6  0x000055848c5854ae in std::thread::_Invoker<std::tuple<gamescope::CAsyncWaiter<gamescope::Rc<commit_t, true>, 1024ul>::CAsyncWaiter(char const*)::{lambda()#1}> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) (this=0x55848d53d468) at /usr/include/c++/13.2.1/bits/std_thread.h:292
#7  0x000055848c585430 in std::thread::_Invoker<std::tuple<gamescope::CAsyncWaiter<gamescope::Rc<commit_t, true>, 1024ul>::CAsyncWaiter(char const*)::{lambda()#1}> >::operator()() (this=0x55848d53d468) at /usr/include/c++/13.2.1/bits/std_thread.h:299
#8  0x000055848c5852f6 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<gamescope::CAsyncWaiter<gamescope::Rc<commit_t, true>, 1024ul>::CAsyncWaiter(char const*)::{lambda()#1}> > >::_M_run() (this=0x55848d53d460) at /usr/include/c++/13.2.1/bits/std_thread.h:244
#9  0x00007f7b390e1b63 in std::execute_native_thread_routine (__p=0x55848d53d460) at /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/thread.cc:104
#10 0x00007f7b38dbd55a in ??? () at /usr/lib/libc.so.6
#11 0x00007f7b38e3aa5c in ??? () at /usr/lib/libc.so.6

Thread 3 (Thread 0x7f7b223bb6c0 (LWP 1176)):
#0  0x00007f7b38e06335 in clock_nanosleep () at /usr/lib/libc.so.6
#1  0x00007f7b38e113e7 in nanosleep () at /usr/lib/libc.so.6
#2  0x00007f7b2d53dad5 in ??? () at /usr/lib/libvulkan_radeon.so
#3  0x00007f7b2d6acd8c in ??? () at /usr/lib/libvulkan_radeon.so
#4  0x00007f7b38dbd55a in ??? () at /usr/lib/libc.so.6
#5  0x00007f7b38e3aa5c in ??? () at /usr/lib/libc.so.6

Thread 2 (Thread 0x7f7b213d16c0 (LWP 1177)):
#0  0x00007f7b2fdc8175 in ??? () at /usr/lib/libzstd.so.1
#1  0x00007f7b2fd9870d in ZSTD_decompressBlock_internal () at /usr/lib/libzstd.so.1
#2  0x00007f7b2fd9a0a3 in ??? () at /usr/lib/libzstd.so.1
#3  0x00007f7b2fd9a444 in ZSTD_decompress_usingDDict () at /usr/lib/libzstd.so.1
#4  0x00007f7b2fd9a54a in ZSTD_decompress () at /usr/lib/libzstd.so.1
#5  0x00007f7b2d695d90 in ??? () at /usr/lib/libvulkan_radeon.so
#6  0x00007f7b2d67be4a in ??? () at /usr/lib/libvulkan_radeon.so
#7  0x00007f7b2d67c525 in ??? () at /usr/lib/libvulkan_radeon.so
#8  0x00007f7b2d67b748 in ??? () at /usr/lib/libvulkan_radeon.so
#9  0x00007f7b2d60af02 in ??? () at /usr/lib/libvulkan_radeon.so
#10 0x00007f7b2d56ab22 in ??? () at /usr/lib/libvulkan_radeon.so
#11 0x00007f7b2d60a863 in ??? () at /usr/lib/libvulkan_radeon.so
#12 0x00007f7b2d60af27 in ??? () at /usr/lib/libvulkan_radeon.so
#13 0x00007f7b2d56b02d in ??? () at /usr/lib/libvulkan_radeon.so
#14 0x00007f7b2d56c0e3 in ??? () at /usr/lib/libvulkan_radeon.so
#15 0x00007f7b2d56c27a in ??? () at /usr/lib/libvulkan_radeon.so
#16 0x00007f7b2d56c50b in ??? () at /usr/lib/libvulkan_radeon.so
#17 0x000055848c5c80cd in CVulkanDevice::compilePipeline (this=0x55848cb1ba60 <g_device>, layerCount=4, ycbcrMask=2, type=SHADER_TYPE_BLUR_COND, blur_layer_count=2, composite_debug=0, colorspace_mask=0, output_eotf=0, itm_enable=false) at ../src/rendervulkan.cpp:1113
#18 0x000055848c5c843d in CVulkanDevice::compileAllPipelines (this=0x55848cb1ba60 <g_device>) at ../src/rendervulkan.cpp:1147
#19 0x000055848c5c4229 in operator() (__closure=0x55848d640548) at ../src/rendervulkan.cpp:300
#20 0x000055848c5d61d2 in std::__invoke_impl<void, CVulkanDevice::BInit(VkInstance, VkSurfaceKHR)::<lambda()> >(std::__invoke_other, struct {...} &&) (__f=...) at /usr/include/c++/13.2.1/bits/invoke.h:61
#21 0x000055848c5d6195 in std::__invoke<CVulkanDevice::BInit(VkInstance, VkSurfaceKHR)::<lambda()> >(struct {...} &&) (__fn=...) at /usr/include/c++/13.2.1/bits/invoke.h:96
#22 0x000055848c5d6142 in std::thread::_Invoker<std::tuple<CVulkanDevice::BInit(VkInstance, VkSurfaceKHR)::<lambda()> > >::_M_invoke<0>(std::_Index_tuple<0>) (this=0x55848d640548) at /usr/include/c++/13.2.1/bits/std_thread.h:292
#23 0x000055848c5d6116 in std::thread::_Invoker<std::tuple<CVulkanDevice::BInit(VkInstance, VkSurfaceKHR)::<lambda()> > >::operator()(void) (this=0x55848d640548) at /usr/include/c++/13.2.1/bits/std_thread.h:299
#24 0x000055848c5d60fa in std::thread::_State_impl<std::thread::_Invoker<std::tuple<CVulkanDevice::BInit(VkInstance, VkSurfaceKHR)::<lambda()> > > >::_M_run(void) (this=0x55848d640540) at /usr/include/c++/13.2.1/bits/std_thread.h:244
#25 0x00007f7b390e1b63 in std::execute_native_thread_routine (__p=0x55848d640540) at /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/thread.cc:104
#26 0x00007f7b38dbd55a in ??? () at /usr/lib/libc.so.6
#27 0x00007f7b38e3aa5c in ??? () at /usr/lib/libc.so.6

--Type <RET> for more, q to quit, c to continue without paging--c
Thread 1 (Thread 0x7f7b3845c580 (LWP 1172)):
#0  0x00007f7b390b22ba in std::type_info::name (this=<optimized out>) at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/typeinfo:104
#1  __gnu_cxx::__verbose_terminate_handler () at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/vterminate.cc:60
#2  0x00007f7b390b010c in __cxxabiv1::__terminate (handler=<optimized out>) at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:48
#3  0x00007f7b390b0179 in std::terminate () at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:58
#4  0x00007f7b390b042f in __cxxabiv1::__cxa_rethrow () at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_throw.cc:136
#5  0x000055848c693fe9 in std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<unsigned int const, gamescope::CDRMConnector>, false> > >::_M_allocate_node<std::piecewise_construct_t const&, std::tuple<unsigned int&>, std::tuple<_drmModeConnector*&> > (this=0x55848ca88ab8 <g_DRM+120>) at /usr/include/c++/13.2.1/bits/hashtable_policy.h:2003
#6  0x000055848c68f8a1 in std::_Hashtable<unsigned int, std::pair<unsigned int const, gamescope::CDRMConnector>, std::allocator<std::pair<unsigned int const, gamescope::CDRMConnector> >, std::__detail::_Select1st, std::equal_to<unsigned int>, std::hash<unsigned int>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::_Scoped_node::_Scoped_node<std::piecewise_construct_t const&, std::tuple<unsigned int&>, std::tuple<_drmModeConnector*&> > (this=0x7ffd28719100, __h=0x55848ca88ab8 <g_DRM+120>) at /usr/include/c++/13.2.1/bits/hashtable.h:307
#7  0x000055848c68b215 in std::_Hashtable<unsigned int, std::pair<unsigned int const, gamescope::CDRMConnector>, std::allocator<std::pair<unsigned int const, gamescope::CDRMConnector> >, std::__detail::_Select1st, std::equal_to<unsigned int>, std::hash<unsigned int>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::_M_emplace<std::piecewise_construct_t const&, std::tuple<unsigned int&>, std::tuple<_drmModeConnector*&> > (this=0x55848ca88ab8 <g_DRM+120>) at /usr/include/c++/13.2.1/bits/hashtable.h:2087
#8  0x000055848c6860c2 in std::_Hashtable<unsigned int, std::pair<unsigned int const, gamescope::CDRMConnector>, std::allocator<std::pair<unsigned int const, gamescope::CDRMConnector> >, std::__detail::_Select1st, std::equal_to<unsigned int>, std::hash<unsigned int>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::emplace<std::piecewise_construct_t const&, std::tuple<unsigned int&>, std::tuple<_drmModeConnector*&> > (this=0x55848ca88ab8 <g_DRM+120>) at /usr/include/c++/13.2.1/bits/hashtable.h:961
#9  0x000055848c67f3fc in std::unordered_map<unsigned int, gamescope::CDRMConnector, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, gamescope::CDRMConnector> > >::emplace<std::piecewise_construct_t const&, std::tuple<unsigned int&>, std::tuple<_drmModeConnector*&> > (this=0x55848ca88ab8 <g_DRM+120>) at /usr/include/c++/13.2.1/bits/unordered_map.h:396
#10 0x000055848c6687c9 in refresh_state (drm=0x55848ca88a40 <g_DRM>) at ../src/Backends/DRMBackend.cpp:767
#11 0x000055848c668d94 in get_resources (drm=0x55848ca88a40 <g_DRM>) at ../src/Backends/DRMBackend.cpp:852
#12 0x000055848c66a386 in init_drm (drm=0x55848ca88a40 <g_DRM>, width=0, height=0, refresh=0) at ../src/Backends/DRMBackend.cpp:1183
#13 0x000055848c67b690 in gamescope::CDRMBackend::Init (this=0x55848d553200) at ../src/Backends/DRMBackend.cpp:3175
#14 0x000055848c653687 in gamescope::IBackend::Set (pBackend=0x55848d553200) at ../src/backend.cpp:37
#15 0x000055848c673dcc in gamescope::IBackend::Set<gamescope::CDRMBackend> () at ../src/Backends/DRMBackend.cpp:3783
#16 0x000055848c59a784 in main (argc=26, argv=0x7ffd28719678) at ../src/main.cpp:859

@RodoMa92
Copy link

RodoMa92 commented Sep 19, 2024

According to the shipped edid (see here, included in the patcher sources), the colorimetry parameters are the following:
Red (X,Y) : (0.6396, 0.3300)
Green (X,Y): (0.2998, 0.5996)
Blue (X,Y): (0.1503, 0.0595)
White (X,Y): (0.3125, 0.3291)

I do not have the hardware to manually test these parameters on my panel, so someone else should calibrate one to get them (assuming there is not a huge panel variance between displays).

@misyltoad misyltoad marked this pull request as ready for review October 6, 2024 22:57
@misyltoad misyltoad force-pushed the new-config-lua branch 3 times, most recently from 8f87e2f to 51f1337 Compare October 7, 2024 17:21
Port our known display configs to this system, and expose
some basic features such as logging and printing convars.

Very early work. See README.md in the scripts folder for more info.
Borked on < Clang 19
@misyltoad misyltoad merged commit d7fab63 into master Oct 7, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants