Files
DroidDeck/tools/gamescope/patches/0133-flippable-image-unexportable-modifiers.patch
T
The412Banner f292274d7f 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.
2026-10-13 11:47:23 -04:00

45 lines
1.9 KiB
Diff

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,