2525#include < binder/Parcel.h>
2626#include < binder/PermissionCache.h>
2727#include < com_android_frameworks_gpuservice_flags.h>
28+ #include < com_android_graphics_graphicsenv_flags.h>
2829#include < cutils/properties.h>
2930#include < cutils/multiuser.h>
31+ #include < feature_override/FeatureOverrideParser.h>
3032#include < gpumem/GpuMem.h>
3133#include < gpuwork/GpuWork.h>
3234#include < gpustats/GpuStats.h>
4143#include < memory>
4244
4345namespace gpuservice_flags = com::android::frameworks::gpuservice::flags;
46+ namespace graphicsenv_flags = com::android::graphics::graphicsenv::flags;
4447
4548namespace android {
4649
@@ -143,7 +146,6 @@ void GpuService::toggleAngleAsSystemDriver(bool enabled) {
143146 }
144147}
145148
146-
147149void GpuService::setUpdatableDriverPath (const std::string& driverPath) {
148150 IPCThreadState* ipc = IPCThreadState::self ();
149151 const int pid = ipc->getCallingPid ();
@@ -171,7 +173,11 @@ status_t GpuService::shellCommand(int /*in*/, int out, int err, std::vector<Stri
171173 for (size_t i = 0 , n = args.size (); i < n; i++)
172174 ALOGV (" arg[%zu]: '%s'" , i, String8 (args[i]).c_str ());
173175
174- if (args.size () >= 1 ) {
176+ if (!args.empty ()) {
177+ if (graphicsenv_flags::feature_overrides ()) {
178+ if (args[0 ] == String16 (" featureOverrides" ))
179+ return cmdFeatureOverrides (out, err);
180+ }
175181 if (args[0 ] == String16 (" vkjson" )) return cmdVkjson (out, err);
176182 if (args[0 ] == String16 (" vkprofiles" )) return cmdVkprofiles (out, err);
177183 if (args[0 ] == String16 (" help" )) return cmdHelp (out);
@@ -235,6 +241,11 @@ status_t GpuService::doDump(int fd, const Vector<String16>& args, bool /*asProto
235241 return NO_ERROR;
236242}
237243
244+ status_t GpuService::cmdFeatureOverrides (int out, int /* err*/ ) {
245+ dprintf (out, " %s\n " , mFeatureOverrideParser .getFeatureOverrides ().toString ().c_str ());
246+ return NO_ERROR;
247+ }
248+
238249namespace {
239250
240251status_t cmdHelp (int out) {
@@ -247,6 +258,10 @@ status_t cmdHelp(int out) {
247258 " GPU Service commands:\n "
248259 " vkjson dump Vulkan properties as JSON\n "
249260 " vkprofiles print support for select Vulkan profiles\n " );
261+ if (graphicsenv_flags::feature_overrides ()) {
262+ fprintf (outs,
263+ " featureOverrides update and output gpuservice's feature overrides\n " );
264+ }
250265 fclose (outs);
251266 return NO_ERROR;
252267}
0 commit comments