Non-Adreno round 6: PowerVR PRIME on old kernels, thermal, hang-up names, bridge flippable images, Venus Zink variants

- drm.c: PR #570's current PRIME ownership check (F_DUPFD_QUERY, then kcmp,
  then the F_SETOWN_EX owner marker): on a kernel before 6.10 with kcmp
  blocked, drmPrimeFDToHandle answered EOPNOTSUPP for every PowerVR import
  (Pixel 10, Android 17: Zink "failed drmPrimeFDToHandle", Xwayland error 7,
  gamescope X11 I/O error). The Mali stand-in node is kept.
- A /sys/class/thermal the kernel will not list gets an empty directory, so
  mangoapp no longer aborts on it.
- gamescope 0132: a hung-up waitable is named before the abort; 0133: the
  bridge's flippable images use supported-but-unexportable modifiers instead
  of asserting.
- Venus: when Zink does not start, the loader's view is logged and Zink is
  retried without ZINK_DEBUG=compact, with ZINK_DESCRIPTORS=auto and without
  kopper before falling back to llvmpipe.
This commit is contained in:
The412Banner committed 2026-10-13 11:47:23 -04:00
1 parent cc69dfa323
commit f292274d7f
7 files changed
+267 -13

No files matched your search

+8
View File
@@ -92,3 +92,11 @@ app's Wayland-hosted gamescope never reaches, or need a newer gamescope than the
backend failed. Also: 0130's probe pipeline is kept instead of destroyed, and skipped when
`GAMESCOPE_NO_YCBCR_SAMPLERS=1` (destroying a pipeline the Venus host had refused killed the
render server).
- `0132-name-hung-up-waitable.patch`: "IWaitable hung up. Aborting." now names the waitable's class,
its fd and what the fd is (`/proc/self/fd`), and the Wayland backend's input thread says why the
compositor connection ended (protocol error or errno) first. An S24 FE aborted there after 60/120 Hz
flips and after a resume with nothing else in the log.
- `0133-flippable-image-unexportable-modifiers.patch`: a flippable (dma-buf exported) image whose
modifiers the driver supports but does not report EXPORTABLE uses them anyway, and an image with no
usable modifier fails with a log line instead of asserting in `CVulkanTexture::BInit`. The Mali
bridge forwards the phone driver's answer, which leaves EXPORTABLE out, though it exports dma-bufs.
@@ -0,0 +1,57 @@
diff --git a/src/Backends/WaylandBackend.cpp b/src/Backends/WaylandBackend.cpp
index a927f69..2c9bd73 100644
--- a/src/Backends/WaylandBackend.cpp
+++ b/src/Backends/WaylandBackend.cpp
@@ -2882,7 +2882,22 @@ namespace gamescope
abort();
}
- CFunctionWaitable waitable( nFD );
+ // The compositor's connection: a hang-up says why (the protocol error, if one was posted).
+ class CDisplayWaitable final : public IWaitable
+ {
+ public:
+ CDisplayWaitable( int nFD, wl_display *pDisplay ) : m_nFD{ nFD }, m_pDisplay{ pDisplay } {}
+ int GetFD() final { return m_nFD; }
+ void OnPollHangUp() final
+ {
+ LogDisplayError( "The Wayland compositor closed gamescope's connection (input thread)", m_pDisplay );
+ IWaitable::OnPollHangUp();
+ }
+ private:
+ int m_nFD;
+ wl_display *m_pDisplay;
+ };
+ CDisplayWaitable waitable( nFD, m_pBackend->GetDisplay() );
m_Waiter.AddWaitable( &waitable );
int nRet = 0;
diff --git a/src/waitable.h b/src/waitable.h
index be54d46..b9116fe 100644
--- a/src/waitable.h
+++ b/src/waitable.h
@@ -9,6 +9,8 @@
#include <functional>
#include <mutex>
+#include <typeinfo>
+#include <stdio.h>
#include "log.hpp"
@@ -30,7 +32,14 @@ namespace gamescope
virtual void OnPollPri() {}
virtual void OnPollHangUp()
{
- g_WaitableLog.errorf( "IWaitable hung up. Aborting." );
+ // Which one: its class and what its descriptor is (a socket, a pipe, an eventfd...).
+ int nFD = GetFD();
+ char szPath[64], szTarget[256] = "?";
+ snprintf( szPath, sizeof( szPath ), "/proc/self/fd/%d", nFD );
+ ssize_t nLen = nFD >= 0 ? readlink( szPath, szTarget, sizeof( szTarget ) - 1 ) : -1;
+ if ( nLen >= 0 )
+ szTarget[nLen] = '\0';
+ g_WaitableLog.errorf( "IWaitable hung up: %s, fd %d -> %s. Aborting.", typeid( *this ).name(), nFD, szTarget );
abort();
}
@@ -0,0 +1,44 @@
diff --git a/src/rendervulkan.cpp b/src/rendervulkan.cpp
index e699c85..0ddd249 100644
--- a/src/rendervulkan.cpp
+++ b/src/rendervulkan.cpp
@@ -2372,6 +2372,7 @@ bool CVulkanTexture::BInit( uint32_t width, uint32_t height, uint32_t depth, uin
}
std::vector<uint64_t> modifiers = {};
+ std::vector<uint64_t> unexportable = {};
// TODO(JoshA): Move this code to backend for making flippable image.
if ( GetBackend()->UsesModifiers() && flags.bFlippable && g_device.supportsModifiers() && !pDMA )
{
@@ -2410,12 +2411,30 @@ bool CVulkanTexture::BInit( uint32_t width, uint32_t height, uint32_t depth, uin
}
if ( !( externalFormatProps.externalMemoryProperties.externalMemoryFeatures & VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT ) )
+ {
+ vk_log.infof( "flippable image: modifier 0x%" PRIx64 " for DRM format 0x%x supported but not reported exportable (features 0x%x)",
+ modifier, drmFormat, externalFormatProps.externalMemoryProperties.externalMemoryFeatures );
+ unexportable.push_back( modifier );
continue;
+ }
modifiers.push_back( modifier );
}
- assert( modifiers.size() > 0 );
+ // A driver that supports the modifier but leaves EXPORTABLE out (the Mali bridge forwards the
+ // phone's own driver's answer) can still export the memory as a dma-buf: the bridge's
+ // swapchains do exactly that. Try those rather than assert (rendervulkan.cpp, CVulkanTexture::BInit).
+ if ( modifiers.empty() && !unexportable.empty() )
+ {
+ vk_log.errorf( "flippable image: no modifier reported exportable for DRM format 0x%x; trying %zu supported one(s) anyway",
+ drmFormat, unexportable.size() );
+ modifiers = unexportable;
+ }
+ if ( modifiers.empty() )
+ {
+ vk_log.errorf( "flippable image: no usable modifier for DRM format 0x%x (%zu offered by the backend)", drmFormat, numPossibleModifiers );
+ return false;
+ }
modifierListInfo = {
.sType = VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT,