Ensure EmuglPipe RenderThread-s have a virtio gpu context id
... and avoid setting invalid PUIDs in rcSetPuid() to avoid lots of
"Failed to find process owned resources fpr puid" errors.
After aosp/2752873, the host GlProcessPipe stopped initializing a unique
id for the process pipe. However, it continued to communicate the value
of the `m_uniqueId` back to the guest. The guest still uses PUID for
rcSetPuid commands in the guest EGL/GL implementations. This would
result in garbage PUIDs being used by RenderThreads for
getProcessResources() calls. Further, if a guest process used both
EGL/GL and Vulkan, getProcessResources() would return nullptr and then
the host would crash when the VkDecoder tried to read the seqnoPtr in
the process resources.
Bug: b/312560224
Test: cvd start --gpu_mode=gfxstream
Change-Id: Ie3697a7588a8d2180ccc9e7f02f38ed6d9f1bd12
diff --git a/host/RendererImpl.cpp b/host/RendererImpl.cpp
index d6dfbdd..bd224ef 100644
--- a/host/RendererImpl.cpp
+++ b/host/RendererImpl.cpp
@@ -224,8 +224,9 @@
}
RenderChannelPtr RendererImpl::createRenderChannel(
- android::base::Stream* loadStream) {
- const auto channel = std::make_shared<RenderChannelImpl>(loadStream);
+ android::base::Stream* loadStream, uint32_t virtioGpuContextId) {
+ const auto channel =
+ std::make_shared<RenderChannelImpl>(loadStream, virtioGpuContextId);
{
android::base::AutoLock lock(mChannelsLock);