feat(vkbridge): dma-heap memory sharing (allocate from /dev/dma_heap, import as dma-buf)

The tablet's driver refused to export dma-bufs; GameNative's wrapper gets Mali
host-visible memory by allocating from /dev/dma_heap (system-uncached, else
system) and importing it (vkGetMemoryFdPropertiesKHR picks the types), without
a dedicated-allocation struct (crashes some Mali drivers). Tried after the
driver's own export and before AHB; the self-test decides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S1U9H1evGNjHRQ3wRUdv5V
This commit is contained in:
Ahmad Sayed Alsayed EbrahimandClaude Opus 5.5 committed 2026-10-10 17:03:15 +03:00
1 parent 03341148cb
commit 0f078c439a
2 files changed
+86 -5

No files matched your search

+2
View File
@@ -15,6 +15,7 @@ enum vkb_mem_strategy {
VKB_MEM_HOSTPTR = 1, /* client memfd, server imports it (VK_EXT_external_memory_host) */
VKB_MEM_DMABUF = 2, /* server exports a dma-buf (VK_EXT_external_memory_dma_buf), client mmaps */
VKB_MEM_AHB = 3, /* server allocates an AHardwareBuffer (BLOB), client mmaps its dma-buf */
VKB_MEM_DMAHEAP = 4, /* server allocates from /dev/dma_heap and imports it as a dma-buf, client mmaps */
};
static inline const char *vkb_mem_strategy_name(uint32_t s)
@@ -23,6 +24,7 @@ static inline const char *vkb_mem_strategy_name(uint32_t s)
case VKB_MEM_HOSTPTR: return "hostptr";
case VKB_MEM_DMABUF: return "dmabuf";
case VKB_MEM_AHB: return "ahb";
case VKB_MEM_DMAHEAP: return "dmaheap";
default: return "none";
}
}