The Imagination proprietary driver forbids re-exporting of imported external DMA BUFs, see [1], and experimentation on the Vulkan blob shows that it's really failing (the Vulkan blob is just a shim over the pvrsrvkm routine here); however Mesa Zink does this kind of behavior for imported memory for creating fences [2] (the code only checks whether it's a aux plane of a multi-plane memory object).
Reading about related Vulkan extensions (I checked VK_KHR_external_memory_capabilities, VK_KHR_external_memory, VK_KHR_external_memory_fd, VK_EXT_external_memory_dma_buf) shows no evidence for accepting/rejecting such behavior, but as it's already imported DMA BUF. it's structure should be eligble for exporting.
Note that the mainline Linux PRIME code will just re-export the DMA-BUF it's already imported [3], and drivers as part of Mesa naturally support this. Place similar code around [1] will allow DMA BUF re-exporting on Imagination proprietary Vulkan driver (a working sample is at [4]), however I still want this question to be clarified and the behavior to be determined.
[1] https://github.com/TexasInstruments/ti-img-rogue-driver/blob/linuxws/scarthgap/k6.12/25.2.6850647/services/server/env/linux/physmem_dmabuf.c#L1868
[2] https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/gallium/drivers/zink/zink_screen.c?ref_type=heads#L2405
[3] https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/drm_prime.c#L453
[4] revyos/th1520-linux-kernel#40
The Imagination proprietary driver forbids re-exporting of imported external DMA BUFs, see [1], and experimentation on the Vulkan blob shows that it's really failing (the Vulkan blob is just a shim over the pvrsrvkm routine here); however Mesa Zink does this kind of behavior for imported memory for creating fences [2] (the code only checks whether it's a aux plane of a multi-plane memory object).
Reading about related Vulkan extensions (I checked VK_KHR_external_memory_capabilities, VK_KHR_external_memory, VK_KHR_external_memory_fd, VK_EXT_external_memory_dma_buf) shows no evidence for accepting/rejecting such behavior, but as it's already imported DMA BUF. it's structure should be eligble for exporting.
Note that the mainline Linux PRIME code will just re-export the DMA-BUF it's already imported [3], and drivers as part of Mesa naturally support this. Place similar code around [1] will allow DMA BUF re-exporting on Imagination proprietary Vulkan driver (a working sample is at [4]), however I still want this question to be clarified and the behavior to be determined.
[1] https://github.com/TexasInstruments/ti-img-rogue-driver/blob/linuxws/scarthgap/k6.12/25.2.6850647/services/server/env/linux/physmem_dmabuf.c#L1868
[2] https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/gallium/drivers/zink/zink_screen.c?ref_type=heads#L2405
[3] https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/drm_prime.c#L453
[4] revyos/th1520-linux-kernel#40