diff --git a/spec_files/gamescope/1231.patch b/spec_files/gamescope/1231.patch new file mode 100644 index 00000000..e21cb0a8 --- /dev/null +++ b/spec_files/gamescope/1231.patch @@ -0,0 +1,239 @@ +From ab115896be1a448bde0eb7673c26300ea4ca5040 Mon Sep 17 00:00:00 2001 +From: sharkautarch <128002472+sharkautarch@users.noreply.github.com> +Date: Sun, 19 May 2024 20:15:36 -0400 +Subject: [PATCH 1/2] QueuePresent: canBypassXWayland(): fetch multiple xcb + cookies initially before waiting on any of them + +--- + layer/VkLayer_FROG_gamescope_wsi.cpp | 1 + + layer/xcb_helpers.hpp | 105 +++++++++++++++++++++++---- + 2 files changed, 93 insertions(+), 13 deletions(-) + +diff --git a/layer/VkLayer_FROG_gamescope_wsi.cpp b/layer/VkLayer_FROG_gamescope_wsi.cpp +index 5844c2a63..ca44849f2 100644 +--- a/layer/VkLayer_FROG_gamescope_wsi.cpp ++++ b/layer/VkLayer_FROG_gamescope_wsi.cpp +@@ -975,6 +975,7 @@ namespace GamescopeWSILayer { + continue; + } + ++ xcb::Prefetcher prefetcher(gamescopeSurface->connection, gamescopeSurface->window); + const bool canBypass = gamescopeSurface->canBypassXWayland(); + if (canBypass != gamescopeSwapchain->isBypassingXWayland) + UpdateSwapchainResult(canBypass ? VK_SUBOPTIMAL_KHR : VK_ERROR_OUT_OF_DATE_KHR); +diff --git a/layer/xcb_helpers.hpp b/layer/xcb_helpers.hpp +index 8fac5635b..72d0ec092 100644 +--- a/layer/xcb_helpers.hpp ++++ b/layer/xcb_helpers.hpp +@@ -4,22 +4,106 @@ + #include + #include + #include ++#include + + namespace xcb { ++ inline static constinit pthread_t g_cache_tid; //incase g_cache could otherwise be accessed by one thread, while it is being deleted by another thread ++ inline static constinit struct cookie_cache_t { ++ xcb_window_t window; ++ std::tuple cached_cookies; ++ std::tuple cached_replies; ++ } g_cache = {}; ++ ++ //Note: this class is currently only meant to be used within GamescopeWSILayer::VkDeviceOverrides::QueuePresentKHR: ++ struct Prefetcher { ++ explicit Prefetcher(xcb_connection_t* connection, const xcb_window_t window) { ++ g_cache = { ++ .window = window, ++ .cached_cookies = { ++ xcb_get_geometry(connection, window), ++ xcb_query_tree(connection, window) ++ } ++ }; ++ g_cache_tid = pthread_self(); ++ } + ++ ~Prefetcher() { ++ g_cache_tid = {}; ++ free(std::get<0>(g_cache.cached_replies)); ++ free(std::get<1>(g_cache.cached_replies)); ++ g_cache.cached_replies = {nullptr,nullptr}; ++ } ++ }; ++ + struct ReplyDeleter { ++ const bool m_bOwning = true; ++ consteval ReplyDeleter(bool bOwning = true) : m_bOwning{bOwning} {} + template + void operator()(T* ptr) const { +- free(const_cast*>(ptr)); ++ if (m_bOwning) ++ free(const_cast*>(ptr)); + } + }; + + template + using Reply = std::unique_ptr; ++ ++ template ++ class XcbFetch { ++ using cookie_f_ptr_t = Cookie_RetType (*)(XcbConn, Args...); ++ using reply_f_ptr_t = Reply_RetType* (*)(XcbConn, Cookie_RetType, xcb_generic_error_t**); ++ ++ const cookie_f_ptr_t m_cookieFunc; ++ const reply_f_ptr_t m_replyFunc; ++ ++ public: ++ consteval XcbFetch(cookie_f_ptr_t cookieFunc, reply_f_ptr_t replyFunc) : m_cookieFunc{cookieFunc}, m_replyFunc{replyFunc} {} ++ ++ inline Reply operator()(XcbConn conn, auto... args) { //have to use auto for argsTwo, since otherwise there'd be a type deduction conflict ++ return Reply { m_replyFunc(conn, m_cookieFunc(conn, args...), nullptr) }; ++ } ++ }; ++ ++ template ++ concept CacheableCookie = std::is_same::value ++ || std::is_same::value; ++ ++ template ++ class XcbFetch { ++ using cookie_f_ptr_t = Cookie_RetType (*)(xcb_connection_t*, xcb_window_t); ++ using reply_f_ptr_t = Reply_RetType* (*)(xcb_connection_t*, Cookie_RetType, xcb_generic_error_t**); ++ ++ const cookie_f_ptr_t m_cookieFunc; ++ const reply_f_ptr_t m_replyFunc; ++ ++ inline Reply getCachedReply(xcb_connection_t* connection) { ++ if (std::get(g_cache.cached_replies) == nullptr) { ++ std::get(g_cache.cached_replies) = m_replyFunc(connection, std::get(g_cache.cached_cookies), nullptr); ++ } + ++ return Reply{std::get(g_cache.cached_replies), ReplyDeleter{false}}; // return 'non-owning' unique_ptr ++ } ++ ++ public: ++ consteval XcbFetch(cookie_f_ptr_t cookieFunc, reply_f_ptr_t replyFunc) : m_cookieFunc{cookieFunc}, m_replyFunc{replyFunc} {} ++ ++ inline Reply operator()(xcb_connection_t* conn, xcb_window_t window) { ++ const bool tryCached = pthread_equal(g_cache_tid, pthread_self()) ++ && g_cache.window == window; ++ if (!tryCached) [[unlikely]] ++ return Reply { m_replyFunc(conn, m_cookieFunc(conn, window), nullptr) }; ++ ++ auto ret = getCachedReply(conn); ++ #if !defined(NDEBUG) || NDEBUG == 0 ++ if (!ret) ++ fprintf(stderr, "[Gamescope WSI] getCachedReply() failed.\n"); ++ #endif ++ return ret; ++ } ++ }; ++ + static std::optional getAtom(xcb_connection_t* connection, std::string_view name) { +- xcb_intern_atom_cookie_t cookie = xcb_intern_atom(connection, false, name.length(), name.data()); +- auto reply = Reply{ xcb_intern_atom_reply(connection, cookie, nullptr) }; ++ auto reply = XcbFetch{xcb_intern_atom, xcb_intern_atom_reply}(connection, false, name.length(), name.data()); + if (!reply) { + fprintf(stderr, "[Gamescope WSI] Failed to get xcb atom.\n"); + return std::nullopt; +@@ -34,8 +118,7 @@ namespace xcb { + + xcb_screen_t* screen = xcb_setup_roots_iterator(xcb_get_setup(connection)).data; + +- xcb_get_property_cookie_t cookie = xcb_get_property(connection, false, screen->root, atom, XCB_ATOM_CARDINAL, 0, sizeof(T) / sizeof(uint32_t)); +- auto reply = Reply{ xcb_get_property_reply(connection, cookie, nullptr) }; ++ auto reply = XcbFetch{xcb_get_property, xcb_get_property_reply}(connection, false, screen->root, atom, XCB_ATOM_CARDINAL, 0, sizeof(T) / sizeof(uint32_t)); + if (!reply) { + fprintf(stderr, "[Gamescope WSI] Failed to read T root window property.\n"); + return std::nullopt; +@@ -61,8 +144,7 @@ namespace xcb { + + static std::optional getToplevelWindow(xcb_connection_t* connection, xcb_window_t window) { + for (;;) { +- xcb_query_tree_cookie_t cookie = xcb_query_tree(connection, window); +- auto reply = Reply{ xcb_query_tree_reply(connection, cookie, nullptr) }; ++ auto reply = XcbFetch{xcb_query_tree, xcb_query_tree_reply}(connection, window); + + if (!reply) { + fprintf(stderr, "[Gamescope WSI] getToplevelWindow: xcb_query_tree failed for window 0x%x.\n", window); +@@ -77,8 +159,7 @@ namespace xcb { + } + + static std::optional getWindowRect(xcb_connection_t* connection, xcb_window_t window) { +- xcb_get_geometry_cookie_t cookie = xcb_get_geometry(connection, window); +- auto reply = Reply{ xcb_get_geometry_reply(connection, cookie, nullptr) }; ++ auto reply = XcbFetch{xcb_get_geometry, xcb_get_geometry_reply}(connection, window); + if (!reply) { + fprintf(stderr, "[Gamescope WSI] getWindowRect: xcb_get_geometry failed for window 0x%x.\n", window); + return std::nullopt; +@@ -112,8 +193,7 @@ namespace xcb { + static std::optional getLargestObscuringChildWindowSize(xcb_connection_t* connection, xcb_window_t window) { + VkExtent2D largestExtent = {}; + +- xcb_query_tree_cookie_t cookie = xcb_query_tree(connection, window); +- auto reply = Reply{ xcb_query_tree_reply(connection, cookie, nullptr) }; ++ auto reply = XcbFetch{xcb_query_tree, xcb_query_tree_reply}(connection, window); + + if (!reply) { + fprintf(stderr, "[Gamescope WSI] getLargestObscuringWindowSize: xcb_query_tree failed for window 0x%x.\n", window); +@@ -130,8 +210,7 @@ namespace xcb { + for (uint32_t i = 0; i < reply->children_len; i++) { + xcb_window_t child = children[i]; + +- xcb_get_window_attributes_cookie_t attributeCookie = xcb_get_window_attributes(connection, child); +- auto attributeReply = Reply{ xcb_get_window_attributes_reply(connection, attributeCookie, nullptr) }; ++ auto attributeReply = XcbFetch{xcb_get_window_attributes, xcb_get_window_attributes_reply}(connection, child); + + const bool obscuring = + attributeReply && + +From 1b59621f4de5c05096d1f279cba2e04264124154 Mon Sep 17 00:00:00 2001 +From: sharkautarch <128002472+sharkautarch@users.noreply.github.com> +Date: Tue, 18 Jun 2024 22:21:23 -0400 +Subject: [PATCH 2/2] WSI: prefetcher: fix issue w/ attempting to prefetch xcb + stuff for pure wayland surfaces + +--- + layer/VkLayer_FROG_gamescope_wsi.cpp | 2 +- + layer/xcb_helpers.hpp | 9 ++++++++- + 2 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/layer/VkLayer_FROG_gamescope_wsi.cpp b/layer/VkLayer_FROG_gamescope_wsi.cpp +index f26819a60..ce011dcd7 100644 +--- a/layer/VkLayer_FROG_gamescope_wsi.cpp ++++ b/layer/VkLayer_FROG_gamescope_wsi.cpp +@@ -1234,7 +1234,7 @@ namespace GamescopeWSILayer { + continue; + } + +- xcb::Prefetcher prefetcher(gamescopeSurface->connection, gamescopeSurface->window); ++ auto prefetcher = xcb::Prefetcher::GetPrefetcherIf(!gamescopeSurface->isWayland(), gamescopeSurface->connection, gamescopeSurface->window); + const bool canBypass = gamescopeSurface->canBypassXWayland(); + if (canBypass != gamescopeSwapchain->isBypassingXWayland) + UpdateSwapchainResult(canBypass ? VK_SUBOPTIMAL_KHR : VK_ERROR_OUT_OF_DATE_KHR); +diff --git a/layer/xcb_helpers.hpp b/layer/xcb_helpers.hpp +index 72d0ec092..f26aef38b 100644 +--- a/layer/xcb_helpers.hpp ++++ b/layer/xcb_helpers.hpp +@@ -16,6 +16,13 @@ namespace xcb { + + //Note: this class is currently only meant to be used within GamescopeWSILayer::VkDeviceOverrides::QueuePresentKHR: + struct Prefetcher { ++ static std::optional GetPrefetcherIf(bool bCond, xcb_connection_t* connection, const xcb_window_t window) { ++ if (bCond) ++ return std::optional(std::in_place_t{}, connection, window); ++ ++ return std::nullopt; ++ } ++ + explicit Prefetcher(xcb_connection_t* connection, const xcb_window_t window) { + g_cache = { + .window = window, +@@ -90,7 +97,7 @@ namespace xcb { + inline Reply operator()(xcb_connection_t* conn, xcb_window_t window) { + const bool tryCached = pthread_equal(g_cache_tid, pthread_self()) + && g_cache.window == window; +- if (!tryCached) [[unlikely]] ++ if (!tryCached) + return Reply { m_replyFunc(conn, m_cookieFunc(conn, window), nullptr) }; + + auto ret = getCachedReply(conn); diff --git a/spec_files/gamescope/1335.patch b/spec_files/gamescope/1335.patch new file mode 100644 index 00000000..515c829a --- /dev/null +++ b/spec_files/gamescope/1335.patch @@ -0,0 +1,127 @@ +From 35f5ba8bb9297d06b7d8238295ae3601367d91ad Mon Sep 17 00:00:00 2001 +From: sharkautarch <128002472+sharkautarch@users.noreply.github.com> +Date: Fri, 24 May 2024 15:43:09 -0400 +Subject: [PATCH 1/2] sdlwindow.cpp: close m_thread w/o std::terminate being + called + +--- + src/Backends/SDLBackend.cpp | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/src/Backends/SDLBackend.cpp b/src/Backends/SDLBackend.cpp +index d7456b6a4..5420683a3 100644 +--- a/src/Backends/SDLBackend.cpp ++++ b/src/Backends/SDLBackend.cpp +@@ -53,6 +53,7 @@ namespace gamescope + GAMESCOPE_SDL_EVENT_CURSOR, + + GAMESCOPE_SDL_EVENT_COUNT, ++ GAMESCOPE_SDL_EVENT_REQ_EXIT, + }; + + class CSDLConnector final : public IBackendConnector +@@ -111,6 +112,7 @@ namespace gamescope + { + public: + CSDLBackend(); ++ ~CSDLBackend(); + + ///////////// + // IBackend +@@ -548,7 +550,12 @@ namespace gamescope + { + // Do nothing. + } +- ++ ++ CSDLBackend::~CSDLBackend() { ++ PushUserEvent(GAMESCOPE_SDL_EVENT_REQ_EXIT); ++ m_SDLThread.join(); ++ } ++ + void CSDLBackend::SDLThreadFunc() + { + pthread_setname_np( pthread_self(), "gamescope-sdl" ); +@@ -944,6 +951,9 @@ namespace gamescope + + SDL_SetCursor( m_pCursor ); + } ++ else if ( event.type == GetUserEventIndex( GAMESCOPE_SDL_EVENT_REQ_EXIT ) ) { ++ return; ++ } + } + break; + } + +From 61392a9e545e0a3341c0d510aaa453c08826cc5b Mon Sep 17 00:00:00 2001 +From: sharkautarch <128002472+sharkautarch@users.noreply.github.com> +Date: Thu, 30 May 2024 14:02:00 -0400 +Subject: [PATCH 2/2] steamcompmgr, rendervulkan: prevent segfault that occured + when closing gamescope, due to a race condition between present thread @ + present_wait_thread_func & compositor thread @ steamcompmgr_exit + +--- + src/rendervulkan.cpp | 7 ++++++- + src/rendervulkan.hpp | 4 ++++ + src/steamcompmgr.cpp | 8 ++++++++ + 3 files changed, 18 insertions(+), 1 deletion(-) + +diff --git a/src/rendervulkan.cpp b/src/rendervulkan.cpp +index ffd0783da..094141839 100644 +--- a/src/rendervulkan.cpp ++++ b/src/rendervulkan.cpp +@@ -2669,7 +2669,8 @@ bool acquire_next_image( void ) + } + + +-static std::atomic g_currentPresentWaitId = {0u}; ++inline std::atomic g_currentPresentWaitId = {0u}; ++inline std::atomic g_presentThreadShouldExit = {false}; + static std::mutex present_wait_lock; + + extern void mangoapp_output_update( uint64_t vblanktime ); +@@ -2693,6 +2694,10 @@ static void present_wait_thread_func( void ) + uint64_t vblanktime = get_time_in_nanos(); + GetVBlankTimer().MarkVBlank( vblanktime, true ); + mangoapp_output_update( vblanktime ); ++ } else if ( g_presentThreadShouldExit.load(std::memory_order_acquire)) { ++ g_presentThreadShouldExit = 0; ++ g_presentThreadShouldExit.notify_all(); ++ return; + } + } + } +diff --git a/src/rendervulkan.hpp b/src/rendervulkan.hpp +index 177468228..a2e0dd972 100644 +--- a/src/rendervulkan.hpp ++++ b/src/rendervulkan.hpp +@@ -74,6 +74,10 @@ enum EStreamColorspace : int + #include + #include + ++extern std::atomic g_currentPresentWaitId; ++ ++extern std::atomic g_presentThreadShouldExit; ++ + struct VulkanRenderer_t + { + struct wlr_renderer base; +diff --git a/src/steamcompmgr.cpp b/src/steamcompmgr.cpp +index 910ed3912..f6539829e 100644 +--- a/src/steamcompmgr.cpp ++++ b/src/steamcompmgr.cpp +@@ -5840,6 +5840,14 @@ steamcompmgr_exit(void) + } + } + ++ //request the present_wait thread to exit ++ //needed to avoid getting a segfault at exit due to race condition: ++ g_presentThreadShouldExit.store(true, std::memory_order_release); ++ g_currentPresentWaitId = 0; //present thread will check if it should exit if this is zero ++ g_currentPresentWaitId.notify_all(); ++ g_presentThreadShouldExit.wait(true); //present thread will toggle this atomic when it sees the exit request ++ //this allows us to wait for present thread to close before deleting the backend ++ + gamescope::IBackend::Set( nullptr ); + + wlserver_lock(); diff --git a/spec_files/gamescope/gamescope.spec b/spec_files/gamescope/gamescope.spec index 4d6e0592..2146f9a8 100644 --- a/spec_files/gamescope/gamescope.spec +++ b/spec_files/gamescope/gamescope.spec @@ -2,11 +2,11 @@ %global _default_patch_fuzz 2 %global build_timestamp %(date +"%Y%m%d") -%global gamescope_tag 3.14.22 +%global gamescope_tag 3.14.23 Name: gamescope Version: 100.%{gamescope_tag} -Release: 9.bazzite +Release: 11.bazzite Summary: Micro-compositor for video games on Wayland License: BSD @@ -15,10 +15,20 @@ URL: https://github.com/ValveSoftware/gamescope # Create stb.pc to satisfy dependency('stb') Source0: stb.pc +# https://github.com/ChimeraOS/gamescope Patch0: chimeraos.patch +# https://hhd.dev/ Patch1: disable-steam-touch-click-atom.patch +# https://github.com/ValveSoftware/gamescope/pull/1281 Patch2: deckhd.patch +# https://github.com/ValveSoftware/gamescope/issues/1398 Patch3: drm-Separate-BOE-and-SDC-OLED-Deck-panel-rates.patch +# https://github.com/ValveSoftware/gamescope/issues/1369 +Patch4: revert-299bc34.patch +# https://github.com/ValveSoftware/gamescope/pull/1335 +Patch5: 1335.patch +# https://github.com/ValveSoftware/gamescope/pull/1231 +Patch6: 1231.patch BuildRequires: meson >= 0.54.0 BuildRequires: ninja-build diff --git a/spec_files/gamescope/revert-299bc34.patch b/spec_files/gamescope/revert-299bc34.patch new file mode 100644 index 00000000..550870fe --- /dev/null +++ b/spec_files/gamescope/revert-299bc34.patch @@ -0,0 +1,65 @@ +diff --git a/src/steamcompmgr.cpp b/src/steamcompmgr.cpp +index d7498e5..d1800a8 100644 +--- a/src/steamcompmgr.cpp ++++ b/src/steamcompmgr.cpp +@@ -3271,7 +3271,7 @@ found:; + if ( window_has_commits( focus ) ) + out->focusWindow = focus; + else +- focus->outdatedInteractiveFocus = true; ++ out->outdatedInteractiveFocus = true; + + // Always update X's idea of focus, but still dirty + // the it being outdated so we can resolve that globally later. +@@ -5995,28 +5995,37 @@ bool handle_done_commit( steamcompmgr_win_t *w, xwayland_ctx_t *ctx, uint64_t co + // Window just got a new available commit, determine if that's worth a repaint + + // If this is an overlay that we're presenting, repaint +- if ( w == global_focus.overlayWindow && w->opacity != TRANSLUCENT ) ++ if ( gameFocused ) + { +- hasRepaintNonBasePlane = true; +- } ++ if ( w == global_focus.overlayWindow && w->opacity != TRANSLUCENT ) ++ { ++ hasRepaintNonBasePlane = true; ++ } + +- if ( w == global_focus.notificationWindow && w->opacity != TRANSLUCENT ) +- { +- hasRepaintNonBasePlane = true; ++ if ( w == global_focus.notificationWindow && w->opacity != TRANSLUCENT ) ++ { ++ hasRepaintNonBasePlane = true; ++ } + } +- +- // If this is an external overlay, repaint +- if ( w == global_focus.externalOverlayWindow && w->opacity != TRANSLUCENT ) ++ if ( ctx ) + { +- hasRepaintNonBasePlane = true; ++ if ( ctx->focus.outdatedInteractiveFocus ) ++ { ++ MakeFocusDirty(); ++ ctx->focus.outdatedInteractiveFocus = false; ++ } + } +- +- if ( w->outdatedInteractiveFocus ) ++ if ( global_focus.outdatedInteractiveFocus ) + { + MakeFocusDirty(); +- w->outdatedInteractiveFocus = false; +- } ++ global_focus.outdatedInteractiveFocus = false; + ++ // If this is an external overlay, repaint ++ if ( w == global_focus.externalOverlayWindow && w->opacity != TRANSLUCENT ) ++ { ++ hasRepaintNonBasePlane = true; ++ } ++ } + // If this is the main plane, repaint + if ( w == global_focus.focusWindow && !w->isSteamStreamingClient ) + { diff --git a/spec_files/mesa/29979.patch b/spec_files/mesa/29979.patch new file mode 100644 index 00000000..1898e1c9 --- /dev/null +++ b/spec_files/mesa/29979.patch @@ -0,0 +1,75 @@ +From cbd19e09d1e293b6b34a30312aac3c865f42b244 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michel=20D=C3=A4nzer?= +Date: Mon, 1 Jul 2024 10:05:52 +0200 +Subject: [PATCH] dri: Go back to hard-coded list of RGBA formats + +Catching these programmatically without false positives / negatives is +surprisingly tricky, go back to the known-working list for now. + +Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11398 +Fixes: ad0edea53a73 ("st/dri: Check format properties from format helpers") +Fixes: 5ca85d75c05d ("dri: Fix BGR format exclusion") + +v2: +* Also put back lima fails removed by 9eeaa4618f8a ("egl/gbm: Enable + RGBA configs"), as those tests are now failing again. + +Part-of: +--- + src/gallium/drivers/lima/ci/lima-fails.txt | 2 ++ + src/gallium/frontends/dri/dri_screen.c | 25 +++++++++------------- + 2 files changed, 12 insertions(+), 15 deletions(-) + +diff --git a/src/gallium/drivers/lima/ci/lima-fails.txt b/src/gallium/drivers/lima/ci/lima-fails.txt +index 155498dbb5679..d6c4edbb5ef5e 100644 +--- a/src/gallium/drivers/lima/ci/lima-fails.txt ++++ b/src/gallium/drivers/lima/ci/lima-fails.txt +@@ -55,7 +55,9 @@ wayland-dEQP-EGL.functional.wide_color.window_888_colorspace_srgb,Fail + + x11-dEQP-EGL.functional.create_context.no_config,Fail + x11-dEQP-EGL.functional.image.modify.renderbuffer_depth16_renderbuffer_clear_depth,Fail ++x11-dEQP-EGL.functional.render.multi_context.gles2.rgb888_window,Fail + x11-dEQP-EGL.functional.render.multi_context.gles2.rgba8888_pbuffer,Fail ++x11-dEQP-EGL.functional.render.multi_thread.gles2.rgb888_window,Fail + x11-dEQP-EGL.functional.render.multi_thread.gles2.rgba8888_pbuffer,Fail + x11-dEQP-EGL.functional.wide_color.pbuffer_8888_colorspace_srgb,Fail + x11-dEQP-EGL.functional.wide_color.window_8888_colorspace_srgb,Fail +diff --git a/src/gallium/frontends/dri/dri_screen.c b/src/gallium/frontends/dri/dri_screen.c +index 2e9ce01147a89..15dde5152b837 100644 +--- a/src/gallium/frontends/dri/dri_screen.c ++++ b/src/gallium/frontends/dri/dri_screen.c +@@ -386,21 +386,16 @@ dri_fill_in_modes(struct dri_screen *screen) + uint8_t msaa_modes[MSAA_VISUAL_MAX_SAMPLES]; + + /* Expose only BGRA ordering if the loader doesn't support RGBA ordering. */ +- if (!allow_rgba_ordering) { +- unsigned sh_ax = util_format_get_component_shift(pipe_formats[f], UTIL_FORMAT_COLORSPACE_RGB, 3); +- unsigned sh_b = util_format_get_component_shift(pipe_formats[f], UTIL_FORMAT_COLORSPACE_RGB, 2); +-#if UTIL_ARCH_BIG_ENDIAN +- unsigned sz_b = util_format_get_component_bits(pipe_formats[f], UTIL_FORMAT_COLORSPACE_RGB, 2); +- +- if (sz_b + sh_b == sh_ax) +- continue; +-#else +- unsigned sz_ax = util_format_get_component_bits(pipe_formats[f], UTIL_FORMAT_COLORSPACE_RGB, 3); +- +- if (sz_ax + sh_ax == sh_b) +- continue; +-#endif +- } ++ if (!allow_rgba_ordering && ++ (pipe_formats[f] == PIPE_FORMAT_RGBA8888_UNORM || ++ pipe_formats[f] == PIPE_FORMAT_RGBX8888_UNORM || ++ pipe_formats[f] == PIPE_FORMAT_RGBA8888_SRGB || ++ pipe_formats[f] == PIPE_FORMAT_RGBX8888_SRGB || ++ pipe_formats[f] == PIPE_FORMAT_R5G5B5A1_UNORM || ++ pipe_formats[f] == PIPE_FORMAT_R5G5B5X1_UNORM || ++ pipe_formats[f] == PIPE_FORMAT_R4G4B4A4_UNORM || ++ pipe_formats[f] == PIPE_FORMAT_R4G4B4X4_UNORM)) ++ continue; + + if (!allow_rgb10 && + util_format_get_component_bits(pipe_formats[f], +-- +GitLab + diff --git a/spec_files/mesa/mesa.spec b/spec_files/mesa/mesa.spec index 7994b4fd..8c2de733 100644 --- a/spec_files/mesa/mesa.spec +++ b/spec_files/mesa/mesa.spec @@ -1,9 +1,13 @@ %ifnarch s390x %global with_hardware 1 +%global with_radeonsi 1 +%global with_vmware 1 %global with_vulkan_hw 1 %global with_vdpau 1 %global with_va 1 %if !0%{?rhel} +%global with_r300 1 +%global with_r600 1 %global with_nine 1 %global with_nvk %{with vulkan_hw} %global with_omx 1 @@ -12,16 +16,23 @@ %global base_vulkan ,amd %endif +%ifnarch %{ix86} +%if !0%{?rhel} +%global with_teflon 1 +%endif +%endif + %ifarch %{ix86} x86_64 %global with_crocus 1 %global with_i915 1 -%if !0%{?rhel} -%global with_intel_clc 1 -%endif %global with_iris 1 %global with_xa 1 +%global with_intel_clc 1 %global intel_platform_vulkan ,intel,intel_hasvk %endif +%ifarch x86_64 +%global with_intel_vk_rt 1 +%endif %ifarch aarch64 x86_64 %{ix86} %if !0%{?rhel} @@ -38,15 +49,6 @@ %global extra_platform_vulkan ,broadcom,freedreno,panfrost,imagination-experimental %endif -%ifnarch s390x -%if !0%{?rhel} -%global with_r300 1 -%global with_r600 1 -%endif -%global with_radeonsi 1 -%global with_vmware 1 -%endif - %if !0%{?rhel} %global with_libunwind 1 %global with_lmsensors 1 @@ -64,7 +66,7 @@ Name: mesa Summary: Mesa graphics libraries %global ver 24.1.2 Version: %{lua:ver = string.gsub(rpm.expand("%{ver}"), "-", "~"); print(ver)} -Release: 100.bazzite.{{{ git_dir_version }}} +Release: 101.bazzite.{{{ git_dir_version }}} License: MIT AND BSD-3-Clause AND SGI-B-2.0 URL: http://www.mesa3d.org @@ -78,27 +80,26 @@ Patch10: gnome-shell-glthread-disable.patch Patch11: 0001-llvmpipe-Init-eglQueryDmaBufModifiersEXT-num_modifie.patch Patch12: 0001-Revert-ac-radeonsi-remove-has_syncobj-has_fence_to_h.patch -# https://gitlab.com/evlaV/mesa/ -Patch21: valve.patch - # s390x only Patch100: fix-egl-on-s390x.patch +# https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29979 +Patch150: 29979.patch + +# https://gitlab.com/evlaV/mesa/ +Patch200: valve.patch + BuildRequires: meson >= 1.3.0 BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: gettext -BuildRequires: python3-pycparser >= 2.20 -BuildRequires: cbindgen >= 0.26.0 -BuildRequires: libbsd-devel -BuildRequires: libxml2-devel %if 0%{?with_hardware} BuildRequires: kernel-headers %endif # We only check for the minimum version of pkgconfig(libdrm) needed so that the # SRPMs for each arch still have the same build dependencies. See: # https://bugzilla.redhat.com/show_bug.cgi?id=1859515 -BuildRequires: pkgconfig(libdrm) >= 2.4.97 +BuildRequires: pkgconfig(libdrm) >= 2.4.119 %if 0%{?with_libunwind} BuildRequires: pkgconfig(libunwind) %endif @@ -146,21 +147,28 @@ BuildRequires: pkgconfig(libomxil-bellagio) BuildRequires: pkgconfig(libelf) BuildRequires: pkgconfig(libglvnd) >= 1.3.2 BuildRequires: llvm-devel >= 7.0.0 -%if 0%{?with_opencl} || 0%{?with_nvk} +%if 0%{?with_teflon} +BuildRequires: flatbuffers-devel +BuildRequires: flatbuffers-compiler +BuildRequires: xtensor-devel +%endif +%if 0%{?with_opencl} || 0%{?with_nvk} || 0%{?with_intel_clc} BuildRequires: clang-devel -BuildRequires: bindgen -BuildRequires: rust-packaging BuildRequires: pkgconfig(libclc) BuildRequires: pkgconfig(SPIRV-Tools) BuildRequires: pkgconfig(LLVMSPIRVLib) %endif +%if 0%{?with_opencl} || 0%{?with_nvk} +BuildRequires: bindgen +BuildRequires: rust-packaging +%endif %if 0%{?with_nvk} -BuildRequires: (rust >= 1.78.0 with rust < 2) +BuildRequires: cbindgen +BuildRequires: (crate(paste) >= 1.0.14 with crate(paste) < 2) BuildRequires: (crate(proc-macro2) >= 1.0.56 with crate(proc-macro2) < 2) BuildRequires: (crate(quote) >= 1.0.25 with crate(quote) < 2) BuildRequires: (crate(syn/clone-impls) >= 2.0.15 with crate(syn/clone-impls) < 3) BuildRequires: (crate(unicode-ident) >= 1.0.6 with crate(unicode-ident) < 2) -BuildRequires: (crate(paste) >= 1.0.14 with crate(paste) < 2) %endif %if %{with valgrind} BuildRequires: pkgconfig(valgrind) @@ -170,6 +178,7 @@ BuildRequires: python3-mako %if 0%{?with_intel_clc} BuildRequires: python3-ply %endif +BuildRequires: python3-pycparser BuildRequires: vulkan-headers BuildRequires: glslang %if 0%{?with_vulkan_hw} @@ -354,6 +363,14 @@ Requires: %{name}-libOpenCL%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{rele %{summary}. %endif +%if 0%{?with_teflon} +%package libTeflon +Summary: Mesa TensorFlow Lite delegate + +%description libTeflon +%{summary}. +%endif + %if 0%{?with_nine} %package libd3d Summary: Mesa Direct3D9 state tracker @@ -378,7 +395,11 @@ Obsoletes: mesa-vulkan-devel < %{?epoch:%{epoch}:}%{version}-%{release} The drivers with support for the Vulkan API. %prep -%autosetup -n %{name}-%{ver} -p1 +%autosetup -n %{name}-%{ver} -N +%autopatch -p1 -M 99 +%ifarch s390x +%autopatch -p1 -m 100 +%endif cp %{SOURCE1} docs/ %build @@ -404,9 +425,6 @@ export MESON_PACKAGE_CACHE_DIR="%{cargo_registry}/" %define _lto_cflags %{nil} %meson \ -%ifnarch x86_64 - -Dintel-rt=disabled \ -%endif -Dplatforms=x11,wayland \ -Ddri3=enabled \ -Dosmesa=true \ @@ -420,6 +438,7 @@ export MESON_PACKAGE_CACHE_DIR="%{cargo_registry}/" -Dgallium-va=%{?with_va:enabled}%{!?with_va:disabled} \ -Dgallium-xa=%{?with_xa:enabled}%{!?with_xa:disabled} \ -Dgallium-nine=%{?with_nine:true}%{!?with_nine:false} \ + -Dteflon=%{?with_teflon:true}%{!?with_teflon:false} \ -Dgallium-opencl=%{?with_opencl:icd}%{!?with_opencl:disabled} \ %if 0%{?with_opencl} -Dgallium-rusticl=true \ @@ -433,10 +452,11 @@ export MESON_PACKAGE_CACHE_DIR="%{cargo_registry}/" -Dgbm=enabled \ -Dglx=dri \ -Degl=enabled \ - -Dglvnd=true \ + -Dglvnd=enabled \ %if 0%{?with_intel_clc} -Dintel-clc=enabled \ %endif + -Dintel-rt=%{?with_intel_vk_rt:enabled}%{!?with_intel_vk_rt:disabled} \ -Dmicrosoft-clc=disabled \ -Dllvm=enabled \ -Dshared-llvm=enabled \ @@ -451,7 +471,7 @@ export MESON_PACKAGE_CACHE_DIR="%{cargo_registry}/" %endif -Dandroid-libbacktrace=disabled \ %ifarch %{ix86} - -Dglx-read-only-text=true + -Dglx-read-only-text=true \ %endif %{nil} %meson_build @@ -541,12 +561,18 @@ popd %endif %endif +%if 0%{?with_teflon} +%files libTeflon +%{_libdir}/libteflon.so +%endif + %if 0%{?with_opencl} %files libOpenCL %{_libdir}/libMesaOpenCL.so.* %{_libdir}/libRusticlOpenCL.so.* %{_sysconfdir}/OpenCL/vendors/mesa.icd %{_sysconfdir}/OpenCL/vendors/rusticl.icd + %files libOpenCL-devel %{_libdir}/libMesaOpenCL.so %{_libdir}/libRusticlOpenCL.so @@ -569,10 +595,6 @@ popd %{_libdir}/dri/kms_swrast_dri.so %{_libdir}/dri/swrast_dri.so %{_libdir}/dri/virtio_gpu_dri.so -%{_libdir}/dri/panthor_dri.so -%{_libdir}/dri/rzg2l-du_dri.so -%{_libdir}/dri/ssd130x_dri.so -%{_libdir}/dri/zynqmp-dpsub_dri.so %if 0%{?with_hardware} %if 0%{?with_r300} @@ -622,6 +644,7 @@ popd %endif %if 0%{?with_panfrost} %{_libdir}/dri/panfrost_dri.so +%{_libdir}/dri/panthor_dri.so %endif %{_libdir}/dri/nouveau_dri.so %if 0%{?with_vmware} @@ -650,11 +673,14 @@ popd %{_libdir}/dri/pl111_dri.so %{_libdir}/dri/repaper_dri.so %{_libdir}/dri/rockchip_dri.so +%{_libdir}/dri/rzg2l-du_dri.so +%{_libdir}/dri/ssd130x_dri.so %{_libdir}/dri/st7586_dri.so %{_libdir}/dri/st7735r_dri.so %{_libdir}/dri/sti_dri.so %{_libdir}/dri/sun4i-drm_dri.so %{_libdir}/dri/udl_dri.so +%{_libdir}/dri/zynqmp-dpsub_dri.so %endif %if 0%{?with_vulkan_hw} %{_libdir}/dri/zink_dri.so