vulkan-cereal: plumb contextId, capsetId, and contextName to RenderThread
The following are provided by the virtio-gpu hypercall interface.
- contextId
* the virtio-gpu context associated with a RenderThread
* could be useful for external memory sharing
- capsetId
* type of context
* could be useful for selectively turning on VK/GL/HWC decoders
- contextName
* name of guest app/process
* useful for naming RenderThread(s) associated with guest app on host
This is just the plumbing. These will be enabled when explicit
ASG context creation lands.
BUG=235485545
TEST=top -H to see RenderThread name
Change-Id: Ia2c927020f7631e448d616a774469018c21860bb
diff --git a/stream-servers/RenderThread.cpp b/stream-servers/RenderThread.cpp
index 8a00801..104cb4a 100644
--- a/stream-servers/RenderThread.cpp
+++ b/stream-servers/RenderThread.cpp
@@ -98,10 +98,14 @@
RenderThread::RenderThread(
struct asg_context context,
android::base::Stream* loadStream,
- android::emulation::asg::ConsumerCallbacks callbacks)
- : android::base::Thread(android::base::ThreadFlags::MaskSignals, 2 * 1024 * 1024),
+ android::emulation::asg::ConsumerCallbacks callbacks,
+ uint32_t contextId, uint32_t capsetId,
+ std::optional<std::string> nameOpt)
+ : android::base::Thread(android::base::ThreadFlags::MaskSignals, 2 * 1024 * 1024,
+ std::move(nameOpt)),
mRingStream(
- new RingStream(context, callbacks, kStreamBufferSize)) {
+ new RingStream(context, callbacks, kStreamBufferSize)),
+ mContextId(contextId), mCapsetId(capsetId) {
if (loadStream) {
const bool success = loadStream->getByte();
if (success) {