diff options
author | 2025-01-13 10:31:34 -0700 | |
---|---|---|
committer | 2025-02-13 09:28:36 -0700 | |
commit | 1af4e87bbb262c3faeedc7262f75af389778a046 (patch) | |
tree | f4cd26f41de13b7aa222e5f0a6ff8ba58dd9ca61 | |
parent | 96efbfe8adeccd80ba301335036baef9d922cc40 (diff) |
GpuService: Add cmdFeatureOverrides
Add 'cmd gpu featureOverrides' to output the current FeatureOverrides
that were parsed by FeatureOverrideParser.
The feature overrides are intended to be used by
getPlatformDisplayAngle() in a later CL, to modify the behavior of
ANGLE.
Bug: 372694741
Test: cmd gpu featureOverrides
Flag: com.android.graphics.graphicsenv.flags.feature_overrides
Change-Id: I04c142fc6e0fd920315e41b36954c45cf032afb3
-rw-r--r-- | services/gpuservice/Android.bp | 1 | ||||
-rw-r--r-- | services/gpuservice/GpuService.cpp | 19 | ||||
-rw-r--r-- | services/gpuservice/include/gpuservice/GpuService.h | 2 |
3 files changed, 20 insertions, 2 deletions
diff --git a/services/gpuservice/Android.bp b/services/gpuservice/Android.bp index 01287b08f4..74e354f09c 100644 --- a/services/gpuservice/Android.bp +++ b/services/gpuservice/Android.bp @@ -39,6 +39,7 @@ cc_aconfig_library { cc_defaults { name: "libgpuservice_defaults", defaults: [ + "aconfig_lib_cc_static_link.defaults", "gpuservice_defaults", "libfeatureoverride_deps", "libgfxstats_deps", diff --git a/services/gpuservice/GpuService.cpp b/services/gpuservice/GpuService.cpp index f74b4fa34d..62e2d1a5c9 100644 --- a/services/gpuservice/GpuService.cpp +++ b/services/gpuservice/GpuService.cpp @@ -25,8 +25,10 @@ #include <binder/Parcel.h> #include <binder/PermissionCache.h> #include <com_android_frameworks_gpuservice_flags.h> +#include <com_android_graphics_graphicsenv_flags.h> #include <cutils/properties.h> #include <cutils/multiuser.h> +#include <feature_override/FeatureOverrideParser.h> #include <gpumem/GpuMem.h> #include <gpuwork/GpuWork.h> #include <gpustats/GpuStats.h> @@ -41,6 +43,7 @@ #include <memory> namespace gpuservice_flags = com::android::frameworks::gpuservice::flags; +namespace graphicsenv_flags = com::android::graphics::graphicsenv::flags; namespace android { @@ -143,7 +146,6 @@ void GpuService::toggleAngleAsSystemDriver(bool enabled) { } } - void GpuService::setUpdatableDriverPath(const std::string& driverPath) { IPCThreadState* ipc = IPCThreadState::self(); const int pid = ipc->getCallingPid(); @@ -171,7 +173,11 @@ status_t GpuService::shellCommand(int /*in*/, int out, int err, std::vector<Stri for (size_t i = 0, n = args.size(); i < n; i++) ALOGV(" arg[%zu]: '%s'", i, String8(args[i]).c_str()); - if (args.size() >= 1) { + if (!args.empty()) { + if (graphicsenv_flags::feature_overrides()) { + if (args[0] == String16("featureOverrides")) + return cmdFeatureOverrides(out, err); + } if (args[0] == String16("vkjson")) return cmdVkjson(out, err); if (args[0] == String16("vkprofiles")) return cmdVkprofiles(out, err); if (args[0] == String16("help")) return cmdHelp(out); @@ -235,6 +241,11 @@ status_t GpuService::doDump(int fd, const Vector<String16>& args, bool /*asProto return NO_ERROR; } +status_t GpuService::cmdFeatureOverrides(int out, int /*err*/) { + dprintf(out, "%s\n", mFeatureOverrideParser.getFeatureOverrides().toString().c_str()); + return NO_ERROR; +} + namespace { status_t cmdHelp(int out) { @@ -247,6 +258,10 @@ status_t cmdHelp(int out) { "GPU Service commands:\n" " vkjson dump Vulkan properties as JSON\n" " vkprofiles print support for select Vulkan profiles\n"); + if (graphicsenv_flags::feature_overrides()) { + fprintf(outs, + " featureOverrides update and output gpuservice's feature overrides\n"); + } fclose(outs); return NO_ERROR; } diff --git a/services/gpuservice/include/gpuservice/GpuService.h b/services/gpuservice/include/gpuservice/GpuService.h index 057d127390..116b6d754a 100644 --- a/services/gpuservice/include/gpuservice/GpuService.h +++ b/services/gpuservice/include/gpuservice/GpuService.h @@ -86,6 +86,8 @@ private: status_t doDump(int fd, const Vector<String16>& args, bool asProto); + status_t cmdFeatureOverrides(int out, int /*err*/); + /* * Attributes */ |