diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2024-02-29 21:09:17 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2024-02-29 21:09:17 +0000 |
commit | 6293c1ed37aa6e9dc75e3a06096459cf78eb0d43 (patch) | |
tree | 56f860b034adbc674b99ae4db630b5d15a38c8d6 | |
parent | abed84fe91d86ef7870e9e99fcdac971145f45e5 (diff) | |
parent | 54903471035b2442dc3a9bc147b95b7663cd554c (diff) | |
download | aemu-snap-temp-L52600030002580520.tar.gz |
Snap for 11516739 from 54903471035b2442dc3a9bc147b95b7663cd554c to emu-34-2-releasesnap-temp-L52600030002580520
Change-Id: I5e5a1bab6bda4401336c21c5a87e037f93963205
-rw-r--r-- | base/Android.bp | 9 | ||||
-rw-r--r-- | host-common/feature_control.cpp | 23 | ||||
-rw-r--r-- | host-common/include/host-common/FeatureControl.h | 6 | ||||
-rw-r--r-- | host-common/include/host-common/FeatureControlDefHost.h | 2 | ||||
-rw-r--r-- | host-common/include/host-common/feature_control.h | 3 |
5 files changed, 34 insertions, 9 deletions
diff --git a/base/Android.bp b/base/Android.bp index e767958..e225a82 100644 --- a/base/Android.bp +++ b/base/Android.bp @@ -1,4 +1,5 @@ package { + default_team: "trendy_team_automotive", // See: http://go/android-license-faq // A large-scale-change added 'default_applicable_licenses' to import // all of the 'license_kinds' from "hardware_google_aemu_license" @@ -10,7 +11,6 @@ package { cc_library_static { name: "gfxstream_base", defaults: ["gfxstream_defaults"], - header_libs: ["gfxstream_renderdoc_headers"], srcs: [ "AlignedBuf.cpp", "CompressingStream.cpp", @@ -38,14 +38,15 @@ cc_library_static { "Tracing.cpp", "Thread_pthread.cpp", ], - export_header_lib_headers: ["gfxstream_renderdoc_headers"], + header_libs: ["libgfxstream_thirdparty_renderdoc_headers"], + export_header_lib_headers: ["libgfxstream_thirdparty_renderdoc_headers"], static_libs: ["liblz4"], } // Run with `atest --host gfxstream_base_tests` cc_test_host { name: "gfxstream_base_tests", - defaults: [ "gfxstream_defaults" ], + defaults: ["gfxstream_defaults"], srcs: [ "LruCache_unittest.cpp", ], @@ -62,7 +63,7 @@ cc_test_host { cc_test_library { name: "gfxstream_base_test_support", - defaults: [ "gfxstream_defaults" ], + defaults: ["gfxstream_defaults"], srcs: [ "testing/file_io.cpp", ], diff --git a/host-common/feature_control.cpp b/host-common/feature_control.cpp index 37b92d4..ce01c8b 100644 --- a/host-common/feature_control.cpp +++ b/host-common/feature_control.cpp @@ -97,3 +97,26 @@ const char* feature_name(Feature feature) { return it->second.c_str(); } + + +Feature feature_from_name(const char* name) { + if (name == nullptr) { + return kFeature_unknown; + } + + static const std::unordered_map<std::string, Feature>* const sNameToFeature = [] { + return new std::unordered_map<std::string, Feature>({ +#define FEATURE_CONTROL_ITEM(item, idx) { #item, kFeature_##item }, +#include "FeatureControlDefHost.h" +#include "FeatureControlDefGuest.h" +#undef FEATURE_CONTROL_ITEM + }); + }(); + + auto it = sNameToFeature->find(std::string(name)); + if (it == sNameToFeature->end()) { + return kFeature_unknown; + } + + return it->second; +}
\ No newline at end of file diff --git a/host-common/include/host-common/FeatureControl.h b/host-common/include/host-common/FeatureControl.h index 0b4593c..57e0621 100644 --- a/host-common/include/host-common/FeatureControl.h +++ b/host-common/include/host-common/FeatureControl.h @@ -28,9 +28,7 @@ namespace featurecontrol { // featurecontrol is used to switch on/off advanced features It loads // sdk/emulator/lib/advancedFeatures.ini for default values and -// .android/advancedFeatures.ini for user overriden values. If on canary -// update channel, sdk/emulator/lib/advancedFeaturesCanary.ini is used for -// default values. +// .android/advancedFeatures.ini for user overridden values. // It is expected to be initialized at the beginning of the emulator. // For easier testing, one may also want to pass the override value through // command line and call setEnabledOverride. (Command line override not @@ -39,7 +37,7 @@ namespace featurecontrol { // featurecontrol::isEnabled is thread safe, all other methods are not. // // To add new features, please (1) add it to android/data/advancedFeatures.ini -// or android/data/advancedFeaturesCanary.ini and (2) add a new line to +// and (2) add a new line to // FeatureControlDef.h, in the following format: // FEATURE_CONTROL_ITEM(YOUR_FEATURE_NAME) diff --git a/host-common/include/host-common/FeatureControlDefHost.h b/host-common/include/host-common/FeatureControlDefHost.h index 2f26f19..bc59744 100644 --- a/host-common/include/host-common/FeatureControlDefHost.h +++ b/host-common/include/host-common/FeatureControlDefHost.h @@ -80,3 +80,5 @@ FEATURE_CONTROL_ITEM(SystemBlob, 46) FEATURE_CONTROL_ITEM(NetsimWebUi, 93) FEATURE_CONTROL_ITEM(NetsimCliUi, 94) FEATURE_CONTROL_ITEM(WiFiPacketStream, 95) +FEATURE_CONTROL_ITEM(VulkanAllocateDeviceMemoryOnly, 98) +FEATURE_CONTROL_ITEM(VulkanAllocateHostMemory, 99) diff --git a/host-common/include/host-common/feature_control.h b/host-common/include/host-common/feature_control.h index 828341a..6e466d4 100644 --- a/host-common/include/host-common/feature_control.h +++ b/host-common/include/host-common/feature_control.h @@ -27,7 +27,7 @@ typedef enum { #include "FeatureControlDefHost.h" #include "FeatureControlDefGuest.h" #undef FEATURE_CONTROL_ITEM - kFeature_unknown + kFeature_unknown = -1, } Feature; // Call this function first to initialize the feature control. @@ -51,5 +51,6 @@ void feature_set_if_not_overridden_or_guest_disabled(Feature feature, bool enabl void feature_update_from_server(); const char* feature_name(Feature feature); +Feature feature_from_name(const char* name); ANDROID_END_HEADER |