aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-05-10 16:24:37 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-05-10 16:24:37 +0000
commitdd3fc7e149175c51beb666afade29024f1a60785 (patch)
treeb194904193eb826dd2123755a158819e1442e53f
parent620e411d468093f7e837db9b808ca65363ee6d23 (diff)
parent11aba60100ec0634cec702a6c559265657644004 (diff)
downloadaemu-aml_tz5_341510010.tar.gz
Snap for 10103804 from 11aba60100ec0634cec702a6c559265657644004 to mainline-tzdata5-releaseaml_tz5_341510070aml_tz5_341510050aml_tz5_341510010aml_tz5_341510010
Change-Id: I0ce81059e01f3492d4b42e96eac606359646621f
-rw-r--r--base/CMakeLists.txt2
-rw-r--r--base/include/aemu/base/files/PathUtils.h3
-rw-r--r--host-common/HostmemIdMapping.cpp32
-rw-r--r--host-common/include/host-common/H264NaluParser.h2
-rw-r--r--host-common/include/host-common/HostmemIdMapping.h15
-rw-r--r--host-common/include/host-common/vm_operations.h3
-rw-r--r--host-common/include/host-common/window_agent.h6
-rw-r--r--third-party/CMakeLists.txt12
8 files changed, 54 insertions, 21 deletions
diff --git a/base/CMakeLists.txt b/base/CMakeLists.txt
index 6b8a37a..61cce42 100644
--- a/base/CMakeLists.txt
+++ b/base/CMakeLists.txt
@@ -68,7 +68,7 @@ if (BUILD_STANDALONE)
endif()
add_library(aemu-base ${aemu-base-srcs})
- target_compile_definitions(aemu-base PRIVATE -DENABLE_HEALTH_MONITOR=1)
+ target_compile_definitions(aemu-base PRIVATE)
if (WIN32)
set(aemu-base-platform-deps Shlwapi)
diff --git a/base/include/aemu/base/files/PathUtils.h b/base/include/aemu/base/files/PathUtils.h
index a80841a..939b592 100644
--- a/base/include/aemu/base/files/PathUtils.h
+++ b/base/include/aemu/base/files/PathUtils.h
@@ -206,6 +206,7 @@ public:
// "file" -> ""
// "file." -> "."
// "/full/path.png" -> ".png"
+ static std::string_view extension(const char* path, HostType hostType = HOST_TYPE);
static std::string_view extension(const std::string& path,
HostType hostType = HOST_TYPE);
// Split |path| into a directory name and a file name. |dirName| and
@@ -300,6 +301,8 @@ public:
return PathUtils::recompose(components, HOST_TYPE);
}
+ static std::string canonicalPath(std::string path);
+
// Given a list of components returned by decompose(), simplify it
// by removing instances of '.' and '..' when that makes sense.
// Note that it is not possible to simplify initial instances of
diff --git a/host-common/HostmemIdMapping.cpp b/host-common/HostmemIdMapping.cpp
index 0800010..5d9efea 100644
--- a/host-common/HostmemIdMapping.cpp
+++ b/host-common/HostmemIdMapping.cpp
@@ -20,8 +20,10 @@ using android::base::ManagedDescriptor;
namespace android {
namespace emulation {
+using Id = uint64_t;
+
// static
-const HostmemIdMapping::Id HostmemIdMapping::kInvalidHostmemId = 0;
+const Id HostmemIdMapping::kInvalidHostmemId = 0;
static HostmemIdMapping* sMapping() {
static HostmemIdMapping* s = new HostmemIdMapping;
@@ -35,7 +37,7 @@ HostmemIdMapping* HostmemIdMapping::get() {
// TODO: Add registerHostmemFixed version that takes a predetermined id,
// for snapshots
-HostmemIdMapping::Id HostmemIdMapping::add(const struct MemEntry *entry) {
+Id HostmemIdMapping::add(const struct MemEntry *entry) {
if (entry->hva == 0 || entry->size == 0) return kInvalidHostmemId;
Id wantedId;
@@ -56,14 +58,22 @@ HostmemIdMapping::Id HostmemIdMapping::add(const struct MemEntry *entry) {
return wantedId;
}
-void HostmemIdMapping::remove(HostmemIdMapping::Id id) {
+void HostmemIdMapping::remove(Id id) {
mEntries.erase(id);
}
-HostmemIdMapping::Id HostmemIdMapping::addDescriptorInfo(ManagedDescriptor descriptor,
- uint32_t handleType, uint32_t caching,
- std::optional<VulkanInfo> vulkanInfoOpt) {
- Id wantedId = mCurrentId++;
+void HostmemIdMapping::addMapping(Id id, const struct MemEntry *entry) {
+ HostmemIdMapping::Entry hostmem_entry;
+ hostmem_entry.id = id;
+ hostmem_entry.hva = entry->hva;
+ hostmem_entry.size = entry->size;
+ hostmem_entry.caching = entry->caching;
+ mEntries.set(id, hostmem_entry);
+}
+
+void HostmemIdMapping::addDescriptorInfo(Id id, ManagedDescriptor descriptor,
+ uint32_t handleType, uint32_t caching,
+ std::optional<VulkanInfo> vulkanInfoOpt) {
struct ManagedDescriptorInfo info =
{
.descriptor = std::move(descriptor),
@@ -72,11 +82,11 @@ HostmemIdMapping::Id HostmemIdMapping::addDescriptorInfo(ManagedDescriptor descr
.vulkanInfoOpt = std::move(vulkanInfoOpt),
};
- mDescriptorInfos.insert(std::make_pair(wantedId, std::move(info)));
- return wantedId;
+
+ mDescriptorInfos.insert(std::make_pair(id, std::move(info)));
}
-std::optional<ManagedDescriptorInfo> HostmemIdMapping::removeDescriptorInfo(HostmemIdMapping::Id id) {
+std::optional<ManagedDescriptorInfo> HostmemIdMapping::removeDescriptorInfo(Id id) {
auto found = mDescriptorInfos.find(id);
if (found != mDescriptorInfos.end()) {
std::optional<ManagedDescriptorInfo> ret = std::move(found->second);
@@ -87,7 +97,7 @@ std::optional<ManagedDescriptorInfo> HostmemIdMapping::removeDescriptorInfo(Host
return std::nullopt;
}
-HostmemIdMapping::Entry HostmemIdMapping::get(HostmemIdMapping::Id id) const {
+HostmemIdMapping::Entry HostmemIdMapping::get(Id id) const {
const HostmemIdMapping::Entry badEntry {
kInvalidHostmemId, 0, 0,
};
diff --git a/host-common/include/host-common/H264NaluParser.h b/host-common/include/host-common/H264NaluParser.h
index 13c0a81..95d796a 100644
--- a/host-common/include/host-common/H264NaluParser.h
+++ b/host-common/include/host-common/H264NaluParser.h
@@ -88,8 +88,6 @@ enum class H264NaluType : uint8_t {
Undefined = 32, // not in H.264 nalu type; just here to cap the enums so checking is simpler.
};
-static const std::string kNaluTypesStrings[];
-
static bool checkSpsFrame(const uint8_t* frame, size_t szBytes);
static bool checkPpsFrame(const uint8_t* frame, size_t szBytes);
static bool checkIFrame(const uint8_t* frame, size_t szBytes);
diff --git a/host-common/include/host-common/HostmemIdMapping.h b/host-common/include/host-common/HostmemIdMapping.h
index 0ce6b07..bef68a4 100644
--- a/host-common/include/host-common/HostmemIdMapping.h
+++ b/host-common/include/host-common/HostmemIdMapping.h
@@ -44,9 +44,11 @@ namespace emulation {
#define STREAM_MEM_HANDLE_TYPE_DMABUF 0x2
#define STREAM_MEM_HANDLE_TYPE_OPAQUE_WIN32 0x3
#define STREAM_MEM_HANDLE_TYPE_SHM 0x4
-#define STREAM_FENCE_HANDLE_TYPE_OPAQUE_FD 0x10
-#define STREAM_FENCE_HANDLE_TYPE_SYNC_FD 0x11
-#define STREAM_FENCE_HANDLE_TYPE_OPAQUE_WIN32 0x12
+#define STREAM_MEM_HANDLE_TYPE_ZIRCON 0x5
+#define STREAM_FENCE_HANDLE_TYPE_OPAQUE_FD 0x6
+#define STREAM_FENCE_HANDLE_TYPE_SYNC_FD 0x7
+#define STREAM_FENCE_HANDLE_TYPE_OPAQUE_WIN32 0x8
+#define STREAM_FENCE_HANDLE_TYPE_ZIRCON 0x9
struct VulkanInfo {
uint32_t memoryIndex;
@@ -79,10 +81,11 @@ public:
// is referenced.
AEMU_EXPORT void remove(Id id);
- Id addDescriptorInfo(ManagedDescriptor descriptor, uint32_t handleType, uint32_t caching,
- std::optional<VulkanInfo> vulkanInfoOpt);
+ void addMapping(Id id, const struct MemEntry *entry);
+ void addDescriptorInfo(Id id, ManagedDescriptor descriptor, uint32_t handleType,
+ uint32_t caching, std::optional<VulkanInfo> vulkanInfoOpt);
- std::optional<ManagedDescriptorInfo> removeDescriptorInfo(HostmemIdMapping::Id id);
+ std::optional<ManagedDescriptorInfo> removeDescriptorInfo(Id id);
// If id == kInvalidHostmemId or not found in map,
// returns entry with id == kInvalidHostmemId,
diff --git a/host-common/include/host-common/vm_operations.h b/host-common/include/host-common/vm_operations.h
index 375d1bc..5dcd6c1 100644
--- a/host-common/include/host-common/vm_operations.h
+++ b/host-common/include/host-common/vm_operations.h
@@ -248,5 +248,8 @@ typedef struct QAndroidVmOperations {
// virtio display
bool (*setDisplay)(int32_t id, int32_t w, int32_t h, uint32_t dpi);
+
+ // Reset the machine
+ void (*system_shutdown_request)(QemuShutdownCause reason);
} QAndroidVmOperations;
ANDROID_END_HEADER
diff --git a/host-common/include/host-common/window_agent.h b/host-common/include/host-common/window_agent.h
index a9489e0..be16f13 100644
--- a/host-common/include/host-common/window_agent.h
+++ b/host-common/include/host-common/window_agent.h
@@ -36,6 +36,9 @@ typedef enum {
} WindowMessageType;
typedef struct {} MultiDisplayPageChangeEvent;
+typedef struct SkinLayout SkinLayout;
+typedef struct QFrame QFrame;
+typedef struct SkinEvent SKinEvent;
static const int kWindowMessageTimeoutInfinite = -1;
@@ -128,6 +131,9 @@ typedef struct QAndroidEmulatorWindowAgent {
void (*quit_request)(void);
void (*getWindowPosition)(int*, int*);
bool (*hasWindow)();
+
+ bool (*userSettingIsDontSaveSnapshot)(void);
+ void (*setUserSettingIsDontSaveSnapshot)(bool);
} QAndroidEmulatorWindowAgent;
#ifndef USING_ANDROID_BP
diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt
index 55e9233..ac39b15 100644
--- a/third-party/CMakeLists.txt
+++ b/third-party/CMakeLists.txt
@@ -10,5 +10,15 @@ endif()
if(ENABLE_VKCEREAL_TESTS AND NOT TARGET gtest)
set(INSTALL_GTEST OFF)
- message(FATAL_ERROR "googletest is not provided.")
+
+ # If gtest target is not provided, find it on the system.
+ find_package(PkgConfig REQUIRED)
+ pkg_search_module(gtest REQUIRED IMPORTED_TARGET GLOBAL gtest>=0.0.0)
+ add_library(gtest ALIAS PkgConfig::gtest)
+
+ pkg_search_module(gmock REQUIRED IMPORTED_TARGET GLOBAL gmock>=0.0.0)
+ add_library(gmock ALIAS PkgConfig::gmock)
+
+ pkg_search_module(gmock_main REQUIRED IMPORTED_TARGET GLOBAL gmock_main>=0.0.0)
+ add_library(gmock_main ALIAS PkgConfig::gmock_main)
endif()