gfxstream: host: BlobManager --> ExternalObjectManager
We should try to support external sync, along with
external memory so:
find ./ -type f -exec sed -i -e 's/BlobManager/ExternalObjectManager/g' {} \;
find ./ -type f -exec sed -i -e 's/removeDescriptorInfo/removeBlobDescriptorInfo/g' {} \;
find ./ -type f -exec sed -i -e 's/addDescriptorInfo/addBlobDescriptorInfo/g' {} \;
find ./ -type f -exec sed -i -e 's/mDescriptorInfo/mBlobDescriptorInfo/g' {} \;
find ./ -type f -exec sed -i -e 's/ManagedDescriptorInfo/BlobDescriptorInfo/g' {} \;
BUG=350965057
TEST=compile
Change-Id: Id9fe5319ed617638ae8c67f9377f5426fe15cf44
diff --git a/host/virtio-gpu-gfxstream-renderer.cpp b/host/virtio-gpu-gfxstream-renderer.cpp
index 217a043..7e46427 100644
--- a/host/virtio-gpu-gfxstream-renderer.cpp
+++ b/host/virtio-gpu-gfxstream-renderer.cpp
@@ -20,7 +20,7 @@
#include <unordered_map>
#include <variant>
-#include "BlobManager.h"
+#include "ExternalObjectManager.h"
#include "FrameBuffer.h"
#include "GfxStreamAgents.h"
#include "VirtioGpuTimelines.h"
@@ -220,8 +220,8 @@
using android::base::SharedMemory;
using emugl::FatalError;
-using gfxstream::BlobManager;
-using gfxstream::ManagedDescriptorInfo;
+using gfxstream::BlobDescriptorInfo;
+using gfxstream::ExternalObjectManager;
using VirtioGpuResId = uint32_t;
@@ -315,7 +315,7 @@
ResType type;
std::shared_ptr<RingBlob> ringBlob;
bool externalAddr = false;
- std::shared_ptr<ManagedDescriptorInfo> descriptorInfo = nullptr;
+ std::shared_ptr<BlobDescriptorInfo> descriptorInfo = nullptr;
};
static inline uint32_t align_up(uint32_t n, uint32_t a) { return ((n + a - 1) / a) * a; }
@@ -1763,7 +1763,7 @@
PipeResEntry e;
struct stream_renderer_resource_create_args args = {0};
- std::optional<ManagedDescriptorInfo> descriptorInfoOpt = std::nullopt;
+ std::optional<BlobDescriptorInfo> descriptorInfoOpt = std::nullopt;
e.args = args;
e.hostPipe = 0;
@@ -1815,9 +1815,9 @@
(create_blob->blob_flags & STREAM_BLOB_FLAG_CREATE_GUEST_HANDLE)) {
#if defined(__linux__) || defined(__QNX__)
ManagedDescriptor managedHandle(handle->os_handle);
- BlobManager::get()->addDescriptorInfo(ctx_id, create_blob->blob_id,
- std::move(managedHandle), handle->handle_type,
- 0, std::nullopt);
+ ExternalObjectManager::get()->addBlobDescriptorInfo(
+ ctx_id, create_blob->blob_id, std::move(managedHandle), handle->handle_type, 0,
+ std::nullopt);
e.caching = STREAM_RENDERER_MAP_CACHE_CACHED;
#else
@@ -1825,13 +1825,13 @@
#endif
} else {
if (!descriptorInfoOpt) {
- descriptorInfoOpt =
- BlobManager::get()->removeDescriptorInfo(ctx_id, create_blob->blob_id);
+ descriptorInfoOpt = ExternalObjectManager::get()->removeBlobDescriptorInfo(
+ ctx_id, create_blob->blob_id);
}
if (descriptorInfoOpt) {
e.descriptorInfo =
- std::make_shared<ManagedDescriptorInfo>(std::move(*descriptorInfoOpt));
+ std::make_shared<BlobDescriptorInfo>(std::move(*descriptorInfoOpt));
} else {
return -EINVAL;
}
@@ -1839,7 +1839,8 @@
e.caching = e.descriptorInfo->caching;
}
} else {
- auto entryOpt = BlobManager::get()->removeMapping(ctx_id, create_blob->blob_id);
+ auto entryOpt =
+ ExternalObjectManager::get()->removeMapping(ctx_id, create_blob->blob_id);
if (entryOpt) {
e.hva = entryOpt->addr;
e.caching = entryOpt->caching;